Install the SDK
Run these commands once from your project root:π₯ Step-1 Choose your existing session replay provider
PostHog
PostHog
π― Step 1 β Go to Posthog and create a project
Your project ID is stored in the url: https://us.posthog.com/project/{project_id}/onboarding?next=%2Fhomeπ» Step 2 β Add the front end snippet to capture events
Next, we are going to add a tiny piece of tracking code (powered by PostHog) to your website. This acts as the βeyesβ that see what users are clicking on.Use your PostHog Project API Key (starts withphc_) here. Personal keys (phx_...) are admin keys and posthog.init() rejects them with personal_api_key.Copy the code snippet below into your websiteβs frontend. Make sure to replace YOUR_POSTHOG_PROJECT_API_KEY and YOUR_PRODUCT_ID with your real values.JavaScriptposthog.get_distinct_id()). This makes PostHogβs distinct_id equal your appβs
user id β so the same id reaches Autoplay as user_id β and links their earlier
anonymous activity to the identified person:π Quick Tip: Once you add this code to your site, jump into our Discord and say hi β we will check your data is flowing and help you get fully set up!
Identity plumbing for widget-based support AI agents: make sure the same user identity flows across all three layers: PostHog
distinct_id / user_id, your chat widget session metadata, and the support AI agent backend sender identifier. If those do not match, chat replies will look like βno recent activityβ because events are stored under one key and fetched with another.π Step 3 β Registering your product with Autoplay
Now that your website is tracking clicks, we need to create a secure βmailing addressβ (Webhook URL) and a shared secret (X-PostHog-Secret) so that data can be safely sent to Autoplay.Registration requires a valid contact email (stored on your connector product row) in addition to your product id. Existing deployments may still have older product rows without email until you re-register.Your stream consumer can pass the bearer token directly to AsyncConnectorClient(token=...) or via AUTOPLAY_APP_UNKEY_TOKEN.Create a Python file with the script below. Paste your Product ID from Step 1 into the script and run it.Python- product_id:
{product_id_entered} - webhook_url:
https://event-connector-luda.onrender.com/webhook/{product_id}
stream_url:https://event-connector-luda.onrender.com/stream/{product_id} - webhook_secret:
{secret}
unkey_key:{secret}
onboard_product registers an event_stream product. result includes your webhook, stream, and auth valuesβsave what prints in the terminal.- Step 4 (PostHog):
result.webhook_url,result.webhook_secret - Step 5 (live stream):
result.stream_url,result.unkey_key(use as Bearer)
Re-registering your product
- A second
onboard_productwith the sameproduct_idreturns 409 until overwrite is allowed. - Pass
force_reregister=True(same as CLI--force-reregister). You must still passcontact_emailon every registration, including overwrites. - After a successful overwrite, the webhook secret rotates. Update PostHog (Step 4) so
X-PostHog-Secretmatches the new secret.
π Step 4 β Set up your PostHog webhook
Now we must tell the website tracker (Step 2) to send its data to the secure address (webhook) you just generated (Step 3).You have three choices:Option A β Automated with the SDK (recommended)Let the SDK create and verify the destination for you β no clicking around in PostHog, no pasting Hog code. Run this once with the values from Step 3:- Join our Discord and say hi.
- We configure the PostHog webhook for you.
- You receive a 1Password link with your Stream URL and API token for Step 5.
- In PostHog, add a Webhook destination.
- Webhook URL: paste
result.webhook_urlfrom Step 3. X-PostHog-Secretheader: pasteresult.webhook_secretfrom Step 3. Do not create a new secret.
let url := ....PostHog webhook setup walkthroughπ‘ Step 5 β Watch Your Data Arrive Live! (Receive your first event)
Everything is wired up! Letβs turn on the monitor to see a live feed of your usersβ actions.Run this final script. If you used the DIY method in Step 4, use theStream URL from Step 3 and your Unkey token. If we helped you on Discord, use the stream URL and API token from Autoplayβs 1Password handoff.Then run the script, it connects to the SSE endpoint and prints every event as it arrives.Pythonprint(...) statements. SDK callbacks still receive typed dataclasses (ActionsPayload / SummaryPayload).π Next: choose your AI support agent β connect via MCP
Your activity is now flowing into the connector. The next step is to choose your existing AI support agent and connect it via MCP β it then pulls a userβs live activity on demand, the moment it needs context to answer.Fin AI (Intercom)
Fin AI (Intercom)
Connect Intercom Fin to live user activity via the MCP server β add the MCP connector, the
Get Live User Activity tool, and Messenger JWT identity.Connect Fin via MCP ->Maven (Coming soon)
Maven (Coming soon)
Coming soon β Maven will connect the same way, via the MCP server.
π Other next steps
Now that your data is flowing, hereβs how to put it to work:- Typed Payloads: Explore all available fields for Actions and Summaries.
- Inject into your LLM Response: Pass real-time user events into your prompt so the LLM understands what a user just didβnot just what they asked. Most users are in the wrong part of your product when they ask for help; this is what lets your onboarding agent bridge that gap.
- Agentic RAG: Build agents that track where a user is, where they need to be, and guide them thereββYouβve been on this page for a few minutesβhereβs where you actually need to go.β
- Async Client: Use Autoplay alongside LangChain or FastAPI.
Typed payloads
Explore all fields on ActionsPayload and SummaryPayload
RAG pipeline
Embed events into a vector store in real time
Async client
Use AsyncConnectorClient with LangChain or FastAPI
Proactive onboarding agent
Combine real-time events, memory, and golden paths
Support AI agent tutorials
Step-by-step guides for Intercom, Ada, Botpress, and more
AI agent skills
Browse, install, and download Cursor / Claude skills
extra field conventions used across the SDK, see Logging. Release history is on the Changelog.Amplitude
Amplitude
π― Step 1 β Install the Amplitude Unified SDK
The Unified SDK (@amplitude/unified) combines Analytics + Session Replay in one package β the same setup used in the Autoplay reference app.π² Step 2 β Install and initialise Amplitude in your app
The interactive walkthrough below gives you a visual overview of the Amplitude SDK setup. Steps 3β5 walk through all three parts with the exact code: Step 3 initialises Amplitude, Step 4 registers your product with Autoplay, and Step 5 identifies users on login.πΊ Full setup walkthroughIf you already have
amplitude.initAll(...) running in your app and users are appearing in the Amplitude dashboard, skip to Step 4 to register with Autoplay.π» Step 3 β Initialize on app load
Callamplitude.initAll() once at app startup β in main.ts, _app.tsx, or your root layout. Replace YOUR_AMPLITUDE_API_KEY with your projectβs API key (see the Tip below for where to find it):πΊ Copy your Amplitude API keyautocapture: true ensures that page views, clicks, and session lifecycle events flow to Autoplay automatically. Session Replay records what users actually do β Autoplay correlates those sessions to give your support AI agent real-time context.π Step 4 β Registering your product with Autoplay
πΊ How to find your Amplitude Project IDUse the same value everywhere: in Step 5βs
identifyObj.set('product_id', ...), here in onboard_product(), and it will appear automatically in your ingest URL in Step 7.Create a Python file with the script below and run it once to generate your connector credentials:- product_id:
{product_id_entered} - stream_url:
https://event-connector-luda.onrender.com/stream/{product_id} - unkey_key:
{secret}
Re-registering your productA second
onboard_product with the same product_id returns 409 until overwrite is allowed. Pass force_reregister=True to overwrite. You must still pass contact_email on every registration, including overwrites.π€ Step 5 β Identify on login (required for session scoping)
Run this immediately after your login flow completes. Use the values you just got from Step 4:YOUR_AUTOPLAY_PRODUCT_IDβ the Amplitude project ID you registered aboveYOUR_CONNECTOR_URLβ the domain part ofstream_url(e.g. ifstream_urlishttps://event-connector-luda.onrender.com/stream/828048, your connector URL ishttps://event-connector-luda.onrender.com)
setUserId and identify?setUserId tells Amplitude who the user is. The Identify call sets user_properties β including product_id and email β which Autoplay uses to map Amplitude events to the correct tenant and to link activity with your support AI agentβs incoming conversation threads. The /identify POST links the live Amplitude session ID to Autoplay so the support AI agent can fetch real-time context immediately when a user opens the chat widget.On logout β reset so the next user starts clean:π’ Step 6 β Understanding Amplitude session IDs
Amplitude assigns each browser session a numeric Unix-millisecond timestamp as its ID (e.g.1749012345678). Autoplay automatically converts it to a string, so your backend always receives payload.session_id as a string like "1749012345678".You donβt need to do anything extra β the /identify POST in Step 5 already links the session to Autoplay at login. Every subsequent event arrives with session_id filled in automatically.Amplitude initialises
session_id to -1 briefly on page load before the first session is established. Autoplay falls back to device_id for these early events, which is still a valid scoping key. This resolves within a few seconds and is completely normal.π Step 7 β Derive the Amplitude ingest URL
Your connector exposes a dedicated Amplitude ingest endpoint. Derive it from thestream_url you saved from Step 4:The
amplitude_ingest_url is different from result.webhook_url. The webhook_url is for a different integration and will return 401 for Amplitude events. Always use /ingest/amplitude/{product_id} for Amplitude.βοΈ Step 8 β Create the event streaming destination in Amplitude
πΊ How to create the Amplitude event streaming destinationAmplitude uses a developer portal to create custom event streaming destinations.8a β Open the destination builder
- In Amplitude, click Data in the left sidebar
- In the left sub-navigation, click Destinations
- Click + Add Destination (top right)
- In the catalog that opens, search for βHTTPβ or scroll to find it, then select it
- Choose βEvent Streamingβ as the type
autoplay-connector.URL Endpoint| Field | Value |
|---|---|
| Method | POST |
| URL | Your amplitude_ingest_url from Step 7 (e.g. https://your-connector.onrender.com/ingest/amplitude/your_product_id) |
| Parameter name | Value |
|---|---|
apiKey | Bearer + your amplitude_bearer_token from Step 7 (e.g. Bearer 4cmp...) |
| Header Key | Header Value |
|---|---|
Authorization | ${parameters.apiKey} |
This template does two things the default Amplitude template does not:1. Event type normalisation β Amplitudeβs autocapture sends events with names like
2. Field mapping β Amplitude stores click details (element text, URL, element path) under its own field names. The template copies them into the fields Autoplay expects so it can generate human-readable descriptions like βUser clicked Sign Up button on the dashboard pageβ.Without this template, only page views appear in the Autoplay stream β clicks and form events are silently ignored.
[Amplitude] Page Viewed and [Amplitude] Element Clicked. The Autoplay connector needs these mapped to standard names it recognises. The template does that automatically:| Amplitude event | Normalised to |
|---|---|
[Amplitude] Page Viewed, Page Viewed, Viewed * | $pageview |
[Amplitude] Element Clicked, [Amplitude] Element Changed, Form * | $autocapture |
| Everything else | passed through unchanged |
- Enable the βSend Eventsβ toggle
- Under βSelect & filter eventsβ, keep it set to βAll Eventsβ
- Click βTest Connectionβ to send a test event and confirm you get a
200 OK - Click βReleaseβ (top right) β this publishes the destination to the catalog
- Go back to Data β Destinations
- Under βNew Destinationsβ, find your destination
- Click it β βAdd New Syncβ page opens
- Enter a Sync Name (e.g.,
production-stream) and click βCreate Syncβ
π‘ Step 9 β Watch Your Data Arrive Live! (Receive your first event)
Everything is wired up! Open a terminal and run:data: lines arrive with "type": "actions" payloads. (If your internet drops, the client reconnects automatically.)Common issues:401on the connector: Confirm theAuthorizationheader isBearer result.unkey_key, not the key alone. Confirm the URL ends with/ingest/amplitude/your_product_id.404: Confirmyour_product_idin the URL matches theproduct_idused inonboard_product.- Events in Amplitude Live Events but not in SSE stream: Confirm the sync is active and the Event Body template uses
event_type(notevent_name) inside{"events": [...]}. - No events in Amplitude Live Events: Confirm the sync βSend Eventsβ toggle is on and that you are calling
amplitude.setUserId()before tracking events.
π Quick Tip: Once you add this code to your site, jump into our Discord and say hi β we will check your data is flowing and help you get fully set up!
π¦ What the payload looks like
A sample Amplitude event that Autoplay receives:ActionsPayload surfaces:session_idβ"1749012345678"(stringified)user_id/emailβ fromuser_propertiesset viaamplitude.identify()actionsβ extracted page view actions withcanonical_url,title, anddescription
β οΈ Common mistakes
Usingresult.webhook_url instead of the Amplitude ingest URL.
Always use /ingest/amplitude/`.Calling amplitude.setUserId() but not amplitude.identify() with product_id.
setUserId alone does not write user_properties. Without an explicit Identify call, product_id and email will be absent from every event β Autoplay will not be able to map the event to your tenant or to an active chat conversation.Session ID is β1 in early events.
Amplitude initializes session_id to β1 briefly before the first session is established. Autoplay falls back to device_id for these events, which is still a valid scoping key. This is normal and resolves within a few seconds of page load.Not calling amplitude.init() before the chat widget opens.
If the chat widget fires GET /sessions/{product_id}/{session_id} before Amplitudeβs session is established, there will be no activity to return. Initialize Amplitude at the earliest possible point in your app lifecycle.π Next: choose your AI support agent β connect via MCP
Your activity is now flowing into the connector. The next step is to choose your existing AI support agent and connect it via MCP β it then pulls a userβs live activity on demand, the moment it needs context to answer.Fin AI (Intercom)
Fin AI (Intercom)
Connect Intercom Fin to live user activity via the MCP server β add the MCP connector, the
Get Live User Activity tool, and Messenger JWT identity.Connect Fin via MCP ->Maven (Coming soon)
Maven (Coming soon)
Coming soon β Maven will connect the same way, via the MCP server.
FullStory (Coming soon)
FullStory (Coming soon)
Coming soon. Join our Discord for notifications.
Datadog (Coming soon)
Datadog (Coming soon)
Coming soon. Join our Discord for notifications.
Pendo (Coming soon)
Pendo (Coming soon)
Coming soon. Join our Discord for notifications.
π€ Step-2 choose your existing AI support agent
Intercom
Intercom
Botpress
Botpress
Dify
Dify
Tidio
Tidio
Landbot
Landbot
Crisp AI
Crisp AI
Zendesk (Coming soon)
Zendesk (Coming soon)
Coming soon.
Rasa (Coming soon)
Rasa (Coming soon)
Coming soon.
Inkeep (Coming soon)
Inkeep (Coming soon)
Coming soon.
πΊοΈ Step-3 Choose your existing visual guidance
Pop-up tours
Userpilot
Userpilot
Chameleon
Chameleon
Userflow
Userflow
Pendo
Pendo
Usertour
Usertour
UserGuiding
UserGuiding
Told
Told
Browser agents
Browser agents (Coming soon)
Browser agents (Coming soon)
Coming soon. Join our Discord for notifications.