| import SupabaseClient from './SupabaseClient' |
| import type { SupabaseClientOptions } from './lib/types' |
|
|
| export * from '@supabase/auth-js' |
| export type { User as AuthUser, Session as AuthSession } from '@supabase/auth-js' |
| export type { |
| PostgrestResponse, |
| PostgrestSingleResponse, |
| PostgrestMaybeSingleResponse, |
| PostgrestBuilder, |
| PostgrestFilterBuilder, |
| PostgrestTransformBuilder, |
| PostgrestQueryBuilder, |
| } from '@supabase/postgrest-js' |
| export { PostgrestError } from '@supabase/postgrest-js' |
| export { StorageApiError } from '@supabase/storage-js' |
| export type { FunctionInvokeOptions } from '@supabase/functions-js' |
| export { |
| FunctionsHttpError, |
| FunctionsFetchError, |
| FunctionsRelayError, |
| FunctionsError, |
| FunctionRegion, |
| } from '@supabase/functions-js' |
| export * from '@supabase/realtime-js' |
| export { default as SupabaseClient } from './SupabaseClient' |
| export type { |
| SupabaseClientOptions, |
| TracePropagationOptions, |
| QueryResult, |
| QueryData, |
| QueryError, |
| DatabaseWithoutInternals, |
| } from './lib/types' |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| export const createClient = < |
| Database = any, |
| SchemaNameOrClientOptions extends |
| | (string & keyof Omit<Database, '__InternalSupabase'>) |
| | { PostgrestVersion: string } = 'public' extends keyof Omit<Database, '__InternalSupabase'> |
| ? 'public' |
| : string & keyof Omit<Database, '__InternalSupabase'>, |
| SchemaName extends string & keyof Omit<Database, '__InternalSupabase'> = |
| SchemaNameOrClientOptions extends string & keyof Omit<Database, '__InternalSupabase'> |
| ? SchemaNameOrClientOptions |
| : 'public' extends keyof Omit<Database, '__InternalSupabase'> |
| ? 'public' |
| : string & keyof Omit<Omit<Database, '__InternalSupabase'>, '__InternalSupabase'>, |
| >( |
| supabaseUrl: string, |
| supabaseKey: string, |
| options?: SupabaseClientOptions<SchemaName> |
| ): SupabaseClient<Database, SchemaNameOrClientOptions, SchemaName> => { |
| return new SupabaseClient<Database, SchemaNameOrClientOptions, SchemaName>( |
| supabaseUrl, |
| supabaseKey, |
| options |
| ) |
| } |
|
|
| |
| function shouldShowDeprecationWarning(): boolean { |
| |
| if (typeof window !== 'undefined' || (globalThis as any)['Deno'] !== undefined) { |
| return false |
| } |
|
|
| |
| |
| const _process = (globalThis as any)['process'] |
| if (!_process) { |
| return false |
| } |
|
|
| const processVersion = _process['version'] |
| if (processVersion === undefined || processVersion === null) { |
| return false |
| } |
|
|
| const versionMatch = processVersion.match(/^v(\d+)\./) |
| if (!versionMatch) { |
| return false |
| } |
|
|
| const majorVersion = parseInt(versionMatch[1], 10) |
| return majorVersion <= 20 |
| } |
|
|
| if (shouldShowDeprecationWarning()) { |
| console.warn( |
| `⚠️ Node.js 20 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. ` + |
| `Please upgrade to Node.js 22 or later. ` + |
| `For more information, visit: https://github.com/orgs/supabase/discussions/45715` |
| ) |
| } |
|
|