Install
Add the Screeb SDK to your app and start it with your channel id, so surveys, messages and session replay can run.
Install the Screeb SDK once, at the start of your app, with the channel id of your workspace. Until a user is identified, Screeb tracks them as an anonymous visitor: see Identity to attach your own user id.
Your channel id is on the Install page of your workspace settings. The steps on the admin side are in the help center: Install Screeb on your website and Install Screeb in your mobile app.
Requirements
Section titled “Requirements”- Node.js 14 or later.
- React 17+, Vue 3+, Angular 12+ (14+ for standalone bootstrapping), Svelte 4+, or Ionic 6+ with Capacitor 4+, depending on your package.
- The same browsers as the JavaScript tag: Chrome 94+, Firefox 91+, Safari 15+, iOS 15+, Edge 94+, with a legacy bundle for older ones.
- With server-side rendering (Next.js, Nuxt, SvelteKit), load and start Screeb on the client side only.
Add the SDK to your project
Section titled “Add the SDK to your project”npm install @screeb/sdk-reactStart the SDK
Section titled “Start the SDK”import { ScreebProvider } from "@screeb/sdk-react";
export const App = () => ( <ScreebProvider autoInit websiteId="<YOUR-CHANNEL-ID>"> <HomePage /> </ScreebProvider>);autoInit starts Screeb as soon as the SDK has loaded. When the user is already logged in at that point, pass userId and userProperties too, so Screeb never creates an anonymous visitor for them (see Identity). To keep Screeb from loading in tests or CI, set shouldLoad to false there.
Stop the SDK
Section titled “Stop the SDK”Stop Screeb at any time, for example when the user withdraws consent. It stays off until you start it again.
const { close } = useScreeb();
await close();Next steps
Section titled “Next steps”- Identify your users to follow them across devices and target surveys on their properties.
- Track events to trigger surveys and messages on what users do.
- Start a survey from your code when the targeting rules are not enough.