Install with Claude Code (2 minutes)
The fastest way to add SegOps to an app is to let an AI coding agent do it. The **SegOps skills** wire the right SDK into your stack — install the package, set up the keys/env, drop in the provider or server client, and emit a test event — so you go from nothing to your first event in minutes.
1. What you need first#
- A SegOps workspace and an API key from Settings → API Keys:
- a public key (
pk_…) for browser/mobile apps (safe to ship), and/or - a secret key (
sk_…) for server-side code (never ship this to a client).
- a public key (
- Your API base URL. Point it at your SegOps stack —
http://localhost:8000for local dev, or your deployment URL. (The hostedapi.segops.aiendpoint is rolling out; until then, use your own stack URL — the skills never hardcode an endpoint.)
2. Install the skills#
The skills ship as a Claude Code plugin (segops) in the public
github.com/segops/skills catalog. Add
the marketplace and install it:
That's it — the skills are now available (namespaced as /segops:<name>), and
Claude invokes the right one automatically when your request matches.
Just want one skill? Each skill is a plain SKILL.md directory, so you can
copy a single one instead:
It's then available as /integrate-nextjs.
3. Paste one prompt#
Paste the prompt for your stack (or call the skill directly, e.g.
/segops:integrate-nextjs):
| Your stack | Prompt |
|---|---|
| Next.js | "Use the integrate-nextjs skill to add SegOps to my app." |
| React (Vite/CRA) | "Use the integrate-react skill to add SegOps." |
| Node.js (server) | "Use the integrate-node skill to add SegOps tracking." |
| iOS (Swift) | "Use the integrate-ios skill to add SegOps." |
| Android (Kotlin) | "Use the integrate-android skill to add SegOps." |
| Shopify | "Use the shopify-install skill to connect my store." |
The skill will ask for your API URL and key, make the changes, and finish by
sending a segops_smoke_test event. Confirm it in SegOps → Event
Sandbox.
4. Do more from a prompt#
Beyond integration, skills cover common workflows (these use a server-side sk_
key via the Admin SDK):
| Goal | Prompt |
|---|---|
| Build an audience | "Use create-segment to build a segment of users who spent over €500 but haven't ordered in 30 days." |
| Track a new event | "Use track-event to add a checkout_completed event." |
| Generate a landing page | "Use generate-landing-page for 'best running shoes for flat feet'." |
| Audit AI visibility | "Use audit-ai-visibility to check how we show up for 'best CRM for startups'." |
| One-off admin script | "Use admin-script to import products.csv." |
Prefer to wire it by hand?#
Every skill is a thin layer over the published SDKs — you can do the same steps manually:
- TypeScript / JavaScript SDK — browser, Node, and the
@segops/sdk/reactprovider + hooks - Admin SDK — segments, pages, queries, schemas, …
- Swift · Kotlin · Go
- Server-side signing — sign
user_idfor the public-key handshake
Troubleshooting#
| Symptom | Fix |
|---|---|
Browser warns about an sk_ key | Use the public key (pk_…) in client code; keep secret keys server-side. |
| Test event never appears | Check the API URL is reachable from where the code runs and the stack is up. |
| Session mint returns 401/403 | The public key is wrong/disabled, or the app's origin isn't allow-listed on the key. |
Events show anonymous | Wire the signing endpoint and call the SDK's setUser / userProvider after login. |