initial commit

This commit is contained in:
2026-02-18 22:22:10 +05:30
commit d76a3eae86
28 changed files with 2493 additions and 0 deletions

27
src/lib/bknd.ts Normal file
View File

@@ -0,0 +1,27 @@
import { createRuntimeApp, type RuntimeBkndConfig } from "bknd/adapter";
import bkndConfig from "../../bknd.config";
export async function getApp<Env = NodeJS.ProcessEnv>(
config: RuntimeBkndConfig<Env>,
args: Env = process.env as Env,
) {
return await createRuntimeApp(config, args);
}
export async function getApi({
headers,
verify,
}: {
verify?: boolean;
headers?: Headers;
}) {
const app = await getApp(bkndConfig, process.env);
if (verify) {
const api = app.getApi({ headers });
await api.verifyAuth();
return api;
}
return app.getApi();
}