Engage
webDeveloper
The ScaleBun.engage namespace — 5 members.
TypeScript
import ScaleBun from '@scalebun/web';
ScaleBun.engage.<method>(…);Members#
| Member | Signature |
|---|---|
track | track(name: string, props?: Record<string, unknown>): void |
refresh | refresh(): Promise<void> |
submit | submit(surveyId: string, result: EngageSurveyResult): Promise<'success' | 'error'> |
emitRatingEvent | emitRatingEvent(type: EngageRatingEventType, input?: EngageRatingEventInput): void |
resetInAppState | resetInAppState(): Promise<void> |
Reference#
track#
TypeScript
ScaleBun.engage.track(name: string, props?: Record<string, unknown>): voidTrack 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): voidE2 — 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).