Overview
Core figures out two things on every visit: which project the request belongs to, and who the visitor is — an anonymous app user ID it creates the first time someone visits (no login or account needed) and remembers across sessions. Every other SDK reuses that identity from Core, so it’s only set up once. Core doesn’t make any network calls of its own, and it’s required by every other SDK on this site.Implementation
Install
Project config
Generate your project config with the Embeddables CLI, then import the generated output in your app:publishableKey — always add it when initializing ({ ...config, publishableKey }). Use the key em init printed, or find it under Settings → Portal / SDK in the admin app.
Install once, then pick your setup:
- React
- JavaScript
- Server
In your existing React app (React 18 or newer), wrap it once, above every product SDK:The Include only the factories for the SDKs you use. Each factory takes that SDK’s options — for example
modules import in the example turns on Analytics, Experiments, and Forms when you use those
products. If you only need Core for now, you can omit modules and add it later. Every Core hook is
listed under Hooks reference below.Core finishes setting up after your component mounts, so
useEmbeddables() and
useAppUserId() return null on the first render (and during server rendering). Always handle
that loading state.Turning on other SDKs (React)
Recommended: runem build after you add SDKs with the CLI. It creates the modules file you
import in the example — already in the right order.Manual: list each product’s React setup yourself (same as the generated file). Put Analytics first
so Experiments and Forms can use it. Form schemas live in Core config (config.forms from the CLI), so
forms() takes no schema argument:analytics({ publishableKey }) or forms({ analyticsInstance }).Hooks reference
Core’s React hooks only work inside the wrapper from the example. They may show empty at first while Core finishes loading — handle that brief state in your UI. See the reference foruseEmbeddables, useAppUserId, page views, and the
rest.Need every method and hook? See Reference — methods and hooks.

