> ## Documentation Index
> Fetch the complete documentation index at: https://docs.doconda.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Licence and domains

> Monthly, yearly or one-time plan, with 7 days free. A licence key that only opens the editor on your domains.

## Purchase

In the dashboard, **Billing → Editor plugin**, you choose a plan and pay with Stripe, per organization: unlimited documents and
users. Only the organization's owner can purchase it. The dashboard shows each plan's price, VAT included,
before you pay.

| Plan | How it is paid |
| - | - |
| Monthly | Every month; cancel whenever you want from **Invoices and card** (the Stripe portal). |
| Yearly | Once a year; cancelled the same way. |
| One-time | A single payment; the licence never expires. If you had a monthly or yearly plan, it is cancelled automatically. |

From the API: `POST /v1/editor/subscribe` with `{ "plan": "monthly" | "yearly" | "perpetual" }`.

### 7-day free trial

The first time an organization purchases the monthly or yearly plan, the **first 7 days are free**. You enter your
card in Stripe, but nothing is charged today; the dashboard shows "free trial until …". When the trial ends, the
first period is charged and the subscription continues on its own. The one-time plan has no trial: to try it, use localhost or the monthly
plan. If you cancel before the end, you pay nothing and the editor stops opening when the trial ends. During the
trial you get everything: key, domains and install link. There is one trial per organization.

Once active, the dashboard gives you:

* a **licence key** (`ek_eu_…` or `ek_us_…`), which you pass in `licenseKey`;
* a list of **domains** where the editor can open.

## Domains

Up to **5**. Each one is a host name:

| You enter | Opens on |
| - | - |
| `app.yourcompany.com` | Only `https://app.yourcompany.com` |
| `*.yourcompany.com` | Any subdomain: `app.yourcompany.com`, `eu.yourcompany.com`… (not `yourcompany.com`: add it separately) |

**https** only. No `https://` and no paths: `app.yourcompany.com`, not `https://app.yourcompany.com/editor`.

On `localhost`, `127.0.0.1` and `*.localhost` the editor **always opens**, with or without a key, and shows the
"development licence" notice. That way you can build without using up domains.

## What happens when it opens

1. The editor asks Doconda for a permit for the site it is on (`POST /v1/editor/token?key=…`). Your site's address
   is set by the browser; the page cannot change it.
2. Doconda checks that the key exists, that the subscription is paid and that the site is in your domains.
3. If all is well, it returns a **signed** permit for that site, valid for **1 hour**. The editor checks the
   signature, stores it in the browser and renews it on its own in the background. If you go offline while editing,
   it keeps working.

Without a valid permit, the editor does not open the file: it shows "This editor needs a Doconda licence" and calls
`onError("editor_unlicensed")`.

That is why your key can go in your site's code: outside your domains it is useless.

## Renewals and cancellations

| Situation | The editor |
| - | - |
| Subscription up to date | Opens |
| The renewal could not be charged | Keeps opening for **7 days** while you update your card; the dashboard warns you |
| Cancelled | Stops opening within 1 hour, including in tabs that were already open |

## Change the key

**Billing → Editor plugin → Change**. The previous key stops working immediately (permits already
issued expire within 1 hour). The install link changes too. Update it in your code.

## How we protect the plugin

* It is delivered **compiled and obfuscated**, never as source code, through a personal install link that only
  works with an active licence.
* Every copy carries a **mark of the organization** that downloaded it. If a copy shows up in use with another
  organization's licence, Doconda knows.
* The licence is checked when opening, when rendering the editor and when saving, and is renewed every hour.
* The [terms of use](https://doconda.com/en/terms) forbid decompiling it, bypassing the licence, removing the mark or continuing to use it
  after the subscription ends.

## Errors

| Code | What it means |
| - | - |
| `editor_unlicensed` | The key does not exist, the subscription is not active or the site is not in your domains |
| `editor_already_active` | You already have the plugin |
| `editor_inactive` | You cannot change the key without an active subscription |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.