ScaleBun
Skip to article

Engage

webDeveloper

The ScaleBun.engage namespace — 5 members.

Updated Reviewed
TypeScript
import ScaleBun from '@scalebun/web';
ScaleBun.engage.<method>(…);

Members#

MemberSignature
tracktrack(name: string, props?: Record<string, unknown>): void
refreshrefresh(): Promise<void>
submitsubmit(surveyId: string, result: EngageSurveyResult): Promise<'success' | 'error'>
emitRatingEventemitRatingEvent(type: EngageRatingEventType, input?: EngageRatingEventInput): void
resetInAppStateresetInAppState(): Promise<void>

Reference#

track#

TypeScript
ScaleBun.engage.track(name: string, props?: Record<string, unknown>): void

Track a custom event that can trigger a survey (alias of track, kept for parity).

refresh#

TypeScript
ScaleBun.engage.refresh(): Promise<void>

Re-fetch the active survey config (e.g. after login / a context change).

submit#

TypeScript
ScaleBun.engage.submit(surveyId: string, result: EngageSurveyResult): Promise<'success' | 'error'>

E2 — submit a response from a custom survey UI → 'success'|'error' (retried, idempotent).

emitRatingEvent#

TypeScript
ScaleBun.engage.emitRatingEvent(type: EngageRatingEventType, input?: EngageRatingEventInput): void

E2 — emit one rating-funnel event (eligible/shown/dismissed/selected/store_redirect).

resetInAppState#

TypeScript
ScaleBun.engage.resetInAppState(): Promise<void>

E2 — dev/QA: clear on-device engage state so campaigns show again (no incognito needed).

Engage · API reference · Web SDK · ScaleBun