Quickstart
Send your first event and see Retivo in action
Choose your integration path:
- Path A — You're a product engineer adding Retivo directly to your app with the SDK.
- Path B — You're a platform team routing events from an analytics tool like Segment or PostHog.
Path A: SDK Integration
1. Get Your API Key
Sign up at your Retivo dashboard, then go to Settings → API Keys and create a key. You'll get a key starting with rt_live_ (production) or rt_test_ (testing).
2. Run the CLI Wizard (Recommended)
The fastest way to get started. The wizard detects your framework, installs packages, and generates integration code:
npx @retivo/cli initIt will prompt you for your API key and set everything up. See the CLI reference for details.
Prefer manual setup? Continue with the steps below.
3. Install the SDK
npm install @retivo/sdk4. Initialize and Identify a User
import { Retivo } from '@retivo/sdk'
const retivo = new Retivo({
apiKey: 'rt_test_...', // use a test key during development
})
retivo.identify('user-123', {
name: 'Jane Smith',
email: 'jane@example.com',
plan: 'pro',
})5. Track Your First Event
retivo.track('project_created', {
projectName: 'My First Project',
})Events are batched automatically — no need to manage flushing.
6. Add the In-App Widget
Show real-time intervention messages to your users:
import { RetivoWidget } from '@retivo/widget'
function App() {
return (
<>
<YourApp />
<RetivoWidget
apiKey="rt_test_..."
userId="user-123"
position="bottom-right"
/>
</>
)
}7. You're Done
Retivo will evaluate users as events arrive and deliver personalized interventions when your playbooks match. Create playbooks in the dashboard under Playbooks → New Playbook.
Next steps: SDK Reference · Widget docs · API Reference
Path B: Connector Integration
1. Get Your API Key
Sign up at your Retivo dashboard, then go to Settings → API Keys and create a key.
2. Point Your Analytics Tool at Retivo
Add a webhook destination in your analytics platform pointing to the appropriate Retivo connector endpoint:
| Platform | Endpoint |
|---|---|
| Segment | https://retivo.ai/api/connectors/segment |
| PostHog | https://retivo.ai/api/connectors/posthog |
| Mixpanel | https://retivo.ai/api/connectors/mixpanel |
Include your API key as a header:
Authorization: Bearer rt_live_...3. Verify Events Are Flowing
Send a test event from your analytics tool, then confirm it arrived:
curl https://retivo.ai/api/customers \
-H "Authorization: Bearer rt_live_..."You should see the user created from your connector event.
4. Register an Outbound Webhook
To receive intervention data in your backend, register a webhook endpoint:
curl -X POST https://retivo.ai/api/webhooks/endpoints \
-H "Authorization: Bearer rt_live_..." \
-H "Content-Type: application/json" \
-d '{ "url": "https://your-app.com/webhooks/retivo" }'Retivo will send signed HTTP callbacks whenever an intervention is delivered via the webhook channel.
5. You're Done
Events flow in from your analytics platform, Retivo evaluates users against your playbooks, and interventions flow out via your webhook. Create playbooks in the dashboard to define when and how Retivo should intervene.
Next steps: Connectors guide · Webhooks guide · API Reference