Files
bknd/examples/nextjs/src/bknd.ts
dswbx 3f26c45dd9 refactored adapters to run test suites (#126)
* refactored adapters to run test suites

* fix bun version for tests

* added missing adapter tests and refactored examples to use `bknd.config.ts` where applicable
2025-04-01 11:43:11 +02:00

21 lines
497 B
TypeScript

import { getApp as getBkndApp } from "bknd/adapter/nextjs";
import { headers } from "next/headers";
import config from "../bknd.config";
export { config };
export async function getApp() {
return await getBkndApp(config, process.env);
}
export async function getApi(opts?: { verify?: boolean }) {
const app = await getApp();
if (opts?.verify) {
const api = app.getApi({ headers: await headers() });
await api.verifyAuth();
return api;
}
return app.getApi();
}