Skip to content

Embedding

  • Redirect (default): navigate the top window to session.url; the user returns to redirect_uri?session=ses_…&status=completed.
  • Popup: open session.url in a popup; on completion the hosted page posts { type: "sweep-connect", session: "ses_…", status: "completed" } to window.opener with your origin as target (the origin must match the application’s registered redirect URIs).
  • Mobile: register an app link or custom scheme as redirect_uri; the hosted flow uses the system browser (never an embedded webview, which providers block).
const session = await sweep.connect.createSession({ end_user_ref: "user_42", providers: ["google_gmail"], operations: ["discover"], redirect_uri: "https://app.example.com/sweep/return" });
window.location.href = session.url;

Sessions expire after 30 minutes. Poll GET /v1/connect/sessions/{id} or listen for sweep.source.connected.