Skip to content

Commit

Permalink
feat: add authToken support for production Turso
Browse files Browse the repository at this point in the history
  • Loading branch information
ixartz committed Aug 24, 2023
1 parent 6bcd532 commit 26b8276
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/libs/DB.ts
Expand Up @@ -6,6 +6,7 @@ import { Env } from './Env.mjs';

const client = createClient({
url: Env.DATABASE_URL,
authToken: Env.DATABASE_AUTH_TOKEN,
});

export const db = drizzle(client);
Expand Down
2 changes: 2 additions & 0 deletions src/libs/Env.mjs
Expand Up @@ -10,6 +10,7 @@ export const Env = createEnv({
server: {
CLERK_SECRET_KEY: z.string().nonempty(),
DATABASE_URL: z.string().nonempty(),
DATABASE_AUTH_TOKEN: z.string().optional(),
},
client: {
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY: z.string().nonempty(),
Expand All @@ -21,6 +22,7 @@ export const Env = createEnv({
runtimeEnv: {
NODE_ENV: process.env.NODE_ENV,
DATABASE_URL: process.env.DATABASE_URL,
DATABASE_AUTH_TOKEN: process.env.DATABASE_AUTH_TOKEN,
CLERK_SECRET_KEY: process.env.CLERK_SECRET_KEY,
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY:
process.env.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY,
Expand Down

0 comments on commit 26b8276

Please sign in to comment.