Getting started
Install the SDK, point it at your SharkAuth server, make a call. Two minutes.
Install
The TypeScript build is ESM-first with CJS fallback. It runs in browsers (Web Crypto) and Node 18+.
Environment
The SDKs do not read environment variables themselves — pass everything explicitly. Conventional names if you wire your own loader:
| Variable | Used for |
|---|---|
SHARK_AUTH_URL | Base URL of your SharkAuth instance |
SHARK_ADMIN_KEY | sk_live_... admin key |
SHARK_AGENT_CLIENT_ID | shark_agent_... for an agent |
SHARK_AGENT_SECRET | Agent client secret |
First call — admin client
First call — public auth
No admin key needed for end-user auth. The Python AuthClient keeps a requests.Session so the cookie planted by /login flows through. The TS AuthClient does the same with a small built-in cookie shim for Node and credentials: "include" for the browser.
What's in Client / SharkClient
The composer client exposes 18 namespaces. Same shape in both languages:
auth, mfa, sessions, consents, dcr,
users, agents, organizations, apps, api_keys, rbac, audit,
webhooks, proxy_rules, proxy_lifecycle, branding, paywall, http
Each namespace is also importable directly if you want to skip the composer:
Two auth modes
| Mode | Python | TypeScript | When |
|---|---|---|---|
| Admin API key | Client(url, "sk_live_") | new SharkClient({...}) | Server-side automation |
| User session | AuthClient(url) | new AuthClient(url) | Acting as an end user |
| Agent + DPoP | OAuthClient + DPoPProver | OAuthClient + DPoPProver | Machine-to-machine, MCP, delegation |
For the agent path, see Delegation and agents.
Next
- Authentication — full human-auth surface
- Delegation and agents — flagship: agents acting on users' behalf
- Errors and retries — what to catch