backlex
v0.1.4
Published
Typed TypeScript client for the backlex API — auth, collection CRUD, query builder, realtime, storage, jobs, flows, flags, and offline sync. Zero dependencies. On npm as compiled ESM + types; on JSR (@backlex/backlex) as TypeScript source.
Maintainers
Readme
backlex
Typed TypeScript client for the backlex API — the same fetch wrapper the admin SPA and the official examples use.
npm i backlex # npm — compiled ESM + types
# or
npx jsr add @backlex/backlex # JSR — TypeScript sourceimport { createClient } from "backlex";
const backlex = createClient({
url: "https://api.your.app",
workspace: "acme", // app mode: auth + data scoped to one workspace
});
await backlex.auth.signUp({ email, password, name });
const { data } = await backlex.from("todos").list({ sort: ["-created_at"] });
await backlex.from("todos").create({ title: "Hello", done: false });
const off = backlex.subscribe("items:todos", (e) => console.log(e.event, e.data));Covers auth (email/OAuth/magic-link/OTP), collection CRUD + a fluent typed query builder, batch writes, full-text/vector/hybrid search, realtime (SSE), storage + resumable uploads, jobs, feature flags, and offline-first sync. Full reference: https://backlex.com/docs/sdk-and-cli.
Distribution
Published to two registries, both zero-dependency:
- npm (
npm i backlex) — compiled ESM JavaScript +.d.ts. Works in every bundler (Vite, Next.js, webpack, esbuild, Rollup), in Node (any version), in Deno/Bun, and for plaintscconsumers. - JSR (
npx jsr add @backlex/backlex) — the TypeScript source; JSR transpiles- generates types on install for Node consumers and serves source to Deno/Bun.
License
Apache-2.0 — see LICENSE.
