Skip to main content
await airstore.connections.create('ws_abc123', {
  integrationType: 'github',
  accessToken: 'ghp_xxxxxxxxxxxx',
})
Connections link external services (Gmail, GitHub, Google Drive, etc.) to a workspace. Once connected, their data is available in the virtual filesystem.

create()

Create a connection by passing existing credentials.
// OAuth-based
const connection = await airstore.connections.create('ws_abc123', {
  integrationType: 'gmail',
  accessToken: 'ya29.xxx',
  refreshToken: '1//xxx',
  scope: 'https://www.googleapis.com/auth/gmail.readonly',
})

// API key-based
const phConnection = await airstore.connections.create('ws_abc123', {
  integrationType: 'posthog',
  apiKey: 'phx_xxxxxxxxxxxx',
})
Parameters
ParameterTypeRequiredDescription
workspaceIdstringYesWorkspace external ID
integrationTypeIntegrationTypeYesProvider: gmail, gdrive, github, notion, linear, slack, posthog
accessTokenstringNoOAuth access token
refreshTokenstringNoOAuth refresh token
apiKeystringNoAPI key (for key-based integrations)
scopestringNoOAuth scope string
extraRecord<string, string>NoProvider-specific extra fields
Returns Promise<Connection>
FieldTypeDescription
external_idstringUnique connection identifier
workspace_idstringWorkspace this connection belongs to
integration_typestringProvider type
scopestring | undefinedOAuth scope granted
expires_atstring | undefinedWhen credentials expire
created_atstringISO 8601 timestamp
updated_atstringISO 8601 timestamp

list()

List all connections in a workspace.
const connections = await airstore.connections.list('ws_abc123')
Parameters
ParameterTypeRequiredDescription
workspaceIdstringYesWorkspace external ID
Returns Promise<Connection[]>

del()

Delete a connection.
await airstore.connections.del('ws_abc123', 'conn_xyz789')
Parameters
ParameterTypeRequiredDescription
workspaceIdstringYesWorkspace external ID
connectionIdstringYesConnection external ID
Returns Promise<void>