This is not an SDK repo with extras attached.
The SDK is one package of eighteen. So is the backend behind api.oxy.so,
the identity vault people install on their phones, and the OAuth provider third parties integrate against.
|
A device holds a No cookies. No refresh token family. Cold boot restores the session without ever redirecting to a login page. |
Keys live on the person's device, in Commons. Records are signed client side and chained per subject, so ownership is proven by cryptography rather than granted by us. DIDs resolve at |
graph TD
P["@oxyhq/protocol<br/><i>signed records, canonical JSON</i>"] --> C["@oxyhq/core<br/><i>API client, session engine, crypto</i>"]
K["@oxyhq/contracts<br/><i>Zod schemas, one source of truth</i>"] --> C
K --> A["@oxyhq/api<br/><i>api.oxy.so</i>"]
F["@oxyhq/federation<br/><i>ActivityPub identity</i>"] --> A
C --> S["@oxyhq/services<br/><i>the single UI SDK</i>"]
C --> A
S --> Commons["Commons<br/><i>identity vault</i>"]
S --> Accounts["Accounts<br/><i>account management</i>"]
S --> IdP["auth.oxy.so<br/><i>OAuth provider</i>"]
S --> Console["Console"]
S --> Inbox["Inbox"]
style P fill:#440151,stroke:#D26AE7,color:#fff
style K fill:#440151,stroke:#D26AE7,color:#fff
style F fill:#440151,stroke:#D26AE7,color:#fff
style C fill:#5B0A6B,stroke:#D26AE7,color:#fff
style A fill:#5B0A6B,stroke:#D26AE7,color:#fff
style S fill:#5B0A6B,stroke:#D26AE7,color:#fff
|
|
There is no separate web only auth SDK. Web apps use
@oxyhq/servicesthrough React Native Web, so every platform shares one provider and one auth UI.
bun install && bun run build:allRequires Node 18+ and Bun 1.3+. Build order comes from the dependency graph: contracts β protocol β core β services β everything else.
React: Expo, React Native, or web
import { OxyProvider, useAuth } from "@oxyhq/services";
function App() {
return (
<OxyProvider clientId={process.env.OXY_CLIENT_ID} baseURL="https://api.oxy.so">
<MyComponent />
</OxyProvider>
);
}
function MyComponent() {
const { user, signIn, isAuthenticated } = useAuth();
if (!isAuthenticated) return <button onClick={() => signIn()}>Sign in</button>;
return <p>Welcome, {user?.username}</p>;
}signIn() opens the in app dialog: the accounts already on this device, plus one Continue with Oxy action. Oxy picks how the request reaches the identity β opening Commons, pushing to it, or showing a QR β instead of asking the person to choose a transport.
Node backends
import { OxyServices, oxyClient } from "@oxyhq/core";
const user = await oxyClient.getUserById("user-id");
const oxy = new OxyServices({ baseURL: "https://api.oxy.so" });
const profile = await oxy.getProfileByUsername("johndoe");Protect routes with @oxyhq/core/server: createOxyAuthMiddleware, requireOxyAuth, getRequiredOxyUserId, plus safeFetch for SSRF safe outbound requests and createOxyCors for a deny by default CORS policy.
Development commands
bun run build:all # build every package in dependency order
bun run start # run the API server
bun run dev # dev mode across workspaces
bun run test # tests, turbo dispatches each package's own runnerPackages never re-export from one another. Apps import @oxyhq/services for the provider and UI, @oxyhq/core for types and services, and @oxyhq/contracts for schemas.
Issues and pull requests are welcome, especially from people who will tell us when something is badly designed. The mission is not a marketing layer, it is the part we are trying to protect.