Web SDK Reference | Has product key
The hasProductKey()
method returns a boolean if the specified product key is available in the script.
JS
hasProductKey(productKey: string);
Returns
Type | Description |
---|---|
| A boolean stating if the product is available based on the productKey that was passed |
Example
JavaScript
JS
let productKeyAvailable = window.twikit.hasProductKey('9625cacf-f602-4a00-b7b4-5b50c380ce93');
if (productKeyAvailable) {
window.twikit.createContext(...);
}