Plug API
Discover all the methods and properties available in the Plug API.
The Plug API is the entry point to the JavaScript SDK and provides methods to retrieve content, evaluate requests, platform, track user interactions, and more.
Looking for something specific?
Use the search bar at the top of the page or press / to quickly search through the documentation.
Use the summary below to quickly jump to a specific topic:
Page | Description |
---|---|
plug | Learn how to initialize the SDK. |
unplug | Learn how to reset the SDK to its initial state. |
identify | Learn how to associate the current session with a user. |
anonymize | Learn how to disassociate the session from the current user. |
setToken | Learn how to replace any existing token with a new one. |
unsetToken | Learn how to clear any existing token. |
getUserId | Learn how to get the ID of the currently identified user. |
isAnonymous | Learn how to check whether the user is anonymous. |
fetch | Learn how to fetch the content of a slot using a standalone function. |
evaluate | Learn how to evaluate a CQL query using a standalone function. |
test | Learn how to evaluate a CQL condition. |
track | Learn how to track an event in the user session. |
user | Learn how to access the user instance. |
session | Learn how to access the session instance. |
tracker | Learn how to access the tracker instance. |
initialized | Learn how to check whether the SDK has been initialized. |
plugged | Learn how to await the SDK initialization. |
flushed | Learn how to await the transmission of pending events. |