Skip to main content
Use auth() to authenticate the current user session with the embedded Assistant.
Applies to Web Component, Window API, and PostMessage. Examples on this page use the Web Component API shape.

Usage

const user = await api.auth({
  access_token: string,
  refresh_token: string,
  id_token: string,
  token_type: string,
});

Prerequisites

  • None

Input validation

  • All fields (access_token, refresh_token, id_token, token_type) are required.
  • Tokens must be valid JWT strings.

Possible errors

  • INVALID_PAYLOAD: Missing required authentication fields.
  • UNAUTHORIZED: Invalid or expired tokens.
  • INTERNAL_ERROR: Authentication service unavailable.

Returns

{
  id: string,
  email: string
}