Skip to content

Release 0.20#291

Merged
dswbx merged 116 commits intomainfrom
release/0.20
Jan 9, 2026
Merged

Release 0.20#291
dswbx merged 116 commits intomainfrom
release/0.20

Conversation

@dswbx
Copy link
Contributor

@dswbx dswbx commented Nov 5, 2025

includes:


License change to Apache 2.0

bknd is now licensed under the Apache 2.0 license, making it even more permissive and enterprise-friendly.

MCP in admin navigation

The MCP (Model Context Protocol) tool is now accessible directly from the main navigation when enabled. The UI has been improved to be route-aware, making it easier to interact with AI tools directly from the admin interface.

Improved hybrid mode

The hybrid mode has been enhanced with better type inference and improved configuration handling:

  • Reader function can now return objects directly (not just strings)
  • Automatic schema syncing in development with sync_required flag
  • Better handling of missing config files with automatic defaults

Repository auto-join for related entities

When querying with where clauses that reference related entities, bknd now automatically adds the necessary joins. This means you can filter by related entity fields without explicitly specifying joins:

// automatically joins "author" when filtering by author.name
const posts = await api.data.readMany("posts", {
  where: { "author.name": "John" },
});

Email OTP plugin

A new authentication plugin for passwordless login using one-time passwords sent via email. The plugin supports both login and registration flows, with configurable TTL, custom email templates, and automatic code invalidation.

import { emailOTP } from "bknd/plugins";
import { resendEmail } from "bknd";

export default {
   options: {
      plugins: [
         emailOTP({
            generateEmail: (otp) => ({
               subject: "OTP Code",
               body: `Your OTP code is: ${otp.code}`,
            }),
         })
      ],
   },
} satisfies BkndConfig;

Plunk email driver

Added support for Plunk as an email driver, joining Resend as supported transactional email services:

import { plunkEmail } from "bknd";

export default {
   options: {
      drivers: {
         email: plunkEmail({ 
            apiKey: "<api-key>",
            from: "hello@example.com",
         }),
      },
  }
}

Special thanks to @cameronapak for adding this 🔥

SvelteKit adapter

bknd now has first-class support for SvelteKit applications. The new adapter follows the same pattern as the existing Astro and Next.js adapters. Read more in the SvelteKit integration guide. Special thanks to @screenfluent for adding this 🔥

Postgres support now included

The separate @bknd/postgres package has been merged into the main bknd package. PostgreSQL connections are now available directly:

import { pgPostgres, postgresJs } from "bknd";
import { Pool } from "pg";
import postgres from 'postgres'

// using pg library
const connection = pg({
  pool: new Pool({
    connectionString: "postgresql://user:password@localhost:5432/database",
  }),
});

// using postgres.js
const connection = postgresJs({
  postgres: postgres("postgresql://user:password@localhost:5432/database"),
});

Run bknd in your browser with SQLocal

You can now run bknd entirely in your browser without any server required. Using SQLocal, bknd now supports in-browser SQLite databases using OPFS (Origin Private File System), with data persisting locally in your browser. This is perfect for offline-first applications, local development, or demo purposes.

The new BkndBrowserApp component wraps everything you need to get started:

import { BkndBrowserApp } from "bknd/adapter/browser";
import { Route } from "wouter";

export function App() {
  return (
    <BkndBrowserApp
       config={{
          /* ... your bknd config */
          adminOptions: { basepath: "/admin" }
       }}
       /* add additional options you're used to from `bknd.config.ts` */
       onBuilt={async (app) => {}}
    >
      {/* your routes */}
      <Route path="/" component={() => <div>hello</div>} />
    </BkndBrowserApp>
  );
}

Additionally, bknd now includes the OpfsStorageAdapter for media storage, allowing full file upload/download support in the browser environment.

dswbx and others added 25 commits December 2, 2025 14:18
feat: add local auth support if api storage provided
feat: add `default_role_register` and password `minLength` config
feat(admin): add mcp as main navigation item when enabled, and make it route-aware
Add framework adapter for SvelteKit with:
- `getApp()` - get bknd app instance
- `serve()` - request handler for hooks.server.ts

Usage in hooks.server.ts:
```typescript
import { serve } from "bknd/adapter/sveltekit";
import config from "../bknd.config";

const bkndHandler = serve(config);

export const handle = async ({ event, resolve }) => {
  if (event.url.pathname.startsWith("/api/")) {
    return bkndHandler(event);
  }
  return resolve(event);
};
```

Includes:
- Adapter implementation (app/src/adapter/sveltekit/)
- Test suite
- Working example (examples/sveltekit/)
- Package exports and types
Remove process.env default to support all SvelteKit runtimes
(Node, Cloudflare Workers, Vercel Edge, Deno). Users now pass
env explicitly via $env/dynamic/private.
…pying

updated `hooks.server.ts` to handle `/admin` routes and prevent fallback for 404 responses. added `adminBasepath` config to match backend paths. introduced assets copying step via `postinstall` script and included `robots.txt` and `favicon.ico` under `static`.
…creation

Replaced `s.object` with `s.strictObject` to enforce schema validation. Updated logic to include unprocessed JSON properties (`...rest`) when creating a user, ensuring additional payload data is preserved.
@dswbx dswbx marked this pull request as ready for review January 9, 2026 13:28
@dswbx dswbx merged commit d826cb2 into main Jan 9, 2026
1 check passed
@dswbx dswbx deleted the release/0.20 branch January 9, 2026 13:32
@dswbx dswbx restored the release/0.20 branch January 9, 2026 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants