• Compare
  • Documentation
  • Pricing
  • Agents
Sign InStart free

The outbound integration layer for SaaS products: emit once, then let Meshes handle routing, retries, fan-out, and delivery history.

  • Terms of Service
  • Privacy Policy
  • Acceptable Use Policy
  • Cookie Policy

© Copyright 2026 Meshes, Inc. All Rights Reserved.

  • Getting Started
    • What is Meshes?
    • Core Concepts
    • Quickstart
    • API Overview
  • AI Tools
    • Cursor Rules
    • MCP Server
    • LLMs Docs
  • API Documentation
    • API Reference
    • Authentication
    • Results
    • Rate Limiting
    • SDKs
    • Integrations & Rules
  • Events
    • Publishable Keys
    • Send Events
    • Bulk Event Ingestion
  • Embed & Sessions
    • Quickstart
    • Session API Overview
    • Launch URL and Iframe Bootstrap
    • Iframe Message Contract
    • Session Roles and Scopes
    • Workspace Pages Available in Embed
    • Session Refresh Lifecycle
    • Iframe Sizing and Resize Handling
    • OAuth and Connection Setup Behavior
    • Security Model
    • Troubleshooting
  • Integrations
    • HubSpot
    • Intercom
    • Slack
    • Salesforce
    • Zoom

Quickstart

Embed a Meshes workspace in your app using a launch URL and a session token.

This quickstart shows the minimum integration path for embedding Meshes inside your application.

1. Mint a session on your backend

Call POST /api/v1/sessions from your backend with your Meshes management credentials.

{
  "workspace_id": "550e8400-e29b-41d4-a716-446655440000",
  "role": "admin",
  "ttl_seconds": 1800,
  "launch_ttl_seconds": 30,
  "launch_path": "/workspace/dashboard",
  "allowed_origins": ["https://app.example.com"]
}

The response includes:

  • access_token
  • session_id
  • launch_url
  • expires_at

2. Set the iframe source

Use the returned launch_url as the iframe source.

<iframe
  src={launchUrl}
  title="Meshes workspace"
  style={{ width: '100%', border: 0 }}
/>

3. Add one host-side message handler

Use the launch_url to derive the expected embed origin, then ignore messages from any other origin.

const iframe = document.querySelector('iframe');
const embedOrigin = new URL(launchUrl).origin;

window.addEventListener('message', async (event) => {
  if (event.origin !== embedOrigin) return;
  if (event.source !== iframe?.contentWindow) return;

  switch (event.data?.type) {
    case 'meshes:ready':
      iframe?.contentWindow?.postMessage(
        {
          type: 'meshes:auth',
          token: accessToken,
        },
        embedOrigin
      );
      break;

    case 'meshes:token-refresh': {
      const refreshed = await refreshMeshesSession(sessionId);
      accessToken = refreshed.access_token;

      iframe?.contentWindow?.postMessage(
        {
          type: 'meshes:auth',
          token: accessToken,
        },
        embedOrigin
      );
      break;
    }

    case 'meshes:resize':
      iframe.style.height = `${Math.max(480, event.data.height)}px`;
      break;
  }
});

4. Let meshes:ready start the runtime session

When the iframe sends meshes:ready, send the current access_token with meshes:auth.

This is the runtime credential. The launch URL is only for the initial iframe request.

5. Refresh in place when the iframe asks

When the iframe later sends meshes:token-refresh, call POST /api/v1/sessions/:sessionId/refresh on your backend and send the new access_token back with another meshes:auth.

6. Hard reload behavior

If the iframe is fully reloaded, mint a fresh session or at least a fresh launch_url before mounting it again.

End-to-end flow summary

  1. your backend mints a session
  2. your frontend mounts the iframe with launch_url
  3. the iframe sends meshes:ready
  4. your frontend sends meshes:auth
  5. the iframe sends meshes:token-refresh when it needs a new token
  6. your frontend refreshes the session on your backend and sends the new token

Next steps

  • Session API Overview
  • Launch URL and Iframe Bootstrap
  • Iframe Message Contract
  • Session Refresh Lifecycle
  • Iframe Sizing and Resize Handling
  1. 1. Mint a session on your backend
    1. 2. Set the iframe source
    2. 3. Add one host-side message handler
    3. 4. Let meshes:ready start the runtime session
    4. 5. Refresh in place when the iframe asks
    5. 6. Hard reload behavior
    6. End-to-end flow summary
    7. Next steps