Lightweight Firebase/Supabase alternative built to run anywhere — incl. Next.js, React Router, Astro, Cloudflare, Bun, Node, AWS Lambda & more.
npm install bknd
!bknd
bknd simplifies app development by providing a fully functional visual backend for database management, authentication, media and workflows. Being lightweight and built on Web Standards, it can be deployed nearly anywhere, including running inside your framework of choice. No more deploying multiple separate services!
It's designed to avoid vendor lock-in and architectural limitations. Built exclusively on WinterTC Minimum Common Web Platform API for universal compatibility, all functionality (data, auth, media, flows) is modular and opt-in, and infrastructure access is adapter-based with direct access to underlying drivers giving you full control without abstractions getting in your way.
* Runtimes: Node.js 22+, Bun 1.0+, Deno, Browser, Cloudflare Workers/Pages, Vercel, Netlify, AWS Lambda, etc.
* Databases:
* SQLite: LibSQL, Node SQLite, Bun SQLite, Cloudflare D1, Cloudflare Durable Objects SQLite, SQLocal
* Postgres: Vanilla Postgres, Supabase, Neon, Xata
* Frameworks: React, Next.js, React Router, Astro, Vite, Waku
* Storage: AWS S3, S3-compatible (Tigris, R2, Minio, etc.), Cloudflare R2 (binding), Cloudinary, Filesystem, Origin Private File System (OPFS)
* Deployment: Standalone, Docker, Cloudflare Workers, Vercel, Netlify, Deno Deploy, AWS Lambda, Valtown etc.
For documentation and examples, please visit https://docs.bknd.io.
> [!WARNING]
> This project requires Node.js 22.13 or higher (because of node:sqlite).
>
> Please keep in mind that bknd is still under active development
> and therefore full backward compatibility is not guaranteed before reaching v1.0.0.
bknd is a general purpose backend system that implements the primitives almost any backend needs. This way, you can use it for any backend use case, including but not limited to:
- Content Management System (CMS) as Wordpress alternative, hosted separately or embedded in your frontend
- AI Agent Backends for managing agent state with built-in data persistence, regardless where it is hosted. Optionally communicate over the integrated MCP server.
- SaaS Products with multi-tenant data isolation (RLS) and user management, with freedom to choose your own database and storage provider
- Prototypes & MVPs to validate ideas quickly without infrastructure overhead
- API-First Applications where you need a reliable, type-safe backend without vendor lock-in either with the integrated TypeScript SDK or REST API using OpenAPI
- IoT & Embedded Devices where minimal footprint matters
The size on npm is misleading, as the bknd package includes the backend, the ui components as well as the whole backend bundled into the cli including static assets.
Depending on what you use, the size can be higher as additional dependencies are getting pulled in. The minimal size of a full bknd app as an API is around 300 kB gzipped (e.g. deployed as Cloudflare Worker).
The solution: A backend system that only assumes and implements primitive details, integrates into multiple environments, and adheres to industry standards.
| Import | Purpose |
|-----------------------------|------------------------------------------------------|
| bkndbknd/adapter/* | Backend including APIs and adapters |
| bknd/ui | Admin UI components for react frameworks |
| bknd/client | TypeScript SDK and React hooks for the API endpoints |
| bknd/elements | React components for authentication and media |
Here is an example of serving the API using node:
``js index.js`
import { serve } from "bknd/adapter/node"
serve();
, your admin route looks like this:
`tsx
import { Admin } from "bknd/ui"
import "bknd/dist/styles.css";export default function AdminPage() {
return
}
`$3
If you're not using a JavaScript environment, you can still access any endpoint using the REST API:
`bash
curl -XGET /api/data/entity/
{
"data": [
{ "id": 1, ... },
{ "id": 2, ... }
],
"meta": { / ... / }
}
`In a JavaScript environment, you can use the TypeScript SDK with type-safety. The above example would look like this:
`ts
import { Api } from "bknd/client";const api = new Api({ host: "" });
const { data } = await api.data.readMany("");
`If you're using React, there are 2 hooks exposed (
useApi, useEntity), as well as an swr wrapper around each (useApiQuery, useEntityQuery). The swr wrapped hooks automatically handled query invalidation:`tsx
import { useState } from "react";
import { useEntityQuery } from "bknd/client";export default function App() {
const { data } = useEntityQuery("todos");
return
{data?.map(todo => (
- {todo.name}
))}
}
`$3
You don't have to figure out API details to include media uploads to your app. For an user avatar upload, this is all you need:
`tsx
import { Media } from "bknd/elements"
import "bknd/dist/main.css"export function UserAvatar() {
return entity={{ name: "users", id: 1, field: "avatar" }}
maxItems={1}
overwrite
/>
}
`
The import path also exports components for login and registration forms which are automatically pointed to the bknd defaults.
🚀 Quick start
To quickly spin up an instance, run:
`bash
npx bknd run
`$3
`bash
npm install bknd
``