Plug API

Explore 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
plugInitialize the SDK.
unplugReset the SDK to its initial state.
identifyAssociate the current session with a user.
anonymizeDisassociate the session from the current user.
setTokenReplace any existing token with a new one.
unsetTokenClear any existing token.
getUserIdGet the ID of the currently identified user.
isAnonymousCheck whether the user is anonymous.
fetchFetch the content of a slot.
evaluateEvaluate a CQL query in real-time.
testEvaluate a CQL condition in real-time.
trackTrack an event in the user session.
userAccess the user instance.
sessionAccess the session instance.
trackerAccess the tracker instance.
initializedCheck whether the SDK has been initialized.
pluggedAwait the SDK initialization.
flushedAwait the transmission of pending events.