License configuration
One License serves Web SDK, Collaboration SDK and Exchange; configure it where each one runs.
For current plans, prices, and usage limits, see Pricing. Direct purchasing questions to the contact-sales entry on that page. This guide covers configuration.
You obtain a License from the Univer website, which also lists the licensing options. 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 | Client features and local printing work, with watermarks on affected output |
| 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 watermark-free exports per month; further complete exports carry watermarks |
At each of these locations you provide the file contents. The License determines which features are available. Whether a user may view or edit a document is a separate matter, governed by the application's identity and authorization.
Web SDK
Charts, sparkline editing, PivotTable and dashboard creation, and local printing all work without a signed client license; this includes the Sheets print and screenshot APIs. Chart, print, and screenshot output may carry a License watermark, depending on the feature and its authorization. Collaboration and Exchange each use their own server-side License.
Freemium provides evaluation access with watermarks and usage limits. Freemium, Business, and Enterprise support unlimited print jobs and pages under their licenses. Freemium printouts carry watermarks. Printing, including saving as PDF through the print function, uses zero export quota. PDF generation through file conversion follows the applicable export rules. Commercial production deployments require a valid Business or Enterprise license. Commercial and dedicated local licenses retain their own entitlements and usage terms.
Preset mode
UniverSheetsAdvancedPreset
licensestringContents of the client License file.
UniverSheetsAdvancedPreset({ // Keep your other options. license: 'YOUR_LICENSE', // content of license.txt})Add license to the existing preset options; the example above uses UniverSheetsAdvancedPreset. Collaborative applications configure a License in the browser as well. The browser example in Collaboration Quick Start shows where the License plugin sits relative to the collaboration plugins.
Plugin mode
UniverLicensePlugin
licensestringContents of the client License file.
import { UniverLicensePlugin } from '@univerjs-pro/license'univer.registerPlugin(UniverLicensePlugin, { license: 'YOUR_LICENSE', // content of license.txt})Register UniverLicensePlugin on the existing Univer instance before the other 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 UNIVER_LICENSE and UNIVER_LICENSE_KEY environment variables. If neither source is set, it runs on the free tier. The License determines the number of collaborative editing connections, the authorized domains, the number of collaboration nodes, and which document types are covered; 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 call is optional. Exchange reads UNIVER_LICENSE and UNIVER_LICENSE_KEY on the first export or quota query, and uses the free tier when neither is set. Imports consume no quota; exports are counted against the License. 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)"Update without downtime
When a renewal produces a new License, you can replace the credentials in the running process without restarting the service. Persistence and distribution of the License (such as a database, files, or a configuration center) are managed by your application; in multi-process deployments, invoke the corresponding update API in each process.
Collaboration SDK
Call collabService.license.update({ license, licenseKey }) to replace the License atomically. If verification fails, it throws and keeps the current License in force.
// For example, trigger the update through an authenticated internal endpointapp.post('/internal/license', express.json(), (req, res) => { const { license, licenseKey } = req.body as { license: string; licenseKey: string } collabService.license.update({ license, licenseKey }) res.json({ status: collabService.license.status, expiresAt: collabService.license.expiresAt })})Exchange
Call await configureExchange({ license, licenseKey }) again to replace the default credentials used by subsequent exports and quota queries:
await configureExchange({ license, licenseKey })Web SDK
Fetch the latest license dynamically before initialization and pass it to UniverLicensePlugin (or the preset configuration) so you do not need to rebuild the frontend. Never expose licenseKey to the frontend.
// Server: expose the current license to the browser at runtime (without licenseKey)app.get('/api/license', async (_req, res) => { res.setHeader('Cache-Control', 'no-store') res.json({ license: await loadCurrentLicense() })})// Browser: fetch the license before initializing Univerconst { license } = await fetch('/api/license', { cache: 'no-store' }).then((r) => r.json())createUniver({ plugins: [ [UniverLicensePlugin, { license: license || undefined }], // ...other plugins ],})Check the configuration
Reopen the application and test the features you need. If watermarks or License restrictions persist, verify that the License content is complete, still valid, and covers the feature and release in question. In plugin mode, also verify that UniverLicensePlugin is registered before the other plugins. If the issue persists, contact the License provider.
How is this guide?