Setting the License
ApexGantt is included in the Premium plan and above, and there is no free tier. Without a valid key the chart renders with a trial watermark, which is for evaluation only. To remove it, call ApexGantt.setLicense() with your key.
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.
Since 3.20.0 the watermark is removed only when the key's plan is Premium or higher. A Pro key, which licenses other Apex products, leaves the ApexGantt watermark in place. Before 3.20.0 any valid key removed it.
Where to put the call
Set your license key once at application start. Calling setLicense before the first new ApexGantt() avoids a one-frame watermark; since 3.17.0 a later call still works and removes the watermark from charts already on the page. 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 registers the key for all of them. Each product then checks the plan it needs: ApexGantt needs Premium or higher (enforced from 3.20.0).
import ApexCharts from 'apexcharts'
// registers the key for 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, at application start.
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 ApexGantt 3.20.0 the guard also covers plans. A different valid key whose plan ranks lower than the valid key already in force 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 page that sets a Premium key for the Gantt and a Pro key from another product's init code keeps the Gantt unwatermarked, whatever order the modules initialise in. Keys of the same plan still replace each other. To move to a lower plan on purpose within a session, call setLicense('') first. Before 3.20.0 the last valid key always won. The guard lives in the shared license manager that ApexGantt 3.20.0 bundles, and it runs in whichever product's setLicense you call: a call made through a product that bundles an older copy of the license manager follows that copy's rules, so on a mixed page set the key once, through ApexGantt or through a product released with the same license manager.
destroy() stops the chart's container from following license changes (since 3.20.0), so a key set after a chart is destroyed never paints the trial overlay on, or sets position: relative on, a container your page has reused.
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
- From 3.20.0 the ApexGantt watermark stays unless the key's plan is Premium or higher. A Pro key does not remove it, and logs a one-time console warning explaining why the trial mark stays. Check the plan on your purchase email, or upgrade at apexcharts.com/pricing.
- If a console warning says a key was ignored because its plan is lower than the one already active, a higher-plan key was set earlier on the page. That key stays in force; call
setLicense('')before setting a lower one if that is what you mean. - Keys are tied to the domain the chart is served from. A key issued for
example.comwill not suppress the watermark onlocalhostduring 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.