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.
request()
Make a token-injected request to a provider API. The most common SDK call.
Signature
Parameters
| Name | Type | Description |
|---|---|---|
method | HttpMethod | string | HTTP method. |
url | string | Full upstream URL. |
grantId | string | Explicit grant. Mutually exclusive with provider. |
provider | string | Resolves to a grant via userTokenGetter. Requires JWT mode. |
account | string | Disambiguator when a user has multiple accounts on one provider. |
json | unknown | JSON-serialized body. |
body | Uint8Array | string | Raw body. |
extraHeaders | Record<string, string> | Additional headers (Auth header is set by the SDK). |
queryParams, pathParams | Record<string, string> | Templated URL inputs. |
reason | string | Human-readable explanation, surfaces in audit logs. |
context | Record<string, string> | Per-call audit metadata. |
userToken | string | Per-call JWT override. |
Returns
AnAlterResponse (a standard Response with a retryInfo: RetryInfo | null property carrying retry metadata).
Throws
GrantNotFoundError, GrantExpiredError, GrantRevokedError, AmbiguousGrantError, NoDelegatedGrantError, PolicyViolationError, ScopeReauthRequiredError, ProviderAPIError, NetworkError. See Errors.
Example
proxyRequest()
Forwards an HTTP exchange through the Alter backend. Use when the call must run server-side (AWS SigV4, approval-gated calls, backend rate limiting).
Signature
Authorization, Cookie, x-api-key, x-amz-security-token) are forbidden — the backend injects credentials at execution time.
Returns
ApprovalResultif the call ran inline. The body is base64-encoded onbodyB64— decode withbodyText()/bodyJson()/bodyBytes().PendingApprovalif policy required human approval. PassapprovalIdtoawaitApproval(). See Approvals.
Example
boto3Client is Python-only. For AWS in Node, use proxyRequest with SigV4-typed managed secrets. See Managed Secrets → Using grants.