# Licensing and activation

> How Birch UI license keys work, how to activate them, what the watermark does, and who needs a seat.

Birch UI's paid products are licensed **per developer, as a one-time purchase, with free updates forever**. A license key is a signed string that you set once in your app. It is checked offline, it never expires, and it never switches features off.

## The short version

- **Free to evaluate.** Every paid feature works without a key. Unlicensed widgets show a small watermark on non-local hosts and log one console warning. The Excel Engine, which has no widget, only logs the warning.
- **One-time purchase.** You pay once per developer seat. There is no subscription and no renewal.
- **Free updates forever.** Paid keys have no expiry date, so a key bought today works with every future version, major releases included.
- **Unlimited apps and end users.** Use your license in as many internal tools, customer-facing apps and SaaS deployments as you like.
- **Offline.** Keys are verified in the browser with an embedded public key. Birch UI never makes a network request.
- **Seats are for developers who write code against Birch UI.** Colleagues who only build, test or deploy the app do not need a seat.

## Which packages need a key

| Package | Product id | Needs a key |
| --- | --- | --- |
| `@birchui/core` | none | No, MIT |
| `@birchui/react`, `vue`, `angular`, `svelte`, `solid`, `element` | none | No, MIT |
| `@birchui/license` | none | No, MIT |
| `@birchui/grid-pro` | `grid-pro` | Yes |
| `@birchui/pivot-studio` | `pivot-studio` | Yes. Watermark and console warning. Covers the Excel Engine; it does not need a Grid Pro key. Pivot charts from `@birchui/pivot-studio/charts` need a Charts or Complete key |
| `@birchui/excel` | `excel` | Yes. Keys for Grid Pro, Pivot Studio, Spreadsheet or all products (`*`) also cover it. Console warning only, never a watermark |
| `@birchui/scheduler` | `scheduler` | Yes |
| `@birchui/gantt` | `gantt` | Yes. Watermark and console warning. Needs no Scheduler or Grid Pro key, even though it uses the scheduler's time axis and the free grid |
| `@birchui/calendar` | `calendar` | Yes. Watermark and console warning, like the grid and scheduler |
| `@birchui/charts` | `charts` | Yes. Watermark and console warning |
| `@birchui/diagram` | `diagram` | Yes. Watermark and console warning |
| `@birchui/spreadsheet` | `spreadsheet` | Yes. Watermark and console warning. A Spreadsheet key also covers the Excel Engine |
| `@birchui/forms` (renderer) | none | No, MIT. The renderer never checks a key |
| `@birchui/forms/builder` (Form Builder) | `forms` | Yes. Watermark and console warning |

The free grid and the form renderer never check a key, never show a watermark and never log a license warning. Only the paid packages do. A Birch UI Complete key (`products: ["*"]`) covers every paid product, Pivot Studio, Gantt, Charts, Diagram, Spreadsheet and the Form Builder included. A Project Suite key covers the Scheduler, the Gantt and the Event Calendar.

## Activate your key

### Option 1: set it once at startup (recommended)

Call `setLicenseKey` before or after your widgets are created. Widgets that are already on the page re-check the new key and remove their watermark, so the order does not matter.

```ts title="main.ts"
import { setLicenseKey } from '@birchui/license';

setLicenseKey(import.meta.env.VITE_BIRCHUI_LICENSE_KEY);
```

Where to call it in each framework:

**React** (`main.tsx`)

```tsx
import { createRoot } from 'react-dom/client';
import { setLicenseKey } from '@birchui/license';
import { App } from './App';

setLicenseKey(import.meta.env.VITE_BIRCHUI_LICENSE_KEY);

createRoot(document.getElementById('root')!).render(<App />);
```

**Vue** (`main.ts`)

```vue
import { createApp } from 'vue';
import { setLicenseKey } from '@birchui/license';
import App from './App.vue';

setLicenseKey(import.meta.env.VITE_BIRCHUI_LICENSE_KEY);

createApp(App).mount('#app');
```

**Angular** (`main.ts`)

```ts
import { bootstrapApplication } from '@angular/platform-browser';
import { setLicenseKey } from '@birchui/license';
import { AppComponent } from './app/app.component';
import { appConfig } from './app/app.config';
import { environment } from './environments/environment';

setLicenseKey(environment.birchLicenseKey);

bootstrapApplication(AppComponent, appConfig).catch((error) => console.error(error));
```

**Svelte** (`src/routes/+layout.svelte`)

```svelte
<script lang="ts">
  import { setLicenseKey } from '@birchui/license';
  import { PUBLIC_BIRCHUI_LICENSE_KEY } from '$env/static/public';

  let { children } = $props();

  setLicenseKey(PUBLIC_BIRCHUI_LICENSE_KEY);
</script>

{@render children()}
```

**Solid** (`index.tsx`)

```tsx
import { render } from 'solid-js/web';
import { setLicenseKey } from '@birchui/license';
import { App } from './App';

setLicenseKey(import.meta.env.VITE_BIRCHUI_LICENSE_KEY);

render(() => <App />, document.getElementById('root')!);
```

**JavaScript** (`main.ts`)

```ts
import { setLicenseKey } from '@birchui/license';
import { mountReports } from './reports';

setLicenseKey(import.meta.env.VITE_BIRCHUI_LICENSE_KEY);

mountReports(document.querySelector('#reports')!);
```

In Next.js, expose the key as `NEXT_PUBLIC_BIRCHUI_LICENSE_KEY` and call `setLicenseKey(process.env.NEXT_PUBLIC_BIRCHUI_LICENSE_KEY)` at the top of a Client Component that wraps your app, or in the module that renders your grid. Calling it on the server is harmless; it simply has no widgets to update there.

### Option 2: pass it to a widget

Every paid widget accepts a `licenseKey` option: the grid (for Grid Pro), Pivot Studio, the scheduler, the Gantt, the event calendar, charts, the diagram, the spreadsheet and the Form Builder. A key passed this way applies to that widget only, and that widget ignores the global key.

```ts title="regional-sales.ts"
import { createGrid } from '@birchui/core';
import { AllProModules } from '@birchui/grid-pro';

const grid = createGrid(document.querySelector('#regional-sales')!, {
  columns: [
    { field: 'region', header: 'Region', rowGroup: true },
    { field: 'revenue', header: 'Revenue', type: 'number', aggFunc: 'sum' },
  ],
  modules: AllProModules,
  licenseKey: 'LQ1.eyJ2IjoxLCJpZCI6ImxpY18zZjlh…',
});
```

Use this when one app holds two separate keys, for example a Grid Pro key and an Event Calendar key bought at different times: set one globally with `setLicenseKey` and pass the other through `licenseKey` on the widgets that need it.

### The Excel Engine

`@birchui/excel` checks its key offline too, the first time you write or read a workbook. It uses the global key from `setLicenseKey`, or a key you pass in the options:

```ts title="export-invoices.ts"
import { downloadXlsx, readXlsx, writeXlsx, type XlsxWorkbook } from '@birchui/excel';

const licenseKey = import.meta.env.VITE_BIRCHUI_LICENSE_KEY;

export async function exportInvoices(workbook: XlsxWorkbook) {
  await downloadXlsx(workbook, 'invoices-2026-11.xlsx', { licenseKey });
}

export async function invoiceBytes(workbook: XlsxWorkbook) {
  return writeXlsx(workbook, { licenseKey });
}

export async function importPriceList(file: File) {
  return readXlsx(file, { licenseKey });
}
```

`writeXlsxSync(workbook, { licenseKey })` takes the same option. Each distinct key is checked once per page or process.

Because the Excel Engine has no visible widget, an unlicensed copy never shows a watermark. It logs one console warning per page and works normally:

```text
[Birch UI] No license key is set for Birch UI Excel Engine. All features keep working. Purchase a license at https://birchui.com/pricing
```

A key for `excel` activates it, and so does a key for Grid Pro, Pivot Studio, Spreadsheet or all products (`*`). Grid Pro's Excel export and import pass the grid's own key to the engine, so a Grid Pro key covers them without extra setup.

> **Web workers and Node**
>
> A worker or a Node process has its own copy of `@birchui/license`, so a key set with `setLicenseKey` on the main page does not reach it. Call `setLicenseKey` inside the worker, or pass `licenseKey` to `writeXlsx` and `readXlsx` there.

> **The key is not a secret**
>
> A license key identifies the licensee and is verified offline, so it is meant to ship in your client bundle. Treat it like a serial number, not a password. Keeping it in an environment variable is still convenient, because it keeps the key out of your repository history.

## What happens without a valid key

Nothing stops working. When a paid widget finds no key, or a key that does not cover it:

1. **All features keep working**, exactly as with a key.
2. **One console warning** is logged per product per page load. It states the reason and links to the pricing page, for example:
   `[Birch UI] No license key is set for Birch UI Grid Pro. All features keep working; a watermark is shown on non-local hosts until a valid license key is set. Purchase a license at https://birchui.com/pricing`
3. **A small watermark** appears in the bottom-right corner of the widget, such as "Birch UI Grid Pro · unlicensed copy". It ignores the pointer and is hidden from assistive technology.

As soon as a valid key is set, the watermark is removed from every widget on the page without a reload.

The Excel Engine skips step 3: it only logs the warning, because it has nothing on screen to mark.

The reasons a key can be rejected:

| Status | Meaning | What to do |
| --- | --- | --- |
| `missing` | No key is set | Call `setLicenseKey` or pass `licenseKey` |
| `malformed` | The string is not a Birch UI key: wrong prefix, bad encoding or invalid payload | Copy the key again in full; whitespace and line breaks are ignored |
| `bad-signature` | The key was altered or not issued by Birch UI | Use the key exactly as issued |
| `wrong-product` | The key is valid but does not include this product | Use the key for this product, or pass it per widget |
| `expired` | A trial key is past its last day | Buy a license; the trial watermark reads "trial expired" |

### Localhost and development

No watermark is shown when the page runs on a local host: `localhost`, `127.0.0.1`, `[::1]`, any `*.localhost` or `*.local` name, `file:` pages, and during server rendering. The console warning is still logged once, so you notice a missing key before you deploy.

Staging and preview hosts, such as `staging.example.com` or a Vercel preview URL, are not local. Set the key there too.

## Offline verification

A key is verified entirely in the browser (or in Node):

- The signature is checked with Ed25519 against a public key embedded in `@birchui/license`.
- It uses WebCrypto when available and falls back to a bundled implementation on plain-HTTP intranet pages, where `crypto.subtle` does not exist.
- There are no network requests, no telemetry and no activation server. Air-gapped networks and offline apps work the same as any other.
- Importing the package never touches `window`, `document` or `location`, so it is safe for server rendering.

## Key format

A key looks like this:

```text
LQ1.<payload>.<signature>
```

- `LQ1` is the format prefix.
- `payload` is the unpadded base64url encoding of a UTF-8 JSON object.
- `signature` is the unpadded base64url encoding of the 64-byte Ed25519 signature over the ASCII bytes of `LQ1.<payload>`.

The payload fields:

| Field | Meaning |
| --- | --- |
| `v` | Format version, always `1` |
| `id` | License id, for example `lic_3f9a0c2e7b14d685` |
| `to` | Licensee, for example `Northwind Traders` |
| `email` | Optional contact address |
| `products` | Product ids such as `["grid-pro", "scheduler"]`, or `["*"]` for every product, including future ones |
| `seats` | Number of developer seats |
| `tier` | `developer`, `team`, `company`, `oem` or `trial` |
| `iat` | Issue date, `YYYY-MM-DD` |
| `exp` | Trial keys only: last valid day, `YYYY-MM-DD`, inclusive, in UTC |

Paid keys never carry `exp`. That is how "free updates forever" works without a license server: there is no date after which a paid key stops being valid.

## Inspect a key in code

`verifyLicenseKey` checks a key against a product and resolves to a result object. It is asynchronous because signature verification uses WebCrypto.

```ts title="license-status.ts"
import { verifyLicenseKey } from '@birchui/license';

const result = await verifyLicenseKey(import.meta.env.VITE_BIRCHUI_LICENSE_KEY, 'grid-pro');

if (result.status === 'valid') {
  console.info(`${result.message} Seats: ${result.license?.seats}`);
} else {
  console.warn(`Grid Pro license problem (${result.status}): ${result.message}`);
}
```

`decodeLicenseKey` reads the payload without checking the signature, which is handy for showing "Licensed to Northwind Traders" in an about dialog. Do not use it to decide whether a key is genuine.

```ts
import { decodeLicenseKey, licenseCovers } from '@birchui/license';

const payload = decodeLicenseKey(key);
if (payload && licenseCovers(payload, 'excel')) {
  console.info(`Excel Engine licensed to ${payload.to}`);
}
```

**`LicenseCheck`** (interface from `@birchui/license`, full reference: https://docs.birchui.com/api/license.md)

```ts
interface LicenseCheck
```

| Property | Type | Description |
| --- | --- | --- |
| `status` | `LicenseStatus` |  |
| `product` | `ProductId` |  |
| `license?` | `LicensePayload` |  |
| `message` | `string` |  |

**`LicensePayload`** (interface from `@birchui/license`, full reference: https://docs.birchui.com/api/license.md)

```ts
interface LicensePayload
```

| Property | Type | Description |
| --- | --- | --- |
| `v` | `1` |  |
| `id` | `string` |  |
| `to` | `string` |  |
| `email?` | `string` |  |
| `products` | `(ProductId \| '*')[]` |  |
| `seats` | `number` |  |
| `tier` | `LicenseTier` |  |
| `iat` | `string` |  |
| `exp?` | `string` |  |

The full list of functions is in the [@birchui/license API reference](https://docs.birchui.com/api/license.md).

## Trials

You can evaluate without any key: see [What happens without a valid key](#what-happens-without-a-valid-key). If you want to try a paid product without the watermark, for example on a staging server you show to stakeholders, request a trial key. It arrives by email and is valid for 30 days. Each email address can hold one active trial per product.

Trial keys use the `trial` tier and carry an `exp` date. Until that day ends (UTC) they behave like a paid key. Afterwards the widget logs one warning and shows a "trial expired" watermark. Features still work, so an expired trial never breaks a demo in front of a customer. Add your paid key once you buy; nothing else changes in your code.

## Seats: who needs one

A seat is for a **developer who writes code that uses Birch UI**: someone who configures the grid or scheduler, writes column definitions, event handlers or cell renderers, or maintains a wrapper component around them.

You do **not** need a seat for colleagues who only:

- build, compile or deploy the app, including CI servers and release engineers;
- work on other parts of the codebase, such as the backend or unrelated front-end screens;
- test the app, design it or use it.

Each tier covers a different team shape:

| Tier | Covers | Notes |
| --- | --- | --- |
| Developer | One named developer | |
| Team | Up to 5 developers | Seats are transferable when people change roles |
| Company | Unlimited developers in one organization | Priority email and read access to the private source repository |
| OEM | Products that expose Birch UI to *their* customers' developers | For low-code platforms, admin-panel builders and component libraries. Quoted individually |

Every tier includes unlimited apps, unlimited end users and unlimited deployments: internal tools, customer-facing apps and multi-tenant SaaS alike. See [Pricing](https://docs.birchui.com/getting-started/pricing.md) for prices.

## Lifetime updates

Your license covers every release of the products you bought, forever, including major versions. You do not need to renew to upgrade, and there is no "licensed version" to stay on. Upgrading is a normal `npm install`.

## Getting your key

1. **Checkout.** Payment is handled by Paddle, the merchant of record, which charges any sales tax or VAT and issues your invoice.
2. **License email.** When the order completes, your key is emailed to the address you used at checkout. The email lists, for each product you bought, the licensee name, the tier and seats, the license ID, the key itself, the packages to install and a snippet that activates the key.
3. **One key per product line.** An order with Grid Pro and the Scheduler gives you two keys. Seats are the quantity times the seats in the tier: a Team license covers 5 developers per unit, a Company license an unlimited number.
4. **Support packs** come without a key. Open a ticket on the support site and quote your order reference.

### The licensee name

The licensee (`to` in the payload) is the company name you entered at checkout, or your email address if you did not enter one. The payload can be read by anyone who opens your JavaScript bundle, so if your key carries your email address and you would rather it showed your company, reissue it from the license portal with a different licensee name.

### The license portal

Every license email links to the license portal. Sign in with the email address you bought with: the portal emails you a sign-in link, which expires after a short time. The portal lists your active licenses and their keys, so it is also where you recover a lost key.

From the portal you can **reissue** a key, for example after a company name change. The new key keeps the same license ID, products, tier and seats. Because keys are verified offline, the previous key keeps working too; switch to the new one at your convenience.

## Troubleshooting

- **The watermark is still visible after setting the key.** Check the console warning: it names the status. `wrong-product` usually means a Scheduler key was used for Grid Pro, or the other way round.
- **No watermark locally, but one in production.** The key is missing from the production build. Check that the environment variable is defined at build time (Vite and Next.js inline public variables during the build).
- **Two products, two keys.** Pass the second key with the widget's `licenseKey` option.
- **Lost key.** Sign in to the license portal with the email address you bought with; it lists every active key.
- **The warning appears twice.** It is logged once per product. Grid Pro and Scheduler each log their own.
