License
One License serves Web SDK, Collaboration SDK and Exchange; configure it where each one runs.
For current plans, prices and usage limits, see Pricing. Use the contact-sales entry on that page for purchasing questions; this guide explains how to configure a license.
Visit the Univer website to check the licensing options and obtain a License. A License consists of two files: license.txt holds the License content, and licenseKey.txt holds the key the server uses to verify it.
| Where it runs | Files needed | Without a License |
|---|---|---|
| Web SDK | license.txt | Free features |
| Collaboration SDK | license.txt and licenseKey.txt | Free tier: 1 collaboration node, 3 collaborative editing connections |
| Exchange | license.txt and licenseKey.txt | Free tier: 10 exports per month |
Provide the file contents. A License determines which features are available; your application's identity and authorization determines who may view or edit a document.
Web SDK
Plugin mode
import { UniverLicensePlugin } from '@univerjs-pro/license'univer.registerPlugin(UniverLicensePlugin, { license: 'YOUR_LICENSE', // content of license.txt})Register UniverLicensePlugin on your existing Univer instance, before other plugins.
Preset mode
UniverSheetsAdvancedPreset({ // Keep your other options. license: 'YOUR_LICENSE', // content of license.txt})Add license to your existing preset configuration; the example uses UniverSheetsAdvancedPreset. Collaborative applications configure the License in the browser as well. The browser example in Collaboration Quick Start shows where the License plugin sits alongside the collaboration plugins.
Collaboration SDK
import { UniverCollabService } from '@univerjs-pro/collaboration-service'const collabService = new UniverCollabService({ dbAdapter, license: 'YOUR_LICENSE', // content of license.txt licenseKey: 'YOUR_LICENSE_KEY', // content of licenseKey.txt})When license and licenseKey are omitted, UniverCollabService reads the environment variables UNIVER_LICENSE and UNIVER_LICENSE_KEY; with neither source it runs on the free tier. The License determines the collaborative editing connections, authorized domains, collaboration nodes and document types; see Collaboration SDK License.
Exchange
import { configureExchange } from '@univerjs-pro/exchange-node'await configureExchange({ license: 'YOUR_LICENSE', // content of license.txt licenseKey: 'YOUR_LICENSE_KEY', // content of licenseKey.txt})This step is optional: Exchange reads the UNIVER_LICENSE and UNIVER_LICENSE_KEY environment variables on the first export or quota query, and runs on the free tier when they are not set either. Exchange counts exports against the License and imports use no quota; see Exchange License for quota queries and errors.
When Collaboration SDK and Exchange run in the same process, set the environment variables once:
export UNIVER_LICENSE="$(cat license.txt)"export UNIVER_LICENSE_KEY="$(cat licenseKey.txt)"Check the configuration
Reopen the application and try the features you need. If watermarks or License restrictions remain, check that the License content is complete, still valid, and covers the feature and release; in plugin mode, also check that UniverLicensePlugin is registered before other plugins. Contact your License provider if the issue remains.
How is this guide?