Skip to content

Commit a9e87d4

Browse files
committed
fix: update Supabase environment variable references in client setup
1 parent e3ed6d4 commit a9e87d4

File tree

2 files changed

+11
-14
lines changed

2 files changed

+11
-14
lines changed

app/.env.example

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
# Supabase configuration
2-
# Replace with your actual Supabase project URL and anon key
3-
VITE_SUPABASE_URL=https://your-project-id.supabase.co
4-
VITE_SUPABASE_ANON_KEY=your-anon-key
5-
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key
1+
# Supabase settings
2+
PUBLIC_SUPABASE_URL=https://your-supabase-url.supabase.co
3+
PUBLIC_SUPABASE_ANON_KEY=your-supabase-anon-key
4+
PRIVATE_SUPABASE_SERVICE_ROLE_KEY=your-supabase-service-role-key
65

7-
8-
# Stripe API keys
9-
STRIPE_PUBLISHABLE_KEY=your-publishable-key
10-
STRIPE_SECRET_KEY=your-secret-key
11-
STRIPE_WEBHOOK_SECRET=your-webhook-secret
6+
# Stripe settings
7+
PRIVATE_STRIPE_API_KEY=your-stripe-secret-key
8+
PUBLIC_STRIPE_PUBLISHABLE_KEY=your-stripe-publishable-key
9+
PRIVATE_STRIPE_WEBHOOK_SECRET=your-stripe-webhook-secret

app/src/lib/supabase/client.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@ import { createClient } from "@supabase/supabase-js";
22
import { writable } from "svelte/store";
33
import type { User } from "@supabase/supabase-js";
44
import { isBrowser } from "@supabase/ssr";
5+
import { env } from "$env/dynamic/public";
56

6-
// Environment variables should be set in .env files
7-
// https://kit.svelte.dev/docs/modules#$env-dynamic-private
8-
const supabaseUrl = import.meta.env.VITE_SUPABASE_URL;
9-
const supabaseAnonKey = import.meta.env.VITE_SUPABASE_ANON_KEY;
7+
const supabaseUrl = env.PUBLIC_SUPABASE_URL;
8+
const supabaseAnonKey = env.PUBLIC_SUPABASE_ANON_KEY;
109

1110
// Create Supabase client
1211
export const supabase = createClient(supabaseUrl, supabaseAnonKey);

0 commit comments

Comments
 (0)