Setting the License
To remove the watermark displayed on the sankey chart, you will need to purchase a license and set it like below.
Setting the key
import ApexSankey from 'apexsankey';
// set license key before creating any charts
ApexSankey.setLicense('your-license-key');
const sankey = new ApexSankey(document.getElementById('sankey-container'), options);
const graph = sankey.render(data);
You will receive your license key via email after purchasing a plan.
Call setLicense once at application startup, before constructing any instance. A chart created before the key is set renders watermarked, because validation happens at construction.
Framework patterns
Put the call at the module scope of your entry point, or in whatever runs once before your first chart mounts.
// React — src/main.jsx or app entry
import ApexSankey from 'apexsankey'
ApexSankey.setLicense(import.meta.env.VITE_APEXCHARTS_LICENSE)
// Vue — src/main.js
import ApexSankey from 'apexsankey'
ApexSankey.setLicense(import.meta.env.VITE_APEXCHARTS_LICENSE)
// Angular — src/main.ts, before bootstrapApplication
import ApexSankey from 'apexsankey'
ApexSankey.setLicense(environment.apexchartsLicense)
The key is validated in the browser and is visible to anyone who inspects your bundle. That is expected: it is domain-scoped, not a secret. Keep it out of source control the same way you would any build-time config, but do not treat exposure in a shipped bundle as a compromise.
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 chart 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.
Troubleshooting
| Symptom | Likely cause |
|---|---|
| Watermark on every chart | setLicense runs after the chart is constructed, or was never called |
| Works locally, watermarked in production | The production hostname is not in the key's domain list |
| Worked before, watermarked now | An expired key, or an unsigned key past the July 2027 cutoff |
| Watermarked after editing the key string | Signature verification rejecting a modified payload |