Setting the License

To remove the watermark displayed on the apextree chart, you will need to purchase the license and set it like below

import ApexTree from 'apextree';

// set license key before creating any charts
ApexTree.setLicense('your-license-key');

const tree = new ApexTree(document.getElementById('svg-tree'), options);
const graph = tree.render(data);

You will receive your license key via email after purchasing a plan.

One key covers the family

A license key was never product-specific, but until recently each library kept its own private copy of the license manager, so setting a key on one did not license another sitting beside it on the same page.

They now share one slot, so any product's setLicense licenses all of them:

import ApexCharts from 'apexcharts'

// licenses the charts, trees, gantt charts and sankey diagrams on this page
ApexCharts.setLicense('your-license-key')

ApexTree.setLicense does the same thing. Call whichever is convenient, once, before your first instance is constructed.

There is also a downgrade guard: once a valid key is registered, a later call with an invalid or expired one cannot replace it.

Since ApexTree 2.3.0 the guard also covers plans. A different valid key whose plan ranks lower than the valid key already in force (a Pro key after a Premium one) is ignored, with a console warning:

[Apex] Ignoring license key: its plan (pro) is lower than premium, the plan of the license already active on this page. Call setLicense("") first to replace it with a lower plan.

So a lower-plan key set by another product's init code cannot take away what a higher-plan key already unlocked, whatever order the modules initialise in. Keys of the same or a higher plan still replace the one in force. To move to a lower plan on purpose, call setLicense('') first, then set the new key. The guard lives in the shared license manager, which ApexCharts 8.8.0, ApexTree 2.3.0, ApexSankey 1.14.0, ApexGantt 3.20.0, ApexMaps 1.3.0, ApexStock 0.6.0 and apex-grid-enterprise 0.9.0 carry, and it runs in whichever product's setLicense you call. A call made through an older release follows that release's rules, so on a page that mixes releases, set the key once, through one of these.

Signature-verified keys

Keys issued from 27 July 2026 onward carry an ECDSA P-256 signature over a canonical payload, checked in the browser against a public key baked into the bundle.

The practical effect: a key whose payload has been edited (plan upgraded, expiry pushed out, domain list widened) no longer validates, and the tree renders watermarked. An unmodified key from your purchase email is unaffected.

Keys issued before that date are unsigned and keep working unchanged until 31 July 2027, with no console warning in the meantime. If your key predates July 2026, request a reissued one before that date.