Sign In

@supabase/supabase-js

Package Overview
Dependencies
Maintainers
2
Versions
815
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@supabase/supabase-js - npm Package Compare versions

Comparing version
2.112.3-canary.0
to
2.112.3
+1
-1
dist/index.cjs

@@ -9,3 +9,3 @@ const require_tracingRegistry = require('./tracingRegistry.cjs');

//#region src/lib/version.ts
const version = "2.112.3-canary.0";
const version = "2.112.3";

@@ -12,0 +12,0 @@ //#endregion

@@ -1,1 +0,1 @@

{"version":3,"file":"index.cjs","names":["JS_RUNTIME_VERSION: string | undefined","DEFAULT_AUTH_OPTIONS: SupabaseAuthClientOptions","DEFAULT_REALTIME_OPTIONS: RealtimeClientOptions","DEFAULT_TRACE_PROPAGATION_OPTIONS: TracePropagationOptions","version","fetch","traceTargets: TracePropagationTarget[] | null","getTraceContextExtractor","DEFAULT_DB_OPTIONS","DEFAULT_AUTH_OPTIONS","DEFAULT_REALTIME_OPTIONS","DEFAULT_GLOBAL_OPTIONS","DEFAULT_TRACE_PROPAGATION_OPTIONS","result: ResolvedSupabaseClientOptions<SchemaName>","AuthClient","supabaseUrl: string","supabaseKey: string","PostgrestClient","SupabaseStorageClient","FunctionsClient","this","RealtimeClient"],"sources":["../src/lib/version.ts","../src/lib/constants.ts","../../../shared/tracing/dist/module/parse.js","../../../shared/tracing/dist/module/validate.js","../../../shared/tracing/dist/module/defaults.js","../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.112.3-canary.0'\n","// constants.ts\nimport { RealtimeClientOptions } from '@supabase/realtime-js'\nimport { SupabaseAuthClientOptions, TracePropagationOptions } from './types'\nimport { version } from './version'\n\nlet JS_ENV = ''\nlet JS_RUNTIME_VERSION: string | undefined\n// @ts-ignore\nif (typeof Deno !== 'undefined') {\n JS_ENV = 'deno'\n // @ts-ignore\n JS_RUNTIME_VERSION = Deno.version?.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 const _process = (globalThis as any)['process']\n JS_RUNTIME_VERSION = _process?.['version']?.replace(/^v/, '')\n}\n\nconst _runtimeMeta = [`runtime=${JS_ENV}`]\nif (JS_RUNTIME_VERSION) {\n _runtimeMeta.push(`runtime-version=${JS_RUNTIME_VERSION}`)\n}\n\nexport const DEFAULT_HEADERS = {\n 'X-Client-Info': `supabase-js/${version}; ${_runtimeMeta.join('; ')}`,\n}\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\nexport const DEFAULT_TRACE_PROPAGATION_OPTIONS: TracePropagationOptions = {\n enabled: false,\n respectSamplingDecision: true,\n}\n","/**\n * Parse W3C traceparent header according to the specification.\n *\n * The traceparent header format is: version-traceid-parentid-traceflags\n * - version: 2 hex digits (currently always \"00\")\n * - traceid: 32 hex digits (128-bit trace identifier)\n * - parentid: 16 hex digits (64-bit span/parent identifier)\n * - traceflags: 2 hex digits (8-bit flags, bit 0 is sampled flag)\n *\n * @param traceparent - The traceparent header value\n * @returns Parsed traceparent object, or null if invalid format\n *\n * @see https://www.w3.org/TR/trace-context/#traceparent-header\n *\n * @example\n * ```typescript\n * const parsed = parseTraceParent('00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01')\n *\n * console.log(parsed)\n * // {\n * // version: '00',\n * // traceId: '0af7651916cd43dd8448eb211c80319c',\n * // parentId: 'b7ad6b7169203331',\n * // traceFlags: '01',\n * // isSampled: true\n * // }\n * ```\n */\nexport function parseTraceParent(traceparent) {\n if (!traceparent || typeof traceparent !== 'string') {\n return null;\n }\n // Split by hyphen\n const parts = traceparent.split('-');\n // Must have exactly 4 parts\n if (parts.length !== 4) {\n return null;\n }\n const [version, traceId, parentId, traceFlags] = parts;\n // Validate field lengths according to W3C spec\n if (version.length !== 2 ||\n traceId.length !== 32 ||\n parentId.length !== 16 ||\n traceFlags.length !== 2) {\n return null;\n }\n // Validate that all fields are valid hexadecimal\n const hexRegex = /^[0-9a-f]+$/i;\n if (!hexRegex.test(version) ||\n !hexRegex.test(traceId) ||\n !hexRegex.test(parentId) ||\n !hexRegex.test(traceFlags)) {\n return null;\n }\n // Validate that trace-id and parent-id are not all zeros (invalid per spec)\n if (traceId === '00000000000000000000000000000000' || parentId === '0000000000000000') {\n return null;\n }\n // Parse sampling decision from trace-flags (bit 0)\n const flags = parseInt(traceFlags, 16);\n const isSampled = (flags & 0x01) === 0x01;\n return {\n version,\n traceId,\n parentId,\n traceFlags,\n isSampled,\n };\n}\n//# sourceMappingURL=parse.js.map","/**\n * Check if trace context should be propagated to the target URL.\n *\n * This function checks if the target URL matches any of the configured\n * propagation targets. Targets can be:\n * - String: Exact hostname match or wildcard domain (*.example.com)\n * - RegExp: Pattern matching hostname\n * - Function: Custom logic to determine if URL should receive trace context\n *\n * @param targetUrl - The URL to check\n * @param targets - Array of propagation targets\n * @returns True if trace context should be propagated, false otherwise\n *\n * @example\n * ```typescript\n * const targets = [\n * 'myproject.supabase.co', // Exact match\n * '*.supabase.co', // Wildcard domain\n * /.*\\.supabase\\.co$/, // Regex pattern\n * (url) => url.hostname === 'localhost' // Custom function\n * ]\n *\n * shouldPropagateToTarget('https://myproject.supabase.co/rest/v1/table', targets)\n * // true\n *\n * shouldPropagateToTarget('https://evil.com/api', targets)\n * // false\n * ```\n */\nexport function shouldPropagateToTarget(targetUrl, targets) {\n if (!targetUrl || !targets || targets.length === 0) {\n return false;\n }\n let url;\n if (targetUrl instanceof URL) {\n url = targetUrl;\n }\n else {\n try {\n url = new URL(targetUrl);\n }\n catch (error) {\n // Invalid URL\n return false;\n }\n }\n // Check each target\n for (const target of targets) {\n try {\n if (typeof target === 'string') {\n // String matcher: exact match or wildcard domain\n if (matchStringTarget(url.hostname, target)) {\n return true;\n }\n }\n else if (target instanceof RegExp) {\n // Regex matcher\n if (target.test(url.hostname)) {\n return true;\n }\n }\n else if (typeof target === 'function') {\n // Function matcher\n if (target(url)) {\n return true;\n }\n }\n }\n catch (error) {\n // Ignore errors from individual matchers and continue\n continue;\n }\n }\n return false;\n}\n/**\n * Match hostname against string target (exact match or wildcard)\n *\n * @param hostname - The hostname to check\n * @param target - The target pattern (exact or wildcard)\n * @returns True if hostname matches target\n */\nfunction matchStringTarget(hostname, target) {\n // Exact match\n if (target === hostname) {\n return true;\n }\n // Wildcard domain match (*.example.com)\n if (target.startsWith('*.')) {\n const domain = target.slice(2); // Remove \"*.\"\n // Check if hostname ends with the domain\n if (hostname.endsWith(domain)) {\n // Ensure it's either an exact match or has a subdomain\n // (prevents \"notexample.com\" from matching \"*.example.com\")\n if (hostname === domain || hostname.endsWith('.' + domain)) {\n return true;\n }\n }\n }\n return false;\n}\n//# sourceMappingURL=validate.js.map","/**\n * Generate default propagation targets based on the Supabase project URL.\n *\n * By default, trace context is only propagated to Supabase domains for\n * security. This prevents leaking trace context to potentially malicious\n * third-party services.\n *\n * Wildcard strings (e.g. `*.supabase.co`) are matched with linear string\n * operations rather than regex, avoiding ReDoS risk.\n *\n * @param supabaseUrl - The Supabase project URL\n * @returns Array of default propagation targets\n */\nexport function getDefaultPropagationTargets(supabaseUrl) {\n const targets = [];\n // Add exact project hostname\n try {\n const url = new URL(supabaseUrl);\n targets.push(url.hostname);\n }\n catch (error) {\n // Invalid URL, skip exact hostname\n }\n // Supabase cloud domains. Use wildcard strings (not regex) — these are\n // matched by linear hostname-suffix checks, so there is no ReDoS surface.\n targets.push('*.supabase.co', '*.supabase.in');\n // Localhost and loopback addresses for local development.\n targets.push('localhost', '127.0.0.1', '[::1]');\n return targets;\n}\n//# sourceMappingURL=defaults.js.map","import {\n parseTraceParent,\n shouldPropagateToTarget,\n getDefaultPropagationTargets,\n type TraceContext,\n type TracePropagationTarget,\n} from '@supabase/tracing'\nimport { getTraceContextExtractor } from './tracingRegistry'\nimport type { TracePropagationOptions } from './types'\n\ntype 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\n/**\n * New-format Supabase API keys (`sb_publishable_…` / `sb_secret_…`) are not JWTs and\n * must never be sent as a Bearer token — they belong only in the `apikey` header.\n * All other keys (legacy JWT keys, `sb_temp_…` temporary keys, unrecognized `sb_`\n * subtypes) keep the Bearer fallback.\n */\nconst isNewApiKey = (key: string): boolean =>\n key.startsWith('sb_publishable_') || key.startsWith('sb_secret_')\n\nconst TEMP_KEY_PREFIX = 'sb_temp_'\n\nconst warnedKeySubtypes = new Set<string>()\n\n/**\n * Warn (once per subtype) when an `sb_` key isn't a subtype this SDK version recognizes.\n * Never throws — the server, not the SDK, decides key validity. The key value is never\n * included in the message.\n */\nexport const checkApiKeyFormat = (key: string): void => {\n if (!key.startsWith('sb_') || isNewApiKey(key) || key.startsWith(TEMP_KEY_PREFIX)) {\n return\n }\n const subtype = key.match(/^sb_[a-zA-Z0-9]+_/)?.[0] ?? 'unknown'\n if (warnedKeySubtypes.has(subtype)) {\n return\n }\n warnedKeySubtypes.add(subtype)\n console.warn(\n '@supabase/supabase-js: Unrecognized Supabase API key format. The client will proceed ' +\n 'and send this key as-is; if you see authentication errors you may need to upgrade ' +\n '@supabase/supabase-js to a version that recognizes this key type.'\n )\n}\n\nexport const fetchWithAuth = (\n supabaseKey: string,\n supabaseUrl: string,\n getAccessToken: () => Promise<string | null>,\n customFetch?: Fetch,\n tracePropagationOptions?: TracePropagationOptions,\n options?: { omitApiKeyAsBearer?: boolean }\n): Fetch => {\n const fetch = resolveFetch(customFetch)\n const HeadersConstructor = resolveHeadersConstructor()\n\n // Pre-compute trace propagation state once. When disabled, the per-request\n // path skips all tracing work with a single truthy check.\n const traceEnabled = tracePropagationOptions?.enabled === true\n const respectSampling = tracePropagationOptions?.respectSamplingDecision !== false\n const traceTargets: TracePropagationTarget[] | null = traceEnabled\n ? getDefaultPropagationTargets(supabaseUrl)\n : null\n\n // Whether the API key may be used as the `Authorization` Bearer fallback when there is no\n // session token. Disabled for Edge Functions with a new-format key (see `isNewApiKey`).\n // Static per instance, so it is computed once here rather than on every request.\n const allowKeyAsBearer = !(options?.omitApiKeyAsBearer && isNewApiKey(supabaseKey))\n\n return async (input, init) => {\n const realToken = await getAccessToken()\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 const bearer = realToken ?? (allowKeyAsBearer ? supabaseKey : null)\n if (bearer) {\n headers.set('Authorization', `Bearer ${bearer}`)\n }\n }\n\n if (traceTargets) {\n const traceHeaders = getTraceHeaders(input, traceTargets, respectSampling)\n\n if (traceHeaders) {\n if (traceHeaders.traceparent && !headers.has('traceparent')) {\n headers.set('traceparent', traceHeaders.traceparent)\n }\n if (traceHeaders.tracestate && !headers.has('tracestate')) {\n headers.set('tracestate', traceHeaders.tracestate)\n }\n if (traceHeaders.baggage && !headers.has('baggage')) {\n headers.set('baggage', traceHeaders.baggage)\n }\n }\n }\n\n return fetch(input, { ...init, headers })\n }\n}\n\nlet warnedMissingTracingRuntime = false\nlet warnedNonW3CPropagator = false\n\n/**\n * For tests only. Resets the one-time missing-tracing-runtime warning.\n *\n * @internal\n */\nexport function _resetTracingRuntimeWarning(): void {\n warnedMissingTracingRuntime = false\n}\n\n/**\n * For tests only. Resets the one-time non-W3C-propagator warning.\n *\n * @internal\n */\nexport function _resetNonW3CPropagatorWarning(): void {\n warnedNonW3CPropagator = false\n}\n\nfunction getTraceHeaders(\n input: RequestInfo | URL,\n targets: TracePropagationTarget[],\n respectSampling: boolean\n): TraceContext | null {\n // Read the registry before the target check so the warning fires on the\n // first request with tracing enabled, not only on Supabase-target ones.\n // Reading per request (one globalThis property access) deliberately\n // supports late registration: with ESM evaluation order, `createClient`\n // can run in a module evaluated before the application entry point's\n // `import '@supabase/supabase-js/tracing'`.\n const extractTraceContext = getTraceContextExtractor()\n\n if (!extractTraceContext) {\n if (!warnedMissingTracingRuntime) {\n warnedMissingTracingRuntime = true\n console.warn(\n '@supabase/supabase-js: tracePropagation is enabled but the tracing runtime is not loaded, ' +\n \"so trace headers will not be attached. Add `import '@supabase/supabase-js/tracing'` at \" +\n 'your application entry point (requires the OpenTelemetry API package to be installed). ' +\n 'The CDN/UMD build does not support trace propagation.'\n )\n }\n return null\n }\n\n const targetUrl: string | URL =\n typeof input === 'string' ? input : input instanceof URL ? input : input.url\n\n if (!shouldPropagateToTarget(targetUrl, targets)) {\n return null\n }\n\n const traceContext = extractTraceContext()\n\n if (!traceContext || !traceContext.traceparent) {\n // An active propagator that writes vendor headers but no W3C\n // `traceparent` (e.g. Sentry without `propagateTraceparent: true`) is\n // otherwise indistinguishable from \"no active trace\" — warn once so the\n // user learns why no trace headers are attached. An empty carrier means\n // no active trace: normal, stay silent.\n if (traceContext?.carrierKeys?.length && !warnedNonW3CPropagator) {\n warnedNonW3CPropagator = true\n const sentryHint = traceContext.carrierKeys.includes('sentry-trace')\n ? ' Sentry detected: set `propagateTraceparent: true` in Sentry.init() to emit it.'\n : ' Configure your tracing SDK to emit W3C trace context on outgoing requests.'\n console.warn(\n '@supabase/supabase-js: tracePropagation is enabled and a tracing SDK is active, but its ' +\n `propagator wrote [${traceContext.carrierKeys.join(', ')}] and no W3C traceparent header, ` +\n 'so trace headers will not be attached.' +\n sentryHint\n )\n }\n return null\n }\n\n if (respectSampling) {\n const parsed = parseTraceParent(traceContext.traceparent)\n if (parsed && !parsed.isSampled) {\n // Unsampled traces still carry `traceparent` so Supabase logs get a\n // trace_id to correlate on; the flag stays `00`, so downstream tracing\n // never records it as sampled. `tracestate` and `baggage` (the\n // vendor/application data channels) are withheld on these requests.\n return { traceparent: traceContext.traceparent }\n }\n }\n\n return traceContext\n}\n","// helpers.ts\nimport { SupabaseClientOptions, TracePropagationOptions } from './types'\n\nfunction normalizeTracePropagation(\n value: TracePropagationOptions | boolean | undefined\n): TracePropagationOptions | undefined {\n return typeof value === 'boolean' ? { enabled: value } : value\n}\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 type ResolvedSupabaseClientOptions<SchemaName> = Omit<\n Required<SupabaseClientOptions<SchemaName>>,\n 'tracePropagation'\n> & {\n tracePropagation: TracePropagationOptions\n}\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): ResolvedSupabaseClientOptions<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 // Accept either a boolean shorthand or an options object on both sides.\n const tracePropagationOptions = normalizeTracePropagation(options.tracePropagation)\n const DEFAULT_TRACE_PROPAGATION_OPTIONS = normalizeTracePropagation(defaults.tracePropagation)\n\n const result: ResolvedSupabaseClientOptions<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 tracePropagation: {\n enabled:\n tracePropagationOptions?.enabled ?? DEFAULT_TRACE_PROPAGATION_OPTIONS?.enabled ?? false,\n respectSamplingDecision:\n tracePropagationOptions?.respectSamplingDecision ??\n DEFAULT_TRACE_PROPAGATION_OPTIONS?.respectSamplingDecision ??\n true,\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 type RealtimeRemoveChannelResponse,\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 DEFAULT_TRACE_PROPAGATION_OPTIONS,\n} from './lib/constants'\nimport { checkApiKeyFormat, fetchWithAuth } from './lib/fetch'\nimport {\n applySettingDefaults,\n validateSupabaseUrl,\n type ResolvedSupabaseClientOptions,\n} 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 & keyof Omit<Database, '__InternalSupabase'> =\n SchemaNameOrClientOptions extends string & 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 functionsFetch?: Fetch\n protected changedAccessToken?: string\n protected accessToken?: () => Promise<string | null>\n\n protected headers: Record<string, string>\n protected settings?: ResolvedSupabaseClientOptions<SchemaName>\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 Optional configuration for the client:\n * - `db.schema` — You can switch in between schemas. The schema needs to be on the list of exposed schemas inside Supabase.\n * - `auth.autoRefreshToken` — Set to `true` if you want to automatically refresh the token before expiring.\n * - `auth.persistSession` — Set to `true` if you want to automatically save the user session into local storage.\n * - `auth.detectSessionInUrl` — Set to `true` if you want to automatically detect OAuth grants in the URL and sign in the user.\n * - `realtime` — Options passed along to the realtime-js constructor.\n * - `storage` — Options passed along to the storage-js constructor.\n * - `global.fetch` — A custom fetch implementation.\n * - `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', 'your-publishable-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', 'your-publishable-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\", \"your-publishable-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', 'your-publishable-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 runtime's global `fetch` to make HTTP requests,\n * but an alternative `fetch` implementation can be provided as an option.\n * This is useful in environments where the global `fetch` is unavailable or where you want to customize request behavior.\n *\n * @example Custom fetch implementation\n * ```js\n * import { createClient } from '@supabase/supabase-js'\n *\n * const supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-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\", \"your-publishable-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\", \"your-publishable-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', 'your-publishable-key')\n *\n * const { data } = await supabase.from('profiles').select('*')\n * ```\n *\n * @exampleDescription With OpenTelemetry tracing\n * Opt in to W3C trace context propagation so the `trace_id` from your\n * client-side spans is attached to Supabase requests and appears in API\n * Gateway and Edge Function logs. Requires `@opentelemetry/api` to be\n * installed in your application and the tracing runtime to be loaded via\n * `import '@supabase/supabase-js/tracing'`. See [Tracing with the JS SDK](https://supabase.com/docs/guides/telemetry/client-side-tracing).\n *\n * @example With OpenTelemetry tracing\n * ```ts\n * import '@supabase/supabase-js/tracing'\n * import { createClient } from '@supabase/supabase-js'\n * import { trace } from '@opentelemetry/api'\n *\n * const supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key', {\n * tracePropagation: true,\n * })\n *\n * const tracer = trace.getTracer('my-app')\n *\n * await tracer.startActiveSpan('fetch-users', async (span) => {\n * // Outgoing request carries the active trace context.\n * const { data, error } = await supabase.from('users').select('*')\n * span.end()\n * })\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 checkApiKeyFormat(supabaseKey)\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 tracePropagation: DEFAULT_TRACE_PROPAGATION_OPTIONS,\n }\n\n const settings = applySettingDefaults(options ?? {}, DEFAULTS)\n this.settings = settings\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 // The fetch wrappers receive the raw session token (null when there is no session) and\n // decide the `Authorization` fallback themselves, so the API-key fallback lives in one place.\n this.fetch = fetchWithAuth(\n supabaseKey,\n supabaseUrl,\n this._getSessionToken.bind(this),\n settings.global.fetch,\n settings.tracePropagation\n )\n // Edge Functions use a dedicated fetch that never falls back to a new-format API key in\n // the Authorization header (see `isNewApiKey` in ./lib/fetch). Other services use `this.fetch`.\n this.functionsFetch = fetchWithAuth(\n supabaseKey,\n supabaseUrl,\n this._getSessionToken.bind(this),\n settings.global.fetch,\n settings.tracePropagation,\n { omitApiKeyAsBearer: true }\n )\n this.realtime = this._initRealtimeClient({\n headers: this.headers,\n accessToken: this._getAccessToken.bind(this),\n fetch: this.fetch,\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 retry: settings.db.retry,\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.functionsFetch,\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<Schema, FnName, 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 * @category Realtime\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 * @category Realtime\n *\n * @example Get all channels\n * ```js\n * const channels = supabase.getChannels()\n * ```\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 * @category Realtime\n *\n * @remarks\n * - Removing a channel is a great way to maintain the performance of your project's Realtime service as well as your database if you're listening to Postgres changes. Supabase will automatically handle cleanup 30 seconds after a client is disconnected, but unused channels may cause degradation as more clients are simultaneously subscribed.\n *\n * @example Removes a channel\n * ```js\n * supabase.removeChannel(myChannel)\n * ```\n */\n removeChannel(channel: RealtimeChannel): Promise<RealtimeRemoveChannelResponse> {\n return this.realtime.removeChannel(channel)\n }\n\n /**\n * Unsubscribes and removes all Realtime channels from Realtime client.\n *\n * @category Realtime\n *\n * @remarks\n * - Removing channels is a great way to maintain the performance of your project's Realtime service as well as your database if you're listening to Postgres changes. Supabase will automatically handle cleanup 30 seconds after a client is disconnected, but unused channels may cause degradation as more clients are simultaneously subscribed.\n *\n * @example Remove all channels\n * ```js\n * supabase.removeAllChannels()\n * ```\n */\n removeAllChannels(): Promise<RealtimeRemoveChannelResponse[]> {\n return this.realtime.removeAllChannels()\n }\n\n /**\n * The raw session token — the custom `accessToken` result or the signed-in user's JWT —\n * or `null` when there is no session. Unlike {@link _getAccessToken} it does not fall back\n * to `supabaseKey`, so callers can distinguish \"no session\" from \"has session\".\n */\n private async _getSessionToken(): Promise<string | null> {\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 ?? null\n }\n\n private async _getAccessToken() {\n return (await this._getSessionToken()) ?? 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 experimental,\n lockAcquireTimeout,\n skipAutoInitialize,\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 experimental,\n fetch,\n lockAcquireTimeout,\n skipAutoInitialize,\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' || event === 'INITIAL_SESSION') &&\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 PostgrestBuilder,\n PostgrestFilterBuilder,\n PostgrestTransformBuilder,\n PostgrestQueryBuilder,\n} from '@supabase/postgrest-js'\nexport { PostgrestError } from '@supabase/postgrest-js'\nexport { StorageApiError } from '@supabase/storage-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 TracePropagationOptions,\n QueryResult,\n QueryData,\n QueryError,\n DatabaseWithoutInternals,\n} from './lib/types'\n\n/**\n * Creates a new Supabase Client.\n *\n * @example Creating a Supabase client\n * ```ts\n * import { createClient } from '@supabase/supabase-js'\n *\n * const supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-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 & keyof Omit<Database, '__InternalSupabase'> =\n SchemaNameOrClientOptions extends string & 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 <= 20 deprecation\nfunction shouldShowDeprecationWarning(): boolean {\n // Skip in browser and Deno environments\n if (typeof window !== 'undefined' || (globalThis as any)['Deno'] !== 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 <= 20\n}\n\nif (shouldShowDeprecationWarning()) {\n console.warn(\n `⚠️ Node.js 20 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. ` +\n `Please upgrade to Node.js 22 or later. ` +\n `For more information, visit: https://github.com/orgs/supabase/discussions/45715`\n )\n}\n"],"mappings":";;;;;;;;AAMA,MAAa,UAAU;;;;ACDvB,IAAI,SAAS;AACb,IAAIA;AAEJ,IAAI,OAAO,SAAS,aAAa;;AAC/B,UAAS;AAET,uCAAqB,KAAK,uEAAS;WAC1B,OAAO,aAAa,YAC7B,UAAS;SACA,OAAO,cAAc,eAAe,UAAU,YAAY,cACnE,UAAS;KACJ;;AACL,UAAS;CACT,MAAM,WAAY,WAAmB;AACrC,sFAAqB,SAAW,gFAAY,QAAQ,MAAM,GAAG;;AAG/D,MAAM,eAAe,CAAC,WAAW,SAAS;AAC1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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"}
{"version":3,"file":"index.cjs","names":["JS_RUNTIME_VERSION: string | undefined","DEFAULT_AUTH_OPTIONS: SupabaseAuthClientOptions","DEFAULT_REALTIME_OPTIONS: RealtimeClientOptions","DEFAULT_TRACE_PROPAGATION_OPTIONS: TracePropagationOptions","version","fetch","traceTargets: TracePropagationTarget[] | null","getTraceContextExtractor","DEFAULT_DB_OPTIONS","DEFAULT_AUTH_OPTIONS","DEFAULT_REALTIME_OPTIONS","DEFAULT_GLOBAL_OPTIONS","DEFAULT_TRACE_PROPAGATION_OPTIONS","result: ResolvedSupabaseClientOptions<SchemaName>","AuthClient","supabaseUrl: string","supabaseKey: string","PostgrestClient","SupabaseStorageClient","FunctionsClient","this","RealtimeClient"],"sources":["../src/lib/version.ts","../src/lib/constants.ts","../../../shared/tracing/dist/module/parse.js","../../../shared/tracing/dist/module/validate.js","../../../shared/tracing/dist/module/defaults.js","../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.112.3'\n","// constants.ts\nimport { RealtimeClientOptions } from '@supabase/realtime-js'\nimport { SupabaseAuthClientOptions, TracePropagationOptions } from './types'\nimport { version } from './version'\n\nlet JS_ENV = ''\nlet JS_RUNTIME_VERSION: string | undefined\n// @ts-ignore\nif (typeof Deno !== 'undefined') {\n JS_ENV = 'deno'\n // @ts-ignore\n JS_RUNTIME_VERSION = Deno.version?.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 const _process = (globalThis as any)['process']\n JS_RUNTIME_VERSION = _process?.['version']?.replace(/^v/, '')\n}\n\nconst _runtimeMeta = [`runtime=${JS_ENV}`]\nif (JS_RUNTIME_VERSION) {\n _runtimeMeta.push(`runtime-version=${JS_RUNTIME_VERSION}`)\n}\n\nexport const DEFAULT_HEADERS = {\n 'X-Client-Info': `supabase-js/${version}; ${_runtimeMeta.join('; ')}`,\n}\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\nexport const DEFAULT_TRACE_PROPAGATION_OPTIONS: TracePropagationOptions = {\n enabled: false,\n respectSamplingDecision: true,\n}\n","/**\n * Parse W3C traceparent header according to the specification.\n *\n * The traceparent header format is: version-traceid-parentid-traceflags\n * - version: 2 hex digits (currently always \"00\")\n * - traceid: 32 hex digits (128-bit trace identifier)\n * - parentid: 16 hex digits (64-bit span/parent identifier)\n * - traceflags: 2 hex digits (8-bit flags, bit 0 is sampled flag)\n *\n * @param traceparent - The traceparent header value\n * @returns Parsed traceparent object, or null if invalid format\n *\n * @see https://www.w3.org/TR/trace-context/#traceparent-header\n *\n * @example\n * ```typescript\n * const parsed = parseTraceParent('00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01')\n *\n * console.log(parsed)\n * // {\n * // version: '00',\n * // traceId: '0af7651916cd43dd8448eb211c80319c',\n * // parentId: 'b7ad6b7169203331',\n * // traceFlags: '01',\n * // isSampled: true\n * // }\n * ```\n */\nexport function parseTraceParent(traceparent) {\n if (!traceparent || typeof traceparent !== 'string') {\n return null;\n }\n // Split by hyphen\n const parts = traceparent.split('-');\n // Must have exactly 4 parts\n if (parts.length !== 4) {\n return null;\n }\n const [version, traceId, parentId, traceFlags] = parts;\n // Validate field lengths according to W3C spec\n if (version.length !== 2 ||\n traceId.length !== 32 ||\n parentId.length !== 16 ||\n traceFlags.length !== 2) {\n return null;\n }\n // Validate that all fields are valid hexadecimal\n const hexRegex = /^[0-9a-f]+$/i;\n if (!hexRegex.test(version) ||\n !hexRegex.test(traceId) ||\n !hexRegex.test(parentId) ||\n !hexRegex.test(traceFlags)) {\n return null;\n }\n // Validate that trace-id and parent-id are not all zeros (invalid per spec)\n if (traceId === '00000000000000000000000000000000' || parentId === '0000000000000000') {\n return null;\n }\n // Parse sampling decision from trace-flags (bit 0)\n const flags = parseInt(traceFlags, 16);\n const isSampled = (flags & 0x01) === 0x01;\n return {\n version,\n traceId,\n parentId,\n traceFlags,\n isSampled,\n };\n}\n//# sourceMappingURL=parse.js.map","/**\n * Check if trace context should be propagated to the target URL.\n *\n * This function checks if the target URL matches any of the configured\n * propagation targets. Targets can be:\n * - String: Exact hostname match or wildcard domain (*.example.com)\n * - RegExp: Pattern matching hostname\n * - Function: Custom logic to determine if URL should receive trace context\n *\n * @param targetUrl - The URL to check\n * @param targets - Array of propagation targets\n * @returns True if trace context should be propagated, false otherwise\n *\n * @example\n * ```typescript\n * const targets = [\n * 'myproject.supabase.co', // Exact match\n * '*.supabase.co', // Wildcard domain\n * /.*\\.supabase\\.co$/, // Regex pattern\n * (url) => url.hostname === 'localhost' // Custom function\n * ]\n *\n * shouldPropagateToTarget('https://myproject.supabase.co/rest/v1/table', targets)\n * // true\n *\n * shouldPropagateToTarget('https://evil.com/api', targets)\n * // false\n * ```\n */\nexport function shouldPropagateToTarget(targetUrl, targets) {\n if (!targetUrl || !targets || targets.length === 0) {\n return false;\n }\n let url;\n if (targetUrl instanceof URL) {\n url = targetUrl;\n }\n else {\n try {\n url = new URL(targetUrl);\n }\n catch (error) {\n // Invalid URL\n return false;\n }\n }\n // Check each target\n for (const target of targets) {\n try {\n if (typeof target === 'string') {\n // String matcher: exact match or wildcard domain\n if (matchStringTarget(url.hostname, target)) {\n return true;\n }\n }\n else if (target instanceof RegExp) {\n // Regex matcher\n if (target.test(url.hostname)) {\n return true;\n }\n }\n else if (typeof target === 'function') {\n // Function matcher\n if (target(url)) {\n return true;\n }\n }\n }\n catch (error) {\n // Ignore errors from individual matchers and continue\n continue;\n }\n }\n return false;\n}\n/**\n * Match hostname against string target (exact match or wildcard)\n *\n * @param hostname - The hostname to check\n * @param target - The target pattern (exact or wildcard)\n * @returns True if hostname matches target\n */\nfunction matchStringTarget(hostname, target) {\n // Exact match\n if (target === hostname) {\n return true;\n }\n // Wildcard domain match (*.example.com)\n if (target.startsWith('*.')) {\n const domain = target.slice(2); // Remove \"*.\"\n // Check if hostname ends with the domain\n if (hostname.endsWith(domain)) {\n // Ensure it's either an exact match or has a subdomain\n // (prevents \"notexample.com\" from matching \"*.example.com\")\n if (hostname === domain || hostname.endsWith('.' + domain)) {\n return true;\n }\n }\n }\n return false;\n}\n//# sourceMappingURL=validate.js.map","/**\n * Generate default propagation targets based on the Supabase project URL.\n *\n * By default, trace context is only propagated to Supabase domains for\n * security. This prevents leaking trace context to potentially malicious\n * third-party services.\n *\n * Wildcard strings (e.g. `*.supabase.co`) are matched with linear string\n * operations rather than regex, avoiding ReDoS risk.\n *\n * @param supabaseUrl - The Supabase project URL\n * @returns Array of default propagation targets\n */\nexport function getDefaultPropagationTargets(supabaseUrl) {\n const targets = [];\n // Add exact project hostname\n try {\n const url = new URL(supabaseUrl);\n targets.push(url.hostname);\n }\n catch (error) {\n // Invalid URL, skip exact hostname\n }\n // Supabase cloud domains. Use wildcard strings (not regex) — these are\n // matched by linear hostname-suffix checks, so there is no ReDoS surface.\n targets.push('*.supabase.co', '*.supabase.in');\n // Localhost and loopback addresses for local development.\n targets.push('localhost', '127.0.0.1', '[::1]');\n return targets;\n}\n//# sourceMappingURL=defaults.js.map","import {\n parseTraceParent,\n shouldPropagateToTarget,\n getDefaultPropagationTargets,\n type TraceContext,\n type TracePropagationTarget,\n} from '@supabase/tracing'\nimport { getTraceContextExtractor } from './tracingRegistry'\nimport type { TracePropagationOptions } from './types'\n\ntype 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\n/**\n * New-format Supabase API keys (`sb_publishable_…` / `sb_secret_…`) are not JWTs and\n * must never be sent as a Bearer token — they belong only in the `apikey` header.\n * All other keys (legacy JWT keys, `sb_temp_…` temporary keys, unrecognized `sb_`\n * subtypes) keep the Bearer fallback.\n */\nconst isNewApiKey = (key: string): boolean =>\n key.startsWith('sb_publishable_') || key.startsWith('sb_secret_')\n\nconst TEMP_KEY_PREFIX = 'sb_temp_'\n\nconst warnedKeySubtypes = new Set<string>()\n\n/**\n * Warn (once per subtype) when an `sb_` key isn't a subtype this SDK version recognizes.\n * Never throws — the server, not the SDK, decides key validity. The key value is never\n * included in the message.\n */\nexport const checkApiKeyFormat = (key: string): void => {\n if (!key.startsWith('sb_') || isNewApiKey(key) || key.startsWith(TEMP_KEY_PREFIX)) {\n return\n }\n const subtype = key.match(/^sb_[a-zA-Z0-9]+_/)?.[0] ?? 'unknown'\n if (warnedKeySubtypes.has(subtype)) {\n return\n }\n warnedKeySubtypes.add(subtype)\n console.warn(\n '@supabase/supabase-js: Unrecognized Supabase API key format. The client will proceed ' +\n 'and send this key as-is; if you see authentication errors you may need to upgrade ' +\n '@supabase/supabase-js to a version that recognizes this key type.'\n )\n}\n\nexport const fetchWithAuth = (\n supabaseKey: string,\n supabaseUrl: string,\n getAccessToken: () => Promise<string | null>,\n customFetch?: Fetch,\n tracePropagationOptions?: TracePropagationOptions,\n options?: { omitApiKeyAsBearer?: boolean }\n): Fetch => {\n const fetch = resolveFetch(customFetch)\n const HeadersConstructor = resolveHeadersConstructor()\n\n // Pre-compute trace propagation state once. When disabled, the per-request\n // path skips all tracing work with a single truthy check.\n const traceEnabled = tracePropagationOptions?.enabled === true\n const respectSampling = tracePropagationOptions?.respectSamplingDecision !== false\n const traceTargets: TracePropagationTarget[] | null = traceEnabled\n ? getDefaultPropagationTargets(supabaseUrl)\n : null\n\n // Whether the API key may be used as the `Authorization` Bearer fallback when there is no\n // session token. Disabled for Edge Functions with a new-format key (see `isNewApiKey`).\n // Static per instance, so it is computed once here rather than on every request.\n const allowKeyAsBearer = !(options?.omitApiKeyAsBearer && isNewApiKey(supabaseKey))\n\n return async (input, init) => {\n const realToken = await getAccessToken()\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 const bearer = realToken ?? (allowKeyAsBearer ? supabaseKey : null)\n if (bearer) {\n headers.set('Authorization', `Bearer ${bearer}`)\n }\n }\n\n if (traceTargets) {\n const traceHeaders = getTraceHeaders(input, traceTargets, respectSampling)\n\n if (traceHeaders) {\n if (traceHeaders.traceparent && !headers.has('traceparent')) {\n headers.set('traceparent', traceHeaders.traceparent)\n }\n if (traceHeaders.tracestate && !headers.has('tracestate')) {\n headers.set('tracestate', traceHeaders.tracestate)\n }\n if (traceHeaders.baggage && !headers.has('baggage')) {\n headers.set('baggage', traceHeaders.baggage)\n }\n }\n }\n\n return fetch(input, { ...init, headers })\n }\n}\n\nlet warnedMissingTracingRuntime = false\nlet warnedNonW3CPropagator = false\n\n/**\n * For tests only. Resets the one-time missing-tracing-runtime warning.\n *\n * @internal\n */\nexport function _resetTracingRuntimeWarning(): void {\n warnedMissingTracingRuntime = false\n}\n\n/**\n * For tests only. Resets the one-time non-W3C-propagator warning.\n *\n * @internal\n */\nexport function _resetNonW3CPropagatorWarning(): void {\n warnedNonW3CPropagator = false\n}\n\nfunction getTraceHeaders(\n input: RequestInfo | URL,\n targets: TracePropagationTarget[],\n respectSampling: boolean\n): TraceContext | null {\n // Read the registry before the target check so the warning fires on the\n // first request with tracing enabled, not only on Supabase-target ones.\n // Reading per request (one globalThis property access) deliberately\n // supports late registration: with ESM evaluation order, `createClient`\n // can run in a module evaluated before the application entry point's\n // `import '@supabase/supabase-js/tracing'`.\n const extractTraceContext = getTraceContextExtractor()\n\n if (!extractTraceContext) {\n if (!warnedMissingTracingRuntime) {\n warnedMissingTracingRuntime = true\n console.warn(\n '@supabase/supabase-js: tracePropagation is enabled but the tracing runtime is not loaded, ' +\n \"so trace headers will not be attached. Add `import '@supabase/supabase-js/tracing'` at \" +\n 'your application entry point (requires the OpenTelemetry API package to be installed). ' +\n 'The CDN/UMD build does not support trace propagation.'\n )\n }\n return null\n }\n\n const targetUrl: string | URL =\n typeof input === 'string' ? input : input instanceof URL ? input : input.url\n\n if (!shouldPropagateToTarget(targetUrl, targets)) {\n return null\n }\n\n const traceContext = extractTraceContext()\n\n if (!traceContext || !traceContext.traceparent) {\n // An active propagator that writes vendor headers but no W3C\n // `traceparent` (e.g. Sentry without `propagateTraceparent: true`) is\n // otherwise indistinguishable from \"no active trace\" — warn once so the\n // user learns why no trace headers are attached. An empty carrier means\n // no active trace: normal, stay silent.\n if (traceContext?.carrierKeys?.length && !warnedNonW3CPropagator) {\n warnedNonW3CPropagator = true\n const sentryHint = traceContext.carrierKeys.includes('sentry-trace')\n ? ' Sentry detected: set `propagateTraceparent: true` in Sentry.init() to emit it.'\n : ' Configure your tracing SDK to emit W3C trace context on outgoing requests.'\n console.warn(\n '@supabase/supabase-js: tracePropagation is enabled and a tracing SDK is active, but its ' +\n `propagator wrote [${traceContext.carrierKeys.join(', ')}] and no W3C traceparent header, ` +\n 'so trace headers will not be attached.' +\n sentryHint\n )\n }\n return null\n }\n\n if (respectSampling) {\n const parsed = parseTraceParent(traceContext.traceparent)\n if (parsed && !parsed.isSampled) {\n // Unsampled traces still carry `traceparent` so Supabase logs get a\n // trace_id to correlate on; the flag stays `00`, so downstream tracing\n // never records it as sampled. `tracestate` and `baggage` (the\n // vendor/application data channels) are withheld on these requests.\n return { traceparent: traceContext.traceparent }\n }\n }\n\n return traceContext\n}\n","// helpers.ts\nimport { SupabaseClientOptions, TracePropagationOptions } from './types'\n\nfunction normalizeTracePropagation(\n value: TracePropagationOptions | boolean | undefined\n): TracePropagationOptions | undefined {\n return typeof value === 'boolean' ? { enabled: value } : value\n}\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 type ResolvedSupabaseClientOptions<SchemaName> = Omit<\n Required<SupabaseClientOptions<SchemaName>>,\n 'tracePropagation'\n> & {\n tracePropagation: TracePropagationOptions\n}\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): ResolvedSupabaseClientOptions<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 // Accept either a boolean shorthand or an options object on both sides.\n const tracePropagationOptions = normalizeTracePropagation(options.tracePropagation)\n const DEFAULT_TRACE_PROPAGATION_OPTIONS = normalizeTracePropagation(defaults.tracePropagation)\n\n const result: ResolvedSupabaseClientOptions<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 tracePropagation: {\n enabled:\n tracePropagationOptions?.enabled ?? DEFAULT_TRACE_PROPAGATION_OPTIONS?.enabled ?? false,\n respectSamplingDecision:\n tracePropagationOptions?.respectSamplingDecision ??\n DEFAULT_TRACE_PROPAGATION_OPTIONS?.respectSamplingDecision ??\n true,\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 type RealtimeRemoveChannelResponse,\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 DEFAULT_TRACE_PROPAGATION_OPTIONS,\n} from './lib/constants'\nimport { checkApiKeyFormat, fetchWithAuth } from './lib/fetch'\nimport {\n applySettingDefaults,\n validateSupabaseUrl,\n type ResolvedSupabaseClientOptions,\n} 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 & keyof Omit<Database, '__InternalSupabase'> =\n SchemaNameOrClientOptions extends string & 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 functionsFetch?: Fetch\n protected changedAccessToken?: string\n protected accessToken?: () => Promise<string | null>\n\n protected headers: Record<string, string>\n protected settings?: ResolvedSupabaseClientOptions<SchemaName>\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 Optional configuration for the client:\n * - `db.schema` — You can switch in between schemas. The schema needs to be on the list of exposed schemas inside Supabase.\n * - `auth.autoRefreshToken` — Set to `true` if you want to automatically refresh the token before expiring.\n * - `auth.persistSession` — Set to `true` if you want to automatically save the user session into local storage.\n * - `auth.detectSessionInUrl` — Set to `true` if you want to automatically detect OAuth grants in the URL and sign in the user.\n * - `realtime` — Options passed along to the realtime-js constructor.\n * - `storage` — Options passed along to the storage-js constructor.\n * - `global.fetch` — A custom fetch implementation.\n * - `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', 'your-publishable-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', 'your-publishable-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\", \"your-publishable-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', 'your-publishable-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 runtime's global `fetch` to make HTTP requests,\n * but an alternative `fetch` implementation can be provided as an option.\n * This is useful in environments where the global `fetch` is unavailable or where you want to customize request behavior.\n *\n * @example Custom fetch implementation\n * ```js\n * import { createClient } from '@supabase/supabase-js'\n *\n * const supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-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\", \"your-publishable-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\", \"your-publishable-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', 'your-publishable-key')\n *\n * const { data } = await supabase.from('profiles').select('*')\n * ```\n *\n * @exampleDescription With OpenTelemetry tracing\n * Opt in to W3C trace context propagation so the `trace_id` from your\n * client-side spans is attached to Supabase requests and appears in API\n * Gateway and Edge Function logs. Requires `@opentelemetry/api` to be\n * installed in your application and the tracing runtime to be loaded via\n * `import '@supabase/supabase-js/tracing'`. See [Tracing with the JS SDK](https://supabase.com/docs/guides/telemetry/client-side-tracing).\n *\n * @example With OpenTelemetry tracing\n * ```ts\n * import '@supabase/supabase-js/tracing'\n * import { createClient } from '@supabase/supabase-js'\n * import { trace } from '@opentelemetry/api'\n *\n * const supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key', {\n * tracePropagation: true,\n * })\n *\n * const tracer = trace.getTracer('my-app')\n *\n * await tracer.startActiveSpan('fetch-users', async (span) => {\n * // Outgoing request carries the active trace context.\n * const { data, error } = await supabase.from('users').select('*')\n * span.end()\n * })\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 checkApiKeyFormat(supabaseKey)\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 tracePropagation: DEFAULT_TRACE_PROPAGATION_OPTIONS,\n }\n\n const settings = applySettingDefaults(options ?? {}, DEFAULTS)\n this.settings = settings\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 // The fetch wrappers receive the raw session token (null when there is no session) and\n // decide the `Authorization` fallback themselves, so the API-key fallback lives in one place.\n this.fetch = fetchWithAuth(\n supabaseKey,\n supabaseUrl,\n this._getSessionToken.bind(this),\n settings.global.fetch,\n settings.tracePropagation\n )\n // Edge Functions use a dedicated fetch that never falls back to a new-format API key in\n // the Authorization header (see `isNewApiKey` in ./lib/fetch). Other services use `this.fetch`.\n this.functionsFetch = fetchWithAuth(\n supabaseKey,\n supabaseUrl,\n this._getSessionToken.bind(this),\n settings.global.fetch,\n settings.tracePropagation,\n { omitApiKeyAsBearer: true }\n )\n this.realtime = this._initRealtimeClient({\n headers: this.headers,\n accessToken: this._getAccessToken.bind(this),\n fetch: this.fetch,\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 retry: settings.db.retry,\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.functionsFetch,\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<Schema, FnName, 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 * @category Realtime\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 * @category Realtime\n *\n * @example Get all channels\n * ```js\n * const channels = supabase.getChannels()\n * ```\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 * @category Realtime\n *\n * @remarks\n * - Removing a channel is a great way to maintain the performance of your project's Realtime service as well as your database if you're listening to Postgres changes. Supabase will automatically handle cleanup 30 seconds after a client is disconnected, but unused channels may cause degradation as more clients are simultaneously subscribed.\n *\n * @example Removes a channel\n * ```js\n * supabase.removeChannel(myChannel)\n * ```\n */\n removeChannel(channel: RealtimeChannel): Promise<RealtimeRemoveChannelResponse> {\n return this.realtime.removeChannel(channel)\n }\n\n /**\n * Unsubscribes and removes all Realtime channels from Realtime client.\n *\n * @category Realtime\n *\n * @remarks\n * - Removing channels is a great way to maintain the performance of your project's Realtime service as well as your database if you're listening to Postgres changes. Supabase will automatically handle cleanup 30 seconds after a client is disconnected, but unused channels may cause degradation as more clients are simultaneously subscribed.\n *\n * @example Remove all channels\n * ```js\n * supabase.removeAllChannels()\n * ```\n */\n removeAllChannels(): Promise<RealtimeRemoveChannelResponse[]> {\n return this.realtime.removeAllChannels()\n }\n\n /**\n * The raw session token — the custom `accessToken` result or the signed-in user's JWT —\n * or `null` when there is no session. Unlike {@link _getAccessToken} it does not fall back\n * to `supabaseKey`, so callers can distinguish \"no session\" from \"has session\".\n */\n private async _getSessionToken(): Promise<string | null> {\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 ?? null\n }\n\n private async _getAccessToken() {\n return (await this._getSessionToken()) ?? 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 experimental,\n lockAcquireTimeout,\n skipAutoInitialize,\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 experimental,\n fetch,\n lockAcquireTimeout,\n skipAutoInitialize,\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' || event === 'INITIAL_SESSION') &&\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 PostgrestBuilder,\n PostgrestFilterBuilder,\n PostgrestTransformBuilder,\n PostgrestQueryBuilder,\n} from '@supabase/postgrest-js'\nexport { PostgrestError } from '@supabase/postgrest-js'\nexport { StorageApiError } from '@supabase/storage-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 TracePropagationOptions,\n QueryResult,\n QueryData,\n QueryError,\n DatabaseWithoutInternals,\n} from './lib/types'\n\n/**\n * Creates a new Supabase Client.\n *\n * @example Creating a Supabase client\n * ```ts\n * import { createClient } from '@supabase/supabase-js'\n *\n * const supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-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 & keyof Omit<Database, '__InternalSupabase'> =\n SchemaNameOrClientOptions extends string & 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 <= 20 deprecation\nfunction shouldShowDeprecationWarning(): boolean {\n // Skip in browser and Deno environments\n if (typeof window !== 'undefined' || (globalThis as any)['Deno'] !== 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 <= 20\n}\n\nif (shouldShowDeprecationWarning()) {\n console.warn(\n `⚠️ Node.js 20 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. ` +\n `Please upgrade to Node.js 22 or later. ` +\n `For more information, visit: https://github.com/orgs/supabase/discussions/45715`\n )\n}\n"],"mappings":";;;;;;;;AAMA,MAAa,UAAU;;;;ACDvB,IAAI,SAAS;AACb,IAAIA;AAEJ,IAAI,OAAO,SAAS,aAAa;;AAC/B,UAAS;AAET,uCAAqB,KAAK,uEAAS;WAC1B,OAAO,aAAa,YAC7B,UAAS;SACA,OAAO,cAAc,eAAe,UAAU,YAAY,cACnE,UAAS;KACJ;;AACL,UAAS;CACT,MAAM,WAAY,WAAmB;AACrC,sFAAqB,SAAW,gFAAY,QAAQ,MAAM,GAAG;;AAG/D,MAAM,eAAe,CAAC,WAAW,SAAS;AAC1C,IAAI,mBACF,cAAa,KAAK,mBAAmB,qBAAqB;AAG5D,MAAa,kBAAkB,EAC7B,iBAAiB,eAAe,QAAQ,IAAI,aAAa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AAY;AACtD,KAAI,CAAC,aACH,QAAO;AAIT,QADqB,SAAS,aAAa,IAAI,GAAG,IAC3B;;AAGzB,IAAI,8BAA8B,CAChC,SAAQ,KACN,8OAGD"}

@@ -13,3 +13,3 @@ import { t as getTraceContextExtractor } from "./tracingRegistry.mjs";

//#region src/lib/version.ts
const version = "2.112.3-canary.0";
const version = "2.112.3";

@@ -16,0 +16,0 @@ //#endregion

@@ -1,1 +0,1 @@

{"version":3,"file":"index.mjs","names":["JS_RUNTIME_VERSION: string | undefined","DEFAULT_AUTH_OPTIONS: SupabaseAuthClientOptions","DEFAULT_REALTIME_OPTIONS: RealtimeClientOptions","DEFAULT_TRACE_PROPAGATION_OPTIONS: TracePropagationOptions","version","fetch","traceTargets: TracePropagationTarget[] | null","DEFAULT_DB_OPTIONS","DEFAULT_AUTH_OPTIONS","DEFAULT_REALTIME_OPTIONS","DEFAULT_GLOBAL_OPTIONS","DEFAULT_TRACE_PROPAGATION_OPTIONS","result: ResolvedSupabaseClientOptions<SchemaName>","supabaseUrl: string","supabaseKey: string","SupabaseStorageClient","this"],"sources":["../src/lib/version.ts","../src/lib/constants.ts","../../../shared/tracing/dist/module/parse.js","../../../shared/tracing/dist/module/validate.js","../../../shared/tracing/dist/module/defaults.js","../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.112.3-canary.0'\n","// constants.ts\nimport { RealtimeClientOptions } from '@supabase/realtime-js'\nimport { SupabaseAuthClientOptions, TracePropagationOptions } from './types'\nimport { version } from './version'\n\nlet JS_ENV = ''\nlet JS_RUNTIME_VERSION: string | undefined\n// @ts-ignore\nif (typeof Deno !== 'undefined') {\n JS_ENV = 'deno'\n // @ts-ignore\n JS_RUNTIME_VERSION = Deno.version?.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 const _process = (globalThis as any)['process']\n JS_RUNTIME_VERSION = _process?.['version']?.replace(/^v/, '')\n}\n\nconst _runtimeMeta = [`runtime=${JS_ENV}`]\nif (JS_RUNTIME_VERSION) {\n _runtimeMeta.push(`runtime-version=${JS_RUNTIME_VERSION}`)\n}\n\nexport const DEFAULT_HEADERS = {\n 'X-Client-Info': `supabase-js/${version}; ${_runtimeMeta.join('; ')}`,\n}\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\nexport const DEFAULT_TRACE_PROPAGATION_OPTIONS: TracePropagationOptions = {\n enabled: false,\n respectSamplingDecision: true,\n}\n","/**\n * Parse W3C traceparent header according to the specification.\n *\n * The traceparent header format is: version-traceid-parentid-traceflags\n * - version: 2 hex digits (currently always \"00\")\n * - traceid: 32 hex digits (128-bit trace identifier)\n * - parentid: 16 hex digits (64-bit span/parent identifier)\n * - traceflags: 2 hex digits (8-bit flags, bit 0 is sampled flag)\n *\n * @param traceparent - The traceparent header value\n * @returns Parsed traceparent object, or null if invalid format\n *\n * @see https://www.w3.org/TR/trace-context/#traceparent-header\n *\n * @example\n * ```typescript\n * const parsed = parseTraceParent('00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01')\n *\n * console.log(parsed)\n * // {\n * // version: '00',\n * // traceId: '0af7651916cd43dd8448eb211c80319c',\n * // parentId: 'b7ad6b7169203331',\n * // traceFlags: '01',\n * // isSampled: true\n * // }\n * ```\n */\nexport function parseTraceParent(traceparent) {\n if (!traceparent || typeof traceparent !== 'string') {\n return null;\n }\n // Split by hyphen\n const parts = traceparent.split('-');\n // Must have exactly 4 parts\n if (parts.length !== 4) {\n return null;\n }\n const [version, traceId, parentId, traceFlags] = parts;\n // Validate field lengths according to W3C spec\n if (version.length !== 2 ||\n traceId.length !== 32 ||\n parentId.length !== 16 ||\n traceFlags.length !== 2) {\n return null;\n }\n // Validate that all fields are valid hexadecimal\n const hexRegex = /^[0-9a-f]+$/i;\n if (!hexRegex.test(version) ||\n !hexRegex.test(traceId) ||\n !hexRegex.test(parentId) ||\n !hexRegex.test(traceFlags)) {\n return null;\n }\n // Validate that trace-id and parent-id are not all zeros (invalid per spec)\n if (traceId === '00000000000000000000000000000000' || parentId === '0000000000000000') {\n return null;\n }\n // Parse sampling decision from trace-flags (bit 0)\n const flags = parseInt(traceFlags, 16);\n const isSampled = (flags & 0x01) === 0x01;\n return {\n version,\n traceId,\n parentId,\n traceFlags,\n isSampled,\n };\n}\n//# sourceMappingURL=parse.js.map","/**\n * Check if trace context should be propagated to the target URL.\n *\n * This function checks if the target URL matches any of the configured\n * propagation targets. Targets can be:\n * - String: Exact hostname match or wildcard domain (*.example.com)\n * - RegExp: Pattern matching hostname\n * - Function: Custom logic to determine if URL should receive trace context\n *\n * @param targetUrl - The URL to check\n * @param targets - Array of propagation targets\n * @returns True if trace context should be propagated, false otherwise\n *\n * @example\n * ```typescript\n * const targets = [\n * 'myproject.supabase.co', // Exact match\n * '*.supabase.co', // Wildcard domain\n * /.*\\.supabase\\.co$/, // Regex pattern\n * (url) => url.hostname === 'localhost' // Custom function\n * ]\n *\n * shouldPropagateToTarget('https://myproject.supabase.co/rest/v1/table', targets)\n * // true\n *\n * shouldPropagateToTarget('https://evil.com/api', targets)\n * // false\n * ```\n */\nexport function shouldPropagateToTarget(targetUrl, targets) {\n if (!targetUrl || !targets || targets.length === 0) {\n return false;\n }\n let url;\n if (targetUrl instanceof URL) {\n url = targetUrl;\n }\n else {\n try {\n url = new URL(targetUrl);\n }\n catch (error) {\n // Invalid URL\n return false;\n }\n }\n // Check each target\n for (const target of targets) {\n try {\n if (typeof target === 'string') {\n // String matcher: exact match or wildcard domain\n if (matchStringTarget(url.hostname, target)) {\n return true;\n }\n }\n else if (target instanceof RegExp) {\n // Regex matcher\n if (target.test(url.hostname)) {\n return true;\n }\n }\n else if (typeof target === 'function') {\n // Function matcher\n if (target(url)) {\n return true;\n }\n }\n }\n catch (error) {\n // Ignore errors from individual matchers and continue\n continue;\n }\n }\n return false;\n}\n/**\n * Match hostname against string target (exact match or wildcard)\n *\n * @param hostname - The hostname to check\n * @param target - The target pattern (exact or wildcard)\n * @returns True if hostname matches target\n */\nfunction matchStringTarget(hostname, target) {\n // Exact match\n if (target === hostname) {\n return true;\n }\n // Wildcard domain match (*.example.com)\n if (target.startsWith('*.')) {\n const domain = target.slice(2); // Remove \"*.\"\n // Check if hostname ends with the domain\n if (hostname.endsWith(domain)) {\n // Ensure it's either an exact match or has a subdomain\n // (prevents \"notexample.com\" from matching \"*.example.com\")\n if (hostname === domain || hostname.endsWith('.' + domain)) {\n return true;\n }\n }\n }\n return false;\n}\n//# sourceMappingURL=validate.js.map","/**\n * Generate default propagation targets based on the Supabase project URL.\n *\n * By default, trace context is only propagated to Supabase domains for\n * security. This prevents leaking trace context to potentially malicious\n * third-party services.\n *\n * Wildcard strings (e.g. `*.supabase.co`) are matched with linear string\n * operations rather than regex, avoiding ReDoS risk.\n *\n * @param supabaseUrl - The Supabase project URL\n * @returns Array of default propagation targets\n */\nexport function getDefaultPropagationTargets(supabaseUrl) {\n const targets = [];\n // Add exact project hostname\n try {\n const url = new URL(supabaseUrl);\n targets.push(url.hostname);\n }\n catch (error) {\n // Invalid URL, skip exact hostname\n }\n // Supabase cloud domains. Use wildcard strings (not regex) — these are\n // matched by linear hostname-suffix checks, so there is no ReDoS surface.\n targets.push('*.supabase.co', '*.supabase.in');\n // Localhost and loopback addresses for local development.\n targets.push('localhost', '127.0.0.1', '[::1]');\n return targets;\n}\n//# sourceMappingURL=defaults.js.map","import {\n parseTraceParent,\n shouldPropagateToTarget,\n getDefaultPropagationTargets,\n type TraceContext,\n type TracePropagationTarget,\n} from '@supabase/tracing'\nimport { getTraceContextExtractor } from './tracingRegistry'\nimport type { TracePropagationOptions } from './types'\n\ntype 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\n/**\n * New-format Supabase API keys (`sb_publishable_…` / `sb_secret_…`) are not JWTs and\n * must never be sent as a Bearer token — they belong only in the `apikey` header.\n * All other keys (legacy JWT keys, `sb_temp_…` temporary keys, unrecognized `sb_`\n * subtypes) keep the Bearer fallback.\n */\nconst isNewApiKey = (key: string): boolean =>\n key.startsWith('sb_publishable_') || key.startsWith('sb_secret_')\n\nconst TEMP_KEY_PREFIX = 'sb_temp_'\n\nconst warnedKeySubtypes = new Set<string>()\n\n/**\n * Warn (once per subtype) when an `sb_` key isn't a subtype this SDK version recognizes.\n * Never throws — the server, not the SDK, decides key validity. The key value is never\n * included in the message.\n */\nexport const checkApiKeyFormat = (key: string): void => {\n if (!key.startsWith('sb_') || isNewApiKey(key) || key.startsWith(TEMP_KEY_PREFIX)) {\n return\n }\n const subtype = key.match(/^sb_[a-zA-Z0-9]+_/)?.[0] ?? 'unknown'\n if (warnedKeySubtypes.has(subtype)) {\n return\n }\n warnedKeySubtypes.add(subtype)\n console.warn(\n '@supabase/supabase-js: Unrecognized Supabase API key format. The client will proceed ' +\n 'and send this key as-is; if you see authentication errors you may need to upgrade ' +\n '@supabase/supabase-js to a version that recognizes this key type.'\n )\n}\n\nexport const fetchWithAuth = (\n supabaseKey: string,\n supabaseUrl: string,\n getAccessToken: () => Promise<string | null>,\n customFetch?: Fetch,\n tracePropagationOptions?: TracePropagationOptions,\n options?: { omitApiKeyAsBearer?: boolean }\n): Fetch => {\n const fetch = resolveFetch(customFetch)\n const HeadersConstructor = resolveHeadersConstructor()\n\n // Pre-compute trace propagation state once. When disabled, the per-request\n // path skips all tracing work with a single truthy check.\n const traceEnabled = tracePropagationOptions?.enabled === true\n const respectSampling = tracePropagationOptions?.respectSamplingDecision !== false\n const traceTargets: TracePropagationTarget[] | null = traceEnabled\n ? getDefaultPropagationTargets(supabaseUrl)\n : null\n\n // Whether the API key may be used as the `Authorization` Bearer fallback when there is no\n // session token. Disabled for Edge Functions with a new-format key (see `isNewApiKey`).\n // Static per instance, so it is computed once here rather than on every request.\n const allowKeyAsBearer = !(options?.omitApiKeyAsBearer && isNewApiKey(supabaseKey))\n\n return async (input, init) => {\n const realToken = await getAccessToken()\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 const bearer = realToken ?? (allowKeyAsBearer ? supabaseKey : null)\n if (bearer) {\n headers.set('Authorization', `Bearer ${bearer}`)\n }\n }\n\n if (traceTargets) {\n const traceHeaders = getTraceHeaders(input, traceTargets, respectSampling)\n\n if (traceHeaders) {\n if (traceHeaders.traceparent && !headers.has('traceparent')) {\n headers.set('traceparent', traceHeaders.traceparent)\n }\n if (traceHeaders.tracestate && !headers.has('tracestate')) {\n headers.set('tracestate', traceHeaders.tracestate)\n }\n if (traceHeaders.baggage && !headers.has('baggage')) {\n headers.set('baggage', traceHeaders.baggage)\n }\n }\n }\n\n return fetch(input, { ...init, headers })\n }\n}\n\nlet warnedMissingTracingRuntime = false\nlet warnedNonW3CPropagator = false\n\n/**\n * For tests only. Resets the one-time missing-tracing-runtime warning.\n *\n * @internal\n */\nexport function _resetTracingRuntimeWarning(): void {\n warnedMissingTracingRuntime = false\n}\n\n/**\n * For tests only. Resets the one-time non-W3C-propagator warning.\n *\n * @internal\n */\nexport function _resetNonW3CPropagatorWarning(): void {\n warnedNonW3CPropagator = false\n}\n\nfunction getTraceHeaders(\n input: RequestInfo | URL,\n targets: TracePropagationTarget[],\n respectSampling: boolean\n): TraceContext | null {\n // Read the registry before the target check so the warning fires on the\n // first request with tracing enabled, not only on Supabase-target ones.\n // Reading per request (one globalThis property access) deliberately\n // supports late registration: with ESM evaluation order, `createClient`\n // can run in a module evaluated before the application entry point's\n // `import '@supabase/supabase-js/tracing'`.\n const extractTraceContext = getTraceContextExtractor()\n\n if (!extractTraceContext) {\n if (!warnedMissingTracingRuntime) {\n warnedMissingTracingRuntime = true\n console.warn(\n '@supabase/supabase-js: tracePropagation is enabled but the tracing runtime is not loaded, ' +\n \"so trace headers will not be attached. Add `import '@supabase/supabase-js/tracing'` at \" +\n 'your application entry point (requires the OpenTelemetry API package to be installed). ' +\n 'The CDN/UMD build does not support trace propagation.'\n )\n }\n return null\n }\n\n const targetUrl: string | URL =\n typeof input === 'string' ? input : input instanceof URL ? input : input.url\n\n if (!shouldPropagateToTarget(targetUrl, targets)) {\n return null\n }\n\n const traceContext = extractTraceContext()\n\n if (!traceContext || !traceContext.traceparent) {\n // An active propagator that writes vendor headers but no W3C\n // `traceparent` (e.g. Sentry without `propagateTraceparent: true`) is\n // otherwise indistinguishable from \"no active trace\" — warn once so the\n // user learns why no trace headers are attached. An empty carrier means\n // no active trace: normal, stay silent.\n if (traceContext?.carrierKeys?.length && !warnedNonW3CPropagator) {\n warnedNonW3CPropagator = true\n const sentryHint = traceContext.carrierKeys.includes('sentry-trace')\n ? ' Sentry detected: set `propagateTraceparent: true` in Sentry.init() to emit it.'\n : ' Configure your tracing SDK to emit W3C trace context on outgoing requests.'\n console.warn(\n '@supabase/supabase-js: tracePropagation is enabled and a tracing SDK is active, but its ' +\n `propagator wrote [${traceContext.carrierKeys.join(', ')}] and no W3C traceparent header, ` +\n 'so trace headers will not be attached.' +\n sentryHint\n )\n }\n return null\n }\n\n if (respectSampling) {\n const parsed = parseTraceParent(traceContext.traceparent)\n if (parsed && !parsed.isSampled) {\n // Unsampled traces still carry `traceparent` so Supabase logs get a\n // trace_id to correlate on; the flag stays `00`, so downstream tracing\n // never records it as sampled. `tracestate` and `baggage` (the\n // vendor/application data channels) are withheld on these requests.\n return { traceparent: traceContext.traceparent }\n }\n }\n\n return traceContext\n}\n","// helpers.ts\nimport { SupabaseClientOptions, TracePropagationOptions } from './types'\n\nfunction normalizeTracePropagation(\n value: TracePropagationOptions | boolean | undefined\n): TracePropagationOptions | undefined {\n return typeof value === 'boolean' ? { enabled: value } : value\n}\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 type ResolvedSupabaseClientOptions<SchemaName> = Omit<\n Required<SupabaseClientOptions<SchemaName>>,\n 'tracePropagation'\n> & {\n tracePropagation: TracePropagationOptions\n}\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): ResolvedSupabaseClientOptions<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 // Accept either a boolean shorthand or an options object on both sides.\n const tracePropagationOptions = normalizeTracePropagation(options.tracePropagation)\n const DEFAULT_TRACE_PROPAGATION_OPTIONS = normalizeTracePropagation(defaults.tracePropagation)\n\n const result: ResolvedSupabaseClientOptions<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 tracePropagation: {\n enabled:\n tracePropagationOptions?.enabled ?? DEFAULT_TRACE_PROPAGATION_OPTIONS?.enabled ?? false,\n respectSamplingDecision:\n tracePropagationOptions?.respectSamplingDecision ??\n DEFAULT_TRACE_PROPAGATION_OPTIONS?.respectSamplingDecision ??\n true,\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 type RealtimeRemoveChannelResponse,\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 DEFAULT_TRACE_PROPAGATION_OPTIONS,\n} from './lib/constants'\nimport { checkApiKeyFormat, fetchWithAuth } from './lib/fetch'\nimport {\n applySettingDefaults,\n validateSupabaseUrl,\n type ResolvedSupabaseClientOptions,\n} 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 & keyof Omit<Database, '__InternalSupabase'> =\n SchemaNameOrClientOptions extends string & 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 functionsFetch?: Fetch\n protected changedAccessToken?: string\n protected accessToken?: () => Promise<string | null>\n\n protected headers: Record<string, string>\n protected settings?: ResolvedSupabaseClientOptions<SchemaName>\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 Optional configuration for the client:\n * - `db.schema` — You can switch in between schemas. The schema needs to be on the list of exposed schemas inside Supabase.\n * - `auth.autoRefreshToken` — Set to `true` if you want to automatically refresh the token before expiring.\n * - `auth.persistSession` — Set to `true` if you want to automatically save the user session into local storage.\n * - `auth.detectSessionInUrl` — Set to `true` if you want to automatically detect OAuth grants in the URL and sign in the user.\n * - `realtime` — Options passed along to the realtime-js constructor.\n * - `storage` — Options passed along to the storage-js constructor.\n * - `global.fetch` — A custom fetch implementation.\n * - `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', 'your-publishable-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', 'your-publishable-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\", \"your-publishable-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', 'your-publishable-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 runtime's global `fetch` to make HTTP requests,\n * but an alternative `fetch` implementation can be provided as an option.\n * This is useful in environments where the global `fetch` is unavailable or where you want to customize request behavior.\n *\n * @example Custom fetch implementation\n * ```js\n * import { createClient } from '@supabase/supabase-js'\n *\n * const supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-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\", \"your-publishable-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\", \"your-publishable-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', 'your-publishable-key')\n *\n * const { data } = await supabase.from('profiles').select('*')\n * ```\n *\n * @exampleDescription With OpenTelemetry tracing\n * Opt in to W3C trace context propagation so the `trace_id` from your\n * client-side spans is attached to Supabase requests and appears in API\n * Gateway and Edge Function logs. Requires `@opentelemetry/api` to be\n * installed in your application and the tracing runtime to be loaded via\n * `import '@supabase/supabase-js/tracing'`. See [Tracing with the JS SDK](https://supabase.com/docs/guides/telemetry/client-side-tracing).\n *\n * @example With OpenTelemetry tracing\n * ```ts\n * import '@supabase/supabase-js/tracing'\n * import { createClient } from '@supabase/supabase-js'\n * import { trace } from '@opentelemetry/api'\n *\n * const supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key', {\n * tracePropagation: true,\n * })\n *\n * const tracer = trace.getTracer('my-app')\n *\n * await tracer.startActiveSpan('fetch-users', async (span) => {\n * // Outgoing request carries the active trace context.\n * const { data, error } = await supabase.from('users').select('*')\n * span.end()\n * })\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 checkApiKeyFormat(supabaseKey)\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 tracePropagation: DEFAULT_TRACE_PROPAGATION_OPTIONS,\n }\n\n const settings = applySettingDefaults(options ?? {}, DEFAULTS)\n this.settings = settings\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 // The fetch wrappers receive the raw session token (null when there is no session) and\n // decide the `Authorization` fallback themselves, so the API-key fallback lives in one place.\n this.fetch = fetchWithAuth(\n supabaseKey,\n supabaseUrl,\n this._getSessionToken.bind(this),\n settings.global.fetch,\n settings.tracePropagation\n )\n // Edge Functions use a dedicated fetch that never falls back to a new-format API key in\n // the Authorization header (see `isNewApiKey` in ./lib/fetch). Other services use `this.fetch`.\n this.functionsFetch = fetchWithAuth(\n supabaseKey,\n supabaseUrl,\n this._getSessionToken.bind(this),\n settings.global.fetch,\n settings.tracePropagation,\n { omitApiKeyAsBearer: true }\n )\n this.realtime = this._initRealtimeClient({\n headers: this.headers,\n accessToken: this._getAccessToken.bind(this),\n fetch: this.fetch,\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 retry: settings.db.retry,\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.functionsFetch,\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<Schema, FnName, 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 * @category Realtime\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 * @category Realtime\n *\n * @example Get all channels\n * ```js\n * const channels = supabase.getChannels()\n * ```\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 * @category Realtime\n *\n * @remarks\n * - Removing a channel is a great way to maintain the performance of your project's Realtime service as well as your database if you're listening to Postgres changes. Supabase will automatically handle cleanup 30 seconds after a client is disconnected, but unused channels may cause degradation as more clients are simultaneously subscribed.\n *\n * @example Removes a channel\n * ```js\n * supabase.removeChannel(myChannel)\n * ```\n */\n removeChannel(channel: RealtimeChannel): Promise<RealtimeRemoveChannelResponse> {\n return this.realtime.removeChannel(channel)\n }\n\n /**\n * Unsubscribes and removes all Realtime channels from Realtime client.\n *\n * @category Realtime\n *\n * @remarks\n * - Removing channels is a great way to maintain the performance of your project's Realtime service as well as your database if you're listening to Postgres changes. Supabase will automatically handle cleanup 30 seconds after a client is disconnected, but unused channels may cause degradation as more clients are simultaneously subscribed.\n *\n * @example Remove all channels\n * ```js\n * supabase.removeAllChannels()\n * ```\n */\n removeAllChannels(): Promise<RealtimeRemoveChannelResponse[]> {\n return this.realtime.removeAllChannels()\n }\n\n /**\n * The raw session token — the custom `accessToken` result or the signed-in user's JWT —\n * or `null` when there is no session. Unlike {@link _getAccessToken} it does not fall back\n * to `supabaseKey`, so callers can distinguish \"no session\" from \"has session\".\n */\n private async _getSessionToken(): Promise<string | null> {\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 ?? null\n }\n\n private async _getAccessToken() {\n return (await this._getSessionToken()) ?? 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 experimental,\n lockAcquireTimeout,\n skipAutoInitialize,\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 experimental,\n fetch,\n lockAcquireTimeout,\n skipAutoInitialize,\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' || event === 'INITIAL_SESSION') &&\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 PostgrestBuilder,\n PostgrestFilterBuilder,\n PostgrestTransformBuilder,\n PostgrestQueryBuilder,\n} from '@supabase/postgrest-js'\nexport { PostgrestError } from '@supabase/postgrest-js'\nexport { StorageApiError } from '@supabase/storage-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 TracePropagationOptions,\n QueryResult,\n QueryData,\n QueryError,\n DatabaseWithoutInternals,\n} from './lib/types'\n\n/**\n * Creates a new Supabase Client.\n *\n * @example Creating a Supabase client\n * ```ts\n * import { createClient } from '@supabase/supabase-js'\n *\n * const supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-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 & keyof Omit<Database, '__InternalSupabase'> =\n SchemaNameOrClientOptions extends string & 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 <= 20 deprecation\nfunction shouldShowDeprecationWarning(): boolean {\n // Skip in browser and Deno environments\n if (typeof window !== 'undefined' || (globalThis as any)['Deno'] !== 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 <= 20\n}\n\nif (shouldShowDeprecationWarning()) {\n console.warn(\n `⚠️ Node.js 20 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. ` +\n `Please upgrade to Node.js 22 or later. ` +\n `For more information, visit: https://github.com/orgs/supabase/discussions/45715`\n )\n}\n"],"mappings":";;;;;;;;;;;;AAMA,MAAa,UAAU;;;;ACDvB,IAAI,SAAS;AACb,IAAIA;AAEJ,IAAI,OAAO,SAAS,aAAa;;AAC/B,UAAS;AAET,uCAAqB,KAAK,uEAAS;WAC1B,OAAO,aAAa,YAC7B,UAAS;SACA,OAAO,cAAc,eAAe,UAAU,YAAY,cACnE,UAAS;KACJ;;AACL,UAAS;CACT,MAAM,WAAY,WAAmB;AACrC,sFAAqB,SAAW,gFAAY,QAAQ,MAAM,GAAG;;AAG/D,MAAM,eAAe,CAAC,WAAW,SAAS;AAC1C,IAAI,mBACF,cAAa,KAAK,mBAAmB,qBAAqB;AAG5D,MAAa,kBAAkB,EAC7B,iBAAiB,eAAe,QAAQ,IAA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Y;AACtD,KAAI,CAAC,aACH,QAAO;AAIT,QADqB,SAAS,aAAa,IAAI,GAAG,IAC3B;;AAGzB,IAAI,8BAA8B,CAChC,SAAQ,KACN,8OAGD"}
{"version":3,"file":"index.mjs","names":["JS_RUNTIME_VERSION: string | undefined","DEFAULT_AUTH_OPTIONS: SupabaseAuthClientOptions","DEFAULT_REALTIME_OPTIONS: RealtimeClientOptions","DEFAULT_TRACE_PROPAGATION_OPTIONS: TracePropagationOptions","version","fetch","traceTargets: TracePropagationTarget[] | null","DEFAULT_DB_OPTIONS","DEFAULT_AUTH_OPTIONS","DEFAULT_REALTIME_OPTIONS","DEFAULT_GLOBAL_OPTIONS","DEFAULT_TRACE_PROPAGATION_OPTIONS","result: ResolvedSupabaseClientOptions<SchemaName>","supabaseUrl: string","supabaseKey: string","SupabaseStorageClient","this"],"sources":["../src/lib/version.ts","../src/lib/constants.ts","../../../shared/tracing/dist/module/parse.js","../../../shared/tracing/dist/module/validate.js","../../../shared/tracing/dist/module/defaults.js","../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.112.3'\n","// constants.ts\nimport { RealtimeClientOptions } from '@supabase/realtime-js'\nimport { SupabaseAuthClientOptions, TracePropagationOptions } from './types'\nimport { version } from './version'\n\nlet JS_ENV = ''\nlet JS_RUNTIME_VERSION: string | undefined\n// @ts-ignore\nif (typeof Deno !== 'undefined') {\n JS_ENV = 'deno'\n // @ts-ignore\n JS_RUNTIME_VERSION = Deno.version?.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 const _process = (globalThis as any)['process']\n JS_RUNTIME_VERSION = _process?.['version']?.replace(/^v/, '')\n}\n\nconst _runtimeMeta = [`runtime=${JS_ENV}`]\nif (JS_RUNTIME_VERSION) {\n _runtimeMeta.push(`runtime-version=${JS_RUNTIME_VERSION}`)\n}\n\nexport const DEFAULT_HEADERS = {\n 'X-Client-Info': `supabase-js/${version}; ${_runtimeMeta.join('; ')}`,\n}\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\nexport const DEFAULT_TRACE_PROPAGATION_OPTIONS: TracePropagationOptions = {\n enabled: false,\n respectSamplingDecision: true,\n}\n","/**\n * Parse W3C traceparent header according to the specification.\n *\n * The traceparent header format is: version-traceid-parentid-traceflags\n * - version: 2 hex digits (currently always \"00\")\n * - traceid: 32 hex digits (128-bit trace identifier)\n * - parentid: 16 hex digits (64-bit span/parent identifier)\n * - traceflags: 2 hex digits (8-bit flags, bit 0 is sampled flag)\n *\n * @param traceparent - The traceparent header value\n * @returns Parsed traceparent object, or null if invalid format\n *\n * @see https://www.w3.org/TR/trace-context/#traceparent-header\n *\n * @example\n * ```typescript\n * const parsed = parseTraceParent('00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01')\n *\n * console.log(parsed)\n * // {\n * // version: '00',\n * // traceId: '0af7651916cd43dd8448eb211c80319c',\n * // parentId: 'b7ad6b7169203331',\n * // traceFlags: '01',\n * // isSampled: true\n * // }\n * ```\n */\nexport function parseTraceParent(traceparent) {\n if (!traceparent || typeof traceparent !== 'string') {\n return null;\n }\n // Split by hyphen\n const parts = traceparent.split('-');\n // Must have exactly 4 parts\n if (parts.length !== 4) {\n return null;\n }\n const [version, traceId, parentId, traceFlags] = parts;\n // Validate field lengths according to W3C spec\n if (version.length !== 2 ||\n traceId.length !== 32 ||\n parentId.length !== 16 ||\n traceFlags.length !== 2) {\n return null;\n }\n // Validate that all fields are valid hexadecimal\n const hexRegex = /^[0-9a-f]+$/i;\n if (!hexRegex.test(version) ||\n !hexRegex.test(traceId) ||\n !hexRegex.test(parentId) ||\n !hexRegex.test(traceFlags)) {\n return null;\n }\n // Validate that trace-id and parent-id are not all zeros (invalid per spec)\n if (traceId === '00000000000000000000000000000000' || parentId === '0000000000000000') {\n return null;\n }\n // Parse sampling decision from trace-flags (bit 0)\n const flags = parseInt(traceFlags, 16);\n const isSampled = (flags & 0x01) === 0x01;\n return {\n version,\n traceId,\n parentId,\n traceFlags,\n isSampled,\n };\n}\n//# sourceMappingURL=parse.js.map","/**\n * Check if trace context should be propagated to the target URL.\n *\n * This function checks if the target URL matches any of the configured\n * propagation targets. Targets can be:\n * - String: Exact hostname match or wildcard domain (*.example.com)\n * - RegExp: Pattern matching hostname\n * - Function: Custom logic to determine if URL should receive trace context\n *\n * @param targetUrl - The URL to check\n * @param targets - Array of propagation targets\n * @returns True if trace context should be propagated, false otherwise\n *\n * @example\n * ```typescript\n * const targets = [\n * 'myproject.supabase.co', // Exact match\n * '*.supabase.co', // Wildcard domain\n * /.*\\.supabase\\.co$/, // Regex pattern\n * (url) => url.hostname === 'localhost' // Custom function\n * ]\n *\n * shouldPropagateToTarget('https://myproject.supabase.co/rest/v1/table', targets)\n * // true\n *\n * shouldPropagateToTarget('https://evil.com/api', targets)\n * // false\n * ```\n */\nexport function shouldPropagateToTarget(targetUrl, targets) {\n if (!targetUrl || !targets || targets.length === 0) {\n return false;\n }\n let url;\n if (targetUrl instanceof URL) {\n url = targetUrl;\n }\n else {\n try {\n url = new URL(targetUrl);\n }\n catch (error) {\n // Invalid URL\n return false;\n }\n }\n // Check each target\n for (const target of targets) {\n try {\n if (typeof target === 'string') {\n // String matcher: exact match or wildcard domain\n if (matchStringTarget(url.hostname, target)) {\n return true;\n }\n }\n else if (target instanceof RegExp) {\n // Regex matcher\n if (target.test(url.hostname)) {\n return true;\n }\n }\n else if (typeof target === 'function') {\n // Function matcher\n if (target(url)) {\n return true;\n }\n }\n }\n catch (error) {\n // Ignore errors from individual matchers and continue\n continue;\n }\n }\n return false;\n}\n/**\n * Match hostname against string target (exact match or wildcard)\n *\n * @param hostname - The hostname to check\n * @param target - The target pattern (exact or wildcard)\n * @returns True if hostname matches target\n */\nfunction matchStringTarget(hostname, target) {\n // Exact match\n if (target === hostname) {\n return true;\n }\n // Wildcard domain match (*.example.com)\n if (target.startsWith('*.')) {\n const domain = target.slice(2); // Remove \"*.\"\n // Check if hostname ends with the domain\n if (hostname.endsWith(domain)) {\n // Ensure it's either an exact match or has a subdomain\n // (prevents \"notexample.com\" from matching \"*.example.com\")\n if (hostname === domain || hostname.endsWith('.' + domain)) {\n return true;\n }\n }\n }\n return false;\n}\n//# sourceMappingURL=validate.js.map","/**\n * Generate default propagation targets based on the Supabase project URL.\n *\n * By default, trace context is only propagated to Supabase domains for\n * security. This prevents leaking trace context to potentially malicious\n * third-party services.\n *\n * Wildcard strings (e.g. `*.supabase.co`) are matched with linear string\n * operations rather than regex, avoiding ReDoS risk.\n *\n * @param supabaseUrl - The Supabase project URL\n * @returns Array of default propagation targets\n */\nexport function getDefaultPropagationTargets(supabaseUrl) {\n const targets = [];\n // Add exact project hostname\n try {\n const url = new URL(supabaseUrl);\n targets.push(url.hostname);\n }\n catch (error) {\n // Invalid URL, skip exact hostname\n }\n // Supabase cloud domains. Use wildcard strings (not regex) — these are\n // matched by linear hostname-suffix checks, so there is no ReDoS surface.\n targets.push('*.supabase.co', '*.supabase.in');\n // Localhost and loopback addresses for local development.\n targets.push('localhost', '127.0.0.1', '[::1]');\n return targets;\n}\n//# sourceMappingURL=defaults.js.map","import {\n parseTraceParent,\n shouldPropagateToTarget,\n getDefaultPropagationTargets,\n type TraceContext,\n type TracePropagationTarget,\n} from '@supabase/tracing'\nimport { getTraceContextExtractor } from './tracingRegistry'\nimport type { TracePropagationOptions } from './types'\n\ntype 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\n/**\n * New-format Supabase API keys (`sb_publishable_…` / `sb_secret_…`) are not JWTs and\n * must never be sent as a Bearer token — they belong only in the `apikey` header.\n * All other keys (legacy JWT keys, `sb_temp_…` temporary keys, unrecognized `sb_`\n * subtypes) keep the Bearer fallback.\n */\nconst isNewApiKey = (key: string): boolean =>\n key.startsWith('sb_publishable_') || key.startsWith('sb_secret_')\n\nconst TEMP_KEY_PREFIX = 'sb_temp_'\n\nconst warnedKeySubtypes = new Set<string>()\n\n/**\n * Warn (once per subtype) when an `sb_` key isn't a subtype this SDK version recognizes.\n * Never throws — the server, not the SDK, decides key validity. The key value is never\n * included in the message.\n */\nexport const checkApiKeyFormat = (key: string): void => {\n if (!key.startsWith('sb_') || isNewApiKey(key) || key.startsWith(TEMP_KEY_PREFIX)) {\n return\n }\n const subtype = key.match(/^sb_[a-zA-Z0-9]+_/)?.[0] ?? 'unknown'\n if (warnedKeySubtypes.has(subtype)) {\n return\n }\n warnedKeySubtypes.add(subtype)\n console.warn(\n '@supabase/supabase-js: Unrecognized Supabase API key format. The client will proceed ' +\n 'and send this key as-is; if you see authentication errors you may need to upgrade ' +\n '@supabase/supabase-js to a version that recognizes this key type.'\n )\n}\n\nexport const fetchWithAuth = (\n supabaseKey: string,\n supabaseUrl: string,\n getAccessToken: () => Promise<string | null>,\n customFetch?: Fetch,\n tracePropagationOptions?: TracePropagationOptions,\n options?: { omitApiKeyAsBearer?: boolean }\n): Fetch => {\n const fetch = resolveFetch(customFetch)\n const HeadersConstructor = resolveHeadersConstructor()\n\n // Pre-compute trace propagation state once. When disabled, the per-request\n // path skips all tracing work with a single truthy check.\n const traceEnabled = tracePropagationOptions?.enabled === true\n const respectSampling = tracePropagationOptions?.respectSamplingDecision !== false\n const traceTargets: TracePropagationTarget[] | null = traceEnabled\n ? getDefaultPropagationTargets(supabaseUrl)\n : null\n\n // Whether the API key may be used as the `Authorization` Bearer fallback when there is no\n // session token. Disabled for Edge Functions with a new-format key (see `isNewApiKey`).\n // Static per instance, so it is computed once here rather than on every request.\n const allowKeyAsBearer = !(options?.omitApiKeyAsBearer && isNewApiKey(supabaseKey))\n\n return async (input, init) => {\n const realToken = await getAccessToken()\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 const bearer = realToken ?? (allowKeyAsBearer ? supabaseKey : null)\n if (bearer) {\n headers.set('Authorization', `Bearer ${bearer}`)\n }\n }\n\n if (traceTargets) {\n const traceHeaders = getTraceHeaders(input, traceTargets, respectSampling)\n\n if (traceHeaders) {\n if (traceHeaders.traceparent && !headers.has('traceparent')) {\n headers.set('traceparent', traceHeaders.traceparent)\n }\n if (traceHeaders.tracestate && !headers.has('tracestate')) {\n headers.set('tracestate', traceHeaders.tracestate)\n }\n if (traceHeaders.baggage && !headers.has('baggage')) {\n headers.set('baggage', traceHeaders.baggage)\n }\n }\n }\n\n return fetch(input, { ...init, headers })\n }\n}\n\nlet warnedMissingTracingRuntime = false\nlet warnedNonW3CPropagator = false\n\n/**\n * For tests only. Resets the one-time missing-tracing-runtime warning.\n *\n * @internal\n */\nexport function _resetTracingRuntimeWarning(): void {\n warnedMissingTracingRuntime = false\n}\n\n/**\n * For tests only. Resets the one-time non-W3C-propagator warning.\n *\n * @internal\n */\nexport function _resetNonW3CPropagatorWarning(): void {\n warnedNonW3CPropagator = false\n}\n\nfunction getTraceHeaders(\n input: RequestInfo | URL,\n targets: TracePropagationTarget[],\n respectSampling: boolean\n): TraceContext | null {\n // Read the registry before the target check so the warning fires on the\n // first request with tracing enabled, not only on Supabase-target ones.\n // Reading per request (one globalThis property access) deliberately\n // supports late registration: with ESM evaluation order, `createClient`\n // can run in a module evaluated before the application entry point's\n // `import '@supabase/supabase-js/tracing'`.\n const extractTraceContext = getTraceContextExtractor()\n\n if (!extractTraceContext) {\n if (!warnedMissingTracingRuntime) {\n warnedMissingTracingRuntime = true\n console.warn(\n '@supabase/supabase-js: tracePropagation is enabled but the tracing runtime is not loaded, ' +\n \"so trace headers will not be attached. Add `import '@supabase/supabase-js/tracing'` at \" +\n 'your application entry point (requires the OpenTelemetry API package to be installed). ' +\n 'The CDN/UMD build does not support trace propagation.'\n )\n }\n return null\n }\n\n const targetUrl: string | URL =\n typeof input === 'string' ? input : input instanceof URL ? input : input.url\n\n if (!shouldPropagateToTarget(targetUrl, targets)) {\n return null\n }\n\n const traceContext = extractTraceContext()\n\n if (!traceContext || !traceContext.traceparent) {\n // An active propagator that writes vendor headers but no W3C\n // `traceparent` (e.g. Sentry without `propagateTraceparent: true`) is\n // otherwise indistinguishable from \"no active trace\" — warn once so the\n // user learns why no trace headers are attached. An empty carrier means\n // no active trace: normal, stay silent.\n if (traceContext?.carrierKeys?.length && !warnedNonW3CPropagator) {\n warnedNonW3CPropagator = true\n const sentryHint = traceContext.carrierKeys.includes('sentry-trace')\n ? ' Sentry detected: set `propagateTraceparent: true` in Sentry.init() to emit it.'\n : ' Configure your tracing SDK to emit W3C trace context on outgoing requests.'\n console.warn(\n '@supabase/supabase-js: tracePropagation is enabled and a tracing SDK is active, but its ' +\n `propagator wrote [${traceContext.carrierKeys.join(', ')}] and no W3C traceparent header, ` +\n 'so trace headers will not be attached.' +\n sentryHint\n )\n }\n return null\n }\n\n if (respectSampling) {\n const parsed = parseTraceParent(traceContext.traceparent)\n if (parsed && !parsed.isSampled) {\n // Unsampled traces still carry `traceparent` so Supabase logs get a\n // trace_id to correlate on; the flag stays `00`, so downstream tracing\n // never records it as sampled. `tracestate` and `baggage` (the\n // vendor/application data channels) are withheld on these requests.\n return { traceparent: traceContext.traceparent }\n }\n }\n\n return traceContext\n}\n","// helpers.ts\nimport { SupabaseClientOptions, TracePropagationOptions } from './types'\n\nfunction normalizeTracePropagation(\n value: TracePropagationOptions | boolean | undefined\n): TracePropagationOptions | undefined {\n return typeof value === 'boolean' ? { enabled: value } : value\n}\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 type ResolvedSupabaseClientOptions<SchemaName> = Omit<\n Required<SupabaseClientOptions<SchemaName>>,\n 'tracePropagation'\n> & {\n tracePropagation: TracePropagationOptions\n}\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): ResolvedSupabaseClientOptions<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 // Accept either a boolean shorthand or an options object on both sides.\n const tracePropagationOptions = normalizeTracePropagation(options.tracePropagation)\n const DEFAULT_TRACE_PROPAGATION_OPTIONS = normalizeTracePropagation(defaults.tracePropagation)\n\n const result: ResolvedSupabaseClientOptions<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 tracePropagation: {\n enabled:\n tracePropagationOptions?.enabled ?? DEFAULT_TRACE_PROPAGATION_OPTIONS?.enabled ?? false,\n respectSamplingDecision:\n tracePropagationOptions?.respectSamplingDecision ??\n DEFAULT_TRACE_PROPAGATION_OPTIONS?.respectSamplingDecision ??\n true,\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 type RealtimeRemoveChannelResponse,\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 DEFAULT_TRACE_PROPAGATION_OPTIONS,\n} from './lib/constants'\nimport { checkApiKeyFormat, fetchWithAuth } from './lib/fetch'\nimport {\n applySettingDefaults,\n validateSupabaseUrl,\n type ResolvedSupabaseClientOptions,\n} 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 & keyof Omit<Database, '__InternalSupabase'> =\n SchemaNameOrClientOptions extends string & 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 functionsFetch?: Fetch\n protected changedAccessToken?: string\n protected accessToken?: () => Promise<string | null>\n\n protected headers: Record<string, string>\n protected settings?: ResolvedSupabaseClientOptions<SchemaName>\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 Optional configuration for the client:\n * - `db.schema` — You can switch in between schemas. The schema needs to be on the list of exposed schemas inside Supabase.\n * - `auth.autoRefreshToken` — Set to `true` if you want to automatically refresh the token before expiring.\n * - `auth.persistSession` — Set to `true` if you want to automatically save the user session into local storage.\n * - `auth.detectSessionInUrl` — Set to `true` if you want to automatically detect OAuth grants in the URL and sign in the user.\n * - `realtime` — Options passed along to the realtime-js constructor.\n * - `storage` — Options passed along to the storage-js constructor.\n * - `global.fetch` — A custom fetch implementation.\n * - `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', 'your-publishable-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', 'your-publishable-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\", \"your-publishable-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', 'your-publishable-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 runtime's global `fetch` to make HTTP requests,\n * but an alternative `fetch` implementation can be provided as an option.\n * This is useful in environments where the global `fetch` is unavailable or where you want to customize request behavior.\n *\n * @example Custom fetch implementation\n * ```js\n * import { createClient } from '@supabase/supabase-js'\n *\n * const supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-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\", \"your-publishable-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\", \"your-publishable-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', 'your-publishable-key')\n *\n * const { data } = await supabase.from('profiles').select('*')\n * ```\n *\n * @exampleDescription With OpenTelemetry tracing\n * Opt in to W3C trace context propagation so the `trace_id` from your\n * client-side spans is attached to Supabase requests and appears in API\n * Gateway and Edge Function logs. Requires `@opentelemetry/api` to be\n * installed in your application and the tracing runtime to be loaded via\n * `import '@supabase/supabase-js/tracing'`. See [Tracing with the JS SDK](https://supabase.com/docs/guides/telemetry/client-side-tracing).\n *\n * @example With OpenTelemetry tracing\n * ```ts\n * import '@supabase/supabase-js/tracing'\n * import { createClient } from '@supabase/supabase-js'\n * import { trace } from '@opentelemetry/api'\n *\n * const supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key', {\n * tracePropagation: true,\n * })\n *\n * const tracer = trace.getTracer('my-app')\n *\n * await tracer.startActiveSpan('fetch-users', async (span) => {\n * // Outgoing request carries the active trace context.\n * const { data, error } = await supabase.from('users').select('*')\n * span.end()\n * })\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 checkApiKeyFormat(supabaseKey)\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 tracePropagation: DEFAULT_TRACE_PROPAGATION_OPTIONS,\n }\n\n const settings = applySettingDefaults(options ?? {}, DEFAULTS)\n this.settings = settings\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 // The fetch wrappers receive the raw session token (null when there is no session) and\n // decide the `Authorization` fallback themselves, so the API-key fallback lives in one place.\n this.fetch = fetchWithAuth(\n supabaseKey,\n supabaseUrl,\n this._getSessionToken.bind(this),\n settings.global.fetch,\n settings.tracePropagation\n )\n // Edge Functions use a dedicated fetch that never falls back to a new-format API key in\n // the Authorization header (see `isNewApiKey` in ./lib/fetch). Other services use `this.fetch`.\n this.functionsFetch = fetchWithAuth(\n supabaseKey,\n supabaseUrl,\n this._getSessionToken.bind(this),\n settings.global.fetch,\n settings.tracePropagation,\n { omitApiKeyAsBearer: true }\n )\n this.realtime = this._initRealtimeClient({\n headers: this.headers,\n accessToken: this._getAccessToken.bind(this),\n fetch: this.fetch,\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 retry: settings.db.retry,\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.functionsFetch,\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<Schema, FnName, 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 * @category Realtime\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 * @category Realtime\n *\n * @example Get all channels\n * ```js\n * const channels = supabase.getChannels()\n * ```\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 * @category Realtime\n *\n * @remarks\n * - Removing a channel is a great way to maintain the performance of your project's Realtime service as well as your database if you're listening to Postgres changes. Supabase will automatically handle cleanup 30 seconds after a client is disconnected, but unused channels may cause degradation as more clients are simultaneously subscribed.\n *\n * @example Removes a channel\n * ```js\n * supabase.removeChannel(myChannel)\n * ```\n */\n removeChannel(channel: RealtimeChannel): Promise<RealtimeRemoveChannelResponse> {\n return this.realtime.removeChannel(channel)\n }\n\n /**\n * Unsubscribes and removes all Realtime channels from Realtime client.\n *\n * @category Realtime\n *\n * @remarks\n * - Removing channels is a great way to maintain the performance of your project's Realtime service as well as your database if you're listening to Postgres changes. Supabase will automatically handle cleanup 30 seconds after a client is disconnected, but unused channels may cause degradation as more clients are simultaneously subscribed.\n *\n * @example Remove all channels\n * ```js\n * supabase.removeAllChannels()\n * ```\n */\n removeAllChannels(): Promise<RealtimeRemoveChannelResponse[]> {\n return this.realtime.removeAllChannels()\n }\n\n /**\n * The raw session token — the custom `accessToken` result or the signed-in user's JWT —\n * or `null` when there is no session. Unlike {@link _getAccessToken} it does not fall back\n * to `supabaseKey`, so callers can distinguish \"no session\" from \"has session\".\n */\n private async _getSessionToken(): Promise<string | null> {\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 ?? null\n }\n\n private async _getAccessToken() {\n return (await this._getSessionToken()) ?? 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 experimental,\n lockAcquireTimeout,\n skipAutoInitialize,\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 experimental,\n fetch,\n lockAcquireTimeout,\n skipAutoInitialize,\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' || event === 'INITIAL_SESSION') &&\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 PostgrestBuilder,\n PostgrestFilterBuilder,\n PostgrestTransformBuilder,\n PostgrestQueryBuilder,\n} from '@supabase/postgrest-js'\nexport { PostgrestError } from '@supabase/postgrest-js'\nexport { StorageApiError } from '@supabase/storage-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 TracePropagationOptions,\n QueryResult,\n QueryData,\n QueryError,\n DatabaseWithoutInternals,\n} from './lib/types'\n\n/**\n * Creates a new Supabase Client.\n *\n * @example Creating a Supabase client\n * ```ts\n * import { createClient } from '@supabase/supabase-js'\n *\n * const supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-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 & keyof Omit<Database, '__InternalSupabase'> =\n SchemaNameOrClientOptions extends string & 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 <= 20 deprecation\nfunction shouldShowDeprecationWarning(): boolean {\n // Skip in browser and Deno environments\n if (typeof window !== 'undefined' || (globalThis as any)['Deno'] !== 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 <= 20\n}\n\nif (shouldShowDeprecationWarning()) {\n console.warn(\n `⚠️ Node.js 20 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. ` +\n `Please upgrade to Node.js 22 or later. ` +\n `For more information, visit: https://github.com/orgs/supabase/discussions/45715`\n )\n}\n"],"mappings":";;;;;;;;;;;;AAMA,MAAa,UAAU;;;;ACDvB,IAAI,SAAS;AACb,IAAIA;AAEJ,IAAI,OAAO,SAAS,aAAa;;AAC/B,UAAS;AAET,uCAAqB,KAAK,uEAAS;WAC1B,OAAO,aAAa,YAC7B,UAAS;SACA,OAAO,cAAc,eAAe,UAAU,YAAY,cACnE,UAAS;KACJ;;AACL,UAAS;CACT,MAAM,WAAY,WAAmB;AACrC,sFAAqB,SAAW,gFAAY,QAAQ,MAAM,GAAG;;AAG/D,MAAM,eAAe,CAAC,WAAW,SAAS;AAC1C,IAAI,mBACF,cAAa,KAAK,mBAAmB,qBAAqB;AAG5D,MAAa,kBAAkB,EAC7B,iBAAiB,eAAe,QAAQ,IAAI,aAAa,KAAK,KAAK,IACpE;AAED,MAAa,yBAAyB,EACpC,SAAS,iBACV;AAED,MAAa,qBAAqB,EAChC,QAAQ,UACT;AAED,MAAaC,uBAAkD;CAC7D,kBAAkB;CAClB,gBAAgB;CAChB,o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canary.0",
"version": "2.112.3",
"description": "Isomorphic Javascript SDK for Supabase",

@@ -80,7 +80,7 @@ "keywords": [

"dependencies": {
"@supabase/auth-js": "2.112.3-canary.0",
"@supabase/functions-js": "2.112.3-canary.0",
"@supabase/postgrest-js": "2.112.3-canary.0",
"@supabase/storage-js": "2.112.3-canary.0",
"@supabase/realtime-js": "2.112.3-canary.0"
"@supabase/auth-js": "2.112.3",
"@supabase/postgrest-js": "2.112.3",
"@supabase/functions-js": "2.112.3",
"@supabase/realtime-js": "2.112.3",
"@supabase/storage-js": "2.112.3"
},

@@ -87,0 +87,0 @@ "peerDependencies": {

@@ -7,2 +7,2 @@ // Generated automatically during releases by scripts/update-version-files.ts

// - Ensuring build artifacts match the published package version
export const version = '2.112.3-canary.0'
export const version = '2.112.3'

Sorry, the diff of this file is too big to display