1. Create your account and API key
Register for AdMesh, complete onboarding, and select Bridge in your platform’s ad formats. Create an API key in the dashboard.2. Install the SDK
3. Wrap your chat with AdMeshProvider
Use a uniquesessionId for each conversation and keep it unchanged across turns.
4. Connect consent and activation
Implement these callbacks in your chat and pass them to recommendations below each assistant response. Use the original user query and its user message ID.handleDelegationConsent(recommendation): show your consent dialog using the supplied consent requirements. Returntrueonly when the user agrees, orfalsewhen they decline.handleDelegationActivated(payload): save thedelegation_session_id, brand details, andmcp_endpointin your host’s session state, then activate your backend’s brand runtime.
5. Route brand conversations
While the brand session is active, route subsequent turns through your backend’s brand runtime using the activation payload. Identify the brand in your chat UI. Hide recommendations on turns generated during the brand session. If an action requires contact or checkout details, collect them through a form with explicit consent before submitting them to the brand runtime.6. Connect the stop action
CalluseAdMesh inside a component wrapped by AdMeshProvider. Wire this handler
to your chat’s stop-brand-conversation button:
7. Test your integration
- Send a query that returns an eligible Bridge recommendation.
- Click Talk to Agent and decline consent; no brand session should start.
- Try again and accept; verify the next turn reaches the brand runtime.
- Stop the brand conversation and verify normal chat routing resumes.