Skip to the content

Get started

How licensing works

The editor edits only while it holds a license for the page it's on. This page explains where that license comes from, what your keys are for, and what happens when something goes wrong, so you can choose how to set it up.

Organizations, applications and keys#

  • Your organization is your company in Dorvyn: its plan, its team, its billing.
  • An application is one product of yours that uses the editor. Its keys belong to it, not to a person, so they keep working when people come and go.
  • A key lets an application's editor get licenses. Each key is test or live, and one of two kinds:
KeyLooks likeWhere it goesWhat it's for
Secret keydvn_sk_live_…, dvn_sk_test_…Your server's environment onlyStrict mode: your server licenses the editor for your signed-in users
Publishable keydvn_pk_live_…, dvn_pk_test_…Its list of domains, and optionally your pagesThe domains the editor may run on. In the page, it licenses the editor without a server

Keys are shown once, when they're made. Dorvyn keeps only a fingerprint of them, so nobody at Dorvyn can show you a key again either. If one is lost, replace it. See Keys and domains.

Grants#

The editor never edits on a key directly. It gets a short-lived grant: a license for one page address, signed by Dorvyn, that the editor verifies itself before anything becomes editable. A grant made for one site is refused on any other.

Grants last minutes, and the editor renews them in the background for as long as the page is open, so a session can last all day without anyone noticing. Renewals are spread out, so thousands of open editors don't all ask at once.

Two ways to license the editor#

Your page has no key. It asks your own server (server-url="/api/dorvyn"), and your server, using @dorvyn/server and your secret key, asks Dorvyn for a grant for the user signed in to your site. Saving as Word goes through your server too.

  • Nothing in the page can be copied and used anywhere else.
  • Every grant and every saved file is tied to one of your users (an opaque id you choose, never an email), so usage is counted and limited per user, and misuse can be traced to an account.
  • Only people signed in to your app get the editor.

It's the right choice for any product where people sign in. It's required on the Organization plan. See Strict mode.

A publishable key in the page#

The key is in your page (license="dvn_pk_live_…") and the editor gets grants with it directly. There's no server work, which makes it good for development, demos, documentation and public pages.

Anyone can read a key that's in a page. That's normal for browser keys, and moving it into a .env file doesn't change it, because the build puts it in your JavaScript. Dorvyn protects it this way:

  • Grants are made only for the domains you listed on the key, and the editor refuses a grant anywhere else.
  • Requests are rate-limited per key and per network, and refused attempts are recorded on your Security page.
  • You can replace or revoke the key at any moment.

What a key in the page can't stop: someone determined could request grants outside a browser and use your editor on their own machine, counted against your plan. Strict mode closes that.

Strict modePublishable key in the page
Key in the pageNoneYes, readable by anyone
Server workOne route with @dorvyn/serverNone
Who can editYour signed-in usersAnyone on your domain
Usage and limitsPer userPer key and network
Organization planRequiredNot accepted

Test and live#

  • Test keys work on http://localhost, 127.0.0.1 and [::1], and on any https address, so you can use them on staging. Files saved with them carry a short test note. They work before you choose a plan.
  • Live keys need https and a real domain (no localhost, no IP addresses). They work while your plan is active.

Keep test and live keys apart: a secret key licenses only for domains on publishable keys of the same environment in the same application.

When the license service can't be reached#

Your users' work never depends on Dorvyn being reachable at every moment.

  • An outage or a lost connection: editing goes on with the last grant for up to 24 hours, with a note in the status bar. Saving as Word waits until Dorvyn can be reached; drafts and saving to your own storage go on as normal. When the service is back, the editor picks up a new grant without a reload.
  • A refusal (the user signed out of your app, a key revoked, a plan ended): editing stops at once and the document becomes read-only. Nothing is lost. Drafts are kept, and editing comes back as soon as a grant does.
  • A page opened during an outage waits for the service before it starts. Its draft is kept.

The editor's state.license tells you which of these is happening. See Events and license states.

Plan status#

Plan statusLive keysTest keys
Not active yet (no plan chosen)RefusedWork
ActiveWorkWork
Payment failedWork for 7 days from the first failed payment, then refused until it's paidWork
SuspendedRefusedRefused
CanceledRefusedWork on localhost only

The dashboard's overview shows a banner whenever the plan isn't active, with what to do.