Setting the License

ApexGantt displays a watermark on charts rendered without a valid license. To remove it, call ApexGantt.setLicense() with your key before creating any chart instance.

import ApexGantt from 'apexgantt'

ApexGantt.setLicense('YOUR-LICENSE-KEY')

const gantt = new ApexGantt(el, options)
gantt.render()

The key is validated client-side. No network request is made and the key does not expire at runtime.

Where to put the call

Call setLicense once at application startup, before any new ApexGantt() calls. The right place depends on your framework.

Vanilla JS / plain HTML:

// In your entry file, before any chart code
ApexGantt.setLicense('YOUR-LICENSE-KEY')

React (App Router / Next.js):

// In a client layout or the top-level component
'use client'
import ApexGantt from 'apexgantt'
ApexGantt.setLicense(process.env.NEXT_PUBLIC_APEXGANTT_LICENSE)

Vue 3:

// main.js
import { createApp } from 'vue'
import ApexGantt from 'apexgantt'
import App from './App.vue'

ApexGantt.setLicense(import.meta.env.VITE_APEXGANTT_LICENSE)
createApp(App).mount('#app')

Angular:

// main.ts
import ApexGantt from 'apexgantt'
ApexGantt.setLicense(environment.apexganttLicense)

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')

ApexGantt.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.

Keeping the key out of source control

Store the license key in an environment variable, not in your source code.

# .env (git-ignored)
NEXT_PUBLIC_APEXGANTT_LICENSE=your-license-key-here
VITE_APEXGANTT_LICENSE=your-license-key-here

Add .env to your .gitignore. In production, set the variable through your hosting platform (Vercel, Netlify, Docker, etc.).

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.

License key not working

  • The watermark appears even with setLicense called if the call happens after new ApexGantt(...). Move setLicense above any chart instantiation.
  • Keys are tied to the domain the chart is served from. A key issued for example.com will not suppress the watermark on localhost during development. Contact support if you need a separate development key.
  • You receive your license key via email after purchasing a plan at apexcharts.com/pricing.