Documentation Index
Fetch the complete documentation index at: https://docs.alterauth.com/llms.txt
Use this file to discover all available pages before exploring further.
connect()
Run headless OAuth from a CLI or script. Opens a browser, polls until the user finishes.
Signature
Parameters
| Name | Default | Notes |
|---|---|---|
providers | undefined | Restrict the picker. |
grantPolicy | undefined | Set max TTL on the resulting grant. |
timeout | 300000 | ms to poll before throwing ConnectTimeoutError. |
pollInterval | 2000 | ms between polls. |
openBrowser | true | Set false over SSH; SDK prints the URL. |
Returns
ConnectResult[] — one per connected account.
Throws
ConnectFlowError, ConnectDeniedError, ConnectTimeoutError, ConnectConfigError.
Example
authenticate()
Open the IDP’s sign-in flow and return the resulting JWT.
Signature
Returns
AuthResult with userToken and userInfo.
Example
createConnectSession()
Build a connect URL backend-side; redirect the user there or hand it to a frontend popup SDK.
Signature
requiredScopes lets a session ask for a narrower per-provider scope set than the app’s Dev Portal default (must be a subset of the Dev Portal allowlist). agent delegates the resulting OAuth grant to a managed agent — when combined with user consent at the Connect UI, the callback creates both the OAuth grant under the user’s principal AND the agent-delegation row.
Returns
ConnectSession with sessionToken and connectUrl. Pass sessionToken to the Connect.js SDK or redirect to connectUrl.
Example
verifyUserToken()
Verify a JWT against the configured IDP without making a provider call.
Signature
Returns
The verifiedsub claim, or null if invalid.