Sign-in and sessions, without the boilerplate
The Anythink SDK is an open source React library for sign-in and sessions: an auth client, a provider, a useAuth hook, and a base class for authenticated requests. Data calls go through the REST API directly — there's no hidden query layer to learn.
Auth and sessions, handled
The SDK is sign-in and sessions, done properly, so you're not hand-rolling token refresh in every project.
Silent, de-duplicated token refresh
Concurrent requests that hit a 401 don't each fire their own refresh call. AuthenticatedBaseService registers a response interceptor that serialises and caches the refresh, then replays the original requests once it completes.
AuthProvider and useAuth
Wrap your app in AuthProvider, point authPrefix at your login route, and call useAuth anywhere for sign-in, sign-out and the current session. No manual token plumbing through your component tree.
Session storage you choose
Pick cookie, sessionStorage or localStorage per AuthClient instance. sessionStorage and localStorage isolate sessions per browser tab, which matters if your app opens multiple projects or environments side by side.
A base class for authenticated calls
Extend AuthenticatedBaseService once, and every request through it carries the session token and handles refresh automatically. Data calls go through the standard Anythink REST API underneath, not a separate client-side query language.
In practice
The SDK's actual surface
import { AuthClient } from "@anythink-cloud/sdk"; let authClientInstance: AuthClient | null = null; export const getAuthClient = (): AuthClient => { if (!authClientInstance) { authClientInstance = new AuthClient({ instanceUrl: "https://api.my.anythink.cloud", orgId: 12345678, storageType: "sessionStorage", // "cookie" (default), "sessionStorage" or "localStorage" }); } return authClientInstance; };
What it's for
Sign-in that works the same everywhere
One AuthClient configuration covers email/password, session refresh and logout. Wire it into a React or Next.js app once, and every authenticated call through AuthenticatedBaseService carries a valid token.
Multiple sessions in the same browser
sessionStorage or localStorage mode isolates a session per tab, which matters if your app, or your team, moves between projects or environments without wanting one login to bleed into another.
Data calls stay on the REST API
The SDK doesn't wrap your entities in a query builder. You call the same REST endpoints documented in the API reference, through a service class that handles the auth header and token refresh for you.
Frequently Asked Questions
Does the SDK generate a typed client for my entities?
Not today. The SDK covers sign-in and sessions — AuthClient, AuthProvider, useAuth and AuthenticatedBaseService. Data calls go through the REST API directly. A typed data client is on the roadmap, with no date set yet.
Is there realtime data in the SDK?
Realtime subscriptions are planned. Today the SDK handles sign-in and sessions, and your app reads and writes data through the REST API.
What does authPrefix do on AuthProvider?
It tells the provider which route prefix your login pages live under, so it matches the API's expectations for where to send an unauthenticated user. It must match your app's actual login route, for example /auth for pages under /auth/login.
Is a Flutter SDK available?
A Flutter SDK is planned, alongside a typed data client. Today Flutter apps use the REST API directly, including sign-in with Apple and Google.
Still have questions?
Get in TouchMore in the same project
Every feature reads from the same data model, so each one you add works with the rest.
Ways to build with it
The dashboard, the CLI, MCP and the SDK, plus guides for moving from other platforms.
Who it's for
How founders, agencies and enterprise teams use Anythink.
Documentation
Guides and reference at docs.anythink.cloud.
- /
- Solutions/
- Typescript Sdk