License key
HyperFormula needs a license key. You pass it in the licenseKey configuration option.
Get a license key
Section titled “Get a license key”To get a license key, visit handsontable.com/pricing or email sales@handsontable.com.
Set the license key
Section titled “Set the license key”In your configuration options, set the licenseKey property to your license key:
import { HyperFormula } from 'hyperformula';
const hf = HyperFormula.buildEmpty({ // replace 'your-license-key' with your license key licenseKey: 'your-license-key',});If your key is a few sentences of text followed by a block in square brackets ([...]), pass the
whole key, exactly as you received it. The key covers its text, so a key cut down to the bracketed
block, or with any word changed, is invalid. Whitespace and line breaks don’t matter, including a
line break saved as \n in a .env file, but keeping the key on one line is the safest choice.
The license key in code examples
Section titled “The license key in code examples”The code examples in this documentation don’t contain a license key. Each one has this commented-out line instead:
// licenseKey: 'your-license-key', // get a key at https://handsontable.com/pricing/?tab=hyperformulaTo run an example in your own project, uncomment the line and replace your-license-key with your license key.
Without a key, functions return #LIC! and license-gated methods, such as addSheet() and copy(), throw a LicenseCapabilityMissingError. See Missing license key.
The live examples on handsontable.com run without a license key: HyperFormula doesn’t check the license key on handsontable.com.
License key validation
Section titled “License key validation”Which versions of HyperFormula a key covers, and for how long, follows from the terms of your contract. Your key carries those terms, and HyperFormula applies them locally, without any connection to a server.
HyperFormula reads the key every time you build an engine or change its configuration. If the key is missing, invalid, or expired, you see a message in the console. Each case is described below.
What depends on the license key
Section titled “What depends on the license key”Missing license key
Section titled “Missing license key”If you don’t set licenseKey, or set it to an empty string, HyperFormula is blocked and you see a warning in the console:
- Every function call evaluates to a
#LIC!error, exceptVERSION()andOFFSET(). - Every license-gated API method throws a
LicenseCapabilityMissingErrorthat names the key’s state, for example:License key is missing. Feature crud is not available. If you need any help, contact us at sales@handsontable.com.The gated methods are the ones that edit cells, rows, columns, and sheets,copy(),cut(),paste(),undo(),redo(),batch(),suspendEvaluation(), and the methods that add, change, or remove named expressions. Building an engine with named expressions throws the same error. - The
isItPossibleTo*()methods returnfalsefor every gated method, andisThereSomethingToUndo()andisThereSomethingToRedo()returnfalse. - Getters and clean-up methods, such as
clearClipboard()andresumeEvaluation(), keep working, andgetAvailableFunctions()still describes the full set of functions.
Formulas without a function call, such as =A1+B1, keep calculating.
Invalid license key
Section titled “Invalid license key”If HyperFormula can’t read your key, or your key doesn’t include HyperFormula, the key is invalid. HyperFormula is blocked in the same way as with a missing key, and you see a warning in the console.
The gpl-v3 key is invalid. For details, see Migrating from 3.x to 4.0.
Expired license key
Section titled “Expired license key”If your key doesn’t cover the version of HyperFormula you installed, or its term has ended, you see a message in the console. Depending on your license terms, an expired key either blocks HyperFormula in the same way as a missing key, or keeps working with what it grants.
To keep using HyperFormula, renew your license key, or install a version that your key covers.
Function or feature not included in your license key
Section titled “Function or feature not included in your license key”A license key may grant all of HyperFormula, or only part of it.
If your key grants only part of HyperFormula, then:
- A function your key doesn’t include evaluates to a
#LIC!error, in the same way as any other error value. Everything else in the sheet keeps calculating. - An API method your key doesn’t include throws a
LicenseCapabilityMissingErrorwhen you call it. Getters never throw;copy()andcut()do, because they belong to the clipboard feature. The matchingisItPossibleTo*()methods, such asisItPossibleToAddRows(), returnfalse, and so doisThereSomethingToUndo()andisThereSomethingToRedo()when your key doesn’t include undo and redo. getAvailableFunctions()andgetFunctionDetails()describe only the functions your key includes, so a function picker built from them never offers a function that then fails.
To get a key that includes more, see Get a license key.
License key support
Section titled “License key support”If you have any issues with your license key, contact our team.