mirror of
https://github.com/bknd-io/bknd/
synced 2026-08-02 08:06:00 +00:00
add: example for tanstack start
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
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();
|
||||
}
|
||||
Reference in New Issue
Block a user