Skip to main content

Overview

The Embeddables CLI (em) sets up and maintains an Embeddables project on your machine: sign in to the admin app, initialize a project, scaffold forms, connect experiments, build the generated config your app uses, and publish it to Embeddables per git branch. Use it to manage your Embeddables project from the command line instead of hand-wiring the Core config yourself.
Requires Node.js 20 or newer. The npm package is @embeddables/em-cli; the command you run is em.

Install

Install globally so the em command used throughout these docs is on your PATH:
Prefer not to install? Run it with npx instead — replace em with npx @embeddables/em-cli in every command below (for example, npx @embeddables/em-cli init).
Add @embeddables/em-cli to devDependencies only if CI runs em build (or similar) and you want the version pinned in package-lock.json. For day-to-day use on your machine, global or npx is enough — the CLI is not imported by your app at runtime.

Update

npm update -g @embeddables/em-cli also works. Check your version with npm list -g @embeddables/em-cli. With npx, add @latest to always fetch the newest publish (npx @embeddables/em-cli@latest …).

Quick start

1

Log in

Opens the Embeddables admin app and stores a local session on your machine. Log in first — you need a session to select a project, connect experiments, view your data, and deploy.
2

Initialize the project

From your app root:
Sets up Embeddables in the current directory, asks which project to use, builds, and prints that project’s sandbox and live publishable keys.
3

Add forms and experiments (optional)

Optional. form create adds a form to your project. experiment connect adds an experiment from your project (interactive picker, or pass its id) — experiments are created in the admin first, so skip this if you have none yet.
4

Use it in your app

Import the generated config into your app — see Core SDK. After you add or change forms or experiments, run em build to regenerate it.

Commands

Run em <command> --help for command-specific flags.

Authentication

login and logout manage a CLI session stored locally (under your user config directory). You sign in through the Embeddables admin app at https://admin.embeddables.com; the CLI then talks to Embeddables production services on your behalf.

Forms

form create adds a new form to your project:
It scaffolds the form and builds once your project is initialized. Display names may repeat.

Experiments

Adds the experiment to your project (deduped), then builds. The positional form never prompts, so it works in CI or scripts.

Build

Validates your project and generates the config your app uses. Import it into your app — see Core SDK.

Deploy

Publishes your project config to Embeddables for the current git branch, so you must be on a checked-out branch (not a detached HEAD). Requires an active CLI session. It does not run build first — run build separately if your deployment pipeline needs fresh generated output.

Next steps