mirror of
https://github.com/bknd-io/bknd/
synced 2026-08-02 08:06:00 +00:00
21 lines
376 B
TypeScript
21 lines
376 B
TypeScript
import config from "../bknd.config";
|
|
import { getApp } from "bknd/adapter/tanstack-start";
|
|
|
|
export async function getApi({
|
|
headers,
|
|
verify,
|
|
}: {
|
|
verify?: boolean;
|
|
headers?: Headers;
|
|
}) {
|
|
const app = await getApp(config, process.env);
|
|
|
|
if (verify) {
|
|
const api = app.getApi({ headers });
|
|
await api.verifyAuth();
|
|
return api;
|
|
}
|
|
|
|
return app.getApi();
|
|
}
|