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.

Croct's mascot winking
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:

PageDescription
plugLearn how to initialize the SDK.
unplugLearn how to reset the SDK to its initial state.
identifyLearn how to associate the current session with a user.
anonymizeLearn how to disassociate the session from the current user.
setTokenLearn how to replace any existing token with a new one.
unsetTokenLearn how to clear any existing token.
getUserIdLearn how to get the ID of the currently identified user.
isAnonymousLearn how to check whether the user is anonymous.
fetchLearn how to fetch the content of a slot using a standalone function.
evaluateLearn how to evaluate a CQL query using a standalone function.
testLearn how to evaluate a CQL condition.
trackLearn how to track an event in the user session.
userLearn how to access the user instance.
sessionLearn how to access the session instance.
trackerLearn how to access the tracker instance.
initializedLearn how to check whether the SDK has been initialized.
pluggedLearn how to await the SDK initialization.
flushedLearn how to await the transmission of pending events.