t3-env icon indicating copy to clipboard operation
t3-env copied to clipboard

added a preset for a supabase

Open Boby900 opened this issue 9 months ago • 2 comments

Boby900 avatar May 09 '24 12:05 Boby900

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
t3-env ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 17, 2024 2:40pm

vercel[bot] avatar May 09 '24 12:05 vercel[bot]

@Boby900 is attempting to deploy a commit to the t3-oss Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar May 09 '24 12:05 vercel[bot]

Hey - I wasn't able to push to your branch, but could you move the variables to client and also move the preset to the nextjs package, since we're using nextjs variables here? Thanks 🙏

// packages/next/src/preset.ts
import { z } from "zod";
import { createEnv } from ".";

export * from "@t3-oss/env-core/presets";

/**
 * Supabase Environment Variables
 *   @see https://supabase.com/docs/guides/getting-started/quickstarts/nextjs
 */
export const supabase = () =>
    createEnv({
      client: {
        NEXT_PUBLIC_SUPABASE_URL: z.string().optional(),
        NEXT_PUBLIC_SUPABASE_ANON_KEY: z.string().optional(),
      },
      runtimeEnv: {
        NEXT_PUBLIC_SUPABASE_ANON_KEY: process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY,
        NEXT_PUBLIC_SUPABASE_URL: process.env.SUPABASE_ANON_KEY,
      },
    });

juliusmarminge avatar May 17 '24 09:05 juliusmarminge