Session
User sessions: a short-lived token for one user, safe to hand to a browser.
session = user.session(scopes=["agents", "humans"], ttl_s=3600)
token = session.token # your frontend uses it as its API key
client = noclick.Client.for_session(session) # or act as that user from Pythonclass SessionA token pinned to one user with a subset of the minting key's scopes. Printing it never shows the token.
| token | string | |
| id | string | null | |
| userId | string | null | |
| scopes | string[] | |
| expiresAt | Date | null | |
| raw | JsonObject | The response JSON exactly as the API sent it. |
| baseUrl | string | undefined | The API the session was minted on. |
| expired | boolean | Whether |
client
client(options?: Omit<ClientOptions, "apiKey">): NoClickA client that acts as this session: await Agent.list({ client: session.client() }).
Defaults to NOCLICK_API_URL, then https://api.noclick.com.
Per-attempt request timeout (default 60s).
Retries for 408/429/5xx (never a POST's 500, which is replayed) and network errors (default 3).
First backoff step; doubles per attempt with jitter (default 500ms).
A custom fetch (a proxy agent, a test double). Defaults to the global one.
A client holding the session's token, pointed at the API the session came from. Every call it makes acts as the session's user, with the session's scopes.