@oneclient/sdk
v0.1.4
Published
The complete TypeScript client for OneClient auth, data, storage, jobs, email, AI, analytics, hosting, domains, and billing.
Maintainers
Readme
@oneclient/sdk
The typed client behind OneClient. It covers project auth, policy-controlled data, parameterized SQL, object storage and S3 multipart uploads, KV, queues and schedules, transactional email, managed/BYOK AI, product analytics, deployments, domains, billing, GitHub, and recovery workflows.
npm install @oneclient/sdkimport { createServerClient } from "@oneclient/sdk";
export default {
async fetch(_request: Request, env: Env) {
const one = createServerClient(env);
await one.analytics.track([
{ name: "workspace.created", occurredAt: new Date().toISOString(), properties: {} },
]);
return Response.json(await one.kv.get("release-flags"));
},
};For the SDK and CLI in one install, use oneclient. Read
the five-minute quickstart or the
generated API reference.
Expo magic-link callbacks
The Better Auth Expo plugin persists OTP responses automatically. For an email magic link, consume
the approved app-scheme callback with consumeExpoMagicLinkCallback, then refresh the Better Auth
session. The helper validates the configured scheme and Better Auth cookie names, writes only to the
provided secure-storage adapter, and returns a URL with the signed cookie removed.
import { consumeExpoMagicLinkCallback } from "@oneclient/sdk";
const callback = await consumeExpoMagicLinkCallback(url, {
scheme: "myapp",
storagePrefix: "myapp",
storage: SecureStore,
});
if (callback.handled) await auth.getSession();