updated to tss adapter in bknd@0.21.0-rc.0

This commit is contained in:
2026-03-15 19:39:13 +05:30
parent 1f342283a0
commit 1925294484
7 changed files with 218 additions and 717 deletions

View File

@@ -1,7 +1,8 @@
import { type BkndConfig, em, entity, text, boolean, libsql } from "bknd";
import { em, entity, text, boolean, libsql } from "bknd";
// Unrelated to framework adapters
import type { TanstackStartConfig } from "bknd/adapter/tanstack-start";
import { registerLocalMediaAdapter } from "bknd/adapter/node";
import { secureRandomString } from "bknd/utils";
const local = registerLocalMediaAdapter();
@@ -15,7 +16,7 @@ const schema = em({
// register your schema to get automatic type completion
type Database = (typeof schema)["DB"];
declare module "bknd" {
interface DB extends Database {}
interface DB extends Database { }
}
export default {
@@ -33,14 +34,19 @@ export default {
// and create a user
await ctx.app.module.auth.createUser({
email: "dswbx@bknd.io",
email: "test@bknd.io",
password: "12345678",
});
},
},
config: {
data: schema.toJSON(),
auth: { enabled: true },
auth: {
enabled: true,
jwt: {
secret: secureRandomString(32),
}
},
media: {
enabled: true,
adapter: local({
@@ -48,4 +54,4 @@ export default {
}),
},
},
} satisfies BkndConfig;
} satisfies TanstackStartConfig;