Skip to main content
Version: Vue SDK

Reference

Complete reference for all functions available via useScreeb().

close

Shuts down the current Screeb session and removes the Screeb tag from the DOM.

const { close } = useScreeb();
await close();

debug

Prints the current state of the Screeb tag to the browser console.

const { debug } = useScreeb();
await debug();

eventTrack

Tracks a user event.

const { eventTrack } = useScreeb();
await eventTrack("Product added to cart", { price: 299 });
ParameterTypeRequiredDescription
eventNamestringYesEvent name (max 128 chars)
eventPropertiesPropertyRecordNoKey/value properties

identity

Changes the current user identity. Running surveys will be closed.

const { identity } = useScreeb();
await identity("<user-id>", { plan: "pro" });
ParameterTypeRequiredDescription
userIdstringYesUnique user identifier
userPropertiesPropertyRecordNoUser properties

identityGet

Returns the current user identity.

const { identityGet } = useScreeb();
const id = await identityGet();

Returns: { anonymous_id, user_id, session_id, session_start, session_end, channel_id, is_ready }

identityGroupAssign

Assigns the current user to a group.

const { identityGroupAssign } = useScreeb();
await identityGroupAssign("company", "Apple", { city: "Cupertino" });
ParameterTypeRequired
groupNamestringYes
groupTypestringNo
groupPropertiesPropertyRecordNo

identityGroupUnassign

Unassigns the current user from a group.

const { identityGroupUnassign } = useScreeb();
await identityGroupUnassign("company", "Apple");

identityProperties

Adds or updates user properties. Pass null to delete a property.

const { identityProperties } = useScreeb();
await identityProperties({ plan: "pro", legacy_field: null });

identityReset

Resets the current user identity. A new anonymous identity is created.

const { identityReset } = useScreeb();
await identityReset();

init

Initializes the Screeb tag.

const { init } = useScreeb();
await init("<website-id>", "<user-id>", { plan: "pro" }, hooks, "en");
ParameterTypeRequired
websiteIdstringYes
userIdstringNo
userPropertiesPropertyRecordNo
hooksHooksInitNo
languagestringNo

load

Manually loads the Screeb tag script. Called automatically by the plugin unless shouldLoad: false.

const { load } = useScreeb();
await load();

messageClose

Closes the currently running in-app message.

const { messageClose } = useScreeb();
await messageClose();

messageStart

Starts an in-app message by its ID.

const { messageStart } = useScreeb();
await messageStart("<message-id>", true, { color: "green" }, hooks, "en");
ParameterTypeRequired
messageIdstringYes
allowMultipleResponsesbooleanNo (default: true)
hiddenFieldsPropertyRecordNo
hooksHooksMessageStartNo
languagestringNo

sessionReplayStart

Starts a session replay recording.

const { sessionReplayStart } = useScreeb();
await sessionReplayStart();

sessionReplayStop

Stops the current session replay recording.

const { sessionReplayStop } = useScreeb();
await sessionReplayStop();

surveyClose

Closes the currently running survey.

const { surveyClose } = useScreeb();
await surveyClose();

surveyStart

Starts a survey by its ID.

const { surveyStart } = useScreeb();
await surveyStart("<survey-id>", "<distribution-id>", false, hiddenFields, hooks, "en", "#container");
ParameterTypeRequired
surveyIdstringYes
distributionIdstringNo
allowMultipleResponsesbooleanNo (default: false)
hiddenFieldsPropertyRecordNo
hooksHooksSurveyStartNo
languagestringNo
selectorsstring | string[]No

targetingCheck

Forces a targeting rule evaluation.

const { targetingCheck } = useScreeb();
await targetingCheck();

targetingDebug

Prints the current targeting engine state.

const { targetingDebug } = useScreeb();
await targetingDebug();