Use this file to discover all available pages before exploring further.
const session = await airstore.oauth.createSession({ integrationType: 'gmail', workspaceId: 'ws_abc123',})// Redirect the user to session.authorize_url
Integrations connect external services (Gmail, GitHub, Google Drive, etc.) to a workspace. Once connected, their data becomes available in the virtual filesystem through source views.The SDK supports two ways to connect integrations:
OAuth flow — Redirect the user to authorize access, then poll for completion. Best for interactive setups.
Direct credentials — Pass existing OAuth tokens or API keys directly. Best for backend automation where you already have credentials.
const result = await airstore.oauth.poll(session.session_id)console.log(result.status) // "complete"console.log(result.connection_id) // "conn_xyz789"
poll() checks the session status every 2 seconds (configurable) and resolves when the user completes or denies authorization. It throws if the session times out or errors.
// Custom polling optionsconst result = await airstore.oauth.poll(session.session_id, { timeout: 120_000, // 2 minutes instead of default 5 interval: 1_000, // Check every second})
This is useful when your backend already manages OAuth tokens for users and you want to pass them through to Airstore without a second authorization prompt.