Licensing
How to activate and manage your license for @rilaykit/workflow.
The @rilaykit/workflow
package is commercial software. A valid license key is required to use it in a production environment and to remove the "Trial Use Only" watermark.
Development environments (like localhost
) do not require a license and will not display a watermark.
Activating Your License
To activate your license, you need to call RilayLicenseManager.setLicenseKey()
once when your application starts. A good place for this is in a root layout file or a central providers file.
The license key should be stored securely, ideally as an environment variable.
import { RilayLicenseManager } from '@rilaykit/workflow';
// The key is safe to be exposed on the client-side
RilayLicenseManager.setLicenseKey(process.env.NEXT_PUBLIC_RILAY_LICENSE_KEY);
The license key is safe to be exposed on the client-side. It is cryptographically signed using an Ed25519 signature and cannot be tampered with. The validation happens securely within the component.
How It Works
- The
RilayLicenseManager
validates the license key against a public key. - It checks the signature, expiry date, and other license details.
- If the license is invalid or expired, the validation will fail, and the watermark will be displayed in production.
- In development mode, console warnings will appear if the license is missing or invalid, but the watermark is suppressed to not interfere with development.
Obtaining a License
You can purchase a license key from the official Rilaykit website. Various plans are available to suit different needs.
Visit rilay.io/pricing to get your license.
License Status API
You can programmatically check the status of the license. This can be useful for displaying messages to administrators or for debugging.
import { RilayLicenseManager } from '@rilaykit/workflow';
// Get the raw validation result
const licenseResult = RilayLicenseManager.getLicenseResult();
/*
{
valid: boolean,
error?: 'MISSING' | 'EXPIRED' | 'INVALID' | 'SIGNATURE_INVALID' | 'FORMAT_INVALID',
data?: {
plan: 'ARCHITECT' | 'FOUNDRY',
company: string,
expiry: number,
...
}
}
*/
// Check if the watermark should be shown
const shouldShowWatermark = RilayLicenseManager.shouldDisplayWatermark();
// Get license info in a friendly format
const info = await RilayLicenseManager.getLicenseInfo();
/*
{
plan: 'FOUNDRY',
company: 'ACME Inc.',
expiryDate: '12/25/2024'
}
*/
This allows you to build custom logic around your license status if needed.