How to access to binding variables during nextjs build process?
I'm trying to user D1 with drizzle orm in next js, currently using next auth 5, and using drizzle adapter for that.. How to get the DB instance during build?
export const {
handlers: { GET, POST },
auth,
signIn,
signOut,
} = NextAuth({
adapter: DrizzleAdapter(getDBInstance()),
providers: [
GoogleProvider({
clientId: process.env.GOOGLE_CLIENT_ID ?? "",
clientSecret: process.env.GOOGLE_CLIENT_SECRET ?? "",
}),
],
});
This is method to get db instance
export const getDBInstance = () => {
console.log("getRequestContext", getRequestContext);
const DB = getRequestContext().env.AI_FORM_GENERATOR_DB;
return drizzle(DB, { schema });
};
How to get access to Binding variable AI_FORM_GENERATOR_DB during build process?
0 Replies