Skip to main content
The OAuth resource handles interactive connection flows where users authorize access in their browser. Create a session, redirect the user, then poll for completion.

createSession()

Create an OAuth session and get the authorization URL.
Redirect the user to authorize_url in their browser. After they approve, Airstore handles the callback. Parameters Returns Promise<OAuthSession>

getSession()

Check the current status of an OAuth session.
Parameters Returns Promise<OAuthSessionStatus>

poll()

Poll a session until it completes, errors, or times out. This is a convenience wrapper around getSession() that checks at a regular interval.
With custom options:
Parameters Returns Promise<OAuthSessionStatus> — resolves with status: "complete". Throws
  • AirstoreError if the session status is error (user denied, provider error, etc.)
  • AirstoreError if the timeout is reached before the session completes