An IronPDF license key unlocks production deployment for your Node.js application. Without a valid key, IronPDF runs in trial mode and stamps every generated PDF with a watermark. Applying a license key removes that watermark and lifts all output restrictions, giving you fully compliant documents ready for end-users. The steps below walk through obtaining a key, configuring it correctly, and confirming it is active.

Quickstart: Apply an IronPDF License Key in Node.js

How Do You Get an IronPDF License Key?

A license key is issued when you purchase a commercial license or register for a free trial. Both paths go through the same IronPDF licensing page, where options are available for single-developer, team, and royalty-free redistribution tiers.

To evaluate IronPDF before committing to a purchase, sign up for a free 30-day trial license. The trial key activates all production features — including HTML-to-PDF rendering, PDF merging, stamping, and encryption — so you can test the full API against your real requirements.

If your organization needs volume pricing or an enterprise agreement, contact the IronPDF sales team for a custom quote.

How Do You Apply a License Key in Node.js?

Set the licenseKey property on the global configuration object before calling any IronPDF function. Place this initialization at the entry point of your application — typically the first lines of your index.js or app.js file — so the key is active for every subsequent PDF operation.

//:path=apply-license-key.js
// Import IronPdfGlobalConfig from the IronPDF package
import { IronPdfGlobalConfig } from "@ironsoftware/ironpdf";

// Apply your license key at application startup
// Replace the placeholder with the key you received from Iron Software
IronPdfGlobalConfig.getConfig().licenseKey = "YOUR-LICENSE-KEY-HERE";
//:path=apply-license-key.js
// Import IronPdfGlobalConfig from the IronPDF package
import { IronPdfGlobalConfig } from "@ironsoftware/ironpdf";

// Apply your license key at application startup
// Replace the placeholder with the key you received from Iron Software
IronPdfGlobalConfig.getConfig().licenseKey = "YOUR-LICENSE-KEY-HERE";
JAVASCRIPT

The assignment takes effect immediately — no restart or re-import is required. Any PDF operation that runs after this line will use the licensed engine.

How Do You Follow License Key Best Practices?

Hardcoding a license key directly in source code creates a security risk, particularly in public repositories. The recommended approach is to store the key in an environment variable and read it at runtime.

//:path=apply-license-key-env.js
import { IronPdfGlobalConfig } from "@ironsoftware/ironpdf";

// Read the license key from an environment variable
// Set IRONPDF_LICENSE_KEY in your .env file or deployment environment
IronPdfGlobalConfig.getConfig().licenseKey = process.env.IRONPDF_LICENSE_KEY;
//:path=apply-license-key-env.js
import { IronPdfGlobalConfig } from "@ironsoftware/ironpdf";

// Read the license key from an environment variable
// Set IRONPDF_LICENSE_KEY in your .env file or deployment environment
IronPdfGlobalConfig.getConfig().licenseKey = process.env.IRONPDF_LICENSE_KEY;
JAVASCRIPT

When using this pattern, add IRONPDF_LICENSE_KEY=your-key to a .env file for local development and configure the variable in your hosting platform's secret management system for production. Add .env to .gitignore to prevent accidental commits.

Two additional practices reduce operational risk:

  • Apply the key once at startup. Assigning it repeatedly on each request is harmless but wastes cycles. Initialize it in your app's entry module.
  • Keep the key out of client-side bundles. License key initialization must occur on the server. IronPDF for Node.js runs in a server-side context, so this is the natural placement — but double-check that your build pipeline does not bundle IronPdfGlobalConfig into browser-facing code.

How Do You Verify Your License Key Is Working?

After applying the key, confirm it was accepted before running your production workflows. Use the isLicensed flag on the global configuration object.

//:path=verify-license-key.js
import { IronPdfGlobalConfig } from "@ironsoftware/ironpdf";

// Apply the license key
IronPdfGlobalConfig.getConfig().licenseKey = process.env.IRONPDF_LICENSE_KEY;

// Verify the key was accepted
const config = IronPdfGlobalConfig.getConfig();
if (config.isLicensed) {
    console.log("IronPDF: license key accepted — production mode active.");
} else {
    console.warn("IronPDF: running in trial mode — PDFs will contain a watermark.");
}
//:path=verify-license-key.js
import { IronPdfGlobalConfig } from "@ironsoftware/ironpdf";

// Apply the license key
IronPdfGlobalConfig.getConfig().licenseKey = process.env.IRONPDF_LICENSE_KEY;

// Verify the key was accepted
const config = IronPdfGlobalConfig.getConfig();
if (config.isLicensed) {
    console.log("IronPDF: license key accepted — production mode active.");
} else {
    console.warn("IronPDF: running in trial mode — PDFs will contain a watermark.");
}
JAVASCRIPT

A true result confirms the key is valid and the engine is running in licensed mode. A false result means the key was not recognized — double-check for extra whitespace, truncation, or an expired trial key. If the problem persists, contact IronPDF support with your key and Node.js version.

What Are the Next Steps?

With a valid license key in place, the IronPDF engine is ready for production workloads. Start with the most common tasks:

To upgrade your license tier or add developer seats, visit the IronPDF licensing page or start a free trial to evaluate a higher tier before purchasing.

Frequently Asked Questions

How do you obtain an IronPDF license key for a Node.js project?

Purchase a license or sign up for a free 30-day trial on the IronPDF licensing page. A key is emailed upon registration or purchase confirmation.

Where in a Node.js application should the license key be applied?

Apply the key at the application entry point — typically the first lines of index.js or app.js — so the key is active before any IronPDF function is called.

What happens if you run IronPDF without a license key?

IronPDF runs in trial mode and stamps every generated PDF with a watermark. Applying a valid license key removes the watermark and lifts all output restrictions.

How do you apply an IronPDF license key in Node.js?

Import IronPdfGlobalConfig from the @ironsoftware/ironpdf package and assign your key: IronPdfGlobalConfig.getConfig().licenseKey = 'YOUR-KEY';

How do you avoid hardcoding the license key in source code?

Store the key in an environment variable such as IRONPDF_LICENSE_KEY, then read it at runtime with process.env.IRONPDF_LICENSE_KEY. Add the variable to your hosting platform's secrets manager for production deployments.

How do you verify that an IronPDF license key was accepted?

Read IronPdfGlobalConfig.getConfig().isLicensed. A return value of true confirms the key is valid and the engine is running in licensed mode.

What should you check if isLicensed returns false?

Verify the key was copied without extra whitespace or truncation, confirm the trial has not expired, and ensure the key is set before any IronPDF operation runs. Contact IronPDF support if the problem persists.

Can the same license key be used across multiple Node.js servers?

License terms depend on your purchased tier. Single-developer licenses cover one developer; team and royalty-free licenses cover broader deployment scenarios. Review the IronPDF licensing page for the tier that matches your deployment requirements.

Curtis Chau
Technical Writer

Curtis Chau holds a Bachelor’s degree in Computer Science (Carleton University) and specializes in front-end development with expertise in Node.js, TypeScript, JavaScript, and React. Passionate about crafting intuitive and aesthetically pleasing user interfaces, Curtis enjoys working with modern frameworks and creating well-structured, visually appealing manuals.

...

Read More
Ready to Get Started?
Version: 2026.4 just released
Still Scrolling Icon

Still Scrolling?

Want proof fast?
run a sample watch your HTML become a PDF.