Developer Docs

Web SDK Reference | Has product key

The hasProductKey() method returns a boolean if the specified product key is available in the script.

JavaScript
hasProductKey(productKey: string);

Returns

Type

Description

boolean

A boolean stating if the product is available based on the productKey that was passed

Example

JavaScript

JavaScript
let productKeyAvailable = window.twikit.hasProductKey('9625cacf-f602-4a00-b7b4-5b50c380ce93');
if (productKeyAvailable) {
  window.twikit.createContext(...);
}