feat(release): prepare 1.1.0 candidate
This commit is contained in:
parent
5a34f66981
commit
5205dcdfa9
736 changed files with 115667 additions and 12203 deletions
|
|
@ -4,19 +4,25 @@
|
|||
|
||||
import { createBrowserClient } from '@supabase/ssr'
|
||||
import type { Database } from './types'
|
||||
import { requireSupabasePublicConfig } from './client'
|
||||
|
||||
let cachedClient: ReturnType<typeof createBrowserClient<Database>> | null = null
|
||||
|
||||
export function getSupabaseBrowserClient(): ReturnType<typeof createBrowserClient<Database>> {
|
||||
if (cachedClient) return cachedClient
|
||||
|
||||
const url = process.env.NEXT_PUBLIC_SUPABASE_URL ?? 'https://placeholder.supabase.co'
|
||||
const key = process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY ?? 'placeholder-anon-key'
|
||||
const { url, anonKey } = requireSupabasePublicConfig({
|
||||
url: process.env.NEXT_PUBLIC_SUPABASE_URL,
|
||||
anonKey: process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY,
|
||||
})
|
||||
|
||||
cachedClient = createBrowserClient<Database>(url, key)
|
||||
cachedClient = createBrowserClient<Database>(url, anonKey)
|
||||
return cachedClient
|
||||
}
|
||||
|
||||
export function isSupabaseConfigured(): boolean {
|
||||
return Boolean(process.env.NEXT_PUBLIC_SUPABASE_URL && process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY)
|
||||
return Boolean(
|
||||
process.env.NEXT_PUBLIC_SUPABASE_URL?.trim()
|
||||
&& process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY?.trim(),
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue