@trypillow/web.
Prerequisites
- A publishable API key from Developer
- A live study ID from the Integration tab
Install the SDK
Initialize the SDK
Callinit(...) once, as early as possible in your application — typically at the top level of your app, outside of any component render cycle. init(...) returns a singleton: calling it again with the same key returns the existing instance.
Initialize the SDK at the app entry point so the audience session is ready before you identify the user or present a study. Do not initialize inside a component that mounts and unmounts — the singleton will persist, but event listeners registered inside that component may become stale.
Identify and present
Identify the current user
Call
setExternalId(...) after login or whenever you know who the user is. Set any properties you want to use for targeting.Presentation modes
Use presentation options to switch between the default centered modal, a floating overlay panel, or an inline embed.What’s next?
Identification
Learn how external IDs and user properties work in the browser SDK.
Studies
Configure study presentation options and widget behavior.
Session management
Reset identity and manage in-progress study sessions.