Files
bknd/examples/waku/src/bknd.ts
T
2025-07-09 08:21:39 +02:00

23 lines
544 B
TypeScript

import { createFrameworkApp } from "bknd/adapter";
import config from "../bknd.config";
export async function getApp() {
return await createFrameworkApp(config, process.env, {
force: import.meta.env && !import.meta.env.PROD,
});
}
export async function getApi(opts?: {
headers?: Headers | any;
verify?: boolean;
}) {
const app = await getApp();
if (opts?.verify && opts.headers) {
const api = app.getApi({ headers: opts.headers });
await api.verifyAuth();
return api;
}
return app.getApi();
}