@depup/supabase__supabase-js 2.99.2-depup.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","names":["DEFAULT_AUTH_OPTIONS: SupabaseAuthClientOptions","DEFAULT_REALTIME_OPTIONS: RealtimeClientOptions","fetch","DEFAULT_DB_OPTIONS","DEFAULT_AUTH_OPTIONS","DEFAULT_REALTIME_OPTIONS","DEFAULT_GLOBAL_OPTIONS","result: Required<SupabaseClientOptions<SchemaName>>","AuthClient","supabaseUrl: string","supabaseKey: string","PostgrestClient","SupabaseStorageClient","FunctionsClient","this","RealtimeClient"],"sources":["../src/lib/version.ts","../src/lib/constants.ts","../src/lib/fetch.ts","../src/lib/helpers.ts","../src/lib/SupabaseAuthClient.ts","../src/SupabaseClient.ts","../src/index.ts"],"sourcesContent":["// Generated automatically during releases by scripts/update-version-files.ts\n// This file provides runtime access to the package version for:\n// - HTTP request headers (e.g., X-Client-Info header for API requests)\n// - Debugging and support (identifying which version is running)\n// - Telemetry and logging (version reporting in errors/analytics)\n// - Ensuring build artifacts match the published package version\nexport const version = '2.99.2'\n","// constants.ts\nimport { RealtimeClientOptions } from '@supabase/realtime-js'\nimport { SupabaseAuthClientOptions } from './types'\nimport { version } from './version'\n\nlet JS_ENV = ''\n// @ts-ignore\nif (typeof Deno !== 'undefined') {\n JS_ENV = 'deno'\n} else if (typeof document !== 'undefined') {\n JS_ENV = 'web'\n} else if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {\n JS_ENV = 'react-native'\n} else {\n JS_ENV = 'node'\n}\n\nexport const DEFAULT_HEADERS = { 'X-Client-Info': `supabase-js-${JS_ENV}/${version}` }\n\nexport const DEFAULT_GLOBAL_OPTIONS = {\n headers: DEFAULT_HEADERS,\n}\n\nexport const DEFAULT_DB_OPTIONS = {\n schema: 'public',\n}\n\nexport const DEFAULT_AUTH_OPTIONS: SupabaseAuthClientOptions = {\n autoRefreshToken: true,\n persistSession: true,\n detectSessionInUrl: true,\n flowType: 'implicit',\n}\n\nexport const DEFAULT_REALTIME_OPTIONS: RealtimeClientOptions = {}\n","type Fetch = typeof fetch\n\nexport const resolveFetch = (customFetch?: Fetch): Fetch => {\n if (customFetch) {\n return (...args: Parameters<Fetch>) => customFetch(...args)\n }\n return (...args: Parameters<Fetch>) => fetch(...args)\n}\n\nexport const resolveHeadersConstructor = () => {\n return Headers\n}\n\nexport const fetchWithAuth = (\n supabaseKey: string,\n getAccessToken: () => Promise<string | null>,\n customFetch?: Fetch\n): Fetch => {\n const fetch = resolveFetch(customFetch)\n const HeadersConstructor = resolveHeadersConstructor()\n\n return async (input, init) => {\n const accessToken = (await getAccessToken()) ?? supabaseKey\n let headers = new HeadersConstructor(init?.headers)\n\n if (!headers.has('apikey')) {\n headers.set('apikey', supabaseKey)\n }\n\n if (!headers.has('Authorization')) {\n headers.set('Authorization', `Bearer ${accessToken}`)\n }\n\n return fetch(input, { ...init, headers })\n }\n}\n","// helpers.ts\nimport { SupabaseClientOptions } from './types'\n\nexport function uuid() {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n var r = (Math.random() * 16) | 0,\n v = c == 'x' ? r : (r & 0x3) | 0x8\n return v.toString(16)\n })\n}\n\nexport function ensureTrailingSlash(url: string): string {\n return url.endsWith('/') ? url : url + '/'\n}\n\nexport const isBrowser = () => typeof window !== 'undefined'\n\nexport function applySettingDefaults<\n Database = any,\n SchemaName extends string & keyof Database = 'public' extends keyof Database\n ? 'public'\n : string & keyof Database,\n>(\n options: SupabaseClientOptions<SchemaName>,\n defaults: SupabaseClientOptions<any>\n): Required<SupabaseClientOptions<SchemaName>> {\n const {\n db: dbOptions,\n auth: authOptions,\n realtime: realtimeOptions,\n global: globalOptions,\n } = options\n const {\n db: DEFAULT_DB_OPTIONS,\n auth: DEFAULT_AUTH_OPTIONS,\n realtime: DEFAULT_REALTIME_OPTIONS,\n global: DEFAULT_GLOBAL_OPTIONS,\n } = defaults\n\n const result: Required<SupabaseClientOptions<SchemaName>> = {\n db: {\n ...DEFAULT_DB_OPTIONS,\n ...dbOptions,\n },\n auth: {\n ...DEFAULT_AUTH_OPTIONS,\n ...authOptions,\n },\n realtime: {\n ...DEFAULT_REALTIME_OPTIONS,\n ...realtimeOptions,\n },\n storage: {},\n global: {\n ...DEFAULT_GLOBAL_OPTIONS,\n ...globalOptions,\n headers: {\n ...(DEFAULT_GLOBAL_OPTIONS?.headers ?? {}),\n ...(globalOptions?.headers ?? {}),\n },\n },\n accessToken: async () => '',\n }\n\n if (options.accessToken) {\n result.accessToken = options.accessToken\n } else {\n // hack around Required<>\n delete (result as any).accessToken\n }\n\n return result\n}\n\n/**\n * Validates a Supabase client URL\n *\n * @param {string} supabaseUrl - The Supabase client URL string.\n * @returns {URL} - The validated base URL.\n * @throws {Error}\n */\nexport function validateSupabaseUrl(supabaseUrl: string): URL {\n const trimmedUrl = supabaseUrl?.trim()\n\n if (!trimmedUrl) {\n throw new Error('supabaseUrl is required.')\n }\n\n if (!trimmedUrl.match(/^https?:\\/\\//i)) {\n throw new Error('Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.')\n }\n\n try {\n return new URL(ensureTrailingSlash(trimmedUrl))\n } catch {\n throw Error('Invalid supabaseUrl: Provided URL is malformed.')\n }\n}\n","import { AuthClient } from '@supabase/auth-js'\nimport { SupabaseAuthClientOptions } from './types'\n\nexport class SupabaseAuthClient extends AuthClient {\n constructor(options: SupabaseAuthClientOptions) {\n super(options)\n }\n}\n","import type { AuthChangeEvent } from '@supabase/auth-js'\nimport { FunctionsClient } from '@supabase/functions-js'\nimport {\n PostgrestClient,\n type PostgrestFilterBuilder,\n type PostgrestQueryBuilder,\n} from '@supabase/postgrest-js'\nimport {\n type RealtimeChannel,\n type RealtimeChannelOptions,\n RealtimeClient,\n type RealtimeClientOptions,\n} from '@supabase/realtime-js'\nimport { StorageClient as SupabaseStorageClient } from '@supabase/storage-js'\nimport {\n DEFAULT_AUTH_OPTIONS,\n DEFAULT_DB_OPTIONS,\n DEFAULT_GLOBAL_OPTIONS,\n DEFAULT_REALTIME_OPTIONS,\n} from './lib/constants'\nimport { fetchWithAuth } from './lib/fetch'\nimport { applySettingDefaults, validateSupabaseUrl } from './lib/helpers'\nimport { SupabaseAuthClient } from './lib/SupabaseAuthClient'\nimport type {\n Fetch,\n GenericSchema,\n SupabaseAuthClientOptions,\n SupabaseClientOptions,\n} from './lib/types'\nimport { GetRpcFunctionFilterBuilderByArgs } from './lib/rest/types/common/rpc'\n\n/**\n * Supabase Client.\n *\n * An isomorphic Javascript client for interacting with Postgres.\n */\nexport default class SupabaseClient<\n Database = any,\n // The second type parameter is also used for specifying db_schema, so we\n // support both cases.\n // TODO: Allow setting db_schema from ClientOptions.\n SchemaNameOrClientOptions extends\n | (string & keyof Omit<Database, '__InternalSupabase'>)\n | { PostgrestVersion: string } = 'public' extends keyof Omit<Database, '__InternalSupabase'>\n ? 'public'\n : string & keyof Omit<Database, '__InternalSupabase'>,\n SchemaName extends string &\n keyof Omit<Database, '__InternalSupabase'> = SchemaNameOrClientOptions extends string &\n keyof Omit<Database, '__InternalSupabase'>\n ? SchemaNameOrClientOptions\n : 'public' extends keyof Omit<Database, '__InternalSupabase'>\n ? 'public'\n : string & keyof Omit<Omit<Database, '__InternalSupabase'>, '__InternalSupabase'>,\n Schema extends Omit<Database, '__InternalSupabase'>[SchemaName] extends GenericSchema\n ? Omit<Database, '__InternalSupabase'>[SchemaName]\n : never = Omit<Database, '__InternalSupabase'>[SchemaName] extends GenericSchema\n ? Omit<Database, '__InternalSupabase'>[SchemaName]\n : never,\n ClientOptions extends { PostgrestVersion: string } = SchemaNameOrClientOptions extends string &\n keyof Omit<Database, '__InternalSupabase'>\n ? // If the version isn't explicitly set, look for it in the __InternalSupabase object to infer the right version\n Database extends { __InternalSupabase: { PostgrestVersion: string } }\n ? Database['__InternalSupabase']\n : // otherwise default to 12\n { PostgrestVersion: '12' }\n : SchemaNameOrClientOptions extends { PostgrestVersion: string }\n ? SchemaNameOrClientOptions\n : never,\n> {\n /**\n * Supabase Auth allows you to create and manage user sessions for access to data that is secured by access policies.\n */\n auth: SupabaseAuthClient\n realtime: RealtimeClient\n /**\n * Supabase Storage allows you to manage user-generated content, such as photos or videos.\n */\n storage: SupabaseStorageClient\n\n protected realtimeUrl: URL\n protected authUrl: URL\n protected storageUrl: URL\n protected functionsUrl: URL\n protected rest: PostgrestClient<Database, ClientOptions, SchemaName>\n protected storageKey: string\n protected fetch?: Fetch\n protected changedAccessToken?: string\n protected accessToken?: () => Promise<string | null>\n\n protected headers: Record<string, string>\n\n /**\n * Create a new client for use in the browser.\n *\n * @category Initializing\n *\n * @param supabaseUrl The unique Supabase URL which is supplied when you create a new project in your project dashboard.\n * @param supabaseKey The unique Supabase Key which is supplied when you create a new project in your project dashboard.\n * @param options.db.schema You can switch in between schemas. The schema needs to be on the list of exposed schemas inside Supabase.\n * @param options.auth.autoRefreshToken Set to \"true\" if you want to automatically refresh the token before expiring.\n * @param options.auth.persistSession Set to \"true\" if you want to automatically save the user session into local storage.\n * @param options.auth.detectSessionInUrl Set to \"true\" if you want to automatically detects OAuth grants in the URL and signs in the user.\n * @param options.realtime Options passed along to realtime-js constructor.\n * @param options.storage Options passed along to the storage-js constructor.\n * @param options.global.fetch A custom fetch implementation.\n * @param options.global.headers Any additional headers to send with each network request.\n *\n * @example Creating a client\n * ```js\n * import { createClient } from '@supabase/supabase-js'\n *\n * // Create a single supabase client for interacting with your database\n * const supabase = createClient('https://xyzcompany.supabase.co', 'publishable-or-anon-key')\n * ```\n *\n * @example With a custom domain\n * ```js\n * import { createClient } from '@supabase/supabase-js'\n *\n * // Use a custom domain as the supabase URL\n * const supabase = createClient('https://my-custom-domain.com', 'publishable-or-anon-key')\n * ```\n *\n * @example With additional parameters\n * ```js\n * import { createClient } from '@supabase/supabase-js'\n *\n * const options = {\n * db: {\n * schema: 'public',\n * },\n * auth: {\n * autoRefreshToken: true,\n * persistSession: true,\n * detectSessionInUrl: true\n * },\n * global: {\n * headers: { 'x-my-custom-header': 'my-app-name' },\n * },\n * }\n * const supabase = createClient(\"https://xyzcompany.supabase.co\", \"publishable-or-anon-key\", options)\n * ```\n *\n * @exampleDescription With custom schemas\n * By default the API server points to the `public` schema. You can enable other database schemas within the Dashboard.\n * Go to [Settings > API > Exposed schemas](/dashboard/project/_/settings/api) and add the schema which you want to expose to the API.\n *\n * Note: each client connection can only access a single schema, so the code above can access the `other_schema` schema but cannot access the `public` schema.\n *\n * @example With custom schemas\n * ```js\n * import { createClient } from '@supabase/supabase-js'\n *\n * const supabase = createClient('https://xyzcompany.supabase.co', 'publishable-or-anon-key', {\n * // Provide a custom schema. Defaults to \"public\".\n * db: { schema: 'other_schema' }\n * })\n * ```\n *\n * @exampleDescription Custom fetch implementation\n * `supabase-js` uses the [`cross-fetch`](https://www.npmjs.com/package/cross-fetch) library to make HTTP requests,\n * but an alternative `fetch` implementation can be provided as an option.\n * This is most useful in environments where `cross-fetch` is not compatible (for instance Cloudflare Workers).\n *\n * @example Custom fetch implementation\n * ```js\n * import { createClient } from '@supabase/supabase-js'\n *\n * const supabase = createClient('https://xyzcompany.supabase.co', 'publishable-or-anon-key', {\n * global: { fetch: fetch.bind(globalThis) }\n * })\n * ```\n *\n * @exampleDescription React Native options with AsyncStorage\n * For React Native we recommend using `AsyncStorage` as the storage implementation for Supabase Auth.\n *\n * @example React Native options with AsyncStorage\n * ```js\n * import 'react-native-url-polyfill/auto'\n * import { createClient } from '@supabase/supabase-js'\n * import AsyncStorage from \"@react-native-async-storage/async-storage\";\n *\n * const supabase = createClient(\"https://xyzcompany.supabase.co\", \"publishable-or-anon-key\", {\n * auth: {\n * storage: AsyncStorage,\n * autoRefreshToken: true,\n * persistSession: true,\n * detectSessionInUrl: false,\n * },\n * });\n * ```\n *\n * @exampleDescription React Native options with Expo SecureStore\n * If you wish to encrypt the user's session information, you can use `aes-js` and store the encryption key in Expo SecureStore.\n * The `aes-js` library, a reputable JavaScript-only implementation of the AES encryption algorithm in CTR mode.\n * A new 256-bit encryption key is generated using the `react-native-get-random-values` library.\n * This key is stored inside Expo's SecureStore, while the value is encrypted and placed inside AsyncStorage.\n *\n * Please make sure that:\n * - You keep the `expo-secure-store`, `aes-js` and `react-native-get-random-values` libraries up-to-date.\n * - Choose the correct [`SecureStoreOptions`](https://docs.expo.dev/versions/latest/sdk/securestore/#securestoreoptions) for your app's needs.\n * E.g. [`SecureStore.WHEN_UNLOCKED`](https://docs.expo.dev/versions/latest/sdk/securestore/#securestorewhen_unlocked) regulates when the data can be accessed.\n * - Carefully consider optimizations or other modifications to the above example, as those can lead to introducing subtle security vulnerabilities.\n *\n * @example React Native options with Expo SecureStore\n * ```ts\n * import 'react-native-url-polyfill/auto'\n * import { createClient } from '@supabase/supabase-js'\n * import AsyncStorage from '@react-native-async-storage/async-storage';\n * import * as SecureStore from 'expo-secure-store';\n * import * as aesjs from 'aes-js';\n * import 'react-native-get-random-values';\n *\n * // As Expo's SecureStore does not support values larger than 2048\n * // bytes, an AES-256 key is generated and stored in SecureStore, while\n * // it is used to encrypt/decrypt values stored in AsyncStorage.\n * class LargeSecureStore {\n * private async _encrypt(key: string, value: string) {\n * const encryptionKey = crypto.getRandomValues(new Uint8Array(256 / 8));\n *\n * const cipher = new aesjs.ModeOfOperation.ctr(encryptionKey, new aesjs.Counter(1));\n * const encryptedBytes = cipher.encrypt(aesjs.utils.utf8.toBytes(value));\n *\n * await SecureStore.setItemAsync(key, aesjs.utils.hex.fromBytes(encryptionKey));\n *\n * return aesjs.utils.hex.fromBytes(encryptedBytes);\n * }\n *\n * private async _decrypt(key: string, value: string) {\n * const encryptionKeyHex = await SecureStore.getItemAsync(key);\n * if (!encryptionKeyHex) {\n * return encryptionKeyHex;\n * }\n *\n * const cipher = new aesjs.ModeOfOperation.ctr(aesjs.utils.hex.toBytes(encryptionKeyHex), new aesjs.Counter(1));\n * const decryptedBytes = cipher.decrypt(aesjs.utils.hex.toBytes(value));\n *\n * return aesjs.utils.utf8.fromBytes(decryptedBytes);\n * }\n *\n * async getItem(key: string) {\n * const encrypted = await AsyncStorage.getItem(key);\n * if (!encrypted) { return encrypted; }\n *\n * return await this._decrypt(key, encrypted);\n * }\n *\n * async removeItem(key: string) {\n * await AsyncStorage.removeItem(key);\n * await SecureStore.deleteItemAsync(key);\n * }\n *\n * async setItem(key: string, value: string) {\n * const encrypted = await this._encrypt(key, value);\n *\n * await AsyncStorage.setItem(key, encrypted);\n * }\n * }\n *\n * const supabase = createClient(\"https://xyzcompany.supabase.co\", \"publishable-or-anon-key\", {\n * auth: {\n * storage: new LargeSecureStore(),\n * autoRefreshToken: true,\n * persistSession: true,\n * detectSessionInUrl: false,\n * },\n * });\n * ```\n *\n * @example With a database query\n * ```ts\n * import { createClient } from '@supabase/supabase-js'\n *\n * const supabase = createClient('https://xyzcompany.supabase.co', 'public-anon-key')\n *\n * const { data } = await supabase.from('profiles').select('*')\n * ```\n */\n constructor(\n protected supabaseUrl: string,\n protected supabaseKey: string,\n options?: SupabaseClientOptions<SchemaName>\n ) {\n const baseUrl = validateSupabaseUrl(supabaseUrl)\n if (!supabaseKey) throw new Error('supabaseKey is required.')\n\n this.realtimeUrl = new URL('realtime/v1', baseUrl)\n this.realtimeUrl.protocol = this.realtimeUrl.protocol.replace('http', 'ws')\n this.authUrl = new URL('auth/v1', baseUrl)\n this.storageUrl = new URL('storage/v1', baseUrl)\n this.functionsUrl = new URL('functions/v1', baseUrl)\n\n // default storage key uses the supabase project ref as a namespace\n const defaultStorageKey = `sb-${baseUrl.hostname.split('.')[0]}-auth-token`\n const DEFAULTS = {\n db: DEFAULT_DB_OPTIONS,\n realtime: DEFAULT_REALTIME_OPTIONS,\n auth: { ...DEFAULT_AUTH_OPTIONS, storageKey: defaultStorageKey },\n global: DEFAULT_GLOBAL_OPTIONS,\n }\n\n const settings = applySettingDefaults(options ?? {}, DEFAULTS)\n\n this.storageKey = settings.auth.storageKey ?? ''\n this.headers = settings.global.headers ?? {}\n\n if (!settings.accessToken) {\n this.auth = this._initSupabaseAuthClient(\n settings.auth ?? {},\n this.headers,\n settings.global.fetch\n )\n } else {\n this.accessToken = settings.accessToken\n\n this.auth = new Proxy<SupabaseAuthClient>({} as any, {\n get: (_, prop) => {\n throw new Error(\n `@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(\n prop\n )} is not possible`\n )\n },\n })\n }\n\n this.fetch = fetchWithAuth(supabaseKey, this._getAccessToken.bind(this), settings.global.fetch)\n this.realtime = this._initRealtimeClient({\n headers: this.headers,\n accessToken: this._getAccessToken.bind(this),\n ...settings.realtime,\n })\n if (this.accessToken) {\n // Start auth immediately to avoid race condition with channel subscriptions\n // Wrap Promise to avoid Firefox extension cross-context Promise access errors\n Promise.resolve(this.accessToken())\n .then((token) => this.realtime.setAuth(token))\n .catch((e) => console.warn('Failed to set initial Realtime auth token:', e))\n }\n\n this.rest = new PostgrestClient(new URL('rest/v1', baseUrl).href, {\n headers: this.headers,\n schema: settings.db.schema,\n fetch: this.fetch,\n timeout: settings.db.timeout,\n urlLengthLimit: settings.db.urlLengthLimit,\n })\n\n this.storage = new SupabaseStorageClient(\n this.storageUrl.href,\n this.headers,\n this.fetch,\n options?.storage\n )\n\n if (!settings.accessToken) {\n this._listenForAuthEvents()\n }\n }\n\n /**\n * Supabase Functions allows you to deploy and invoke edge functions.\n */\n get functions(): FunctionsClient {\n return new FunctionsClient(this.functionsUrl.href, {\n headers: this.headers,\n customFetch: this.fetch,\n })\n }\n\n // NOTE: signatures must be kept in sync with PostgrestClient.from\n from<\n TableName extends string & keyof Schema['Tables'],\n Table extends Schema['Tables'][TableName],\n >(relation: TableName): PostgrestQueryBuilder<ClientOptions, Schema, Table, TableName>\n from<ViewName extends string & keyof Schema['Views'], View extends Schema['Views'][ViewName]>(\n relation: ViewName\n ): PostgrestQueryBuilder<ClientOptions, Schema, View, ViewName>\n /**\n * Perform a query on a table or a view.\n *\n * @param relation - The table or view name to query\n */\n from(relation: string): PostgrestQueryBuilder<ClientOptions, Schema, any> {\n return this.rest.from(relation)\n }\n\n // NOTE: signatures must be kept in sync with PostgrestClient.schema\n /**\n * Select a schema to query or perform an function (rpc) call.\n *\n * The schema needs to be on the list of exposed schemas inside Supabase.\n *\n * @param schema - The schema to query\n */\n schema<DynamicSchema extends string & keyof Omit<Database, '__InternalSupabase'>>(\n schema: DynamicSchema\n ): PostgrestClient<\n Database,\n ClientOptions,\n DynamicSchema,\n Database[DynamicSchema] extends GenericSchema ? Database[DynamicSchema] : any\n > {\n return this.rest.schema<DynamicSchema>(schema)\n }\n\n // NOTE: signatures must be kept in sync with PostgrestClient.rpc\n /**\n * Perform a function call.\n *\n * @param fn - The function name to call\n * @param args - The arguments to pass to the function call\n * @param options - Named parameters\n * @param options.head - When set to `true`, `data` will not be returned.\n * Useful if you only need the count.\n * @param options.get - When set to `true`, the function will be called with\n * read-only access mode.\n * @param options.count - Count algorithm to use to count rows returned by the\n * function. Only applicable for [set-returning\n * functions](https://www.postgresql.org/docs/current/functions-srf.html).\n *\n * `\"exact\"`: Exact but slow count algorithm. Performs a `COUNT(*)` under the\n * hood.\n *\n * `\"planned\"`: Approximated but fast count algorithm. Uses the Postgres\n * statistics under the hood.\n *\n * `\"estimated\"`: Uses exact count for low numbers and planned count for high\n * numbers.\n */\n rpc<\n FnName extends string & keyof Schema['Functions'],\n Args extends Schema['Functions'][FnName]['Args'] = never,\n FilterBuilder extends GetRpcFunctionFilterBuilderByArgs<\n Schema,\n FnName,\n Args\n > = GetRpcFunctionFilterBuilderByArgs<Schema, FnName, Args>,\n >(\n fn: FnName,\n args: Args = {} as Args,\n options: {\n head?: boolean\n get?: boolean\n count?: 'exact' | 'planned' | 'estimated'\n } = {\n head: false,\n get: false,\n count: undefined,\n }\n ): PostgrestFilterBuilder<\n ClientOptions,\n Schema,\n FilterBuilder['Row'],\n FilterBuilder['Result'],\n FilterBuilder['RelationName'],\n FilterBuilder['Relationships'],\n 'RPC'\n > {\n return this.rest.rpc(fn, args, options) as unknown as PostgrestFilterBuilder<\n ClientOptions,\n Schema,\n FilterBuilder['Row'],\n FilterBuilder['Result'],\n FilterBuilder['RelationName'],\n FilterBuilder['Relationships'],\n 'RPC'\n >\n }\n\n /**\n * Creates a Realtime channel with Broadcast, Presence, and Postgres Changes.\n *\n * @param {string} name - The name of the Realtime channel.\n * @param {Object} opts - The options to pass to the Realtime channel.\n *\n */\n channel(name: string, opts: RealtimeChannelOptions = { config: {} }): RealtimeChannel {\n return this.realtime.channel(name, opts)\n }\n\n /**\n * Returns all Realtime channels.\n */\n getChannels(): RealtimeChannel[] {\n return this.realtime.getChannels()\n }\n\n /**\n * Unsubscribes and removes Realtime channel from Realtime client.\n *\n * @param {RealtimeChannel} channel - The name of the Realtime channel.\n *\n */\n removeChannel(channel: RealtimeChannel): Promise<'ok' | 'timed out' | 'error'> {\n return this.realtime.removeChannel(channel)\n }\n\n /**\n * Unsubscribes and removes all Realtime channels from Realtime client.\n */\n removeAllChannels(): Promise<('ok' | 'timed out' | 'error')[]> {\n return this.realtime.removeAllChannels()\n }\n\n private async _getAccessToken() {\n if (this.accessToken) {\n return await this.accessToken()\n }\n\n const { data } = await this.auth.getSession()\n\n return data.session?.access_token ?? this.supabaseKey\n }\n\n private _initSupabaseAuthClient(\n {\n autoRefreshToken,\n persistSession,\n detectSessionInUrl,\n storage,\n userStorage,\n storageKey,\n flowType,\n lock,\n debug,\n throwOnError,\n }: SupabaseAuthClientOptions,\n headers?: Record<string, string>,\n fetch?: Fetch\n ) {\n const authHeaders = {\n Authorization: `Bearer ${this.supabaseKey}`,\n apikey: `${this.supabaseKey}`,\n }\n return new SupabaseAuthClient({\n url: this.authUrl.href,\n headers: { ...authHeaders, ...headers },\n storageKey: storageKey,\n autoRefreshToken,\n persistSession,\n detectSessionInUrl,\n storage,\n userStorage,\n flowType,\n lock,\n debug,\n throwOnError,\n fetch,\n // auth checks if there is a custom authorizaiton header using this flag\n // so it knows whether to return an error when getUser is called with no session\n hasCustomAuthorizationHeader: Object.keys(this.headers).some(\n (key) => key.toLowerCase() === 'authorization'\n ),\n })\n }\n\n private _initRealtimeClient(options: RealtimeClientOptions) {\n return new RealtimeClient(this.realtimeUrl.href, {\n ...options,\n params: { ...{ apikey: this.supabaseKey }, ...options?.params },\n })\n }\n\n private _listenForAuthEvents() {\n const data = this.auth.onAuthStateChange((event, session) => {\n this._handleTokenChanged(event, 'CLIENT', session?.access_token)\n })\n return data\n }\n\n private _handleTokenChanged(\n event: AuthChangeEvent,\n source: 'CLIENT' | 'STORAGE',\n token?: string\n ) {\n if (\n (event === 'TOKEN_REFRESHED' || event === 'SIGNED_IN') &&\n this.changedAccessToken !== token\n ) {\n this.changedAccessToken = token\n this.realtime.setAuth(token)\n } else if (event === 'SIGNED_OUT') {\n this.realtime.setAuth()\n if (source == 'STORAGE') this.auth.signOut()\n this.changedAccessToken = undefined\n }\n }\n}\n","import SupabaseClient from './SupabaseClient'\nimport type { SupabaseClientOptions } from './lib/types'\n\nexport * from '@supabase/auth-js'\nexport type { User as AuthUser, Session as AuthSession } from '@supabase/auth-js'\nexport type {\n PostgrestResponse,\n PostgrestSingleResponse,\n PostgrestMaybeSingleResponse,\n} from '@supabase/postgrest-js'\nexport { PostgrestError } from '@supabase/postgrest-js'\nexport type { FunctionInvokeOptions } from '@supabase/functions-js'\nexport {\n FunctionsHttpError,\n FunctionsFetchError,\n FunctionsRelayError,\n FunctionsError,\n FunctionRegion,\n} from '@supabase/functions-js'\nexport * from '@supabase/realtime-js'\nexport { default as SupabaseClient } from './SupabaseClient'\nexport type {\n SupabaseClientOptions,\n QueryResult,\n QueryData,\n QueryError,\n DatabaseWithoutInternals,\n} from './lib/types'\n\n/**\n * Creates a new Supabase Client.\n *\n * @example\n * ```ts\n * import { createClient } from '@supabase/supabase-js'\n *\n * const supabase = createClient('https://xyzcompany.supabase.co', 'public-anon-key')\n * const { data, error } = await supabase.from('profiles').select('*')\n * ```\n */\nexport const createClient = <\n Database = any,\n SchemaNameOrClientOptions extends\n | (string & keyof Omit<Database, '__InternalSupabase'>)\n | { PostgrestVersion: string } = 'public' extends keyof Omit<Database, '__InternalSupabase'>\n ? 'public'\n : string & keyof Omit<Database, '__InternalSupabase'>,\n SchemaName extends string &\n keyof Omit<Database, '__InternalSupabase'> = SchemaNameOrClientOptions extends string &\n keyof Omit<Database, '__InternalSupabase'>\n ? SchemaNameOrClientOptions\n : 'public' extends keyof Omit<Database, '__InternalSupabase'>\n ? 'public'\n : string & keyof Omit<Omit<Database, '__InternalSupabase'>, '__InternalSupabase'>,\n>(\n supabaseUrl: string,\n supabaseKey: string,\n options?: SupabaseClientOptions<SchemaName>\n): SupabaseClient<Database, SchemaNameOrClientOptions, SchemaName> => {\n return new SupabaseClient<Database, SchemaNameOrClientOptions, SchemaName>(\n supabaseUrl,\n supabaseKey,\n options\n )\n}\n\n// Check for Node.js <= 18 deprecation\nfunction shouldShowDeprecationWarning(): boolean {\n // Skip in browser environments\n if (typeof window !== 'undefined') {\n return false\n }\n\n // Skip if process is not available (e.g., Edge Runtime)\n // Use dynamic property access to avoid Next.js Edge Runtime static analysis warnings\n const _process = (globalThis as any)['process']\n if (!_process) {\n return false\n }\n\n const processVersion = _process['version']\n if (processVersion === undefined || processVersion === null) {\n return false\n }\n\n const versionMatch = processVersion.match(/^v(\\d+)\\./)\n if (!versionMatch) {\n return false\n }\n\n const majorVersion = parseInt(versionMatch[1], 10)\n return majorVersion <= 18\n}\n\nif (shouldShowDeprecationWarning()) {\n console.warn(\n `⚠️ Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. ` +\n `Please upgrade to Node.js 20 or later. ` +\n `For more information, visit: https://github.com/orgs/supabase/discussions/37217`\n )\n}\n"],"mappings":";;;;;;;AAMA,MAAa,UAAU;;;;ACDvB,IAAI,SAAS;AAEb,IAAI,OAAO,SAAS,YAClB,UAAS;SACA,OAAO,aAAa,YAC7B,UAA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AK,KAAK,QAAQ,CAAC,MACrD,QAAQ,IAAI,aAAa,KAAK,gBAChC;GACF,CAAC;;CAGJ,AAAQ,oBAAoB,SAAgC;AAC1D,SAAO,IAAIC,sCAAe,KAAK,YAAY,wCACtC,gBACH,0CAAa,EAAE,QAAQ,KAAK,aAAa,qDAAK,QAAS,WACvD;;CAGJ,AAAQ,uBAAuB;AAI7B,SAHa,KAAK,KAAK,mBAAmB,OAAO,YAAY;AAC3D,QAAK,oBAAoB,OAAO,4DAAU,QAAS,aAAa;IAChE;;CAIJ,AAAQ,oBACN,OACA,QACA,OACA;AACA,OACG,UAAU,qBAAqB,UAAU,gBAC1C,KAAK,uBAAuB,OAC5B;AACA,QAAK,qBAAqB;AAC1B,QAAK,SAAS,QAAQ,MAAM;aACnB,UAAU,cAAc;AACjC,QAAK,SAAS,SAAS;AACvB,OAAI,UAAU,UAAW,MAAK,KAAK,SAAS;AAC5C,QAAK,qBAAqB;;;;;;;;;;;;;;;;;;ACjiBhC,MAAa,gBAeX,aACA,aACA,YACoE;AACpE,QAAO,IAAI,eACT,aACA,aACA,QACD;;AAIH,SAAS,+BAAwC;AAE/C,KAAI,OAAO,WAAW,YACpB,QAAO;CAKT,MAAM,WAAY,WAAmB;AACrC,KAAI,CAAC,SACH,QAAO;CAGT,MAAM,iBAAiB,SAAS;AAChC,KAAI,mBAAmB,UAAa,mBAAmB,KACrD,QAAO;CAGT,MAAM,eAAe,eAAe,MAAM,YAAY;AACtD,KAAI,CAAC,aACH,QAAO;AAIT,QADqB,SAAS,aAAa,IAAI,GAAG,IAC3B;;AAGzB,IAAI,8BAA8B,CAChC,SAAQ,KACN,8OAGD"}
@@ -0,0 +1,564 @@
1
+ import { FunctionInvokeOptions, FunctionRegion, FunctionsClient, FunctionsError, FunctionsFetchError, FunctionsHttpError, FunctionsRelayError } from "@supabase/functions-js";
2
+ import { PostgrestClient, PostgrestError, PostgrestError as PostgrestError$1, PostgrestFilterBuilder, PostgrestMaybeSingleResponse, PostgrestQueryBuilder, PostgrestResponse, PostgrestSingleResponse } from "@supabase/postgrest-js";
3
+ import { RealtimeChannel, RealtimeChannelOptions, RealtimeClient, RealtimeClientOptions } from "@supabase/realtime-js";
4
+ import { StorageClient, StorageClientOptions } from "@supabase/storage-js";
5
+ import { AuthClient, GoTrueClientOptions, Session as AuthSession, User as AuthUser } from "@supabase/auth-js";
6
+ export * from "@supabase/realtime-js";
7
+ export * from "@supabase/auth-js";
8
+
9
+ //#region src/lib/rest/types/common/common.d.ts
10
+ type GenericRelationship = {
11
+ foreignKeyName: string;
12
+ columns: string[];
13
+ isOneToOne?: boolean;
14
+ referencedRelation: string;
15
+ referencedColumns: string[];
16
+ };
17
+ type GenericTable = {
18
+ Row: Record<string, unknown>;
19
+ Insert: Record<string, unknown>;
20
+ Update: Record<string, unknown>;
21
+ Relationships: GenericRelationship[];
22
+ };
23
+ type GenericUpdatableView = {
24
+ Row: Record<string, unknown>;
25
+ Insert: Record<string, unknown>;
26
+ Update: Record<string, unknown>;
27
+ Relationships: GenericRelationship[];
28
+ };
29
+ type GenericNonUpdatableView = {
30
+ Row: Record<string, unknown>;
31
+ Relationships: GenericRelationship[];
32
+ };
33
+ type GenericView = GenericUpdatableView | GenericNonUpdatableView;
34
+ type GenericSetofOption = {
35
+ isSetofReturn?: boolean | undefined;
36
+ isOneToOne?: boolean | undefined;
37
+ isNotNullable?: boolean | undefined;
38
+ to: string;
39
+ from: string;
40
+ };
41
+ type GenericFunction = {
42
+ Args: Record<string, unknown> | never;
43
+ Returns: unknown;
44
+ SetofOptions?: GenericSetofOption;
45
+ };
46
+ type GenericSchema = {
47
+ Tables: Record<string, GenericTable>;
48
+ Views: Record<string, GenericView>;
49
+ Functions: Record<string, GenericFunction>;
50
+ };
51
+ //#endregion
52
+ //#region src/lib/types.d.ts
53
+ interface SupabaseAuthClientOptions extends GoTrueClientOptions {}
54
+ type Fetch = typeof fetch;
55
+ type SupabaseClientOptions<SchemaName> = {
56
+ /**
57
+ * The Postgres schema which your tables belong to. Must be on the list of exposed schemas in Supabase. Defaults to `public`.
58
+ */
59
+ db?: {
60
+ schema?: SchemaName;
61
+ /**
62
+ * Optional timeout in milliseconds for PostgREST requests.
63
+ * When set, requests will automatically abort after this duration to prevent indefinite hangs.
64
+ *
65
+ * @example
66
+ * ```ts
67
+ * const supabase = createClient(url, key, {
68
+ * db: { timeout: 30000 } // 30 second timeout
69
+ * })
70
+ * ```
71
+ */
72
+ timeout?: number;
73
+ /**
74
+ * Maximum URL length in characters before warnings/errors are triggered.
75
+ * Defaults to 8000 characters. Used to provide helpful hints when URLs
76
+ * exceed server limits.
77
+ *
78
+ * @example
79
+ * ```ts
80
+ * const supabase = createClient(url, key, {
81
+ * db: { urlLengthLimit: 10000 } // Custom limit
82
+ * })
83
+ * ```
84
+ */
85
+ urlLengthLimit?: number;
86
+ };
87
+ auth?: {
88
+ /**
89
+ * Automatically refreshes the token for logged-in users. Defaults to true.
90
+ */
91
+ autoRefreshToken?: boolean;
92
+ /**
93
+ * Optional key name used for storing tokens in local storage.
94
+ */
95
+ storageKey?: string;
96
+ /**
97
+ * Whether to persist a logged-in session to storage. Defaults to true.
98
+ */
99
+ persistSession?: boolean;
100
+ /**
101
+ * Detect a session from the URL. Used for OAuth login callbacks. Defaults to true.
102
+ *
103
+ * Can be set to a function to provide custom logic for determining if a URL contains
104
+ * a Supabase auth callback. The function receives the current URL and parsed parameters,
105
+ * and should return true if the URL should be processed as a Supabase auth callback.
106
+ *
107
+ * This is useful when your app uses other OAuth providers (e.g., Facebook Login) that
108
+ * also return access_token in the URL fragment, which would otherwise be incorrectly
109
+ * intercepted by Supabase Auth.
110
+ *
111
+ * @example
112
+ * ```ts
113
+ * detectSessionInUrl: (url, params) => {
114
+ * // Ignore Facebook OAuth redirects
115
+ * if (url.pathname === '/facebook/redirect') return false
116
+ * // Use default detection for other URLs
117
+ * return Boolean(params.access_token || params.error_description)
118
+ * }
119
+ * ```
120
+ */
121
+ detectSessionInUrl?: boolean | ((url: URL, params: {
122
+ [parameter: string]: string;
123
+ }) => boolean);
124
+ /**
125
+ * A storage provider. Used to store the logged-in session.
126
+ */
127
+ storage?: SupabaseAuthClientOptions['storage'];
128
+ /**
129
+ * A storage provider to store the user profile separately from the session.
130
+ * Useful when you need to store the session information in cookies,
131
+ * without bloating the data with the redundant user object.
132
+ *
133
+ * @experimental
134
+ */
135
+ userStorage?: SupabaseAuthClientOptions['userStorage'];
136
+ /**
137
+ * OAuth flow to use - defaults to implicit flow. PKCE is recommended for mobile and server-side applications.
138
+ */
139
+ flowType?: SupabaseAuthClientOptions['flowType'];
140
+ /**
141
+ * If debug messages for authentication client are emitted. Can be used to inspect the behavior of the library.
142
+ */
143
+ debug?: SupabaseAuthClientOptions['debug'];
144
+ /**
145
+ * Provide your own locking mechanism based on the environment. By default no locking is done at this time.
146
+ *
147
+ * @experimental
148
+ */
149
+ lock?: SupabaseAuthClientOptions['lock'];
150
+ /**
151
+ * If there is an error with the query, throwOnError will reject the promise by
152
+ * throwing the error instead of returning it as part of a successful response.
153
+ */
154
+ throwOnError?: SupabaseAuthClientOptions['throwOnError'];
155
+ };
156
+ /**
157
+ * Options passed to the realtime-js instance
158
+ */
159
+ realtime?: RealtimeClientOptions;
160
+ storage?: StorageClientOptions;
161
+ global?: {
162
+ /**
163
+ * A custom `fetch` implementation.
164
+ */
165
+ fetch?: Fetch;
166
+ /**
167
+ * Optional headers for initializing the client.
168
+ */
169
+ headers?: Record<string, string>;
170
+ };
171
+ /**
172
+ * Optional function for using a third-party authentication system with
173
+ * Supabase. The function should return an access token or ID token (JWT) by
174
+ * obtaining it from the third-party auth SDK. Note that this
175
+ * function may be called concurrently and many times. Use memoization and
176
+ * locking techniques if this is not supported by the SDKs.
177
+ *
178
+ * When set, the `auth` namespace of the Supabase client cannot be used.
179
+ * Create another client if you wish to use Supabase Auth and third-party
180
+ * authentications concurrently in the same application.
181
+ */
182
+ accessToken?: () => Promise<string | null>;
183
+ };
184
+ /**
185
+ * Helper types for query results.
186
+ */
187
+ type QueryResult<T> = T extends PromiseLike<infer U> ? U : never;
188
+ type QueryData<T> = T extends PromiseLike<{
189
+ data: infer U;
190
+ }> ? Exclude<U, null> : never;
191
+ type QueryError = PostgrestError$1;
192
+ /**
193
+ * Strips internal Supabase metadata from Database types.
194
+ * Useful for libraries defining generic constraints on Database types.
195
+ *
196
+ * @example
197
+ * ```typescript
198
+ * type CleanDB = DatabaseWithoutInternals<Database>
199
+ * ```
200
+ */
201
+ type DatabaseWithoutInternals<DB> = Omit<DB, '__InternalSupabase'>;
202
+ //#endregion
203
+ //#region src/lib/SupabaseAuthClient.d.ts
204
+ declare class SupabaseAuthClient extends AuthClient {
205
+ constructor(options: SupabaseAuthClientOptions);
206
+ }
207
+ //#endregion
208
+ //#region src/lib/rest/types/common/rpc.d.ts
209
+ type IsMatchingArgs<FnArgs extends GenericFunction['Args'], PassedArgs extends GenericFunction['Args']> = [FnArgs] extends [Record<PropertyKey, never>] ? PassedArgs extends Record<PropertyKey, never> ? true : false : keyof PassedArgs extends keyof FnArgs ? PassedArgs extends FnArgs ? true : false : false;
210
+ type MatchingFunctionArgs<Fn$1 extends GenericFunction, Args extends GenericFunction['Args']> = Fn$1 extends {
211
+ Args: infer A extends GenericFunction['Args'];
212
+ } ? IsMatchingArgs<A, Args> extends true ? Fn$1 : never : false;
213
+ type FindMatchingFunctionByArgs<FnUnion, Args extends GenericFunction['Args']> = FnUnion extends infer Fn extends GenericFunction ? MatchingFunctionArgs<Fn, Args> : false;
214
+ type TablesAndViews<Schema extends GenericSchema> = Schema['Tables'] & Exclude<Schema['Views'], ''>;
215
+ type UnionToIntersection<U$1> = (U$1 extends any ? (k: U$1) => void : never) extends ((k: infer I) => void) ? I : never;
216
+ type LastOf<T> = UnionToIntersection<T extends any ? () => T : never> extends (() => infer R) ? R : never;
217
+ type IsAny<T> = 0 extends 1 & T ? true : false;
218
+ type ExactMatch<T, S> = [T] extends [S] ? ([S] extends [T] ? true : false) : false;
219
+ type ExtractExactFunction<Fns, Args> = Fns extends infer F ? F extends GenericFunction ? ExactMatch<F['Args'], Args> extends true ? F : never : never : never;
220
+ type IsNever<T> = [T] extends [never] ? true : false;
221
+ type RpcFunctionNotFound<FnName> = {
222
+ Row: any;
223
+ Result: {
224
+ error: true;
225
+ } & "Couldn't infer function definition matching provided arguments";
226
+ RelationName: FnName;
227
+ Relationships: null;
228
+ };
229
+ type CrossSchemaError<TableRef extends string> = {
230
+ error: true;
231
+ } & `Function returns SETOF from a different schema ('${TableRef}'). Use .overrideTypes<YourReturnType>() to specify the return type explicitly.`;
232
+ type GetRpcFunctionFilterBuilderByArgs<Schema extends GenericSchema, FnName extends string & keyof Schema['Functions'], Args> = {
233
+ 0: Schema['Functions'][FnName];
234
+ 1: IsAny<Schema> extends true ? any : IsNever<Args> extends true ? IsNever<ExtractExactFunction<Schema['Functions'][FnName], Args>> extends true ? LastOf<Schema['Functions'][FnName]> : ExtractExactFunction<Schema['Functions'][FnName], Args> : Args extends Record<PropertyKey, never> ? LastOf<Schema['Functions'][FnName]> : Args extends GenericFunction['Args'] ? IsNever<LastOf<FindMatchingFunctionByArgs<Schema['Functions'][FnName], Args>>> extends true ? LastOf<Schema['Functions'][FnName]> : LastOf<FindMatchingFunctionByArgs<Schema['Functions'][FnName], Args>> : ExtractExactFunction<Schema['Functions'][FnName], Args> extends GenericFunction ? ExtractExactFunction<Schema['Functions'][FnName], Args> : any;
235
+ }[1] extends infer Fn ? IsAny<Fn> extends true ? {
236
+ Row: any;
237
+ Result: any;
238
+ RelationName: FnName;
239
+ Relationships: null;
240
+ } : Fn extends GenericFunction ? {
241
+ Row: Fn['SetofOptions'] extends GenericSetofOption ? Fn['SetofOptions']['to'] extends keyof TablesAndViews<Schema> ? TablesAndViews<Schema>[Fn['SetofOptions']['to']]['Row'] : Fn['Returns'] extends any[] ? Fn['Returns'][number] extends Record<string, unknown> ? Fn['Returns'][number] : CrossSchemaError<Fn['SetofOptions']['to'] & string> : Fn['Returns'] extends Record<string, unknown> ? Fn['Returns'] : CrossSchemaError<Fn['SetofOptions']['to'] & string> : Fn['Returns'] extends any[] ? Fn['Returns'][number] extends Record<string, unknown> ? Fn['Returns'][number] : never : Fn['Returns'] extends Record<string, unknown> ? Fn['Returns'] : never;
242
+ Result: Fn['SetofOptions'] extends GenericSetofOption ? Fn['SetofOptions']['isSetofReturn'] extends true ? Fn['SetofOptions']['isOneToOne'] extends true ? Fn['Returns'][] : Fn['Returns'] : Fn['Returns'] : Fn['Returns'];
243
+ RelationName: Fn['SetofOptions'] extends GenericSetofOption ? Fn['SetofOptions']['to'] : FnName;
244
+ Relationships: Fn['SetofOptions'] extends GenericSetofOption ? Fn['SetofOptions']['to'] extends keyof Schema['Tables'] ? Schema['Tables'][Fn['SetofOptions']['to']]['Relationships'] : Fn['SetofOptions']['to'] extends keyof Schema['Views'] ? Schema['Views'][Fn['SetofOptions']['to']]['Relationships'] : null : null;
245
+ } : Fn extends false ? RpcFunctionNotFound<FnName> : RpcFunctionNotFound<FnName> : RpcFunctionNotFound<FnName>;
246
+ //#endregion
247
+ //#region src/SupabaseClient.d.ts
248
+ /**
249
+ * Supabase Client.
250
+ *
251
+ * An isomorphic Javascript client for interacting with Postgres.
252
+ */
253
+ declare class SupabaseClient<Database = any, SchemaNameOrClientOptions extends (string & keyof Omit<Database, '__InternalSupabase'>) | {
254
+ PostgrestVersion: string;
255
+ } = ('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'>), Schema extends (Omit<Database, '__InternalSupabase'>[SchemaName] extends GenericSchema ? Omit<Database, '__InternalSupabase'>[SchemaName] : never) = (Omit<Database, '__InternalSupabase'>[SchemaName] extends GenericSchema ? Omit<Database, '__InternalSupabase'>[SchemaName] : never), ClientOptions extends {
256
+ PostgrestVersion: string;
257
+ } = (SchemaNameOrClientOptions extends string & keyof Omit<Database, '__InternalSupabase'> ? Database extends {
258
+ __InternalSupabase: {
259
+ PostgrestVersion: string;
260
+ };
261
+ } ? Database['__InternalSupabase'] : {
262
+ PostgrestVersion: '12';
263
+ } : SchemaNameOrClientOptions extends {
264
+ PostgrestVersion: string;
265
+ } ? SchemaNameOrClientOptions : never)> {
266
+ protected supabaseUrl: string;
267
+ protected supabaseKey: string;
268
+ /**
269
+ * Supabase Auth allows you to create and manage user sessions for access to data that is secured by access policies.
270
+ */
271
+ auth: SupabaseAuthClient;
272
+ realtime: RealtimeClient;
273
+ /**
274
+ * Supabase Storage allows you to manage user-generated content, such as photos or videos.
275
+ */
276
+ storage: StorageClient;
277
+ protected realtimeUrl: URL;
278
+ protected authUrl: URL;
279
+ protected storageUrl: URL;
280
+ protected functionsUrl: URL;
281
+ protected rest: PostgrestClient<Database, ClientOptions, SchemaName>;
282
+ protected storageKey: string;
283
+ protected fetch?: Fetch;
284
+ protected changedAccessToken?: string;
285
+ protected accessToken?: () => Promise<string | null>;
286
+ protected headers: Record<string, string>;
287
+ /**
288
+ * Create a new client for use in the browser.
289
+ *
290
+ * @category Initializing
291
+ *
292
+ * @param supabaseUrl The unique Supabase URL which is supplied when you create a new project in your project dashboard.
293
+ * @param supabaseKey The unique Supabase Key which is supplied when you create a new project in your project dashboard.
294
+ * @param options.db.schema You can switch in between schemas. The schema needs to be on the list of exposed schemas inside Supabase.
295
+ * @param options.auth.autoRefreshToken Set to "true" if you want to automatically refresh the token before expiring.
296
+ * @param options.auth.persistSession Set to "true" if you want to automatically save the user session into local storage.
297
+ * @param options.auth.detectSessionInUrl Set to "true" if you want to automatically detects OAuth grants in the URL and signs in the user.
298
+ * @param options.realtime Options passed along to realtime-js constructor.
299
+ * @param options.storage Options passed along to the storage-js constructor.
300
+ * @param options.global.fetch A custom fetch implementation.
301
+ * @param options.global.headers Any additional headers to send with each network request.
302
+ *
303
+ * @example Creating a client
304
+ * ```js
305
+ * import { createClient } from '@supabase/supabase-js'
306
+ *
307
+ * // Create a single supabase client for interacting with your database
308
+ * const supabase = createClient('https://xyzcompany.supabase.co', 'publishable-or-anon-key')
309
+ * ```
310
+ *
311
+ * @example With a custom domain
312
+ * ```js
313
+ * import { createClient } from '@supabase/supabase-js'
314
+ *
315
+ * // Use a custom domain as the supabase URL
316
+ * const supabase = createClient('https://my-custom-domain.com', 'publishable-or-anon-key')
317
+ * ```
318
+ *
319
+ * @example With additional parameters
320
+ * ```js
321
+ * import { createClient } from '@supabase/supabase-js'
322
+ *
323
+ * const options = {
324
+ * db: {
325
+ * schema: 'public',
326
+ * },
327
+ * auth: {
328
+ * autoRefreshToken: true,
329
+ * persistSession: true,
330
+ * detectSessionInUrl: true
331
+ * },
332
+ * global: {
333
+ * headers: { 'x-my-custom-header': 'my-app-name' },
334
+ * },
335
+ * }
336
+ * const supabase = createClient("https://xyzcompany.supabase.co", "publishable-or-anon-key", options)
337
+ * ```
338
+ *
339
+ * @exampleDescription With custom schemas
340
+ * By default the API server points to the `public` schema. You can enable other database schemas within the Dashboard.
341
+ * Go to [Settings > API > Exposed schemas](/dashboard/project/_/settings/api) and add the schema which you want to expose to the API.
342
+ *
343
+ * Note: each client connection can only access a single schema, so the code above can access the `other_schema` schema but cannot access the `public` schema.
344
+ *
345
+ * @example With custom schemas
346
+ * ```js
347
+ * import { createClient } from '@supabase/supabase-js'
348
+ *
349
+ * const supabase = createClient('https://xyzcompany.supabase.co', 'publishable-or-anon-key', {
350
+ * // Provide a custom schema. Defaults to "public".
351
+ * db: { schema: 'other_schema' }
352
+ * })
353
+ * ```
354
+ *
355
+ * @exampleDescription Custom fetch implementation
356
+ * `supabase-js` uses the [`cross-fetch`](https://www.npmjs.com/package/cross-fetch) library to make HTTP requests,
357
+ * but an alternative `fetch` implementation can be provided as an option.
358
+ * This is most useful in environments where `cross-fetch` is not compatible (for instance Cloudflare Workers).
359
+ *
360
+ * @example Custom fetch implementation
361
+ * ```js
362
+ * import { createClient } from '@supabase/supabase-js'
363
+ *
364
+ * const supabase = createClient('https://xyzcompany.supabase.co', 'publishable-or-anon-key', {
365
+ * global: { fetch: fetch.bind(globalThis) }
366
+ * })
367
+ * ```
368
+ *
369
+ * @exampleDescription React Native options with AsyncStorage
370
+ * For React Native we recommend using `AsyncStorage` as the storage implementation for Supabase Auth.
371
+ *
372
+ * @example React Native options with AsyncStorage
373
+ * ```js
374
+ * import 'react-native-url-polyfill/auto'
375
+ * import { createClient } from '@supabase/supabase-js'
376
+ * import AsyncStorage from "@react-native-async-storage/async-storage";
377
+ *
378
+ * const supabase = createClient("https://xyzcompany.supabase.co", "publishable-or-anon-key", {
379
+ * auth: {
380
+ * storage: AsyncStorage,
381
+ * autoRefreshToken: true,
382
+ * persistSession: true,
383
+ * detectSessionInUrl: false,
384
+ * },
385
+ * });
386
+ * ```
387
+ *
388
+ * @exampleDescription React Native options with Expo SecureStore
389
+ * If you wish to encrypt the user's session information, you can use `aes-js` and store the encryption key in Expo SecureStore.
390
+ * The `aes-js` library, a reputable JavaScript-only implementation of the AES encryption algorithm in CTR mode.
391
+ * A new 256-bit encryption key is generated using the `react-native-get-random-values` library.
392
+ * This key is stored inside Expo's SecureStore, while the value is encrypted and placed inside AsyncStorage.
393
+ *
394
+ * Please make sure that:
395
+ * - You keep the `expo-secure-store`, `aes-js` and `react-native-get-random-values` libraries up-to-date.
396
+ * - Choose the correct [`SecureStoreOptions`](https://docs.expo.dev/versions/latest/sdk/securestore/#securestoreoptions) for your app's needs.
397
+ * E.g. [`SecureStore.WHEN_UNLOCKED`](https://docs.expo.dev/versions/latest/sdk/securestore/#securestorewhen_unlocked) regulates when the data can be accessed.
398
+ * - Carefully consider optimizations or other modifications to the above example, as those can lead to introducing subtle security vulnerabilities.
399
+ *
400
+ * @example React Native options with Expo SecureStore
401
+ * ```ts
402
+ * import 'react-native-url-polyfill/auto'
403
+ * import { createClient } from '@supabase/supabase-js'
404
+ * import AsyncStorage from '@react-native-async-storage/async-storage';
405
+ * import * as SecureStore from 'expo-secure-store';
406
+ * import * as aesjs from 'aes-js';
407
+ * import 'react-native-get-random-values';
408
+ *
409
+ * // As Expo's SecureStore does not support values larger than 2048
410
+ * // bytes, an AES-256 key is generated and stored in SecureStore, while
411
+ * // it is used to encrypt/decrypt values stored in AsyncStorage.
412
+ * class LargeSecureStore {
413
+ * private async _encrypt(key: string, value: string) {
414
+ * const encryptionKey = crypto.getRandomValues(new Uint8Array(256 / 8));
415
+ *
416
+ * const cipher = new aesjs.ModeOfOperation.ctr(encryptionKey, new aesjs.Counter(1));
417
+ * const encryptedBytes = cipher.encrypt(aesjs.utils.utf8.toBytes(value));
418
+ *
419
+ * await SecureStore.setItemAsync(key, aesjs.utils.hex.fromBytes(encryptionKey));
420
+ *
421
+ * return aesjs.utils.hex.fromBytes(encryptedBytes);
422
+ * }
423
+ *
424
+ * private async _decrypt(key: string, value: string) {
425
+ * const encryptionKeyHex = await SecureStore.getItemAsync(key);
426
+ * if (!encryptionKeyHex) {
427
+ * return encryptionKeyHex;
428
+ * }
429
+ *
430
+ * const cipher = new aesjs.ModeOfOperation.ctr(aesjs.utils.hex.toBytes(encryptionKeyHex), new aesjs.Counter(1));
431
+ * const decryptedBytes = cipher.decrypt(aesjs.utils.hex.toBytes(value));
432
+ *
433
+ * return aesjs.utils.utf8.fromBytes(decryptedBytes);
434
+ * }
435
+ *
436
+ * async getItem(key: string) {
437
+ * const encrypted = await AsyncStorage.getItem(key);
438
+ * if (!encrypted) { return encrypted; }
439
+ *
440
+ * return await this._decrypt(key, encrypted);
441
+ * }
442
+ *
443
+ * async removeItem(key: string) {
444
+ * await AsyncStorage.removeItem(key);
445
+ * await SecureStore.deleteItemAsync(key);
446
+ * }
447
+ *
448
+ * async setItem(key: string, value: string) {
449
+ * const encrypted = await this._encrypt(key, value);
450
+ *
451
+ * await AsyncStorage.setItem(key, encrypted);
452
+ * }
453
+ * }
454
+ *
455
+ * const supabase = createClient("https://xyzcompany.supabase.co", "publishable-or-anon-key", {
456
+ * auth: {
457
+ * storage: new LargeSecureStore(),
458
+ * autoRefreshToken: true,
459
+ * persistSession: true,
460
+ * detectSessionInUrl: false,
461
+ * },
462
+ * });
463
+ * ```
464
+ *
465
+ * @example With a database query
466
+ * ```ts
467
+ * import { createClient } from '@supabase/supabase-js'
468
+ *
469
+ * const supabase = createClient('https://xyzcompany.supabase.co', 'public-anon-key')
470
+ *
471
+ * const { data } = await supabase.from('profiles').select('*')
472
+ * ```
473
+ */
474
+ constructor(supabaseUrl: string, supabaseKey: string, options?: SupabaseClientOptions<SchemaName>);
475
+ /**
476
+ * Supabase Functions allows you to deploy and invoke edge functions.
477
+ */
478
+ get functions(): FunctionsClient;
479
+ from<TableName extends string & keyof Schema['Tables'], Table extends Schema['Tables'][TableName]>(relation: TableName): PostgrestQueryBuilder<ClientOptions, Schema, Table, TableName>;
480
+ from<ViewName extends string & keyof Schema['Views'], View extends Schema['Views'][ViewName]>(relation: ViewName): PostgrestQueryBuilder<ClientOptions, Schema, View, ViewName>;
481
+ /**
482
+ * Select a schema to query or perform an function (rpc) call.
483
+ *
484
+ * The schema needs to be on the list of exposed schemas inside Supabase.
485
+ *
486
+ * @param schema - The schema to query
487
+ */
488
+ schema<DynamicSchema extends string & keyof Omit<Database, '__InternalSupabase'>>(schema: DynamicSchema): PostgrestClient<Database, ClientOptions, DynamicSchema, Database[DynamicSchema] extends GenericSchema ? Database[DynamicSchema] : any>;
489
+ /**
490
+ * Perform a function call.
491
+ *
492
+ * @param fn - The function name to call
493
+ * @param args - The arguments to pass to the function call
494
+ * @param options - Named parameters
495
+ * @param options.head - When set to `true`, `data` will not be returned.
496
+ * Useful if you only need the count.
497
+ * @param options.get - When set to `true`, the function will be called with
498
+ * read-only access mode.
499
+ * @param options.count - Count algorithm to use to count rows returned by the
500
+ * function. Only applicable for [set-returning
501
+ * functions](https://www.postgresql.org/docs/current/functions-srf.html).
502
+ *
503
+ * `"exact"`: Exact but slow count algorithm. Performs a `COUNT(*)` under the
504
+ * hood.
505
+ *
506
+ * `"planned"`: Approximated but fast count algorithm. Uses the Postgres
507
+ * statistics under the hood.
508
+ *
509
+ * `"estimated"`: Uses exact count for low numbers and planned count for high
510
+ * numbers.
511
+ */
512
+ rpc<FnName extends string & keyof Schema['Functions'], Args extends Schema['Functions'][FnName]['Args'] = never, FilterBuilder extends GetRpcFunctionFilterBuilderByArgs<Schema, FnName, Args> = GetRpcFunctionFilterBuilderByArgs<Schema, FnName, Args>>(fn: FnName, args?: Args, options?: {
513
+ head?: boolean;
514
+ get?: boolean;
515
+ count?: 'exact' | 'planned' | 'estimated';
516
+ }): PostgrestFilterBuilder<ClientOptions, Schema, FilterBuilder['Row'], FilterBuilder['Result'], FilterBuilder['RelationName'], FilterBuilder['Relationships'], 'RPC'>;
517
+ /**
518
+ * Creates a Realtime channel with Broadcast, Presence, and Postgres Changes.
519
+ *
520
+ * @param {string} name - The name of the Realtime channel.
521
+ * @param {Object} opts - The options to pass to the Realtime channel.
522
+ *
523
+ */
524
+ channel(name: string, opts?: RealtimeChannelOptions): RealtimeChannel;
525
+ /**
526
+ * Returns all Realtime channels.
527
+ */
528
+ getChannels(): RealtimeChannel[];
529
+ /**
530
+ * Unsubscribes and removes Realtime channel from Realtime client.
531
+ *
532
+ * @param {RealtimeChannel} channel - The name of the Realtime channel.
533
+ *
534
+ */
535
+ removeChannel(channel: RealtimeChannel): Promise<'ok' | 'timed out' | 'error'>;
536
+ /**
537
+ * Unsubscribes and removes all Realtime channels from Realtime client.
538
+ */
539
+ removeAllChannels(): Promise<('ok' | 'timed out' | 'error')[]>;
540
+ private _getAccessToken;
541
+ private _initSupabaseAuthClient;
542
+ private _initRealtimeClient;
543
+ private _listenForAuthEvents;
544
+ private _handleTokenChanged;
545
+ }
546
+ //#endregion
547
+ //#region src/index.d.ts
548
+ /**
549
+ * Creates a new Supabase Client.
550
+ *
551
+ * @example
552
+ * ```ts
553
+ * import { createClient } from '@supabase/supabase-js'
554
+ *
555
+ * const supabase = createClient('https://xyzcompany.supabase.co', 'public-anon-key')
556
+ * const { data, error } = await supabase.from('profiles').select('*')
557
+ * ```
558
+ */
559
+ declare const createClient: <Database = any, SchemaNameOrClientOptions extends (string & keyof Omit<Database, "__InternalSupabase">) | {
560
+ PostgrestVersion: string;
561
+ } = ("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>;
562
+ //#endregion
563
+ export { type AuthSession, type AuthUser, type DatabaseWithoutInternals, type FunctionInvokeOptions, FunctionRegion, FunctionsError, FunctionsFetchError, FunctionsHttpError, FunctionsRelayError, PostgrestError, type PostgrestMaybeSingleResponse, type PostgrestResponse, type PostgrestSingleResponse, type QueryData, type QueryError, type QueryResult, SupabaseClient, type SupabaseClientOptions, createClient };
564
+ //# sourceMappingURL=index.d.cts.map