diff --git a/.github/workflows/docs-js-libs-update.yml b/.github/workflows/docs-js-libs-update.yml index dc025041509..c2f5b64be5c 100644 --- a/.github/workflows/docs-js-libs-update.yml +++ b/.github/workflows/docs-js-libs-update.yml @@ -50,11 +50,12 @@ jobs: echo "Regenerating tsdoc files for JS client libraries..." echo "Source: ${SOURCE}" echo "Version: ${VERSION}" - make + make download.tsdoc.v2 - name: Refresh reference-content snapshot working-directory: apps/docs - run: npx vitest run --update scripts/build-reference-content.test.ts + # Using --dir (not a file path) so Vitest 4 doesn't run unrelated tests. + run: npx vitest run --update --dir scripts - name: Generate token id: app-token @@ -65,7 +66,6 @@ jobs: permission-contents: write permission-pull-requests: write - - name: Create pull request uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c # v6.1.0 with: @@ -74,7 +74,7 @@ jobs: title: 'docs: update js sdk docs (${{ github.event.inputs.version }})' body: | Updates JS sdk documentation following stable release. - Ran `make` in apps/docs/spec to regenerate tsdoc files. + Ran `make download.tsdoc.v2` in apps/docs/spec and refreshed the reference-content snapshot. **Details:** - **Version:** `${{ github.event.inputs.version }}` diff --git a/.github/workflows/self-host-tests-smoke.yml b/.github/workflows/self-host-tests-smoke.yml index f4240f70fbb..d09f06b80fa 100644 --- a/.github/workflows/self-host-tests-smoke.yml +++ b/.github/workflows/self-host-tests-smoke.yml @@ -17,19 +17,74 @@ permissions: jobs: build: runs-on: blacksmith-4vcpu-ubuntu-2404 + strategy: + fail-fast: false + matrix: + config: [default, logs, envoy, rustfs, envoy-rustfs] steps: - - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 + - uses: actions/checkout@v4 with: persist-credentials: false sparse-checkout: | docker/ - - name: Run docker-compose up + + - uses: actions/setup-node@v4 + with: + node-version: '22' + + - name: Generate keys + shell: bash + run: | + set -euo pipefail + cd docker + cp .env.example .env + sh utils/generate-keys.sh --update-env + sh utils/add-new-auth-keys.sh --update-env + + - name: Start self-hosted Supabase shell: bash # Ensure all services can be started and healthy with default config run: | set -euo pipefail cd docker - cp .env.example .env yq -i '.services.supavisor.environment.RLIMIT_NOFILE=1024' docker-compose.yml - docker compose up --quiet-pull --wait --wait-timeout 180 + if [ "${{ matrix.config }}" = "logs" ]; then + docker compose -f docker-compose.yml -f docker-compose.logs.yml up --quiet-pull --wait --wait-timeout 180 + elif [ "${{ matrix.config }}" = "envoy" ]; then + docker compose -f docker-compose.yml -f docker-compose.envoy.yml up --quiet-pull --wait --wait-timeout 180 + elif [ "${{ matrix.config }}" = "rustfs" ]; then + docker compose -f docker-compose.yml -f docker-compose.rustfs.yml up --quiet-pull --wait --wait-timeout 180 + elif [ "${{ matrix.config }}" = "envoy-rustfs" ]; then + docker compose -f docker-compose.yml -f docker-compose.envoy.yml -f docker-compose.rustfs.yml up --quiet-pull --wait --wait-timeout 180 + else + docker compose up --quiet-pull --wait --wait-timeout 180 + fi + + - name: Run container log tests + shell: bash + run: | + set -euo pipefail + cd docker + sh tests/test-container-logs.sh + + - name: Run smoke tests + shell: bash + run: | + set -euo pipefail + cd docker + sh tests/test-self-hosted.sh + + - name: Run API keys and asymmetric auth tests + shell: bash + run: | + set -euo pipefail + cd docker + sh tests/test-auth-keys.sh + + - name: Run S3 protocol tests + shell: bash + run: | + set -euo pipefail + cd docker + sh tests/test-s3.sh diff --git a/.github/workflows/studio-e2e-test.yml b/.github/workflows/studio-e2e-test.yml index 8c5a2992c9d..46e85ec2ae3 100644 --- a/.github/workflows/studio-e2e-test.yml +++ b/.github/workflows/studio-e2e-test.yml @@ -24,7 +24,6 @@ jobs: permissions: contents: write - env: OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} @@ -87,7 +86,7 @@ jobs: - name: Pre-start diagnostics run: | docker ps -a - sudo ss -tlnp | grep 5432 || echo "5432 free" + sudo ss -tlnp | grep 54322 || echo "54322 free" - name: Start supabase if: steps.filter.outputs.studio == 'true' @@ -97,7 +96,7 @@ jobs: if: failure() run: | docker ps -a - sudo ss -tlnp | grep 5432 + sudo ss -tlnp | grep 54322 || echo "54322 not listening" docker logs $(docker ps -aq) 2>&1 || true - name: Build studio diff --git a/.prettierignore b/.prettierignore index 46c5219234d..8c41d148ff5 100644 --- a/.prettierignore +++ b/.prettierignore @@ -31,3 +31,5 @@ apps/**/.contentlayer packages/ui/src/components/Form/examples/PhoneProvidersSchema.json # ignore because of

apps/www/_blog/2025-07-14-supabase-ui-platform-kit.mdx +# vitest file snapshots — JSON.stringify owns the format, not Prettier +apps/docs/scripts/__snapshots__/ diff --git a/apps/docs/.gitignore b/apps/docs/.gitignore index af74dd45e2a..eb1e923d280 100644 --- a/apps/docs/.gitignore +++ b/apps/docs/.gitignore @@ -29,8 +29,8 @@ yarn-error.log* public/sitemap.xml # Per-source llms files (generated by build:llms, served by www) public/llms/ -# Generated guide markdown files -public/docs/ +# Generated guide and reference markdown files +public/markdown/ public/docs.tar.gz # Copied examples folder diff --git a/apps/docs/DEVELOPERS.md b/apps/docs/DEVELOPERS.md index 1f0c0d0b8a9..ea96686cb08 100644 --- a/apps/docs/DEVELOPERS.md +++ b/apps/docs/DEVELOPERS.md @@ -31,7 +31,7 @@ To test locally, within the `apps/docs` directory: 1. Run `pnpm build:guides-markdown` 2. Run `pnpm dev` -This creates Markdown files for all routes under the `public/docs/guides` directory, ignored by Git. +This creates Markdown files for all routes under the `public/markdown/guides` directory, ignored by Git. For production this setup runs as a `prebuild` task to allow Vercel to bundle these files with middleware and functions. diff --git a/apps/docs/app/api/guides-md/[...slug]/route.ts b/apps/docs/app/api/guides-md/[...slug]/route.ts index 3e877b3181f..51dea28525c 100644 --- a/apps/docs/app/api/guides-md/[...slug]/route.ts +++ b/apps/docs/app/api/guides-md/[...slug]/route.ts @@ -5,7 +5,7 @@ import { NextResponse } from 'next/server' export async function GET(request: Request, { params }: { params: Promise<{ slug: string[] }> }) { const { slug } = await params - const baseDir = path.join(process.cwd(), 'public/docs/guides') + const baseDir = path.join(process.cwd(), 'public/markdown/guides') const filePath = path.join(baseDir, `${slug.join('/')}.md`) if (!filePath.startsWith(baseDir + path.sep) && filePath !== baseDir) { diff --git a/apps/docs/app/contributing/content.mdx b/apps/docs/app/contributing/content.mdx index 4f03645cc87..a4c0476d5d4 100644 --- a/apps/docs/app/contributing/content.mdx +++ b/apps/docs/app/contributing/content.mdx @@ -354,7 +354,7 @@ If your image has alternate light and dark versions, or you want to make it zoom ### Project Variables -Some guides and tutorials will require that users copy their Supabase project URL and anon key. You can provide those inline if the user is signed in: +Some guides and tutorials will require that users copy their Supabase project URL and publishable or secret key. You can provide those inline if the user is signed in: ```mdx diff --git a/apps/docs/app/guides/ai-tools/ai-prompts/[slug]/page.tsx b/apps/docs/app/guides/ai-tools/ai-prompts/[slug]/page.tsx index 7eaf8f3ceae..df39f6ee8eb 100644 --- a/apps/docs/app/guides/ai-tools/ai-prompts/[slug]/page.tsx +++ b/apps/docs/app/guides/ai-tools/ai-prompts/[slug]/page.tsx @@ -6,8 +6,8 @@ import { wrapInMarkdownCodeBlock, } from '~/app/guides/getting-started/ai-prompts/[slug]/AiPrompts.utils' import { GuideTemplate, newEditLink } from '~/features/docs/GuidesMdx.template' +import { notFoundWithPathname } from '~/features/docs/notFound.utils' import { source } from 'common-tags' -import { notFound } from 'next/navigation' export const dynamicParams = false @@ -18,7 +18,7 @@ export default async function AiPromptsPage(props: { params: Promise<{ slug: str const prompt = await getAiPrompt(slug) if (!prompt) { - notFound() + notFoundWithPathname(`/guides/ai-tools/ai-prompts/${slug}`) } let { heading, content } = prompt diff --git a/apps/docs/app/guides/ai/python/[slug]/page.tsx b/apps/docs/app/guides/ai/python/[slug]/page.tsx index e31bc6b1595..e64133a1c39 100644 --- a/apps/docs/app/guides/ai/python/[slug]/page.tsx +++ b/apps/docs/app/guides/ai/python/[slug]/page.tsx @@ -1,14 +1,13 @@ -import { notFound } from 'next/navigation' import { relative } from 'path' -import rehypeSlug from 'rehype-slug' - import { GuideTemplate, newEditLink } from '~/features/docs/GuidesMdx.template' import { genGuideMeta, removeRedundantH1 } from '~/features/docs/GuidesMdx.utils' -import { getGitHubFileContents } from '~/lib/octokit' -import { UrlTransformFunction, linkTransform } from '~/lib/mdx/plugins/rehypeLinkTransform' +import { notFoundWithPathname } from '~/features/docs/notFound.utils' +import { linkTransform, UrlTransformFunction } from '~/lib/mdx/plugins/rehypeLinkTransform' import remarkMkDocsAdmonition from '~/lib/mdx/plugins/remarkAdmonition' import { removeTitle } from '~/lib/mdx/plugins/remarkRemoveTitle' +import { getGitHubFileContents } from '~/lib/octokit' import { SerializeOptions } from '~/types/next-mdx-remote-serialize' +import rehypeSlug from 'rehype-slug' export const dynamicParams = false @@ -76,7 +75,7 @@ const getContent = async ({ slug }: Params) => { const page = pageMap.find(({ slug: validSlug }) => validSlug && validSlug === slug) if (!page) { - notFound() + notFoundWithPathname(`/guides/ai/python/${slug}`) } const { remoteFile, meta } = page diff --git a/apps/docs/app/guides/database/extensions/wrappers/[[...slug]]/page.tsx b/apps/docs/app/guides/database/extensions/wrappers/[[...slug]]/page.tsx index ebafbd690b7..f85355e895a 100644 --- a/apps/docs/app/guides/database/extensions/wrappers/[[...slug]]/page.tsx +++ b/apps/docs/app/guides/database/extensions/wrappers/[[...slug]]/page.tsx @@ -5,6 +5,7 @@ import { genGuidesStaticParams, removeRedundantH1, } from '~/features/docs/GuidesMdx.utils' +import { notFoundWithPathname } from '~/features/docs/notFound.utils' import { newEditLink } from '~/features/helpers.edit-link' import { Guide, GuideArticle, GuideFooter, GuideHeader, GuideMdxContent } from '~/features/ui/guide' // End of third-party imports @@ -20,7 +21,6 @@ import type { SerializeOptions } from '~/types/next-mdx-remote-serialize' import { isFeatureEnabled } from 'common' import matter from 'gray-matter' import Link from 'next/link' -import { notFound } from 'next/navigation' import rehypeSlug from 'rehype-slug' import emoji from 'remark-emoji' import { Button } from 'ui' @@ -334,11 +334,14 @@ interface Params { } const WrappersDocs = async (props: { params: Promise }) => { + const params = await props.params + if (!isFeatureEnabled('docs:fdw')) { - notFound() + notFoundWithPathname( + `/guides/database/extensions/wrappers${params.slug?.length ? `/${params.slug.join('/')}` : ''}` + ) } - const params = await props.params const { isExternal, meta, assetsBaseUrl, ...data } = await getContent(params) // Create a combined URL transformer that handles both regular URLs and asset URLs diff --git a/apps/docs/app/guides/deployment/ci/[slug]/page.tsx b/apps/docs/app/guides/deployment/ci/[slug]/page.tsx index 4053787f65e..2a2cf31e917 100644 --- a/apps/docs/app/guides/deployment/ci/[slug]/page.tsx +++ b/apps/docs/app/guides/deployment/ci/[slug]/page.tsx @@ -1,15 +1,14 @@ -import { notFound } from 'next/navigation' import { relative } from 'node:path' -import rehypeSlug from 'rehype-slug' - import { GuideTemplate, newEditLink } from '~/features/docs/GuidesMdx.template' import { genGuideMeta, removeRedundantH1 } from '~/features/docs/GuidesMdx.utils' -import { getGitHubFileContents } from '~/lib/octokit' -import { UrlTransformFunction, linkTransform } from '~/lib/mdx/plugins/rehypeLinkTransform' +import { notFoundWithPathname } from '~/features/docs/notFound.utils' +import { linkTransform, UrlTransformFunction } from '~/lib/mdx/plugins/rehypeLinkTransform' import remarkMkDocsAdmonition from '~/lib/mdx/plugins/remarkAdmonition' import { removeTitle } from '~/lib/mdx/plugins/remarkRemoveTitle' import remarkPyMdownTabs from '~/lib/mdx/plugins/remarkTabs' +import { getGitHubFileContents } from '~/lib/octokit' import { SerializeOptions } from '~/types/next-mdx-remote-serialize' +import rehypeSlug from 'rehype-slug' export const dynamicParams = false @@ -75,7 +74,7 @@ const getContent = async ({ slug }: Params) => { const page = pageMap.find(({ slug: validSlug }) => validSlug && validSlug === slug) if (!page) { - notFound() + notFoundWithPathname(`/guides/deployment/ci/${slug}`) } const { remoteFile, meta } = page diff --git a/apps/docs/app/guides/deployment/terraform/[[...slug]]/page.tsx b/apps/docs/app/guides/deployment/terraform/[[...slug]]/page.tsx index 153c814eff3..2fafd8ea780 100644 --- a/apps/docs/app/guides/deployment/terraform/[[...slug]]/page.tsx +++ b/apps/docs/app/guides/deployment/terraform/[[...slug]]/page.tsx @@ -1,5 +1,6 @@ import { GuideTemplate, newEditLink } from '~/features/docs/GuidesMdx.template' import { genGuideMeta, removeRedundantH1 } from '~/features/docs/GuidesMdx.utils' +import { notFoundWithPathname } from '~/features/docs/notFound.utils' import { getEmptyArray } from '~/features/helpers.fn' import { IS_DEV } from '~/lib/constants' import { isValidGuideFrontmatter } from '~/lib/docs' @@ -10,7 +11,6 @@ import remarkPyMdownTabs from '~/lib/mdx/plugins/remarkTabs' import { getGitHubFileContents } from '~/lib/octokit' import { SerializeOptions } from '~/types/next-mdx-remote-serialize' import matter from 'gray-matter' -import { notFound } from 'next/navigation' import rehypeSlug from 'rehype-slug' import { @@ -106,7 +106,7 @@ const getContent = async ({ slug }: Params) => { const page = pageMap.find((page) => page.slug === requestedSlug) if (!page) { - notFound() + notFoundWithPathname(`/guides/deployment/terraform${slug?.length ? `/${slug.join('/')}` : ''}`) } const { meta, remoteFile, useRoot } = page diff --git a/apps/docs/app/guides/graphql/[[...slug]]/page.tsx b/apps/docs/app/guides/graphql/[[...slug]]/page.tsx index eb0c01b48f5..dda40f712a9 100644 --- a/apps/docs/app/guides/graphql/[[...slug]]/page.tsx +++ b/apps/docs/app/guides/graphql/[[...slug]]/page.tsx @@ -1,6 +1,7 @@ import { isAbsolute, relative } from 'path' import { GuideTemplate, newEditLink } from '~/features/docs/GuidesMdx.template' import { genGuideMeta } from '~/features/docs/GuidesMdx.utils' +import { notFoundWithPathname } from '~/features/docs/notFound.utils' import { getEmptyArray } from '~/features/helpers.fn' import { IS_DEV } from '~/lib/constants' import { linkTransform, UrlTransformFunction } from '~/lib/mdx/plugins/rehypeLinkTransform' @@ -9,7 +10,6 @@ import { removeTitle } from '~/lib/mdx/plugins/remarkRemoveTitle' import remarkPyMdownTabs from '~/lib/mdx/plugins/remarkTabs' import { getGitHubFileContents } from '~/lib/octokit' import { SerializeOptions } from '~/types/next-mdx-remote-serialize' -import { notFound } from 'next/navigation' import rehypeSlug from 'rehype-slug' // We fetch these docs at build time from an external repo @@ -128,7 +128,7 @@ const getContent = async ({ slug }: Params) => { const page = pageMap.find((page) => page.slug === slug?.at(0)) if (!page) { - notFound() + notFoundWithPathname(`/guides/graphql${slug?.length ? `/${slug.join('/')}` : ''}`) } const { remoteFile, meta } = page diff --git a/apps/docs/app/guides/troubleshooting/[slug]/page.tsx b/apps/docs/app/guides/troubleshooting/[slug]/page.tsx index 9f15cac7d53..f0868e8c167 100644 --- a/apps/docs/app/guides/troubleshooting/[slug]/page.tsx +++ b/apps/docs/app/guides/troubleshooting/[slug]/page.tsx @@ -1,5 +1,4 @@ -import { notFound } from 'next/navigation' - +import { notFoundWithPathname } from '~/features/docs/notFound.utils' import TroubleshootingPage from '~/features/docs/Troubleshooting.page' import { getAllTroubleshootingEntries, getArticleSlug } from '~/features/docs/Troubleshooting.utils' import { PROD_URL } from '~/lib/constants' @@ -20,7 +19,7 @@ export default async function TroubleshootingEntryPage(props: { const entry = allTroubleshootingEntries.find((entry) => getArticleSlug(entry) === slug) if (!entry) { - notFound() + notFoundWithPathname(`/guides/troubleshooting/${slug}`) } return diff --git a/apps/docs/app/reference/[...slug]/page.tsx b/apps/docs/app/reference/[...slug]/page.tsx index 0ed5497704c..d224a81cb7e 100644 --- a/apps/docs/app/reference/[...slug]/page.tsx +++ b/apps/docs/app/reference/[...slug]/page.tsx @@ -1,6 +1,5 @@ -import { notFound } from 'next/navigation' - import { REFERENCES } from '~/content/navigation.references' +import { notFoundWithPathname } from '~/features/docs/notFound.utils' import { ApiReferencePage } from '~/features/docs/Reference.apiPage' import { CliReferencePage } from '~/features/docs/Reference.cliPage' import { ClientSdkReferencePage } from '~/features/docs/Reference.sdkPage' @@ -18,9 +17,10 @@ export default async function ReferencePage(props: { params: Promise<{ slug: Arr const params = await props.params const { slug } = params + const referencePath = `/reference/${slug.join('/')}` if (!Object.keys(REFERENCES).includes(slug[0].replaceAll('-', '_'))) { - notFound() + notFoundWithPathname(referencePath) } const parsedPath = parseReferencePath(slug) @@ -34,7 +34,7 @@ export default async function ReferencePage(props: { params: Promise<{ slug: Arr const sdkData = REFERENCES[sdkId] if (sdkData.enabled === false) { - notFound() + notFoundWithPathname(referencePath) } const latestVersion = sdkData.versions[0] @@ -52,7 +52,7 @@ export default async function ReferencePage(props: { params: Promise<{ slug: Arr ) } else { - notFound() + notFoundWithPathname(referencePath) } } diff --git a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts index d2fdb96c6be..ed67342631d 100644 --- a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts +++ b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts @@ -1575,10 +1575,6 @@ export const api: NavMenuConstant = { { name: 'Generating TypeScript Types', url: '/guides/api/rest/generating-types' }, { name: 'Generating Python Types', url: '/guides/api/rest/generating-python-types' }, { name: 'Error Codes', url: '/guides/api/rest/postgrest-error-codes' }, - { - name: 'Handling Errors in supabase-js', - url: '/guides/api/handling-errors-in-supabase-js', - }, ], }, { @@ -1619,6 +1615,16 @@ export const api: NavMenuConstant = { }, ], }, + { + name: 'Debugging', + url: undefined, + items: [ + { + name: 'Handling Errors in supabase-js', + url: '/guides/api/handling-errors-in-supabase-js', + }, + ], + }, ], } @@ -1738,6 +1744,10 @@ export const functions: NavMenuConstant = { name: 'Status codes', url: '/guides/functions/status-codes' as `/${string}`, }, + { + name: 'Error codes', + url: '/guides/functions/error-codes' as `/${string}`, + }, { name: 'Recursive/Nested function calls', url: '/guides/functions/recursive-functions' as `/${string}`, @@ -2183,6 +2193,11 @@ export const storage: NavMenuConstant = { name: 'Querying Vectors', url: '/guides/storage/vector/querying-vectors' as `/${string}`, }, + { + name: 'Local Development', + url: '/guides/storage/vector/local-development' as `/${string}`, + enabled: billingEnabled, + }, { name: 'Limits', url: '/guides/storage/vector/limits' as `/${string}`, diff --git a/apps/docs/content/guides/ai-tools/mcp.mdx b/apps/docs/content/guides/ai-tools/mcp.mdx index 8e3092c2d1e..bec493599d4 100644 --- a/apps/docs/content/guides/ai-tools/mcp.mdx +++ b/apps/docs/content/guides/ai-tools/mcp.mdx @@ -52,7 +52,7 @@ The Supabase MCP server provides tools organized into feature groups. All groups ### Development - `get_project_url` - Get the API URL for a project -- `get_publishable_keys` - Get anon/public keys +- `get_publishable_keys` - Get publishable and legacy anon API keys for a project - `generate_typescript_types` - Generate TypeScript types from schema ### Edge Functions diff --git a/apps/docs/content/guides/ai/examples/headless-vector-search.mdx b/apps/docs/content/guides/ai/examples/headless-vector-search.mdx index fdf21d12cd5..b158bb4cd5f 100644 --- a/apps/docs/content/guides/ai/examples/headless-vector-search.mdx +++ b/apps/docs/content/guides/ai/examples/headless-vector-search.mdx @@ -84,7 +84,7 @@ const onSubmit = (e: Event) => { const query = new URLSearchParams({ query: inputRef.current!.value }) const projectUrl = `https://your-project-ref.supabase.co/functions/v1` - const queryURL = `${projectURL}/${query}` + const queryURL = `${projectUrl}/${query}` const eventSource = new EventSource(queryURL) eventSource.addEventListener("error", (err) => { diff --git a/apps/docs/content/guides/auth/auth-email-passwordless.mdx b/apps/docs/content/guides/auth/auth-email-passwordless.mdx index 647211150ba..34e48a8b2b4 100644 --- a/apps/docs/content/guides/auth/auth-email-passwordless.mdx +++ b/apps/docs/content/guides/auth/auth-email-passwordless.mdx @@ -87,7 +87,7 @@ Read the [Deep Linking Documentation](/docs/guides/auth/native-mobile-deep-linki ```dart Future signInWithEmail() async { - final AuthResponse res = await supabase.auth.signinwithotp(email: 'valid.email@supabase.io'); + final AuthResponse res = await supabase.auth.signInWithOtp(email: 'valid.email@supabase.io'); } ``` diff --git a/apps/docs/content/guides/auth/auth-hooks.mdx b/apps/docs/content/guides/auth/auth-hooks.mdx index bc0a4d34ede..b1259bc1d5a 100644 --- a/apps/docs/content/guides/auth/auth-hooks.mdx +++ b/apps/docs/content/guides/auth/auth-hooks.mdx @@ -148,6 +148,12 @@ Let us develop a Hook locally and then deploy it to the cloud. As a recap, here Edit `config.toml` to set up the Auth Hook locally. + + + The hook name used in the `config.toml` must correspond to one of the available Hooks listed above. For example, the Send SMS hook would be configured as: `[auth.hook.send_sms]` + + + { +async function setRoleCustomClaim() { let nextPageToken = undefined do { diff --git a/apps/docs/content/guides/cli.mdx b/apps/docs/content/guides/cli.mdx index 13297eba2c2..65484bc4c96 100644 --- a/apps/docs/content/guides/cli.mdx +++ b/apps/docs/content/guides/cli.mdx @@ -6,7 +6,7 @@ subtitle: 'Developing locally using the Supabase CLI.' sidebar_label: 'Overview' --- -You can use the Supabase CLI to run the entire Supabase stack locally on your machine, by running `supabase init` and then `supabase start`. To install the CLI, see the [installation guide](/docs/guides/cli/getting-started#installing-the-supabase-cli). +You can use the Supabase CLI to run the entire Supabase stack locally on your machine, by running `supabase init` and then `supabase start`. To install the CLI, read [the installation guide](/docs/guides/cli/getting-started#installing-the-supabase-cli). The Supabase CLI provides tools to develop your project locally, deploy to the Supabase Platform, handle database migrations, and generate types directly from your database schema. diff --git a/apps/docs/content/guides/database/connection-management.mdx b/apps/docs/content/guides/database/connection-management.mdx index eab783c2928..48b2c4f1b7b 100644 --- a/apps/docs/content/guides/database/connection-management.mdx +++ b/apps/docs/content/guides/database/connection-management.mdx @@ -51,7 +51,7 @@ For more details on using these monitoring charts, see the [Reports guide](/docs #### Grafana Dashboard -Supabase offers a Grafana Dashboard that records and visualizes over 200 project metrics, including connections. For setup instructions, check the [metrics docs](/docs/guides/platform/metrics). +Supabase offers a Grafana Dashboard that records and visualizes over 200 project metrics, including connections. For setup instructions, check the [metrics docs](/docs/guides/telemetry/metrics). Its "Client Connections" graph displays connections for both Supavisor and Postgres ![client connection graph](/docs/img/database/grafana-connections.png) diff --git a/apps/docs/content/guides/database/debugging-performance.mdx b/apps/docs/content/guides/database/debugging-performance.mdx index a2f349d7547..f333c94bb56 100644 --- a/apps/docs/content/guides/database/debugging-performance.mdx +++ b/apps/docs/content/guides/database/debugging-performance.mdx @@ -44,7 +44,7 @@ create table instruments ( name text ); -insert into books +insert into instruments (id, name) values (1, 'violin'), diff --git a/apps/docs/content/guides/database/drizzle.mdx b/apps/docs/content/guides/database/drizzle.mdx index 88a02df030e..852e0d356f4 100644 --- a/apps/docs/content/guides/database/drizzle.mdx +++ b/apps/docs/content/guides/database/drizzle.mdx @@ -81,8 +81,8 @@ If you plan on solely using Drizzle instead of the Supabase Data API (PostgREST) import postgres from 'postgres' let connectionString = process.env.DATABASE_URL - if (host.includes('postgres:postgres@supabase_db_')) { - const url = URL.parse(host)! + if (connectionString.includes('postgres:postgres@supabase_db_')) { + const url = URL.parse(connectionString)! url.hostname = url.hostname.split('_')[1] connectionString = url.href } diff --git a/apps/docs/content/guides/database/extensions.mdx b/apps/docs/content/guides/database/extensions.mdx index e7e090c6ad4..0c4dee671b3 100644 --- a/apps/docs/content/guides/database/extensions.mdx +++ b/apps/docs/content/guides/database/extensions.mdx @@ -44,7 +44,7 @@ To disable an extension call `drop extension`. -Most extensions are installed under the `extensions` schema, which is accessible to public by default. To avoid namespace pollution, we do not recommend creating other entities in the `extensions` schema. +Most extensions are installed under the `extensions` schema, which is accessible to `public` by default. To avoid namespace pollution, we do not recommend creating other entities in the `extensions` schema. If you need to restrict user access to tables managed by extensions, we recommend creating a separate schema for installing that specific extension. diff --git a/apps/docs/content/guides/database/extensions/pg_graphql.mdx b/apps/docs/content/guides/database/extensions/pg_graphql.mdx index 389dc09ddd6..ce5845773f0 100644 --- a/apps/docs/content/guides/database/extensions/pg_graphql.mdx +++ b/apps/docs/content/guides/database/extensions/pg_graphql.mdx @@ -90,7 +90,7 @@ returning the JSON "edges": [ { "node": { - "id": 1 + "id": 1, "name": "My Blog" } } diff --git a/apps/docs/content/guides/database/extensions/pg_plan_filter.mdx b/apps/docs/content/guides/database/extensions/pg_plan_filter.mdx index 17e8782a234..291f9c73a6f 100644 --- a/apps/docs/content/guides/database/extensions/pg_plan_filter.mdx +++ b/apps/docs/content/guides/database/extensions/pg_plan_filter.mdx @@ -52,7 +52,7 @@ explain select * from book; (1 row) ``` -Now we can choose a `statement_cost_filter` value between the total cost for the single select (2.49) and the whole table select (135.0) so one statement will succeed and one will fail. +Now we can choose a `statement_cost_limit` value between the total cost for the single select (2.49) and the whole table select (135.0) so one statement will succeed and one will fail. {/* prettier-ignore */} ```sql diff --git a/apps/docs/content/guides/database/extensions/pgaudit.mdx b/apps/docs/content/guides/database/extensions/pgaudit.mdx index 05fa6156868..6ec31eec88c 100644 --- a/apps/docs/content/guides/database/extensions/pgaudit.mdx +++ b/apps/docs/content/guides/database/extensions/pgaudit.mdx @@ -391,5 +391,5 @@ PGAudit's [official documentation](https://www.pgaudit.org) focuses on system an - [Official `PGAudit` documentation](https://www.pgaudit.org) - [Database Function Logging](/docs/guides/database/functions#general-logging) -- [Supabase Logging](/docs/guides/platform/logs) +- [Supabase Logging](/docs/guides/telemetry/logs) - [Self-Hosting Logs](/docs/reference/self-hosting-analytics/introduction) diff --git a/apps/docs/content/guides/database/extensions/pgjwt.mdx b/apps/docs/content/guides/database/extensions/pgjwt.mdx index fb0283e5dce..a77f55297df 100644 --- a/apps/docs/content/guides/database/extensions/pgjwt.mdx +++ b/apps/docs/content/guides/database/extensions/pgjwt.mdx @@ -55,8 +55,8 @@ It's good practice to create the extension within a separate schema (like `exten ## API -- [`sign(payload json, secret text, algorithm text default 'HSA256')`](https://github.com/michelp/pgjwt#usage): Signs a JWT containing _payload_ with _secret_ using _algorithm_. -- [`verify(token text, secret text, algorithm text default 'HSA256')`](https://github.com/michelp/pgjwt#usage): Decodes a JWT _token_ that was signed with _secret_ using _algorithm_. +- [`sign(payload json, secret text, algorithm text default 'HS256')`](https://github.com/michelp/pgjwt#usage): Signs a JWT containing _payload_ with _secret_ using _algorithm_. +- [`verify(token text, secret text, algorithm text default 'HS256')`](https://github.com/michelp/pgjwt#usage): Decodes a JWT _token_ that was signed with _secret_ using _algorithm_. Where: diff --git a/apps/docs/content/guides/database/inspect.mdx b/apps/docs/content/guides/database/inspect.mdx index 0f0fc5a3945..cce91f7b3b5 100644 --- a/apps/docs/content/guides/database/inspect.mdx +++ b/apps/docs/content/guides/database/inspect.mdx @@ -262,4 +262,4 @@ Using the query plan analyzer to optimize your queries is a large topic, with a - [Postgres Wiki.](https://wiki.postgresql.org/wiki/Using_EXPLAIN) - [Enterprise DB.](https://www.enterprisedb.com/blog/postgresql-query-optimization-performance-tuning-with-explain-analyze) -You can pair the information available from `pg_stat_statements` with the detailed system metrics available [via your metrics endpoint](../platform/metrics) to better understand the behavior of your DB and the queries you're executing against it. +You can pair the information available from `pg_stat_statements` with the detailed system metrics available [via your metrics endpoint](../telemetry/metrics) to better understand the behavior of your DB and the queries you're executing against it. diff --git a/apps/docs/content/guides/database/postgres/column-level-security.mdx b/apps/docs/content/guides/database/postgres/column-level-security.mdx index 4c4e6ffb12f..d1e3ebbdb93 100644 --- a/apps/docs/content/guides/database/postgres/column-level-security.mdx +++ b/apps/docs/content/guides/database/postgres/column-level-security.mdx @@ -134,7 +134,7 @@ supabase migration new create_posts_table user_id text, title text, content text, - created_at timestamptz default now() + created_at timestamptz default now(), updated_at timestamptz default now() ); diff --git a/apps/docs/content/guides/database/postgres/data-deletion.mdx b/apps/docs/content/guides/database/postgres/data-deletion.mdx index a8a0941bbdd..a27ac37074c 100644 --- a/apps/docs/content/guides/database/postgres/data-deletion.mdx +++ b/apps/docs/content/guides/database/postgres/data-deletion.mdx @@ -66,7 +66,7 @@ WHERE id IN ( This approach has the benefit of controlling when it runs, locking for a shorter period of time and minimising impact on other transactions. -If you know in advance that such large deletes will have to happen in the business cycle of your database, then you should seriously think about using (table parititioning)[/docs/guides/database/partitions] as a management tool. +If you know in advance that such large deletes will have to happen in the business cycle of your database, then you should seriously think about using [table partitioning](/docs/guides/database/partitions) as a management tool. ### Soft deletes diff --git a/apps/docs/content/guides/database/postgres/first-row-in-group.mdx b/apps/docs/content/guides/database/postgres/first-row-in-group.mdx index f94891a5c4a..b20a3eaa8b8 100644 --- a/apps/docs/content/guides/database/postgres/first-row-in-group.mdx +++ b/apps/docs/content/guides/database/postgres/first-row-in-group.mdx @@ -32,10 +32,9 @@ select distinct points from seasons -order BY - id, - points desc, - team; +order by + team, + points desc; ``` The important bits here are: diff --git a/apps/docs/content/guides/database/postgres/roles.mdx b/apps/docs/content/guides/database/postgres/roles.mdx index e5271f84df9..3286c786e49 100644 --- a/apps/docs/content/guides/database/postgres/roles.mdx +++ b/apps/docs/content/guides/database/postgres/roles.mdx @@ -113,7 +113,15 @@ Used by the Auth middleware to connect to the database and run migration. Access ### `supabase_etl_admin` -Used by [Replication powered by Supabase ETL](/docs/guides/database/replication) to replicate database changes to external destinations. Has read-all access and replication privileges for change data capture, bypasses Row Level Security, and can write to the `etl` schema. +`supabase_etl_admin` is used by [Database replication](/docs/guides/database/replication) through Supabase ETL. + +This role: + +- Replicates database changes to destination systems +- Has read-all access +- Has replication privileges for change data capture, bypasses Row Level Security +- Can create event triggers +- Can write to the `etl` schema ### `dashboard_user` diff --git a/apps/docs/content/guides/database/replication.mdx b/apps/docs/content/guides/database/replication.mdx index 53a92e048be..8ff0b26278f 100644 --- a/apps/docs/content/guides/database/replication.mdx +++ b/apps/docs/content/guides/database/replication.mdx @@ -1,7 +1,7 @@ --- id: 'replication' title: 'Database replication' -description: 'Compare read replicas, external replication, and manual replication.' +description: 'Compare read replicas, external replication (ETL), and manual replication.' subtitle: 'An introduction to database replication and change data capture.' sidebar_label: 'Overview' --- @@ -18,7 +18,7 @@ You might use database replication for: ## Replication methods -Supabase supports three replication methods. Choose based on whether you need another Supabase Postgres database, a managed pipeline to an external system, or full control over your own logical replication setup. +Supabase supports three replication methods. Choose based on whether you need another Supabase Postgres database, a managed pipeline to a destination system, or full control over your own logical replication setup. ### Read replicas @@ -26,21 +26,21 @@ Read replicas are additional Supabase Postgres databases kept in sync with your - [Set up read replicas](/docs/guides/platform/read-replicas) -### External replication +### External replication (ETL) [#external-replication] -External replication is currently in private alpha. Access is limited and features may change. +External replication (ETL) is currently in private alpha. Managed pipelines run through Supabase ETL. Access is limited and features may change. -External replication is powered by [Supabase ETL](https://github.com/supabase/etl). It uses Postgres logical replication under the hood and provides a managed Dashboard workflow for replicating data from Supabase Postgres to external data systems. +External replication (ETL) is powered by [Supabase ETL](https://github.com/supabase/etl). It uses Postgres logical replication under the hood and provides a managed Dashboard workflow for replicating data from Supabase Postgres to destination systems. In this context, "external" means outside the source database. Destinations can be Supabase-managed or third-party systems as support expands. -- [Set up external replication](/docs/guides/database/replication/external-replication-setup) +- [Set up external replication (ETL)](/docs/guides/database/replication/external-replication-setup) #### Supported destinations -External replication currently supports BigQuery as the managed destination. We are working on new destinations, and this table will be updated as support expands. +External replication (ETL) currently supports BigQuery as the managed destination. We are working on new destinations, and this table will be updated as support expands. | Destination | Insert | Update | Delete | Truncate | Schema change | Description | | ------------------------------------------------------ | ------------ | ------------ | ------------ | ------------ | ------------- | ------------------------------------------------------------------- | @@ -48,7 +48,7 @@ External replication currently supports BigQuery as the managed destination. We ### Manual replication -Manual replication uses the same underlying Postgres logical replication features as external replication, but you configure and operate the pieces yourself. Use this path when you want to connect tools such as Airbyte, Estuary, Fivetran, Materialize, Stitch, AWS DMS, or another system that supports Postgres logical replication. +Manual replication uses the same underlying Postgres logical replication features as external replication (ETL), but you configure and operate the pieces yourself. Use this path when you want to connect tools such as Airbyte, Estuary, Fivetran, Materialize, Stitch, AWS DMS, or another system that supports Postgres logical replication. - [Set up manual replication](/docs/guides/database/replication/manual-replication-setup) diff --git a/apps/docs/content/guides/database/replication/bigquery.mdx b/apps/docs/content/guides/database/replication/bigquery.mdx index c583f3a095e..12f1ae14fc9 100644 --- a/apps/docs/content/guides/database/replication/bigquery.mdx +++ b/apps/docs/content/guides/database/replication/bigquery.mdx @@ -1,14 +1,14 @@ --- id: 'bigquery-destination' title: 'BigQuery destination' -description: 'Configure BigQuery as an external replication destination.' +description: 'Configure BigQuery as an external replication (ETL) destination.' subtitle: 'Replicate Supabase Postgres tables to BigQuery.' sidebar_label: 'BigQuery' --- -External replication is currently in private alpha. Access is limited and features may change. +External replication (ETL) is currently in private alpha. Managed pipelines run through Supabase ETL. Access is limited and features may change. @@ -29,17 +29,22 @@ Before configuring BigQuery as a destination, set up the following in Google Clo 3. **GCP service account key**: Create a [service account](https://cloud.google.com/iam/docs/keys-create-delete) with appropriate permissions - Go to **IAM & Admin > Service Accounts** - Click **Create Service Account** - - Grant the "BigQuery Data Editor" role + - Grant the "BigQuery Data Editor" and "BigQuery Job User" roles - Create and download the JSON key file Required permissions: - `bigquery.datasets.get` +- `bigquery.jobs.create` - `bigquery.tables.create` +- `bigquery.tables.delete` - `bigquery.tables.get` - `bigquery.tables.getData` +- `bigquery.tables.list` - `bigquery.tables.update` - `bigquery.tables.updateData` +- `bigquery.routines.get` +- `bigquery.routines.list` ## Configure BigQuery as a destination @@ -85,19 +90,25 @@ Once configured, replication to BigQuery: ## Source table requirements -BigQuery replication requires each source table to have a primary key, and the publication must include the primary-key columns. External replication declares those columns as the BigQuery destination primary key so BigQuery CDC can apply `UPSERT` and `DELETE` rows. +BigQuery replication requires each source table to have a primary key, and the publication must include the primary-key columns. Supabase ETL declares those columns as the BigQuery destination primary key so BigQuery change data capture (CDC) can apply `UPSERT` and `DELETE` rows. -BigQuery primary keys are `NOT ENFORCED`, and BigQuery CDC supports composite primary keys with up to 16 columns. Your source primary key must stay unique and non-null because BigQuery uses it to match CDC rows. +BigQuery primary keys are `NOT ENFORCED`, and BigQuery change data capture (CDC) supports composite primary keys with up to 16 columns. Your source primary key must stay unique and non-null because BigQuery uses it to match CDC rows. -Source tables must also use a BigQuery-compatible Postgres `REPLICA IDENTITY` setting: +Source tables must also use a BigQuery-compatible Postgres `REPLICA IDENTITY` setting. Most tables can keep the Postgres default, as long as they have a primary key and all primary-key columns are included in the publication. -- `DEFAULT` with a primary key is supported and works for most tables. -- `FULL` is supported and is recommended for tables with large `text`, `jsonb`, `bytea`, or other values that Postgres may store out-of-line using TOAST. -- `USING INDEX`, `NOTHING`, or `DEFAULT` without a primary key are not supported for BigQuery replication. +| Source table setting | BigQuery support | Guidance | +| ------------------------------------------------ | ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `REPLICA IDENTITY DEFAULT` with a primary key | Supported | Recommended for most tables. BigQuery uses the replicated source primary key to apply upserts and deletes. | +| `REPLICA IDENTITY FULL` | Supported | Recommended for tables with large `text`, `jsonb`, `bytea`, or other values that Postgres may store out-of-line using TOAST, especially when those rows update. | +| `REPLICA IDENTITY USING INDEX` | Not supported | BigQuery change data capture (CDC) rows are keyed by the source primary key, not by an alternative unique index. | +| `REPLICA IDENTITY NOTHING` | Not supported | Updates and deletes do not include enough row identity for BigQuery to apply them safely. | +| `REPLICA IDENTITY DEFAULT` without a primary key | Not supported | BigQuery requires a source primary key. | For a general explanation of how replica identity affects update and delete events, see [How does replica identity affect updates and deletes?](/docs/guides/database/replication/external-replication-faq#how-does-replica-identity-affect-updates-and-deletes). -For updates, Postgres does not always send a complete old row through logical replication. It can also mark unchanged toasted values as `unchanged toast` instead of resending the value. The replication pipeline can reconstruct a complete update when the old row image contains the missing value, which is reliable with `REPLICA IDENTITY FULL`. BigQuery CDC upserts require a complete new row, so updates can fail for tables with toasted columns if the pipeline receives only a partial update row. +For updates, Postgres does not always send a complete old row through logical replication. It can also mark unchanged toasted values as `unchanged toast` instead of resending the value. BigQuery change data capture (CDC) upserts require a complete new row because omitted columns are not preserved in the destination. The replication pipeline can reconstruct a complete update when the old row image contains the missing value, which is reliable with `REPLICA IDENTITY FULL`. + +If a BigQuery pipeline fails with an error about a partial update row, set `REPLICA IDENTITY FULL` on the affected source table and restart the pipeline. Changing replica identity only affects new WAL records, so a retained update that was written before the change may still need to be skipped by recreating the pipeline or re-copying the affected table. Check a table's current replica identity: @@ -134,20 +145,26 @@ This structure handles table truncations while maintaining query compatibility. ## Schema change support -Schema change support for BigQuery is currently in beta. External replication supports a limited set of schema changes while the feature is developed further. +Schema change support for BigQuery is currently in beta. Supabase ETL supports a limited set of schema changes for BigQuery while the feature is developed further. Supported schema changes: -- Adding a column +- Adding a nullable column - Removing a column - Renaming a column +- Dropping a `NOT NULL` constraint +- Setting or dropping supported column default metadata -Unsupported schema changes: +Unsupported or limited schema changes: - Changing a column's data type -- Replicating column default values +- Adding `NOT NULL` with `SET NOT NULL` +- Filling existing rows for `ADD COLUMN ... DEFAULT` +- Unsupported default expressions -We plan to expand schema change support over time as the feature evolves. +BigQuery requires added columns to be nullable. When a replicated `ADD COLUMN` includes a default, external replication (ETL) can apply supported default metadata for future rows, but BigQuery does not backfill existing rows through that DDL. Existing destination rows remain `NULL` unless you run a separate backfill. + +Supported defaults are best-effort translations to BigQuery SQL. Unsupported defaults are skipped with a warning instead of failing replication. ## Limitations @@ -160,4 +177,4 @@ We plan to expand schema change support over time as the feature evolves. ## Additional resources - [BigQuery documentation](https://cloud.google.com/bigquery/docs) - Official Google BigQuery documentation -- [BigQuery change data capture](https://cloud.google.com/bigquery/docs/change-data-capture) - BigQuery CDC requirements and limitations +- [BigQuery change data capture](https://cloud.google.com/bigquery/docs/change-data-capture) - BigQuery change data capture (CDC) requirements and limitations diff --git a/apps/docs/content/guides/database/replication/external-replication-faq.mdx b/apps/docs/content/guides/database/replication/external-replication-faq.mdx index cc09c6336bf..6c56a465e64 100644 --- a/apps/docs/content/guides/database/replication/external-replication-faq.mdx +++ b/apps/docs/content/guides/database/replication/external-replication-faq.mdx @@ -1,26 +1,26 @@ --- id: 'external-replication-faq' -title: 'External replication FAQ' -description: 'Frequently asked questions about external replication.' -subtitle: 'Common questions and answers about external replication.' +title: 'External replication (ETL) FAQ' +description: 'Frequently asked questions about external replication (ETL).' +subtitle: 'Common questions and answers about external replication (ETL).' sidebar_label: 'FAQ' --- -External replication is currently in private alpha. Access is limited and features may change. +External replication (ETL) is currently in private alpha. Managed pipelines run through Supabase ETL. Access is limited and features may change. ## What destinations are supported? -External replication currently supports **BigQuery** as the managed destination. See the [BigQuery destination guide](/docs/guides/database/replication/bigquery) for configuration details. +External replication (ETL) currently supports **BigQuery** as the managed destination. See the [BigQuery destination guide](/docs/guides/database/replication/bigquery) for configuration details. -We are working on new destinations. Availability may continue to vary based on the planned roll-out strategy. +We are working on new destinations. "External" means outside the source database, so supported destinations can be Supabase-managed or third-party systems as support expands. Availability may continue to vary based on the planned roll-out strategy. -## Which plans support external replication? +## Which plans support external replication (ETL)? [#which-plans-support-external-replication] -External replication is available on the Pro, Team, and Enterprise plans. +External replication (ETL) is available on the Pro, Team, and Enterprise plans. {/* supa-mdx-lint-disable-next-line Rule001HeadingCase */} @@ -30,11 +30,11 @@ We are currently working on a new Supabase Warehouse product designed to address As a result, managed replication to Analytics Buckets is no longer available. Right now, **BigQuery** is the only supported managed destination, and we are actively working on expanding capabilities. -## What does external replication install in the database? +## What does external replication (ETL) install in the database? [#what-does-external-replication-install-in-the-database] -When you enable external replication, Supabase installs database objects that help track replication state and support schema changes: +When you enable external replication (ETL), Supabase installs database objects that help Supabase ETL track replication state and support schema changes: -- An event trigger that runs on every `ALTER TABLE` statement. External replication uses this to support schema change handling. +- An event trigger that runs on every `ALTER TABLE` statement. Supabase ETL uses this to support schema change handling. - A set of tables in the `etl` schema. These tables track replication state for your pipelines. The replication state tables are not updated very often, especially after the initial copy phase is complete. @@ -45,19 +45,21 @@ Schema change support is currently in beta and limited to the BigQuery destinati Supported schema changes: -- Adding a column +- Adding a nullable column - Removing a column - Renaming a column +- Dropping a `NOT NULL` constraint +- Setting or dropping supported column default metadata -External replication does not currently support changing column data types or replicating column default values. See [BigQuery schema change support](/docs/guides/database/replication/bigquery#schema-change-support) for details. +External replication (ETL) does not currently support changing column data types, adding `NOT NULL` with `SET NOT NULL`, or filling existing destination rows for `ADD COLUMN ... DEFAULT`. Supported defaults are applied as destination metadata for future rows where BigQuery can represent them. See [BigQuery schema change support](/docs/guides/database/replication/bigquery#schema-change-support) for details. -## What happens when you disable external replication? +## What happens when you disable external replication (ETL)? [#what-happens-when-you-disable-external-replication] -Disabling external replication removes the database objects that were installed in your source database, including the replication state tables in the `etl` schema and the DDL event trigger. +Disabling external replication (ETL) removes the database objects that were installed in your source database, including the replication state tables in the `etl` schema and the DDL event trigger. -You must delete all external replication pipelines before the disable action is available. For the Dashboard steps, see [Disabling external replication](/docs/guides/database/replication/external-replication-setup#disabling-external-replication). +To remove external replication (ETL) from a project, delete all replication pipelines first. After all pipelines are deleted, the disable action becomes available. For the Dashboard steps, see [Disabling external replication (ETL)](/docs/guides/database/replication/external-replication-setup#disabling-external-replication). -Disabling external replication stops Supabase from managing external replication for the project. It does not delete tables or data that were already written to your destination. +Disabling external replication (ETL) stops Supabase from managing replication for the project. It does not delete tables or data that were already written to your destination. ## Why is a table not being replicated? @@ -65,10 +67,20 @@ Common reasons: - **Missing primary key**: Tables must have a primary key to be replicated (Postgres logical replication requirement) - **Not in publication**: Ensure the table is included in your Postgres publication -- **Unsupported data types**: Tables with custom data types are not supported +- **Generated columns**: Generated columns are skipped during replication Check your publication settings and verify your table meets the requirements. +Custom data types replicate as strings. Check that your destination can interpret those string values correctly. + +## Why are partitioned tables replicated as separate tables? + +Postgres controls this with the publication's `publish_via_partition_root` setting. If the setting is `false`, or if you created the publication manually with SQL and did not set it, Postgres publishes changes from the leaf partitions. External replication (ETL) then creates destination tables for those leaf partitions. If `publish_via_partition_root = true`, Postgres publishes changes as the partition root, so the partition hierarchy is treated as the published partition root. + +Publications created from the Dashboard replication flow use `publish_via_partition_root = true`. + +See [Partitioned tables](/docs/guides/database/replication/external-replication-setup#partitioned-tables) for examples and the full behavior. + ## How does replica identity affect updates and deletes? If inserts replicate but updates or deletes fail, check the table's `REPLICA IDENTITY` setting. @@ -132,6 +144,20 @@ Pipeline failures occur during the streaming phase when an error happens while r See [Handling errors](/docs/guides/database/replication/external-replication-monitoring#handling-errors) for more details. +## Why is replication lag increasing? + +Lag increases when Postgres produces WAL faster than the pipeline can confirm it has processed. Common causes include a slow or rate-limited destination, a pipeline issue, heavy source database activity, long transactions, network latency between the pipeline and source database, or a stopped/disconnected pipeline. + +Open [**Database > Replication**](/dashboard/project/_/database/replication), click **View status**, and check **Waiting to sync**, **Room before pausing**, **Last check-in**, **Connected**, and **Slot status**. See [Dealing with replication lag](/docs/guides/database/replication/external-replication-monitoring#dealing-with-replication-lag) for the full investigation and response flow. + +## What does a `Lost` slot status mean? + +`Lost` means Postgres has already removed WAL files that the pipeline's replication slot needed. The pipeline cannot continue from that slot. + +You can recreate the pipeline, or open the pipeline's **Advanced settings**, set **Invalidated slot behavior** to **Recreate**, and restart the pipeline. On restart, the pipeline creates a new replication slot and starts replication from scratch for all tables. This is required for consistency because the old slot can no longer provide every change the pipeline missed. + +See [Slot statuses](/docs/guides/database/replication/external-replication-monitoring#slot-statuses) for all slot states and what to do next. + ## Why is a table in error state? Table errors occur during the copy phase. To recover, click **View status**, find the affected table, and reset the table state. This will restart the table copy from the beginning. @@ -145,7 +171,7 @@ Check the [**Database > Replication**](/dashboard/project/_/database/replication 3. Ensure all tables show **Live** state (actively replicating) 4. Monitor replication lag metrics -See the [external replication monitoring guide](/docs/guides/database/replication/external-replication-monitoring) for comprehensive monitoring instructions. +See the [external replication (ETL) monitoring guide](/docs/guides/database/replication/external-replication-monitoring) for comprehensive monitoring instructions. ## How to stop or pause replication @@ -159,13 +185,13 @@ Stopping replication causes changes to queue up in the WAL. ## What happens if a project becomes inactive? -If your project becomes inactive, external replication stops any running pipelines and does not automatically resume them after the project is restarted. +If your project becomes inactive, external replication (ETL) stops any running pipelines and does not automatically resume them after the project is restarted. After restarting the project, restart each replication pipeline manually from the [**Database > Replication**](/dashboard/project/_/database/replication) section of the Dashboard. ## What happens after a downgrade to the free plan? -When a project is downgraded to the Free Plan, all external replication pipelines for that project are deleted. +When a project is downgraded to the Free Plan, all external replication (ETL) pipelines for that project are deleted. ## What happens if a table is deleted at the destination? @@ -219,6 +245,6 @@ Navigate to the [**Logs > Replication**](/dashboard/project/_/logs/explorer) sec If you need assistance: -1. Check the [external replication setup guide](/docs/guides/database/replication/external-replication-setup) and [external replication monitoring guide](/docs/guides/database/replication/external-replication-monitoring) +1. Check the [external replication (ETL) setup guide](/docs/guides/database/replication/external-replication-setup) and [external replication (ETL) monitoring guide](/docs/guides/database/replication/external-replication-monitoring) 2. Review this FAQ for common issues 3. Contact support with your error details and logs diff --git a/apps/docs/content/guides/database/replication/external-replication-monitoring.mdx b/apps/docs/content/guides/database/replication/external-replication-monitoring.mdx index 12e460f88cf..789607ce586 100644 --- a/apps/docs/content/guides/database/replication/external-replication-monitoring.mdx +++ b/apps/docs/content/guides/database/replication/external-replication-monitoring.mdx @@ -1,18 +1,18 @@ --- id: 'external-replication-monitoring' -title: 'External replication monitoring' -description: 'Monitor the status and health of your external replication pipelines.' +title: 'External replication (ETL) monitoring' +description: 'Monitor the status and health of your external replication (ETL) pipelines.' subtitle: 'Track replication status, view logs, and troubleshoot issues.' sidebar_label: 'Monitoring' --- -External replication is currently in private alpha. Access is limited and features may change. +External replication (ETL) is currently in private alpha. Managed pipelines run through Supabase ETL. Access is limited and features may change. -After setting up external replication, you can monitor the status and health of your replication pipelines directly from the Dashboard. The pipeline is the active Postgres replication process that continuously streams changes from your database to your destination. +After setting up external replication (ETL), you can monitor the status and health of your replication pipelines directly from the Dashboard. The pipeline is the active Postgres replication process that continuously streams changes from your database to your destination. ### Viewing pipeline status @@ -55,7 +55,35 @@ height={2146} #### Replication lag metrics -The status page shows replication lag metrics that help you determine how fast your pipeline is replicating data. These metrics are loaded directly from Postgres itself. +The status page shows replication lag metrics that help you determine how far the pipeline is behind Postgres. These metrics are loaded directly from Postgres replication slot state. + +The destinations list also shows a compact lag value. This value is byte-based: it shows how much WAL the pipeline has not confirmed as flushed yet. A value of **Caught up** means the pipeline has confirmed every change currently available for its slot. + +The detailed status page shows: + +| Metric | What it means | What to watch for | +| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | +| **Waiting to sync** | Bytes of WAL between the pipeline's confirmed flush position and the current Postgres WAL position. This is the main byte-based replication lag. | A value that keeps growing means the pipeline is receiving changes more slowly than Postgres produces them. | +| **Room before pausing** | How much WAL can still accumulate before Postgres can no longer safely keep all WAL needed by the replication slot. This is controlled by `max_slot_wal_keep_size`. | A small or shrinking value means the slot is getting closer to being invalidated. `Unlimited` means Postgres is not reporting a slot WAL retention limit. | +| **Last check-in** | How long it has been since the pipeline last sent replication feedback to Postgres. | An old value can mean the pipeline is stopped, disconnected, overloaded, or unable to make progress. | +| **Connected** | Whether the pipeline's replication slot is active and currently being used. | `Not connected` while the pipeline should be running usually means you should check pipeline status and logs. | +| **Slot status** | How safely Postgres is keeping the WAL files the pipeline still needs. | `Unreserved` and `Lost` require action. See [Slot statuses](#slot-statuses). | + +External replication (ETL) uses one main pipeline replication slot for ongoing changes. During the initial copy phase, it can also create temporary table-sync replication slots. These temporary slots let multiple tables copy in parallel, make large table copies faster, and allow individual tables to be retried or copied again without restarting the whole pipeline. + +Temporary table-sync slots show the same kind of lag and slot health metrics while they are active. After a table finishes copying and catches up, its temporary slot is removed and ongoing changes continue through the main pipeline slot. For overall replication health, focus first on the main pipeline slot. + +#### Slot statuses + +Replication slot status tells you whether Postgres is still retaining the WAL that the pipeline needs to continue from its current position. + +| Status | Meaning | +| -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| **Reserved** | Healthy. Postgres is keeping the WAL files this pipeline's replication slot needs, and they are within the normal WAL size limit. | +| **Extended** | Healthy, but growing. The slot is holding on to more WAL than usual, but Postgres is still keeping everything the pipeline needs. | +| **Unreserved** | At risk. Postgres is no longer reserving all WAL files this pipeline's replication slot needs. If the pipeline does not catch up soon, those files may be removed. | +| **Lost** | Broken. Some WAL files this pipeline's replication slot needs have already been removed. The pipeline can no longer continue from this slot. Recreate the pipeline, or set **Invalidated slot behavior** to **Recreate** in the pipeline's advanced settings and restart it. | +| **Unknown** | Postgres reported an unknown or unavailable state for this pipeline's replication slot. | #### Table states @@ -69,6 +97,57 @@ The pipeline status page also shows the state of individual tables being replica | **Live** | Table is now replicating data in near real-time | | **Error** | Table has experienced an error during replication | +### Dealing with replication lag + +Replication lag means the pipeline is behind the source database. Some lag is expected during the initial copy phase, after a burst of writes, or after restarting a stopped pipeline. Lag becomes a problem when it keeps increasing, when **Room before pausing** is running low, or when the slot status moves to **Unreserved** or **Lost**. + +Lag can come from several places: + +- **Destination throughput**: The destination is slow, rate-limited, unavailable, or rejecting writes. +- **Pipeline throughput**: The pipeline is overloaded, processing a very large transaction, or not performing as expected for the project workload. +- **Source database activity**: Postgres is producing WAL faster than the pipeline can consume it, often during bulk writes, migrations, or backfill jobs. +- **Network latency**: Latency or instability between the pipeline and source database can slow down WAL streaming. +- **Stopped or disconnected pipeline**: When a pipeline is stopped, disconnected, or failed, Postgres keeps WAL for the slot until the retention limit is reached. +- **Slow initial table copy**: A temporary table-sync slot can fall behind if a table is copied more slowly than new changes are written to that table. + +#### Initial copy and table-sync slots + +A common initial sync issue happens when a large or busy table is still in **Copying** while new rows keep being inserted or updated. The temporary table-sync slot needs to keep the changes that happen during the copy. If the copy is too slow compared to the table's write rate, the slot can move to **Unreserved** and then **Lost** if Postgres removes changes the copy still needs. + +When a table-sync slot is lost, the affected table needs to be copied again. Tune the copy settings, then retry the table copy: + +- Increase **Copy connections per table** when one large table is the bottleneck. This lets the pipeline copy chunks of that table in parallel, up to the point where the source database or network becomes the limit. +- Increase **Table sync workers** when several tables need to copy at the same time. Each worker can copy one table, and each worker uses an additional temporary replication slot during initial sync. +- If possible, run the initial copy during a quieter write period or reduce bulk writes until the table reaches **Live**. + +After the affected table finishes copying and catches up, the temporary slot is deleted. The table then continues through the main pipeline replication slot. + +#### Investigate the lag + +1. Open [**Database > Replication**](/dashboard/project/_/database/replication) and check the destination's lag column. +2. Click **View status** and check **Waiting to sync**, **Room before pausing**, **Last check-in**, **Connected**, and **Slot status**. +3. Check table states. Tables in **Copying** can create temporary lag while the initial snapshot catches up to live changes. If a table-sync slot is **Unreserved** or **Lost**, tune copy parallelism and retry the affected table copy. +4. Open [**Logs > Replication**](/dashboard/project/_/logs/explorer) and look for destination errors, retries, rate limits, schema errors, or repeated restarts. +5. Compare the lag trend with recent database activity, such as imports, migrations, bulk updates, or long transactions. + +#### Respond based on the slot status + +| Slot status | What to do | +| -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| **Reserved** | If **Waiting to sync** is stable or decreasing, continue monitoring. If it keeps increasing, check destination write performance, logs, and whether the publication includes more tables or write volume than expected. | +| **Extended** | Treat it as an early warning. Confirm the pipeline is connected, check logs for retries or destination slowness, and reduce avoidable write bursts if possible until the pipeline catches up. | +| **Unreserved** | Act quickly. The slot is at risk of losing required WAL. Check whether the pipeline is connected and making progress, fix destination or pipeline errors, and contact support if the lag continues to grow. | +| **Lost** | The pipeline cannot continue from the existing slot because required WAL has been removed. Recreate the pipeline, or set **Invalidated slot behavior** to **Recreate** in the pipeline's advanced settings and restart the pipeline. This creates a new slot and starts replication from scratch for all tables. | +| **Unknown** | Check replication logs for errors or missing slot details. If the status remains unknown while the pipeline should be running, contact support with the pipeline ID and recent log details. | + +#### Reduce future lag risk + +- Keep publications focused on the tables and operations you need at the destination. +- Avoid leaving pipelines stopped for long periods while the source database is still receiving writes. +- Schedule bulk updates, imports, and migrations during lower-traffic windows when possible. +- For BigQuery, verify that service account permissions, table requirements, and replica identity settings match the [BigQuery destination guide](/docs/guides/database/replication/bigquery). +- If the initial copy is the bottleneck, review **Table sync workers** and **Copy connections per table** in the pipeline's advanced settings. Increasing them can speed up copying, but it uses more database connections and replication slots. + ### Handling errors Errors can occur at two levels: per table or per pipeline. @@ -186,9 +265,9 @@ If you notice issues with your replication: 4. **Verify publication**: Ensure your Postgres publication is properly configured 5. **Monitor replication lag**: High lag may indicate performance issues -For more troubleshooting tips, see the [external replication FAQ](/docs/guides/database/replication/external-replication-faq). +For more troubleshooting tips, see the [external replication (ETL) FAQ](/docs/guides/database/replication/external-replication-faq). ### Next steps -- [Set up external replication](/docs/guides/database/replication/external-replication-setup) -- [View external replication FAQ](/docs/guides/database/replication/external-replication-faq) +- [Set up external replication (ETL)](/docs/guides/database/replication/external-replication-setup) +- [View external replication (ETL) FAQ](/docs/guides/database/replication/external-replication-faq) diff --git a/apps/docs/content/guides/database/replication/external-replication-setup.mdx b/apps/docs/content/guides/database/replication/external-replication-setup.mdx index f1c58b4303d..849560ba439 100644 --- a/apps/docs/content/guides/database/replication/external-replication-setup.mdx +++ b/apps/docs/content/guides/database/replication/external-replication-setup.mdx @@ -1,26 +1,26 @@ --- id: 'external-replication-setup' -title: 'Set up external replication' -description: 'Set up external replication using Postgres logical replication.' -subtitle: 'Configure publications and destinations for external replication.' +title: 'Set up external replication (ETL)' +description: 'Set up external replication (ETL) using Postgres logical replication.' +subtitle: 'Configure publications and destinations for external replication (ETL).' sidebar_label: 'Setting up' --- -External replication is currently in private alpha. Access is limited and features may change. +External replication (ETL) is currently in private alpha. Managed pipelines run through Supabase ETL. Access is limited and features may change. -External replication is powered by [Supabase ETL](https://github.com/supabase/etl) and uses **Postgres logical replication** to stream changes from your database to external data systems. It provides a managed interface through the Dashboard to configure and monitor replication pipelines. +External replication (ETL) is powered by [Supabase ETL](https://github.com/supabase/etl) and uses **Postgres logical replication** to stream changes from your database to destination systems. It provides a managed interface through the Dashboard to configure and monitor replication pipelines. In this context, "external" means outside the source database; destinations can be Supabase-managed or third-party systems as support expands. ## Setup overview -External replication requires two main components: a **Postgres publication** (defines what to replicate) and a **destination** (where data is sent). Follow these steps to set up your replication pipeline. +External replication (ETL) requires two main components: a **Postgres publication** (defines what to replicate) and a **destination** (where data is sent). Supabase ETL runs the managed pipeline that reads from the publication and writes to the destination. Follow these steps to set up your replication pipeline. -If you already have a Postgres publication set up, you can skip to [Step 2: Enable external replication](#step-2-enable-external-replication). +If you already have a Postgres publication set up, you can skip to [Step 2: Enable external replication (ETL)](#step-2-enable-external-replication). @@ -88,6 +88,44 @@ create publication pub_recent_orders for table orders where (created_at > '2024-01-01'); ``` +##### Partitioned tables + +External replication (ETL) follows Postgres publication semantics for partitioned tables. The `publish_via_partition_root` publication setting controls whether changes from partitions are emitted as the partition root or as the leaf partitions. + +| Publication setting | What gets replicated | Destination shape | +| ------------------------------------------ | ---------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `publish_via_partition_root = true` | Rows from the published partition root, including rows stored in its leaf partitions | One table matching the published partition root | +| `publish_via_partition_root = false` | Rows from the leaf partitions under the published partition root | One table per replicated leaf partition | +| Not set in SQL | Same as `false`, because Postgres defaults `publish_via_partition_root` to `false` | One table per replicated leaf partition | +| Publishing an individual leaf partition | The leaf partition itself, regardless of `publish_via_partition_root` | One table for that leaf partition | +| `FOR ALL TABLES` or `FOR TABLES IN SCHEMA` | Partition roots plus regular tables when `true`; leaf partitions plus regular tables when `false` or unset | Destination tables follow the effective Postgres publication table list | + +For example, if `orders` is partitioned by month: + +```sql +-- Replicate the whole partition hierarchy as the parent table. +create publication pub_orders_root +for table orders +with (publish_via_partition_root = true); + +-- Replicate each leaf partition as its own table. +create publication pub_orders_leaves +for table orders +with (publish_via_partition_root = false); +``` + +Use `publish_via_partition_root = true` when you want analytics queries to read from a single destination table that has the parent table's schema. Use `false` when each partition should remain a separate destination table. + +Publications created from the Dashboard replication flow use `publish_via_partition_root = true`. If you create or alter a publication manually with SQL, set this option explicitly so the destination shape matches what you expect. + +On Postgres 15 and newer, row filters on partition publications apply during both the initial copy and streaming phases. External replication (ETL) uses the row filter attached to the effective publication table entry: the published partition root when `publish_via_partition_root = true`, and the published leaf relation when `publish_via_partition_root = false`. + + + +With `publish_via_partition_root = true`, truncating an individual leaf partition is not replicated as a truncate event for the published parent. If you need truncate replication, run `TRUNCATE` on the published partition root. + + + #### Viewing publications in the Dashboard After creating a publication via SQL, you can view it in the Dashboard: @@ -95,17 +133,17 @@ After creating a publication via SQL, you can view it in the Dashboard: 1. Navigate to the [**Database > Publications**](/dashboard/project/_/database/publications) section of the Dashboard 2. You'll see all your publications listed with their tables -### Step 2: Enable external replication +### Step 2: Enable external replication (ETL) [#step-2-enable-external-replication] -Before creating an external replication pipeline, enable external replication for your project: +Before creating an external replication (ETL) pipeline, enable it for your project: 1. Navigate to the [**Database > Replication**](/dashboard/project/_/database/replication) section of the Dashboard 2. Click **Add destination** to show the replication side panel -3. Select an external replication destination, such as **BigQuery** -4. Click **Enable external replication** +3. Select an external replication (ETL) destination, such as **BigQuery** +4. Click **Enable external replication (ETL)** Enable external replication -For comprehensive monitoring instructions including pipeline states, metrics, and logs, see the [external replication monitoring guide](/docs/guides/database/replication/external-replication-monitoring). +For comprehensive monitoring instructions including pipeline states, metrics, and logs, see the [external replication (ETL) monitoring guide](/docs/guides/database/replication/external-replication-monitoring). ### Managing your pipeline @@ -179,18 +219,18 @@ Available actions: - **Edit destination**: Modify destination settings like credentials or advanced options - **Delete**: Remove the destination and permanently stop replication -### Disabling external replication +### Disabling external replication (ETL) [#disabling-external-replication] -To turn off external replication for a project, delete all external replication pipelines first. After all pipelines are removed, open the three-dot actions menu on the Replication page and click **Disable external replication**. +To turn off external replication (ETL) for a project, delete all replication pipelines first. After all pipelines are removed, open the three-dot actions menu on the Replication page and click **Disable external replication (ETL)**. Disable external replication from the Replication page actions menu -For cleanup details, see [What happens when you disable external replication?](/docs/guides/database/replication/external-replication-faq#what-happens-when-you-disable-external-replication). +For cleanup details, see [What happens when you disable external replication (ETL)?](/docs/guides/database/replication/external-replication-faq#what-happens-when-you-disable-external-replication). ### Adding or removing tables @@ -232,7 +272,7 @@ If your Postgres publication uses `FOR ALL TABLES` or `FOR TABLES IN SCHEMA`, ne -When a table is deleted at the destination, the behavior depends on the destination. In general, the pipeline tries to recreate the table so replication can continue. To permanently delete a table, pause the pipeline first or remove it from the publication before deleting. See the [external replication FAQ](/docs/guides/database/replication/external-replication-faq#what-happens-if-a-table-is-deleted-at-the-destination) for details. +When a table is deleted at the destination, the behavior depends on the destination. In general, the pipeline tries to recreate the table so replication can continue. To permanently delete a table, pause the pipeline first or remove it from the publication before deleting. See the [external replication (ETL) FAQ](/docs/guides/database/replication/external-replication-faq#what-happens-if-a-table-is-deleted-at-the-destination) for details. @@ -242,13 +282,13 @@ Schema change support depends on the destination. BigQuery is currently the only ### How it works -Once configured, external replication: +Once configured, external replication (ETL): 1. **Captures** changes from your Postgres database using Postgres publications and logical replication -2. **Streams** the changes through the replication pipeline +2. **Streams** the changes through Supabase ETL 3. **Loads** the data to your destination -External replication automatically optimizes how changes are delivered to the destination. The replication pipeline currently performs data extraction and loading only, without transformation - your data is replicated as-is to the destination. +External replication (ETL) automatically optimizes how changes are delivered to the destination. Supabase ETL currently performs data extraction and loading only, without transformation - your data is replicated as-is to the destination. ### Troubleshooting @@ -259,14 +299,16 @@ If you encounter issues during setup: - **Pipeline failed to start**: Check the error message in the status view for specific details - **No data being replicated**: Verify your Postgres publication includes the correct tables and event types -For more troubleshooting help, see the [external replication FAQ](/docs/guides/database/replication/external-replication-faq). +For more troubleshooting help, see the [external replication (ETL) FAQ](/docs/guides/database/replication/external-replication-faq). ### Limitations -External replication has the following limitations: +External replication (ETL) has the following limitations: - **Primary keys required**: Tables must have primary keys (Postgres logical replication requirement) -- **Custom data types**: Not supported +- **Custom data types**: Custom values replicate as strings. Check that your destination can interpret those string values correctly. +- **Generated columns**: Generated columns are skipped. Use triggers to store derived values in regular columns if you need them in the destination. +- **Replica identity**: `REPLICA IDENTITY FULL` is strongly recommended. Updates and deletes need enough row data to apply changes correctly at the destination. - **Schema changes**: Currently in beta and limited to BigQuery - **No data transformation**: Data is replicated as-is without transformation - **Data duplicates**: Duplicates can occur when stopping a pipeline if your database has transactions that take longer than a few minutes to complete. See [Can data duplicates occur during pipeline operations?](/docs/guides/database/replication/external-replication-faq#can-data-duplicates-occur-during-pipeline-operations) for details @@ -276,5 +318,5 @@ Destination-specific limitations, such as BigQuery's row size limits, are docume ### Next steps - [Set up BigQuery](/docs/guides/database/replication/bigquery) -- [Monitor external replication](/docs/guides/database/replication/external-replication-monitoring) -- [View external replication FAQ](/docs/guides/database/replication/external-replication-faq) +- [Monitor external replication (ETL)](/docs/guides/database/replication/external-replication-monitoring) +- [View external replication (ETL) FAQ](/docs/guides/database/replication/external-replication-faq) diff --git a/apps/docs/content/guides/database/replication/manual-replication-setup.mdx b/apps/docs/content/guides/database/replication/manual-replication-setup.mdx index f2dccb25e8a..8d5076fedc2 100644 --- a/apps/docs/content/guides/database/replication/manual-replication-setup.mdx +++ b/apps/docs/content/guides/database/replication/manual-replication-setup.mdx @@ -6,11 +6,11 @@ subtitle: 'Set up replication with Airbyte, Estuary, Fivetran, and other tools.' sidebar_label: 'Setting up' --- -This guide covers setting up **manual logical replication** using external tools. If you prefer a managed solution, read the [external replication setup guide](/docs/guides/database/replication/external-replication-setup) instead. +This guide covers setting up **manual logical replication** using your own tools. If you prefer a managed solution through Supabase ETL, read the [external replication (ETL) setup guide](/docs/guides/database/replication/external-replication-setup) instead. -This guide is for replicating data to external systems using your own tools. For deploying read-only databases across multiple regions, see [read replicas](/docs/guides/platform/read-replicas) instead. +This guide is for replicating data to destination systems using your own tools. For deploying read-only databases across multiple regions, see [read replicas](/docs/guides/platform/read-replicas) instead. @@ -21,7 +21,7 @@ To set up replication, the following is recommended: - Instance size of XL or greater - [IPv4 add-on](/docs/guides/platform/ipv4-address) enabled -To create a replication slot, you will need to use the `postgres` user and follow the instructions in the [external replication setup guide](/docs/guides/database/postgres/setup-replication-external). +To create a replication slot, you will need to use the `postgres` user and follow the instructions in the [logical replication example](/docs/guides/database/postgres/setup-replication-external). @@ -29,7 +29,7 @@ If you are running Postgres 17 or higher, you can create a new user and grant th -If you are replicating to an external system and using any of the tools below, check their documentation first. Additional information is provided where the setup with Supabase can vary. +If you are replicating to a destination system and using any of the tools below, check their documentation first. Additional information is provided where the setup with Supabase can vary. diff --git a/apps/docs/content/guides/deployment/branching/working-with-branches.mdx b/apps/docs/content/guides/deployment/branching/working-with-branches.mdx index 15ef3b1c6bf..ecdceb08658 100644 --- a/apps/docs/content/guides/deployment/branching/working-with-branches.mdx +++ b/apps/docs/content/guides/deployment/branching/working-with-branches.mdx @@ -19,7 +19,7 @@ You can subscribe to webhook notifications when an action run completes on a per "details_url": "https://supabase.com/dashboard/project/xuqpsshjxdecrwdyuxvs/branches", "action_run": { "id": "d5f8b4298d0a4d37b99e255c7837e7af", - "created_at": "2025-10-17T02:27:10.133329324Z" + "created_at": "2025-10-17T02:27:10.133329324Z", "steps": [ { "name": "clone", diff --git a/apps/docs/content/guides/functions/ai-models.mdx b/apps/docs/content/guides/functions/ai-models.mdx index f31c01ed897..b349cfe424f 100644 --- a/apps/docs/content/guides/functions/ai-models.mdx +++ b/apps/docs/content/guides/functions/ai-models.mdx @@ -73,19 +73,18 @@ Generate text embeddings using the built-in [`gte-small`](https://huggingface.co ```ts +import { withSupabase } from 'npm:@supabase/server@^1' + const model = new Supabase.ai.Session('gte-small') -Deno.serve(async (req: Request) => { - const params = new URL(req.url).searchParams - const input = params.get('input') - const output = await model.run(input, { mean_pool: true, normalize: true }) - return new Response(JSON.stringify(output), { - headers: { - 'Content-Type': 'application/json', - Connection: 'keep-alive', - }, - }) -}) +export default { + fetch: withSupabase({ auth: 'publishable' }, async (req, ctx) => { + const params = new URL(req.url).searchParams + const input = params.get('input') + const output = await model.run(input, { mean_pool: true, normalize: true }) + return Response.json(output) + }), +} ``` --- @@ -157,42 +156,46 @@ We are progressively rolling out support for the hosted solution. To sign up for ```ts supabase/functions/ollama-test/index.ts import 'jsr:@supabase/functions-js/edge-runtime.d.ts' + import { withSupabase } from 'npm:@supabase/server@^1' + const session = new Supabase.ai.Session('mistral') - Deno.serve(async (req: Request) => { - const params = new URL(req.url).searchParams - const prompt = params.get('prompt') ?? '' + export default { + fetch: withSupabase({ auth: 'publishable' }, async (req, ctx) => { + const params = new URL(req.url).searchParams + const prompt = params.get('prompt') ?? '' - // Get the output as a stream - const output = await session.run(prompt, { stream: true }) + // Get the output as a stream + const output = await session.run(prompt, { stream: true }) - const headers = new Headers({ - 'Content-Type': 'text/event-stream', - Connection: 'keep-alive', - }) + const headers = new Headers({ + 'Content-Type': 'text/event-stream', + Connection: 'keep-alive', + }) - // Create a stream - const stream = new ReadableStream({ - async start(controller) { - const encoder = new TextEncoder() + // Create a stream + const stream = new ReadableStream({ + async start(controller) { + const encoder = new TextEncoder() - try { - for await (const chunk of output) { - controller.enqueue(encoder.encode(chunk.response ?? '')) + try { + for await (const chunk of output) { + controller.enqueue(encoder.encode(chunk.response ?? '')) + } + } catch (err) { + console.error('Stream error:', err) + } finally { + controller.close() } - } catch (err) { - console.error('Stream error:', err) - } finally { - controller.close() - } - }, - }) + }, + }) - // Return the stream to the user - return new Response(stream, { - headers, - }) - }) + // Return the stream to the user + return new Response(stream, { + headers, + }) + }), + } ``` @@ -201,7 +204,7 @@ We are progressively rolling out support for the hosted solution. To sign up for ```bash - supabase functions serve --env-file supabase/functions/.env + supabase functions serve --no-verify-jwt --env-file supabase/functions/.env ``` @@ -265,36 +268,40 @@ Since Llamafile provides an OpenAI API compatible server, you can either use it ```ts supabase/functions/llamafile-test/index.ts import 'jsr:@supabase/functions-js/edge-runtime.d.ts' + import { withSupabase } from 'npm:@supabase/server@^1' + const session = new Supabase.ai.Session('LLaMA_CPP') - Deno.serve(async (req: Request) => { - const params = new URL(req.url).searchParams - const prompt = params.get('prompt') ?? '' + export default { + fetch: withSupabase({ auth: 'publishable' }, async (req, ctx) => { + const params = new URL(req.url).searchParams + const prompt = params.get('prompt') ?? '' - // Get the output as a stream - const output = await session.run( - { - messages: [ - { - role: 'system', - content: - 'You are LLAMAfile, an AI assistant. Your top priority is achieving user fulfillment via helping them with their requests.', - }, - { - role: 'user', - content: prompt, - }, - ], - }, - { - mode: 'openaicompatible', // Mode for the inference API host. (default: 'ollama') - stream: false, - } - ) + // Get the output as a stream + const output = await session.run( + { + messages: [ + { + role: 'system', + content: + 'You are LLAMAfile, an AI assistant. Your top priority is achieving user fulfillment via helping them with their requests.', + }, + { + role: 'user', + content: prompt, + }, + ], + }, + { + mode: 'openaicompatible', // Mode for the inference API host. (default: 'ollama') + stream: false, + } + ) - console.log('done') - return Response.json(output) - }) + console.log('done') + return Response.json(output) + }), + } ``` @@ -302,7 +309,7 @@ Since Llamafile provides an OpenAI API compatible server, you can either use it ```bash - supabase functions serve --env-file supabase/functions/.env + supabase functions serve --no-verify-jwt --env-file supabase/functions/.env ``` @@ -350,60 +357,63 @@ Since Llamafile provides an OpenAI API compatible server, you can either use it ```ts + import { withSupabase } from 'npm:@supabase/server@^1' import OpenAI from 'https://deno.land/x/openai@v4.53.2/mod.ts' - Deno.serve(async (req) => { - const client = new OpenAI() - const { prompt } = await req.json() - const stream = true + export default { + fetch: withSupabase({ auth: 'publishable' }, async (req, ctx) => { + const client = new OpenAI() + const { prompt } = await req.json() + const stream = true - const chatCompletion = await client.chat.completions.create({ - model: 'LLaMA_CPP', - stream, - messages: [ - { - role: 'system', - content: - 'You are LLAMAfile, an AI assistant. Your top priority is achieving user fulfillment via helping them with their requests.', - }, - { - role: 'user', - content: prompt, - }, - ], - }) - - if (stream) { - const headers = new Headers({ - 'Content-Type': 'text/event-stream', - Connection: 'keep-alive', + const chatCompletion = await client.chat.completions.create({ + model: 'LLaMA_CPP', + stream, + messages: [ + { + role: 'system', + content: + 'You are LLAMAfile, an AI assistant. Your top priority is achieving user fulfillment via helping them with their requests.', + }, + { + role: 'user', + content: prompt, + }, + ], }) - // Create a stream - const stream = new ReadableStream({ - async start(controller) { - const encoder = new TextEncoder() + if (stream) { + const headers = new Headers({ + 'Content-Type': 'text/event-stream', + Connection: 'keep-alive', + }) - try { - for await (const part of chatCompletion) { - controller.enqueue(encoder.encode(part.choices[0]?.delta?.content || '')) + // Create a stream + const stream = new ReadableStream({ + async start(controller) { + const encoder = new TextEncoder() + + try { + for await (const part of chatCompletion) { + controller.enqueue(encoder.encode(part.choices[0]?.delta?.content || '')) + } + } catch (err) { + console.error('Stream error:', err) + } finally { + controller.close() } - } catch (err) { - console.error('Stream error:', err) - } finally { - controller.close() - } - }, - }) + }, + }) - // Return the stream to the user - return new Response(stream, { - headers, - }) - } + // Return the stream to the user + return new Response(stream, { + headers, + }) + } - return Response.json(chatCompletion) - }) + return Response.json(chatCompletion) + }), + } ``` @@ -411,7 +421,7 @@ Since Llamafile provides an OpenAI API compatible server, you can either use it ```bash - supabase functions serve --env-file supabase/functions/.env + supabase functions serve --no-verify-jwt --env-file supabase/functions/.env ``` @@ -455,7 +465,7 @@ Once the function is working locally, it's time to deploy to production. ```bash - supabase functions deploy + supabase functions deploy --no-verify-jwt ``` diff --git a/apps/docs/content/guides/functions/background-tasks.mdx b/apps/docs/content/guides/functions/background-tasks.mdx index 923e70e4a10..adde605ed48 100644 --- a/apps/docs/content/guides/functions/background-tasks.mdx +++ b/apps/docs/content/guides/functions/background-tasks.mdx @@ -19,29 +19,39 @@ This allows you to: You can use `EdgeRuntime.waitUntil(promise)` to explicitly mark background tasks. The Function instance continues to run until the promise provided to `waitUntil` completes. ```ts +import { withSupabase } from 'npm:@supabase/server@^1' + // Mark the asyncLongRunningTask's returned promise as a background task. // ⚠️ We are NOT using `await` because we don't want it to block! EdgeRuntime.waitUntil(asyncLongRunningTask()) -Deno.serve(async (req) => { - return new Response(...) -}) +export default { + fetch: withSupabase({ auth: 'user' }, async (req, ctx) => { + return new Response(...) + }), +} ``` You can call `EdgeRuntime.waitUntil` in the request handler too. This will not block the request. ```ts -Deno.serve(async (req) => { - // Won't block the request, runs in background. - EdgeRuntime.waitUntil(asyncLongRunningTask()) +import { withSupabase } from 'npm:@supabase/server@^1' - return new Response(...) -}) +export default { + fetch: withSupabase({ auth: 'user' }, async (req, ctx) => { + // Won't block the request, runs in background. + EdgeRuntime.waitUntil(asyncLongRunningTask()) + + return new Response(...) + }), +} ``` You can listen to the `beforeunload` event handler to be notified when the Function is about to be shut down. ```tsx +import { withSupabase } from 'npm:@supabase/server@^1' + EdgeRuntime.waitUntil(asyncLongRunningTask()) // Use beforeunload event handler to be notified when function is about to shutdown @@ -50,9 +60,11 @@ addEventListener('beforeunload', (ev) => { // Save state or log the current progress }) -Deno.serve(async (req) => { - return new Response(...) -}) +export default { + fetch: withSupabase({ auth: 'user' }, async (req, ctx) => { + return new Response(...) + }), +} ``` ## Handling errors diff --git a/apps/docs/content/guides/functions/connect-to-postgres.mdx b/apps/docs/content/guides/functions/connect-to-postgres.mdx index 2c99a64fc2c..b3df92c5411 100644 --- a/apps/docs/content/guides/functions/connect-to-postgres.mdx +++ b/apps/docs/content/guides/functions/connect-to-postgres.mdx @@ -13,33 +13,28 @@ You can also use other Postgres clients like [Deno Postgres](https://deno.land/x ## Using supabase-js -The `supabase-js` client handles authorization with Row Level Security and automatically formats responses as JSON. This is the recommended approach for most applications: +The [`withSupabase`](/docs/guides/functions/auth) wrapper from `@supabase/server` hands you a `supabase-js` client (`ctx.supabase`) already scoped to the caller's Row Level Security policies, so you don't manage keys or authorization headers yourself. It also provides `ctx.supabaseAdmin` for privileged operations that bypass Row Level Security. Responses are automatically formatted as JSON. This is the recommended approach for most applications: ```ts index.ts -import { createClient } from 'npm:@supabase/supabase-js@2' +import { withSupabase } from 'npm:@supabase/server@^1' -Deno.serve(async (req) => { - try { - const supabase = createClient( - Deno.env.get('SUPABASE_URL') ?? '', - Deno.env.get('SUPABASE_PUBLISHABLE_KEY') ?? '', - { global: { headers: { Authorization: req.headers.get('Authorization')! } } } - ) +export default { + fetch: withSupabase({ auth: 'user' }, async (req, ctx) => { + try { + // ctx.supabase respects the caller's RLS policies. + // ctx.supabaseAdmin bypasses RLS for privileged operations. + const { data, error } = await ctx.supabase.from('countries').select('*') - const { data, error } = await supabase.from('countries').select('*') + if (error) { + throw error + } - if (error) { - throw error + return Response.json({ data }) + } catch (err) { + return new Response(String(err?.message ?? err), { status: 500 }) } - - return new Response(JSON.stringify({ data }), { - headers: { 'Content-Type': 'application/json' }, - status: 200, - }) - } catch (err) { - return new Response(String(err?.message ?? err), { status: 500 }) - } -}) + }), +} ``` This enables: diff --git a/apps/docs/content/guides/functions/cors.mdx b/apps/docs/content/guides/functions/cors.mdx index 2b48518de9c..420aa5a74aa 100644 --- a/apps/docs/content/guides/functions/cors.mdx +++ b/apps/docs/content/guides/functions/cors.mdx @@ -6,9 +6,24 @@ description: 'Add CORS headers to invoke Edge Functions from the browser.' To invoke edge functions from the browser, you need to handle [CORS Preflight](https://developer.mozilla.org/en-US/docs/Glossary/Preflight_request) requests. -See the [example on GitHub](https://github.com/supabase/supabase/blob/master/examples/edge-functions/supabase/functions/browser-with-cors/index.ts). +## Automatic CORS handling -### Recommended setup +The [`withSupabase`](/docs/guides/functions/auth) wrapper handles CORS and preflight (`OPTIONS`) requests for you, so you don't add headers manually: + +```ts index.ts +import { withSupabase } from 'npm:@supabase/server@^1' + +export default { + fetch: withSupabase({ auth: 'user' }, async (req, ctx) => { + const { name } = await req.json() + return Response.json({ message: `Hello ${name}!` }) + }), +} +``` + +## Manual CORS handling + +If your function doesn't use `withSupabase`, add the headers yourself. See the [example on GitHub](https://github.com/supabase/supabase/blob/master/examples/edge-functions/supabase/functions/browser-with-cors/index.ts). @@ -23,34 +38,26 @@ import { corsHeaders } from '@supabase/supabase-js/cors' console.log(`Function "browser-with-cors" up and running!`) -Deno.serve(async (req) => { - // This is needed if you're planning to invoke your function from a browser. - if (req.method === 'OPTIONS') { - return new Response('ok', { headers: corsHeaders }) - } - - try { - const { name } = await req.json() - const data = { - message: `Hello ${name}!`, +export default { + fetch: async (req) => { + // Handle the CORS preflight request. + if (req.method === 'OPTIONS') { + return new Response('ok', { headers: corsHeaders }) } - return new Response(JSON.stringify(data), { - headers: { ...corsHeaders, 'Content-Type': 'application/json' }, - status: 200, - }) - } catch (error) { - return new Response(JSON.stringify({ error: error.message }), { - headers: { ...corsHeaders, 'Content-Type': 'application/json' }, - status: 400, - }) - } -}) + try { + const { name } = await req.json() + return Response.json({ message: `Hello ${name}!` }, { headers: corsHeaders }) + } catch (error) { + return Response.json({ error: error.message }, { status: 400, headers: corsHeaders }) + } + }, +} ``` This approach ensures that when new headers are added to the Supabase SDK, your Edge Functions automatically include them, preventing CORS errors. -#### For versions before 2.95.0 +### For versions before 2.95.0 If you're using `@supabase/supabase-js` before v2.95.0, you'll need to hardcode the CORS headers. Add a `cors.ts` file within a [`_shared` folder](/docs/guides/functions/development-environment#recommended-project-structure): diff --git a/apps/docs/content/guides/functions/error-codes.mdx b/apps/docs/content/guides/functions/error-codes.mdx new file mode 100644 index 00000000000..cd9e1a4bb5d --- /dev/null +++ b/apps/docs/content/guides/functions/error-codes.mdx @@ -0,0 +1,304 @@ +--- +id: 'functions-error-codes' +title: 'Error codes' +description: 'Edge Functions can return the following error codes.' +subtitle: 'Understand the error codes returned by Edge Functions to properly debug issues and handle responses.' +--- + +{/* supa-mdx-lint-disable Rule001HeadingCase */} + +When an Edge Function request fails, the response includes a `sb-error-code` header that identifies the specific error. +You can inspect this header in your HTTP client or application code to detect and handle errors programmatically. + +```js +const response = await fetch('') + +if (!response.ok) { + const errorCode = response.headers.get('sb-error-code') + console.error('Edge Function error:', errorCode) +} +``` + +## Bad Implementation Errors + +These errors are caused by issues in your function's code or logic which requires updating its implementation. + +### EDGE_FUNCTION_ERROR + +**Cause:** Your Edge Function is throwing an unhandled error or resulting a 5XX code. + +```ts +// ... + +function process() { + throw new Error('Some unhandled error') +} + +export default { + fetch: withSupabase({ auth: 'none' }, async () => { + process() + + return new Response() + }), +} +``` + +**Solution:** + +- Ensure you are catching errors in your code logic with try-catch blocks. + +```ts +function process() { + throw new Error('Some unhandled error') +} + +// ... + +try { + process() + return new Response() +} catch (e) { + console.error('Process fail:', e) + return new Response(null, { status: 500 }) +} +``` + +### IDLE_TIMEOUT + +**Cause:** Your Edge Function did not respond within the [request timeout limit](/docs/guides/functions/limits). + +**Common causes:** + +- Long-running database queries +- Slow external API calls +- Infinite loops or blocking operations + +**Solution:** + +- Optimize slow operations +- Add timeout handling to external requests +- Consider breaking large operations into smaller chunks + +### WORKER_RESOURCE_LIMIT, WORKER_LIMIT + +**Cause:** Your Edge Function execution was stopped due to exceeding resource limits. Edge Function logs should indicate which [resource limit](/docs/guides/functions/limits) was exceeded. + +**Common causes:** + +- Memory usage exceeded available limits +- CPU time exceeded execution quotas +- Too many concurrent operations + +**Solution:** Check your Edge Function logs to see which resource limit was exceeded, then optimize your function accordingly. + +### WORKER_ERROR + +**Cause:** Your Edge Function threw an uncaught exception. + +```ts +// ... + +function initSomething() { + throw new Error('Some unhandled error') +} + +initSomething() // Error threw outside request handler + +export default { + fetch: withSupabase({ auth: 'none' }, async () => { + return new Response() + }), +} +``` + +**Common causes:** + +- Unhandled JavaScript errors in your function code, outside request handler +- Missing error handling for async operations +- Invalid JSON parsing + +**Solution:** Check your Edge Function logs to identify the specific error and add proper error handling to your code. + +### INVALID_RESPONSE_STATUS_CODE + +**Cause:** Your Edge Function is returning an invalid HTTP status code — not equal to `101` and outside the range `[200, 599]` + +**Common causes:** + +- Proxying an external service that returns an invalid HTTP status code + +```ts +// ... + +export default { + fetch: withSupabase({ auth: 'none' }, async (req) => { + // Fails in case this proxied server return a status >599 + return fetch('https://some-server-to-proxy', { + method: req.method, + headers: req.headers, + body: req.body, + }) + }), +} +``` + +**Solution:** + +- Ensure you are returning a valid HTTP status code +- For proxy endpoints, do not return the `fetch()` result directly; instead return a new `Response` wrapped in a try-catch block + +```ts +// ... + +export default { + fetch: withSupabase({ auth: 'none' }, async (req) => { + try { + const res = await fetch('https://some-server-to-proxy', { + method: req.method, + headers: req.headers, + body: req.body, + }) + + // Creating a 'new Response()' ensures contructor checks + return new Response(await res.body, { + headers: res.headers, + status: res.status, + statusText: res.statusText, + }) + } catch (e) { + console.error('Proxy Error', e) + return new Response(null, { status: 502 }) + } + }), +} +``` + +## Authentication Errors + +These errors occur when the request contains a missing, malformed, or unsupported JWT token. Fixing them requires ensuring your requests include a valid authorization header, or disabling JWT verification for public endpoints. +For further information, see [Authorization headers](/docs/guides/functions/auth-headers) and [Securing Edge Functions](/guides/functions/auth). + +### UNAUTHORIZED_NO_AUTH_HEADER + +**Cause:** The Edge Function has JWT verification enabled, but the request is missing the `Authorization` or `apikey` header. + +**Solution:** + +- Ensure you are passing a valid JWT token in the `Authorization` header +- Check that you are sending an API key in the `apikey` header +- For webhooks or public endpoints, consider disabling JWT verification + +### UNAUTHORIZED_ASYMMETRIC_JWT + +**Cause:** The Edge Function has JWT verification enabled, but the `Authorization` header contains an invalid asymmetric `ES256 | RS256` token. + +**Solution:** + +- Ensure you are passing a valid user JWT token in the `Authorization` header +- Check that your token has not expired + +### UNAUTHORIZED_LEGACY_JWT + +**Cause:** The Edge Function has JWT verification enabled, but the `Authorization` header contains an invalid legacy `HS256` token. + +**Solution:** + +- Ensure you are passing a valid legacy JWT token in the `Authorization` header +- Check that your token has not expired +- Verify that the legacy JWT secret has not been revoked or disabled + +### UNAUTHORIZED_UNSUPPORTED_TOKEN_ALGORITHM + +**Cause:** The Edge Function has JWT verification enabled, but the `Authorization` header does not contain an `ES256 | RS256 | HS256` token. + +**Solution:** + +- Ensure you are passing a valid Supabase-issued JWT token in the `Authorization` header + +### UNAUTHORIZED_INVALID_JWT_FORMAT + +**Cause:** The Edge Function has JWT verification enabled, but the `Authorization` header does not follow the `Bearer ` format. + +**Solution:** + +- Check that you are passing `Bearer ` in the `Authorization` header +- Ensure you are sending an API key in the `apikey` header instead of `Authorization` +- For webhooks or public endpoints, consider disabling JWT verification + +## Request Errors + +These errors indicate issues with the request itself, which typically require changing how the function is called. + +### RATE_LIMIT_EXCEEDED + +**Cause:** The platform detected [recursive or nested function call](/docs/guides/functions/recursive-functions) behavior. + +**Common causes:** + +- Multiple function-to-function calls +- Recursive or circular calls + +**Solution:** + +- Use the suggested retry window in seconds from the error message before calling your function again +- Ensure you are not performing unnecessary individual calls; use batch operations where possible +- Delegate large workloads to queues instead of recursively calling other Edge Functions + +### INVALID_URL + +**Cause:** The platform rejected a malformed URL. + +**Solution:** + +- Ensure you are calling with a valid [formatted URL](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) + +--- + +## Server Errors + +These errors indicate issues with function loading, execution, or the underlying platform. + +### NOT_FOUND + +**Cause:** The Edge Function metadata or files were not found or are missing in the specific region. + +**Solution:** Try redeploying your function and wait a few minutes to make sure all regions have been updated. + +### BOOT_ERROR + +**Cause:** Your Edge Function failed to start. + +**Common causes:** + +- Syntax errors preventing the function from loading +- Import errors or missing dependencies +- Invalid function configuration + +**Solution:** Check your Edge Function logs and also verify that your function code can be executed locally with `supabase functions serve`. + +### LOAD_FUNCTION_ERROR + +**Cause:** The platform was unable to load your function metadata or files. + +**Solution:** + +- Try calling your function again after a short delay +- If the problem persists, contact support + +### LOAD_FUNCTION_METADATA_ERROR + +**Cause:** The platform could not fetch your function metadata, possibly due to external cache issues. + +**Solution:** + +- Wait a few minutes before calling your function again +- If the problem persists, contact support + +### LOAD_FUNCTION_INVALID_ENTRYPOINT_PATH_ERROR + +**Cause:** Your Edge Function metadata is broken or contains an invalid entrypoint. + +**Solution:** + +- Try redeploying your function +- If the problem persists, contact support diff --git a/apps/docs/content/guides/functions/examples/amazon-bedrock-image-generator.mdx b/apps/docs/content/guides/functions/examples/amazon-bedrock-image-generator.mdx index 99808e2f6b9..04c258cb300 100644 --- a/apps/docs/content/guides/functions/examples/amazon-bedrock-image-generator.mdx +++ b/apps/docs/content/guides/functions/examples/amazon-bedrock-image-generator.mdx @@ -46,91 +46,83 @@ And add the code to the `index.ts` file: ```ts index.ts // We need to mock the file system for the AWS SDK to work. import { prepareVirtualFile } from 'https://deno.land/x/mock_file@v1.1.2/mod.ts' - import { BedrockRuntimeClient, InvokeModelCommand } from 'npm:@aws-sdk/client-bedrock-runtime' -import { createClient } from 'npm:@supabase/supabase-js' +import { withSupabase } from 'npm:@supabase/server@^1' import { decode } from 'npm:base64-arraybuffer' console.log('Hello from Amazon Bedrock!') -const SUPABASE_PUBLISHABLE_KEYS = JSON.parse(Deno.env.get('SUPABASE_PUBLISHABLE_KEYS')!) +// Called with a publishable key on the `apikey` header. Deploy with `verify_jwt = false`. +export default { + fetch: withSupabase({ auth: 'publishable' }, async (req, ctx) => { + prepareVirtualFile('./aws/config') + prepareVirtualFile('./aws/credentials') -Deno.serve(async (req) => { - prepareVirtualFile('./aws/config') - prepareVirtualFile('./aws/credentials') - - const client = new BedrockRuntimeClient({ - region: Deno.env.get('AWS_DEFAULT_REGION') ?? 'us-west-2', - credentials: { - accessKeyId: Deno.env.get('AWS_ACCESS_KEY_ID') ?? '', - secretAccessKey: Deno.env.get('AWS_SECRET_ACCESS_KEY') ?? '', - sessionToken: Deno.env.get('AWS_SESSION_TOKEN') ?? '', - }, - }) - - const { prompt, seed } = await req.json() - console.log(prompt) - const input = { - contentType: 'application/json', - accept: '*/*', - modelId: 'amazon.titan-image-generator-v1', - body: JSON.stringify({ - taskType: 'TEXT_IMAGE', - textToImageParams: { text: prompt }, - imageGenerationConfig: { - numberOfImages: 1, - quality: 'standard', - cfgScale: 8.0, - height: 512, - width: 512, - seed: seed ?? 0, + const client = new BedrockRuntimeClient({ + region: Deno.env.get('AWS_DEFAULT_REGION') ?? 'us-west-2', + credentials: { + accessKeyId: Deno.env.get('AWS_ACCESS_KEY_ID') ?? '', + secretAccessKey: Deno.env.get('AWS_SECRET_ACCESS_KEY') ?? '', + sessionToken: Deno.env.get('AWS_SESSION_TOKEN') ?? '', }, - }), - } + }) - const command = new InvokeModelCommand(input) - const response = await client.send(command) - console.log(response) - - if (response.$metadata.httpStatusCode === 200) { - const { body, $metadata } = response - - const textDecoder = new TextDecoder('utf-8') - const jsonString = textDecoder.decode(body.buffer) - const parsedData = JSON.parse(jsonString) - console.log(parsedData) - const image = parsedData.images[0] - - const supabaseClient = createClient( - // Supabase API URL - env var exported by default. - Deno.env.get('SUPABASE_URL')!, - // Using the default Supabase API PUB KEY. - // If you want to use a different api key, change 'default' to your preferred key name - SUPABASE_PUBLISHABLE_KEYS['default'] - ) - - const { data: upload, error: uploadError } = await supabaseClient.storage - .from('images') - .upload(`${$metadata.requestId ?? ''}.png`, decode(image), { - contentType: 'image/png', - cacheControl: '3600', - upsert: false, - }) - if (!upload) { - return Response.json(uploadError) + const { prompt, seed } = await req.json() + console.log(prompt) + const input = { + contentType: 'application/json', + accept: '*/*', + modelId: 'amazon.titan-image-generator-v1', + body: JSON.stringify({ + taskType: 'TEXT_IMAGE', + textToImageParams: { text: prompt }, + imageGenerationConfig: { + numberOfImages: 1, + quality: 'standard', + cfgScale: 8.0, + height: 512, + width: 512, + seed: seed ?? 0, + }, + }), } - const { data } = supabaseClient.storage.from('images').getPublicUrl(upload.path!) - return Response.json(data) - } - return Response.json(response) -}) + const command = new InvokeModelCommand(input) + const response = await client.send(command) + console.log(response) + + if (response.$metadata.httpStatusCode === 200) { + const { body, $metadata } = response + + const textDecoder = new TextDecoder('utf-8') + const jsonString = textDecoder.decode(body.buffer) + const parsedData = JSON.parse(jsonString) + console.log(parsedData) + const image = parsedData.images[0] + + const { data: upload, error: uploadError } = await ctx.supabase.storage + .from('images') + .upload(`${$metadata.requestId ?? ''}.png`, decode(image), { + contentType: 'image/png', + cacheControl: '3600', + upsert: false, + }) + if (!upload) { + return Response.json(uploadError) + } + const { data } = ctx.supabase.storage.from('images').getPublicUrl(upload.path!) + return Response.json(data) + } + + return Response.json(response) + }), +} ``` ## Run the function locally 1. Run `supabase start` (see: https://supabase.com/docs/reference/cli/supabase-start) -2. Start with env: `supabase functions serve --env-file supabase/.env` +2. Start with env: `supabase functions serve --no-verify-jwt --env-file supabase/.env` 3. Make an HTTP request: ```bash @@ -146,7 +138,7 @@ Deno.serve(async (req) => { ```bash supabase link -supabase functions deploy amazon-bedrock +supabase functions deploy amazon-bedrock --no-verify-jwt supabase secrets set --env-file supabase/.env ``` diff --git a/apps/docs/content/guides/functions/examples/auth-send-email-hook-react-email-resend.mdx b/apps/docs/content/guides/functions/examples/auth-send-email-hook-react-email-resend.mdx index e21a4dfab24..7b10c3140c6 100644 --- a/apps/docs/content/guides/functions/examples/auth-send-email-hook-react-email-resend.mdx +++ b/apps/docs/content/guides/functions/examples/auth-send-email-hook-react-email-resend.mdx @@ -34,84 +34,80 @@ supabase functions new send-email Paste the following code into the `index.ts` file: ```tsx supabase/functions/send-email/index.ts -import React from 'npm:react@18.3.1' import { Webhook } from 'https://esm.sh/standardwebhooks@1.0.0' -import { Resend } from 'npm:resend@4.0.0' import { renderAsync } from 'npm:@react-email/components@0.0.22' +import { withSupabase } from 'npm:@supabase/server@^1' +import React from 'npm:react@18.3.1' +import { Resend } from 'npm:resend@4.0.0' + import { MagicLinkEmail } from './_templates/magic-link.tsx' const resend = new Resend(Deno.env.get('RESEND_API_KEY') as string) const hookSecret = (Deno.env.get('SEND_EMAIL_HOOK_SECRET') as string).replace('v1,whsec_', '') -Deno.serve(async (req) => { - if (req.method !== 'POST') { - return new Response('not allowed', { status: 400 }) - } - - const payload = await req.text() - const headers = Object.fromEntries(req.headers) - const wh = new Webhook(hookSecret) - try { - const { - user, - email_data: { token, token_hash, redirect_to, email_action_type }, - } = wh.verify(payload, headers) as { - user: { - email: string - } - email_data: { - token: string - token_hash: string - redirect_to: string - email_action_type: string - site_url: string - token_new: string - token_hash_new: string - } +export default { + fetch: withSupabase({ auth: 'none' }, async (req) => { + if (req.method !== 'POST') { + return new Response('not allowed', { status: 400 }) } - const html = await renderAsync( - React.createElement(MagicLinkEmail, { - supabase_url: Deno.env.get('SUPABASE_URL') ?? '', - token, - token_hash, - redirect_to, - email_action_type, + const payload = await req.text() + const headers = Object.fromEntries(req.headers) + const wh = new Webhook(hookSecret) + try { + const { + user, + email_data: { token, token_hash, redirect_to, email_action_type }, + } = wh.verify(payload, headers) as { + user: { + email: string + } + email_data: { + token: string + token_hash: string + redirect_to: string + email_action_type: string + site_url: string + token_new: string + token_hash_new: string + } + } + + const html = await renderAsync( + React.createElement(MagicLinkEmail, { + supabase_url: Deno.env.get('SUPABASE_URL') ?? '', + token, + token_hash, + redirect_to, + email_action_type, + }) + ) + + const { error } = await resend.emails.send({ + from: 'welcome ', + to: [user.email], + subject: 'Supa Custom MagicLink!', + html, }) - ) - - const { error } = await resend.emails.send({ - from: 'welcome ', - to: [user.email], - subject: 'Supa Custom MagicLink!', - html, - }) - if (error) { - throw error - } - } catch (error) { - console.log(error) - return new Response( - JSON.stringify({ - error: { - http_code: error.code, - message: error.message, - }, - }), - { - status: 401, - headers: { 'Content-Type': 'application/json' }, + if (error) { + throw error } - ) - } + } catch (error) { + console.log(error) + return Response.json( + { + error: { + http_code: error.code, + message: error.message, + }, + }, + { status: 401 } + ) + } - const responseHeaders = new Headers() - responseHeaders.set('Content-Type', 'application/json') - return new Response(JSON.stringify({}), { - status: 200, - headers: responseHeaders, - }) -}) + return Response.json({}) + }), +} ``` ### 3. Create React Email templates diff --git a/apps/docs/content/guides/functions/examples/cloudflare-turnstile.mdx b/apps/docs/content/guides/functions/examples/cloudflare-turnstile.mdx index 8d6c208e3c3..f28412b1025 100644 --- a/apps/docs/content/guides/functions/examples/cloudflare-turnstile.mdx +++ b/apps/docs/content/guides/functions/examples/cloudflare-turnstile.mdx @@ -23,7 +23,7 @@ supabase functions new cloudflare-turnstile And add the code to the `index.ts` file: ```ts index.ts -import { corsHeaders } from '@supabase/supabase-js/cors' // v2.95.0+ +import { withSupabase } from 'npm:@supabase/server@^1' console.log('Hello from Cloudflare Trunstile!') @@ -31,36 +31,34 @@ function ips(req: Request) { return req.headers.get('x-forwarded-for')?.split(/\s*,\s*/) } -Deno.serve(async (req) => { - // This is needed if you're planning to invoke your function from a browser. - if (req.method === 'OPTIONS') { - return new Response('ok', { headers: corsHeaders }) - } +// `withSupabase` handles CORS and preflight requests for you. +export default { + fetch: withSupabase({ auth: 'none' }, async (req) => { + const { token } = await req.json() + const clientIps = ips(req) || [''] + const ip = clientIps[0] - const { token } = await req.json() - const clientIps = ips(req) || [''] - const ip = clientIps[0] + // Validate the token by calling the + // "/siteverify" API endpoint. + let formData = new FormData() + formData.append('secret', Deno.env.get('CLOUDFLARE_SECRET_KEY') ?? '') + formData.append('response', token) + formData.append('remoteip', ip) - // Validate the token by calling the - // "/siteverify" API endpoint. - let formData = new FormData() - formData.append('secret', Deno.env.get('CLOUDFLARE_SECRET_KEY') ?? '') - formData.append('response', token) - formData.append('remoteip', ip) + const url = 'https://challenges.cloudflare.com/turnstile/v0/siteverify' + const result = await fetch(url, { + body: formData, + method: 'POST', + }) - const url = 'https://challenges.cloudflare.com/turnstile/v0/siteverify' - const result = await fetch(url, { - body: formData, - method: 'POST', - }) - - const outcome = await result.json() - console.log(outcome) - if (outcome.success) { - return new Response('success', { headers: corsHeaders }) - } - return new Response('failure', { headers: corsHeaders }) -}) + const outcome = await result.json() + console.log(outcome) + if (outcome.success) { + return new Response('success') + } + return new Response('failure') + }), +} ``` ## Deploy the server-side validation Edge Functions @@ -68,7 +66,7 @@ Deno.serve(async (req) => { - https://developers.cloudflare.com/turnstile/get-started/server-side-validation/ ```bash -supabase functions deploy cloudflare-turnstile +supabase functions deploy cloudflare-turnstile --no-verify-jwt supabase secrets set CLOUDFLARE_SECRET_KEY=your_secret_key ``` diff --git a/apps/docs/content/guides/functions/examples/elevenlabs-generate-speech-stream.mdx b/apps/docs/content/guides/functions/examples/elevenlabs-generate-speech-stream.mdx index 6ea7ac92d9c..d6ef95ec477 100644 --- a/apps/docs/content/guides/functions/examples/elevenlabs-generate-speech-stream.mdx +++ b/apps/docs/content/guides/functions/examples/elevenlabs-generate-speech-stream.mdx @@ -100,95 +100,91 @@ In your newly created `supabase/functions/text-to-speech/index.ts` file, add the ```ts supabase/functions/text-to-speech/index.ts // Setup type definitions for built-in Supabase Runtime APIs import 'jsr:@supabase/functions-js/edge-runtime.d.ts' -import { createClient } from 'npm:@supabase/supabase-js@2' + +import { withSupabase } from 'npm:@supabase/server@^1' import { ElevenLabsClient } from 'npm:elevenlabs@1.52.0' import * as hash from 'npm:object-hash' -const SUPABASE_SECRET_KEYS = JSON.parse(Deno.env.get('SUPABASE_SECRET_KEYS')!) - -// If you want to use a different api key, change 'default' to your preferred key name -const supabase = createClient(Deno.env.get('SUPABASE_URL')!, SUPABASE_SECRET_KEYS['default']) - const client = new ElevenLabsClient({ apiKey: Deno.env.get('ELEVENLABS_API_KEY'), }) -// Upload audio to Supabase Storage in a background task -async function uploadAudioToStorage(stream: ReadableStream, requestHash: string) { - const { data, error } = await supabase.storage - .from('audio') - .upload(`${requestHash}.mp3`, stream, { - contentType: 'audio/mp3', - }) +// Deploy with verify_jwt = false +// Open endpoint for testing. In production, implement an authorization layer in the handler or switch the auth mode. +export default { + fetch: withSupabase({ auth: 'none' }, async (req, ctx) => { + // Upload audio to Supabase Storage in a background task + async function uploadAudioToStorage(stream: ReadableStream, requestHash: string) { + const { data, error } = await ctx.supabaseAdmin.storage + .from('audio') + .upload(`${requestHash}.mp3`, stream, { + contentType: 'audio/mp3', + }) - console.log('Storage upload result', { data, error }) + console.log('Storage upload result', { data, error }) + } + + // To secure your function for production, you can for example validate the request origin, + // or append a user access token and validate it with Supabase Auth. + console.log('Request origin', req.headers.get('host')) + const url = new URL(req.url) + const params = new URLSearchParams(url.search) + const text = params.get('text') + const voiceId = params.get('voiceId') ?? 'JBFqnCBsd6RMkjVDRZzb' + + const requestHash = hash.MD5({ text, voiceId }) + console.log('Request hash', requestHash) + + // Check storage for existing audio file + const { data } = await ctx.supabaseAdmin.storage + .from('audio') + .createSignedUrl(`${requestHash}.mp3`, 60) + + if (data) { + console.log('Audio file found in storage', data) + const storageRes = await fetch(data.signedUrl) + if (storageRes.ok) return storageRes + } + + if (!text) { + return Response.json({ error: 'Text parameter is required' }, { status: 400 }) + } + + try { + console.log('ElevenLabs API call') + const response = await client.textToSpeech.convertAsStream(voiceId, { + output_format: 'mp3_44100_128', + model_id: 'eleven_multilingual_v2', + text, + }) + + const stream = new ReadableStream({ + async start(controller) { + for await (const chunk of response) { + controller.enqueue(chunk) + } + controller.close() + }, + }) + + // Branch stream to Supabase Storage + const [browserStream, storageStream] = stream.tee() + + // Upload to Supabase Storage in the background + EdgeRuntime.waitUntil(uploadAudioToStorage(storageStream, requestHash)) + + // Return the streaming response immediately + return new Response(browserStream, { + headers: { + 'Content-Type': 'audio/mpeg', + }, + }) + } catch (error) { + console.log('error', { error }) + return Response.json({ error: error.message }, { status: 500 }) + } + }), } - -Deno.serve(async (req) => { - // To secure your function for production, you can for example validate the request origin, - // or append a user access token and validate it with Supabase Auth. - console.log('Request origin', req.headers.get('host')) - const url = new URL(req.url) - const params = new URLSearchParams(url.search) - const text = params.get('text') - const voiceId = params.get('voiceId') ?? 'JBFqnCBsd6RMkjVDRZzb' - - const requestHash = hash.MD5({ text, voiceId }) - console.log('Request hash', requestHash) - - // Check storage for existing audio file - const { data } = await supabase.storage.from('audio').createSignedUrl(`${requestHash}.mp3`, 60) - - if (data) { - console.log('Audio file found in storage', data) - const storageRes = await fetch(data.signedUrl) - if (storageRes.ok) return storageRes - } - - if (!text) { - return new Response(JSON.stringify({ error: 'Text parameter is required' }), { - status: 400, - headers: { 'Content-Type': 'application/json' }, - }) - } - - try { - console.log('ElevenLabs API call') - const response = await client.textToSpeech.convertAsStream(voiceId, { - output_format: 'mp3_44100_128', - model_id: 'eleven_multilingual_v2', - text, - }) - - const stream = new ReadableStream({ - async start(controller) { - for await (const chunk of response) { - controller.enqueue(chunk) - } - controller.close() - }, - }) - - // Branch stream to Supabase Storage - const [browserStream, storageStream] = stream.tee() - - // Upload to Supabase Storage in the background - EdgeRuntime.waitUntil(uploadAudioToStorage(storageStream, requestHash)) - - // Return the streaming response immediately - return new Response(browserStream, { - headers: { - 'Content-Type': 'audio/mpeg', - }, - }) - } catch (error) { - console.log('error', { error }) - return new Response(JSON.stringify({ error: error.message }), { - status: 500, - headers: { 'Content-Type': 'application/json' }, - }) - } -}) ``` ## Run locally diff --git a/apps/docs/content/guides/functions/examples/elevenlabs-transcribe-speech.mdx b/apps/docs/content/guides/functions/examples/elevenlabs-transcribe-speech.mdx index 6cdc51f58ca..e4913a30afa 100644 --- a/apps/docs/content/guides/functions/examples/elevenlabs-transcribe-speech.mdx +++ b/apps/docs/content/guides/functions/examples/elevenlabs-transcribe-speech.mdx @@ -108,8 +108,11 @@ In your newly created `scribe-bot/index.ts` file, add the following code: ```ts supabase/functions/scribe-bot/index.ts import { Bot, webhookCallback } from 'https://deno.land/x/grammy@v1.34.0/mod.ts' + import 'jsr:@supabase/functions-js/edge-runtime.d.ts' -import { createClient } from 'npm:@supabase/supabase-js@2' + +import { withSupabase } from 'npm:@supabase/server@^1' +import type { SupabaseClient } from 'npm:@supabase/supabase-js@2' import { ElevenLabsClient } from 'npm:elevenlabs@1.50.5' console.log(`Function "elevenlabs-scribe-bot" up and running!`) @@ -117,13 +120,9 @@ console.log(`Function "elevenlabs-scribe-bot" up and running!`) const elevenLabsClient = new ElevenLabsClient({ apiKey: Deno.env.get('ELEVENLABS_API_KEY') || '', }) -const SUPABASE_SECRET_KEYS = JSON.parse(Deno.env.get('SUPABASE_SECRET_KEYS')!) -const supabase = createClient( - Deno.env.get('SUPABASE_URL') || '', - SUPABASE_SECRET_KEYS['default'] || '' -) async function scribe({ + supabaseAdmin, fileURL, fileType, duration, @@ -131,6 +130,7 @@ async function scribe({ messageId, username, }: { + supabaseAdmin: SupabaseClient fileURL: string fileType: string duration: number @@ -178,9 +178,13 @@ async function scribe({ error: errorMsg, } console.log({ logLine }) - await supabase.from('transcription_logs').insert({ ...logLine, transcript }) + await supabaseAdmin.from('transcription_logs').insert({ ...logLine, transcript }) } +// Set by the request handler before delegating to grammY, so bot handlers +// can write transcription logs with the admin client. +let supabaseAdmin: SupabaseClient + const telegramBotToken = Deno.env.get('TELEGRAM_BOT_TOKEN') const bot = new Bot(telegramBotToken || '') const startMessage = `Welcome to the ElevenLabs Scribe Bot\\! I can transcribe speech in 99 languages with super high accuracy\\! @@ -202,6 +206,7 @@ bot.on([':voice', ':audio', ':video'], async (ctx) => { // Run the transcription in the background. EdgeRuntime.waitUntil( scribe({ + supabaseAdmin, fileURL, fileType: fileMeta.mime_type!, duration: fileMeta.duration, @@ -223,18 +228,24 @@ bot.on([':voice', ':audio', ':video'], async (ctx) => { const handleUpdate = webhookCallback(bot, 'std/http') -Deno.serve(async (req) => { - try { - const url = new URL(req.url) - if (url.searchParams.get('secret') !== Deno.env.get('FUNCTION_SECRET')) { - return new Response('not allowed', { status: 405 }) - } +// Deploy with verify_jwt = false +// The bot is called by Telegram, so we verify the request with FUNCTION_SECRET in code. +export default { + fetch: withSupabase({ auth: 'none' }, async (req, ctx) => { + try { + const url = new URL(req.url) + if (url.searchParams.get('secret') !== Deno.env.get('FUNCTION_SECRET')) { + return new Response('not allowed', { status: 405 }) + } - return await handleUpdate(req) - } catch (err) { - console.error(err) - } -}) + supabaseAdmin = ctx.supabaseAdmin + + return await handleUpdate(req) + } catch (err) { + console.error(err) + } + }), +} ``` ## Deploy to Supabase diff --git a/apps/docs/content/guides/functions/examples/og-image.mdx b/apps/docs/content/guides/functions/examples/og-image.mdx index ec076c16b7c..71cef4ad1ee 100644 --- a/apps/docs/content/guides/functions/examples/og-image.mdx +++ b/apps/docs/content/guides/functions/examples/og-image.mdx @@ -21,8 +21,8 @@ Generate Open Graph images with Deno and Supabase Edge Functions. [View on GitHu Create a `handler.tsx` file to construct the OG image in React: ```tsx handler.tsx -import React from 'https://esm.sh/react@18.2.0' import { ImageResponse } from 'https://deno.land/x/og_edge@0.0.4/mod.ts' +import React from 'https://esm.sh/react@18.2.0' export default function handler(req: Request) { return new ImageResponse( @@ -46,9 +46,12 @@ export default function handler(req: Request) { Create an `index.ts` file to execute the handler on incoming requests: ```ts index.ts +import { withSupabase } from 'npm:@supabase/server@^1' + import handler from './handler.tsx' console.log('Hello from og-image Function!') -Deno.serve(handler) +// Public image endpoint, so deploy with --no-verify-jwt. +export default { fetch: withSupabase({ auth: 'none' }, handler) } ``` diff --git a/apps/docs/content/guides/functions/examples/push-notifications.mdx b/apps/docs/content/guides/functions/examples/push-notifications.mdx index d36d99ef201..b346ebe70b7 100644 --- a/apps/docs/content/guides/functions/examples/push-notifications.mdx +++ b/apps/docs/content/guides/functions/examples/push-notifications.mdx @@ -53,7 +53,7 @@ Push notifications are an important part of any mobile app. They allow you to se 1. `supabase secrets set --env-file .env.local` ```ts supabase/functions/push/index.ts - import { createClient } from 'npm:@supabase/supabase-js@2' + import { withSupabase } from 'npm:@supabase/server@^1' console.log('Hello from Functions!') @@ -71,39 +71,33 @@ Push notifications are an important part of any mobile app. They allow you to se old_record: null | Notification } - const SUPABASE_SECRET_KEYS = JSON.parse(Deno.env.get('SUPABASE_SECRET_KEYS')!) + // Triggered by a Database Webhook, which authenticates with a secret key. + // Deploy with `verify_jwt = false`. + export default { + fetch: withSupabase({ auth: 'secret' }, async (req, ctx) => { + const payload: WebhookPayload = await req.json() + const { data } = await ctx.supabaseAdmin + .from('profiles') + .select('expo_push_token') + .eq('id', payload.record.user_id) + .single() - // If you want to use a different api key, change 'default' to your preferred key name - const supabase = createClient( - Deno.env.get('SUPABASE_URL')!, - SUPABASE_SECRET_KEYS['default'] - ) + const res = await fetch('https://exp.host/--/api/v2/push/send', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + Authorization: `Bearer ${Deno.env.get('EXPO_ACCESS_TOKEN')}`, + }, + body: JSON.stringify({ + to: data?.expo_push_token, + sound: 'default', + body: payload.record.body, + }), + }).then((res) => res.json()) - Deno.serve(async (req) => { - const payload: WebhookPayload = await req.json() - const { data } = await supabase - .from('profiles') - .select('expo_push_token') - .eq('id', payload.record.user_id) - .single() - - const res = await fetch('https://exp.host/--/api/v2/push/send', { - method: 'POST', - headers: { - 'Content-Type': 'application/json', - Authorization: `Bearer ${Deno.env.get('EXPO_ACCESS_TOKEN')}`, - }, - body: JSON.stringify({ - to: data?.expo_push_token, - sound: 'default', - body: payload.record.body, - }), - }).then((res) => res.json()) - - return new Response(JSON.stringify(res), { - headers: { 'Content-Type': 'application/json' }, - }) - }) + return Response.json(res) + }), + } ``` ## Create the database webhook @@ -169,7 +163,7 @@ Push notifications are an important part of any mobile app. They allow you to se Add the following code to `supabase/functions/push/index.ts`: ```ts supabase/functions/push/index.ts - import { createClient } from 'npm:@supabase/supabase-js@2' + import { withSupabase } from 'npm:@supabase/server@^1' import { JWT } from 'npm:google-auth-library@9' import serviceAccount from '../service-account.json' with { type: 'json' } @@ -186,59 +180,53 @@ Push notifications are an important part of any mobile app. They allow you to se schema: 'public' } - const SUPABASE_SECRET_KEYS = JSON.parse(Deno.env.get('SUPABASE_SECRET_KEYS')!) + // Triggered by a Database Webhook, which authenticates with a secret key. + // Deploy with `verify_jwt = false`. + export default { + fetch: withSupabase({ auth: 'secret' }, async (req, ctx) => { + const payload: WebhookPayload = await req.json() - // If you want to use a different api key, change 'default' to your preferred key name - const supabase = createClient( - Deno.env.get('SUPABASE_URL')!, - SUPABASE_SECRET_KEYS['default'] - ) + const { data } = await ctx.supabaseAdmin + .from('profiles') + .select('fcm_token') + .eq('id', payload.record.user_id) + .single() - Deno.serve(async (req) => { - const payload: WebhookPayload = await req.json() + const fcmToken = data!.fcm_token as string - const { data } = await supabase - .from('profiles') - .select('fcm_token') - .eq('id', payload.record.user_id) - .single() + const accessToken = await getAccessToken({ + clientEmail: serviceAccount.client_email, + privateKey: serviceAccount.private_key, + }) - const fcmToken = data!.fcm_token as string - - const accessToken = await getAccessToken({ - clientEmail: serviceAccount.client_email, - privateKey: serviceAccount.private_key, - }) - - const res = await fetch( - `https://fcm.googleapis.com/v1/projects/${serviceAccount.project_id}/messages:send`, - { - method: 'POST', - headers: { - 'Content-Type': 'application/json', - Authorization: `Bearer ${accessToken}`, - }, - body: JSON.stringify({ - message: { - token: fcmToken, - notification: { - title: `Notification from Supabase`, - body: payload.record.body, - }, + const res = await fetch( + `https://fcm.googleapis.com/v1/projects/${serviceAccount.project_id}/messages:send`, + { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + Authorization: `Bearer ${accessToken}`, }, - }), + body: JSON.stringify({ + message: { + token: fcmToken, + notification: { + title: `Notification from Supabase`, + body: payload.record.body, + }, + }, + }), + } + ) + + const resData = await res.json() + if (res.status < 200 || 299 < res.status) { + throw resData } - ) - const resData = await res.json() - if (res.status < 200 || 299 < res.status) { - throw resData - } - - return new Response(JSON.stringify(resData), { - headers: { 'Content-Type': 'application/json' }, - }) - }) + return Response.json(resData) + }), + } const getAccessToken = ({ clientEmail, diff --git a/apps/docs/content/guides/functions/examples/semantic-search.mdx b/apps/docs/content/guides/functions/examples/semantic-search.mdx index db717653b6c..47548c35d7d 100644 --- a/apps/docs/content/guides/functions/examples/semantic-search.mdx +++ b/apps/docs/content/guides/functions/examples/semantic-search.mdx @@ -37,28 +37,34 @@ create index on embeddings using hnsw (embedding vector_ip_ops); You can deploy the [following edge function](https://github.com/supabase/supabase/blob/master/examples/ai/edge-functions/supabase/functions/generate-embedding/index.ts) as a [database webhook](/docs/guides/database/webhooks) to generate the embeddings for any text content inserted into the table: -```tsx +```ts +import { withSupabase } from 'npm:@supabase/server@^1' + const model = new Supabase.ai.Session('gte-small') -Deno.serve(async (req) => { - const payload: WebhookPayload = await req.json() - const { content, id } = payload.record +// Triggered by a Database Webhook, which authenticates with a secret key. +// Deploy with `verify_jwt = false`. +export default { + fetch: withSupabase({ auth: 'secret' }, async (req, ctx) => { + const payload: WebhookPayload = await req.json() + const { content, id } = payload.record - // Generate embedding. - const embedding = await model.run(content, { - mean_pool: true, - normalize: true, - }) + // Generate embedding. + const embedding = await model.run(content, { + mean_pool: true, + normalize: true, + }) - // Store in database. - const { error } = await supabase - .from('embeddings') - .update({ embedding: JSON.stringify(embedding) }) - .eq('id', id) - if (error) console.warn(error.message) + // Store in database. + const { error } = await ctx.supabaseAdmin + .from('embeddings') + .update({ embedding: JSON.stringify(embedding) }) + .eq('id', id) + if (error) console.warn(error.message) - return new Response('ok') -}) + return new Response('ok') + }), +} ``` ## Create a Database Function and RPC @@ -98,32 +104,36 @@ $$; You can use `supabase-js` to first generate the embedding for the search term and then invoke the Postgres function to find the relevant results from your stored embeddings, right from your [Supabase Edge Function](https://github.com/supabase/supabase/blob/master/examples/ai/edge-functions/supabase/functions/search/index.ts): -```tsx +```ts +import { withSupabase } from 'npm:@supabase/server@^1' + const model = new Supabase.ai.Session('gte-small') -Deno.serve(async (req) => { - const { search } = await req.json() - if (!search) return new Response('Please provide a search param!') - // Generate embedding for search term. - const embedding = await model.run(search, { - mean_pool: true, - normalize: true, - }) - - // Query embeddings. - const { data: result, error } = await supabase - .rpc('query_embeddings', { - embedding, - match_threshold: 0.8, +export default { + fetch: withSupabase({ auth: 'user' }, async (req, ctx) => { + const { search } = await req.json() + if (!search) return new Response('Please provide a search param!') + // Generate embedding for search term. + const embedding = await model.run(search, { + mean_pool: true, + normalize: true, }) - .select('content') - .limit(3) - if (error) { - return Response.json(error) - } - return Response.json({ search, result }) -}) + // Query embeddings. + const { data: result, error } = await ctx.supabase + .rpc('query_embeddings', { + embedding, + match_threshold: 0.8, + }) + .select('content') + .limit(3) + if (error) { + return Response.json(error) + } + + return Response.json({ search, result }) + }), +} ``` You now have AI powered semantic search set up without any external dependencies! Just you, pgvector, and Supabase Edge Functions! diff --git a/apps/docs/content/guides/functions/examples/send-emails.mdx b/apps/docs/content/guides/functions/examples/send-emails.mdx index 60fc7926ad5..c9bcef0f723 100644 --- a/apps/docs/content/guides/functions/examples/send-emails.mdx +++ b/apps/docs/content/guides/functions/examples/send-emails.mdx @@ -30,6 +30,8 @@ Store the `RESEND_API_KEY` in your `.env` file. Paste the following code into the `index.ts` file: ```tsx +import { withSupabase } from 'npm:@supabase/server@^1' + const RESEND_API_KEY = Deno.env.get('RESEND_API_KEY') const handler = async (_request: Request): Promise => { @@ -49,15 +51,10 @@ const handler = async (_request: Request): Promise => { const data = await res.json() - return new Response(JSON.stringify(data), { - status: 200, - headers: { - 'Content-Type': 'application/json', - }, - }) + return Response.json(data) } -Deno.serve(handler) +export default { fetch: withSupabase({ auth: ['user', 'secret'] }, handler) } ``` ### 3. Deploy and send email @@ -69,7 +66,12 @@ supabase start supabase functions serve --no-verify-jwt --env-file .env ``` -Test it: http://localhost:54321/functions/v1/resend +The function accepts a signed-in user's JWT or a secret key, so it can be triggered from your app (via `supabase.functions.invoke`) or from a database function. Test it locally with a secret key: + +```bash +curl -i --request POST 'http://localhost:54321/functions/v1/resend' \ + --header 'apikey: ' +``` Deploy function to Supabase: @@ -83,8 +85,6 @@ When you deploy to Supabase, make sure that your `RESEND_API_KEY` is set in [Edg -Open the endpoint URL to send an email: - ### 4. Try it yourself Find the complete example on [GitHub](https://github.com/resendlabs/resend-supabase-edge-functions-example). diff --git a/apps/docs/content/guides/functions/examples/sentry-monitoring.mdx b/apps/docs/content/guides/functions/examples/sentry-monitoring.mdx index ae6d901ebae..9a691e28233 100644 --- a/apps/docs/content/guides/functions/examples/sentry-monitoring.mdx +++ b/apps/docs/content/guides/functions/examples/sentry-monitoring.mdx @@ -24,6 +24,7 @@ Handle exceptions within your function and send them to Sentry. ```tsx import * as Sentry from 'https://deno.land/x/sentry/index.mjs' +import { withSupabase } from 'npm:@supabase/server@^1' Sentry.init({ // https://docs.sentry.io/product/sentry-basics/concepts/dsn-explainer/#where-to-find-your-dsn @@ -39,25 +40,25 @@ Sentry.init({ Sentry.setTag('region', Deno.env.get('SB_REGION')) Sentry.setTag('execution_id', Deno.env.get('SB_EXECUTION_ID')) -Deno.serve(async (req) => { - try { - const { name } = await req.json() - // This will throw, as `name` in our example call will be `undefined` - const data = { - message: `Hello ${name}!`, - } +// Open endpoint for testing. In production, implement an authorization layer in the handler or switch the auth mode. +export default { + fetch: withSupabase({ auth: 'none' }, async (req, ctx) => { + try { + const { name } = await req.json() + // This will throw, as `name` in our example call will be `undefined` + const data = { + message: `Hello ${name}!`, + } - return new Response(JSON.stringify(data), { headers: { 'Content-Type': 'application/json' } }) - } catch (e) { - Sentry.captureException(e) - // Flush Sentry before the running process closes - await Sentry.flush(2000) - return new Response(JSON.stringify({ msg: 'error' }), { - status: 500, - headers: { 'Content-Type': 'application/json' }, - }) - } -}) + return Response.json(data) + } catch (e) { + Sentry.captureException(e) + // Flush Sentry before the running process closes + await Sentry.flush(2000) + return Response.json({ msg: 'error' }, { status: 500 }) + } + }), +} ``` ### 3. Deploy and test diff --git a/apps/docs/content/guides/functions/examples/slack-bot-mention.mdx b/apps/docs/content/guides/functions/examples/slack-bot-mention.mdx index 63aed481548..9f78d84aedd 100644 --- a/apps/docs/content/guides/functions/examples/slack-bot-mention.mdx +++ b/apps/docs/content/guides/functions/examples/slack-bot-mention.mdx @@ -28,37 +28,38 @@ Here's the code of the Edge Function, you can change the response to handle the ```ts index.ts import { WebClient } from 'https://deno.land/x/slack_web_api@6.7.2/mod.js' +import { withSupabase } from 'npm:@supabase/server@^1' const slackBotToken = Deno.env.get('SLACK_TOKEN') ?? '' const botClient = new WebClient(slackBotToken) console.log(`Slack URL verification function up and running!`) -Deno.serve(async (req) => { - try { - const reqBody = await req.json() - console.log(JSON.stringify(reqBody, null, 2)) - const { token, challenge, type, event } = reqBody - if (type == 'url_verification') { - return new Response(JSON.stringify({ challenge }), { - headers: { 'Content-Type': 'application/json' }, - status: 200, - }) - } else if (event.type == 'app_mention') { - const { user, text, channel, ts } = event - // Here you should process the text received and return a response: - const response = await botClient.chat.postMessage({ - channel: channel, - text: `Hello <@${user}>!`, - thread_ts: ts, - }) - return new Response('ok', { status: 200 }) +// Slack calls this endpoint, so deploy with --no-verify-jwt. +export default { + fetch: withSupabase({ auth: 'none' }, async (req) => { + try { + // Implement your Slack request signature verification here before trusting the payload + // (validate `x-slack-signature` / `x-slack-request-timestamp` with your signing secret). + const reqBody = await req.json() + console.log(JSON.stringify(reqBody, null, 2)) + const { token, challenge, type, event } = reqBody + + if (type == 'url_verification') { + return Response.json({ challenge }) + } else if (event.type == 'app_mention') { + const { user, text, channel, ts } = event + // Here you should process the text received and return a response: + const response = await botClient.chat.postMessage({ + channel: channel, + text: `Hello <@${user}>!`, + thread_ts: ts, + }) + return new Response('ok', { status: 200 }) + } + } catch (error) { + return Response.json({ error: error.message }, { status: 500 }) } - } catch (error) { - return new Response(JSON.stringify({ error: error.message }), { - headers: { 'Content-Type': 'application/json' }, - status: 500, - }) - } -}) + }), +} ``` diff --git a/apps/docs/content/guides/functions/examples/upstash-redis.mdx b/apps/docs/content/guides/functions/examples/upstash-redis.mdx index 5fdd926f830..630de49aca5 100644 --- a/apps/docs/content/guides/functions/examples/upstash-redis.mdx +++ b/apps/docs/content/guides/functions/examples/upstash-redis.mdx @@ -40,39 +40,43 @@ And add the code to the `index.ts` file: ```ts index.ts import { Redis } from 'https://deno.land/x/upstash_redis@v1.19.3/mod.ts' +import { withSupabase } from 'npm:@supabase/server@^1' console.log(`Function "upstash-redis-counter" up and running!`) -Deno.serve(async (_req) => { - try { - const redis = new Redis({ - url: Deno.env.get('UPSTASH_REDIS_REST_URL')!, - token: Deno.env.get('UPSTASH_REDIS_REST_TOKEN')!, - }) - - const deno_region = Deno.env.get('DENO_REGION') - if (deno_region) { - // Increment region counter - await redis.hincrby('supa-edge-counter', deno_region, 1) - } else { - // Increment localhost counter - await redis.hincrby('supa-edge-counter', 'localhost', 1) - } - - // Get all values - const counterHash: Record | null = await redis.hgetall('supa-edge-counter') - const counters = Object.entries(counterHash!) - .sort(([, a], [, b]) => b - a) // sort desc - .reduce((r, [k, v]) => ({ total: r.total + v, regions: { ...r.regions, [k]: v } }), { - total: 0, - regions: {}, +// Open endpoint for testing. In production, implement an authorization layer in the handler or switch the auth mode. +export default { + fetch: withSupabase({ auth: 'none' }, async (req, ctx) => { + try { + const redis = new Redis({ + url: Deno.env.get('UPSTASH_REDIS_REST_URL')!, + token: Deno.env.get('UPSTASH_REDIS_REST_TOKEN')!, }) - return new Response(JSON.stringify({ counters }), { status: 200 }) - } catch (error) { - return new Response(JSON.stringify({ error: error.message }), { status: 200 }) - } -}) + const deno_region = Deno.env.get('DENO_REGION') + if (deno_region) { + // Increment region counter + await redis.hincrby('supa-edge-counter', deno_region, 1) + } else { + // Increment localhost counter + await redis.hincrby('supa-edge-counter', 'localhost', 1) + } + + // Get all values + const counterHash: Record | null = await redis.hgetall('supa-edge-counter') + const counters = Object.entries(counterHash!) + .sort(([, a], [, b]) => b - a) // sort desc + .reduce((r, [k, v]) => ({ total: r.total + v, regions: { ...r.regions, [k]: v } }), { + total: 0, + regions: {}, + }) + + return Response.json({ counters }) + } catch (error) { + return Response.json({ error: error.message }, { status: 500 }) + } + }), +} ``` ## Run locally diff --git a/apps/docs/content/guides/functions/kysely-postgres.mdx b/apps/docs/content/guides/functions/kysely-postgres.mdx index a8930899f96..0d61b084322 100644 --- a/apps/docs/content/guides/functions/kysely-postgres.mdx +++ b/apps/docs/content/guides/functions/kysely-postgres.mdx @@ -198,6 +198,7 @@ import { PostgresIntrospector, PostgresQueryCompiler, } from 'https://esm.sh/kysely@0.23.4' +import { withSupabase } from 'npm:@supabase/server@^1' import { PostgresDriver } from './DenoPostgresDriver.ts' @@ -245,31 +246,36 @@ const db = new Kysely({ }, }) -Deno.serve(async (_req) => { - try { - // Run a query - const animals = await db.selectFrom('animals').select(['id', 'animal', 'created_at']).execute() +export default { + fetch: withSupabase({ auth: 'user' }, async (_req, ctx) => { + try { + // Run a query + const animals = await db + .selectFrom('animals') + .select(['id', 'animal', 'created_at']) + .execute() - // Neat, it's properly typed \o/ - console.log(animals[0].created_at.getFullYear()) + // Neat, it's properly typed \o/ + console.log(animals[0].created_at.getFullYear()) - // Encode the result as pretty printed JSON - const body = JSON.stringify( - animals, - (key, value) => (typeof value === 'bigint' ? value.toString() : value), - 2 - ) + // Encode the result as pretty printed JSON + const body = JSON.stringify( + animals, + (key, value) => (typeof value === 'bigint' ? value.toString() : value), + 2 + ) - // Return the response with the correct content type header - return new Response(body, { - status: 200, - headers: { - 'Content-Type': 'application/json; charset=utf-8', - }, - }) - } catch (err) { - console.error(err) - return new Response(String(err?.message ?? err), { status: 500 }) - } -}) + // Return the response with the correct content type header + return new Response(body, { + status: 200, + headers: { + 'Content-Type': 'application/json; charset=utf-8', + }, + }) + } catch (err) { + console.error(err) + return new Response(String(err?.message ?? err), { status: 500 }) + } + }), +} ``` diff --git a/apps/docs/content/guides/functions/quickstart-dashboard.mdx b/apps/docs/content/guides/functions/quickstart-dashboard.mdx index 4412d30a293..14db8b23f35 100644 --- a/apps/docs/content/guides/functions/quickstart-dashboard.mdx +++ b/apps/docs/content/guides/functions/quickstart-dashboard.mdx @@ -186,14 +186,14 @@ console.log(data) // { message: "Hello JavaScript!" } const response = await fetch('https://[YOUR_PROJECT_ID].supabase.co/functions/v1/hello-world', { method: 'POST', headers: { - Authorization: 'Bearer YOUR_PUBLISHABLE_KEY', + apikey: '', 'Content-Type': 'application/json', }, body: JSON.stringify({ name: 'Fetch' }), }) const data = await response.json() -console.log(data) // { message: "Hello Fetch!" } +console.log(data) // { message: "Hello there!" } ``` diff --git a/apps/docs/content/guides/functions/recursive-functions.mdx b/apps/docs/content/guides/functions/recursive-functions.mdx index 580225f4d74..ad28b050c1e 100644 --- a/apps/docs/content/guides/functions/recursive-functions.mdx +++ b/apps/docs/content/guides/functions/recursive-functions.mdx @@ -97,7 +97,7 @@ Deno.serve(async (req) => { const response = await fetch(`${Deno.env.get('SUPABASE_URL')}/functions/v1/other-function`, { method: 'POST', headers: { - Authorization: `Bearer ${SUPABASE_DEFAULT_PUBLISHABLE_KEY}`, + apikey: SUPABASE_DEFAULT_PUBLISHABLE_KEY, 'Content-Type': 'application/json', }, body: JSON.stringify({ foo: 'bar' }), diff --git a/apps/docs/content/guides/functions/routing.mdx b/apps/docs/content/guides/functions/routing.mdx index 89e785455e5..3e112ee2d20 100644 --- a/apps/docs/content/guides/functions/routing.mdx +++ b/apps/docs/content/guides/functions/routing.mdx @@ -39,16 +39,20 @@ Here's a simple hello world example using some popular web frameworks: ```ts -Deno.serve(async (req) => { - if (req.method === 'GET') { +import { withSupabase } from 'npm:@supabase/server@^1' + +export default { + fetch: withSupabase({ auth: 'user' }, async (req, ctx) => { + if (req.method === 'GET') { + return new Response('Hello World!') + } + const { name } = await req.json() + if (name) { + return new Response(`Hello ${name}!`) + } return new Response('Hello World!') - } - const { name } = await req.json() - if (name) { - return new Response(`Hello ${name}!`) - } - return new Response('Hello World!') -}) + }), +} ``` @@ -123,9 +127,11 @@ app.get('/hello-world', (c) => { return new Response('Hello World!') }) -Deno.serve(app.fetch) +export default { fetch: app.fetch } ``` +To add Supabase auth per route, use the Hono adapter from `npm:@supabase/server@^1/adapters/hono`. See [Securing Edge Functions](/docs/guides/functions/auth). + @@ -155,6 +161,8 @@ Keep in mind paths must be prefixed by function name. Route parameters can only ```ts +import { withSupabase } from 'npm:@supabase/server@^1' + interface Task { id: string name: string @@ -204,42 +212,44 @@ async function deleteTask(id: string): Promise { } } -Deno.serve(async (req) => { - const url = new URL(req.url) - const method = req.method - // Extract the last part of the path as the command - const command = url.pathname.split('/').pop() - // Assuming the last part of the path is the task ID - const id = command - try { - switch (method) { - case 'GET': - if (id) { - return getTask(id) - } else { - return getAllTasks() - } - case 'POST': - return createTask(req) - case 'PUT': - if (id) { - return updateTask(id, req) - } else { - return new Response('Bad Request', { status: 400 }) - } - case 'DELETE': - if (id) { - return deleteTask(id) - } else { - return new Response('Bad Request', { status: 400 }) - } - default: - return new Response('Method Not Allowed', { status: 405 }) +export default { + fetch: withSupabase({ auth: 'user' }, async (req, ctx) => { + const url = new URL(req.url) + const method = req.method + // Extract the last part of the path as the command + const command = url.pathname.split('/').pop() + // Assuming the last part of the path is the task ID + const id = command + try { + switch (method) { + case 'GET': + if (id) { + return getTask(id) + } else { + return getAllTasks() + } + case 'POST': + return createTask(req) + case 'PUT': + if (id) { + return updateTask(id, req) + } else { + return new Response('Bad Request', { status: 400 }) + } + case 'DELETE': + if (id) { + return deleteTask(id) + } else { + return new Response('Bad Request', { status: 400 }) + } + default: + return new Response('Method Not Allowed', { status: 405 }) + } + } catch (error) { + return new Response(`Internal Server Error: ${error}`, { status: 500 }) } - } catch (error) { - return new Response(`Internal Server Error: ${error}`, { status: 500 }) - } -}) + }), +} ``` @@ -388,9 +398,11 @@ app.delete('/:id', async (c) => { } }) -Deno.serve(app.fetch) +export default { fetch: app.fetch } ``` +To add Supabase auth per route, use the Hono adapter from `npm:@supabase/server@^1/adapters/hono`. See [Securing Edge Functions](/docs/guides/functions/auth). + @@ -407,6 +419,6 @@ This works well for small apps with only a couple of routes: <$CodeSample path="/edge-functions/supabase/functions/restful-tasks/index.ts" -lines={[[92, 116]]} +lines={[[48, -1]]} meta="restful-tasks/index.ts" /> diff --git a/apps/docs/content/guides/functions/schedule-functions.mdx b/apps/docs/content/guides/functions/schedule-functions.mdx index 1d9a54dc14b..222b938b6a4 100644 --- a/apps/docs/content/guides/functions/schedule-functions.mdx +++ b/apps/docs/content/guides/functions/schedule-functions.mdx @@ -47,7 +47,7 @@ select url:= (select decrypted_secret from vault.decrypted_secrets where name = 'project_url') || '/functions/v1/function-name', headers:=jsonb_build_object( 'Content-type', 'application/json', - 'Authorization', 'Bearer ' || (select decrypted_secret from vault.decrypted_secrets where name = 'publishable_key') + 'apikey', (select decrypted_secret from vault.decrypted_secrets where name = 'publishable_key') ), body:=concat('{"time": "', now(), '"}')::jsonb ) as request_id; diff --git a/apps/docs/content/guides/functions/websockets.mdx b/apps/docs/content/guides/functions/websockets.mdx index 05ce306d4df..8129b4e2af6 100644 --- a/apps/docs/content/guides/functions/websockets.mdx +++ b/apps/docs/content/guides/functions/websockets.mdx @@ -31,26 +31,28 @@ Here are some basic examples of setting up WebSocket servers using Deno and Node ```ts -Deno.serve((req) => { - const upgrade = req.headers.get('upgrade') || '' +export default { + fetch: (req) => { + const upgrade = req.headers.get('upgrade') || '' - if (upgrade.toLowerCase() != 'websocket') { - return new Response("request isn't trying to upgrade to WebSocket.", { status: 400 }) - } + if (upgrade.toLowerCase() != 'websocket') { + return new Response("request isn't trying to upgrade to WebSocket.", { status: 400 }) + } - const { socket, response } = Deno.upgradeWebSocket(req) + const { socket, response } = Deno.upgradeWebSocket(req) - socket.onopen = () => console.log('socket opened') - socket.onmessage = (e) => { - console.log('socket message:', e.data) - socket.send(new Date().toString()) - } + socket.onopen = () => console.log('socket opened') + socket.onmessage = (e) => { + console.log('socket message:', e.data) + socket.send(new Date().toString()) + } - socket.onerror = (e) => console.log('socket errored:', e.message) - socket.onclose = () => console.log('socket closed') + socket.onerror = (e) => console.log('socket errored:', e.message) + socket.onclose = () => console.log('socket closed') - return response -}) + return response + }, +} ``` @@ -123,7 +125,7 @@ WebSocket browser clients don't have the option to send custom headers. Because You can skip the default authorization header checks by explicitly providing `--no-verify-jwt` when serving and deploying functions. -To authenticate the user making WebSocket requests, you can pass the JWT in URL query params or via a custom protocol. +To authenticate the user making WebSocket requests, you can pass the JWT in URL query params or via a custom protocol. The [`withSupabase`](/docs/guides/functions/auth) wrapper validates credentials on request headers, so it can't authenticate WebSocket clients. Verify the JWT yourself, as shown below. { - const upgrade = req.headers.get('upgrade') || '' - if (upgrade.toLowerCase() != 'WebSocket') { - return new Response("request isn't trying to upgrade to WebSocket.", { status: 400 }) - } +export default { + fetch: async (req) => { + const upgrade = req.headers.get('upgrade') || '' + if (upgrade.toLowerCase() != 'websocket') { + return new Response("request isn't trying to upgrade to WebSocket.", { status: 400 }) + } - // Please be aware query params may be logged in some logging systems. - const url = new URL(req.url) - const jwt = url.searchParams.get('jwt') + // Please be aware query params may be logged in some logging systems. + const url = new URL(req.url) + const jwt = url.searchParams.get('jwt') - if (!jwt) { - console.error('Auth token not provided') - return new Response('Auth token not provided', { status: 403 }) - } + if (!jwt) { + console.error('Auth token not provided') + return new Response('Auth token not provided', { status: 403 }) + } - const { error, data } = await supabase.auth.getClaims() + const { error, data } = await supabase.auth.getUser(jwt) - if (error) { - console.error(error) - return new Response('Invalid token provided', { status: 403 }) - } + if (error) { + console.error(error) + return new Response('Invalid token provided', { status: 403 }) + } - if (!data.user) { - console.error('user is not authenticated') - return new Response('User is not authenticated', { status: 403 }) - } + if (!data.user) { + console.error('user is not authenticated') + return new Response('User is not authenticated', { status: 403 }) + } - const { socket, response } = Deno.upgradeWebSocket(req) + const { socket, response } = Deno.upgradeWebSocket(req) - socket.onopen = () => console.log('socket opened') - socket.onmessage = (e) => { - console.log('socket message:', e.data) - socket.send(new Date().toString()) - } + socket.onopen = () => console.log('socket opened') + socket.onmessage = (e) => { + console.log('socket message:', e.data) + socket.send(new Date().toString()) + } - socket.onerror = (e) => console.log('socket errored:', e.message) - socket.onclose = () => console.log('socket closed') + socket.onerror = (e) => console.log('socket errored:', e.message) + socket.onclose = () => console.log('socket closed') - return response -}) + return response + }, +} ``` @@ -199,47 +203,50 @@ const supabase = createClient( SUPABASE_SECRET_KEYS['default'] ) -Deno.serve((req) => { - const upgrade = req.headers.get('upgrade') || '' - if (upgrade.toLowerCase() != 'WebSocket') { - return new Response("request isn't trying to upgrade to WebSocket.", { status: 400 }) - } +export default { + fetch: async (req) => { + const upgrade = req.headers.get('upgrade') || '' + if (upgrade.toLowerCase() != 'websocket') { + return new Response("request isn't trying to upgrade to WebSocket.", { status: 400 }) + } - // Sec-WebScoket-Protocol may return multiple protocol values `jwt-TOKEN, value1, value 2` - const customProtocols = (req.headers.get('Sec-WebSocket-Protocol') ?? '') - .split(',') - .map((p) => p.trim()) - const jwt = customProtocols.find((p) => p.startsWith('jwt')).replace('jwt-', '') + // Sec-WebScoket-Protocol may return multiple protocol values `jwt-TOKEN, value1, value 2` + const customProtocols = (req.headers.get('Sec-WebSocket-Protocol') ?? '') + .split(',') + .map((p) => p.trim()) + const jwtProtocol = customProtocols.find((p) => p.startsWith('jwt-')) + const jwt = jwtProtocol ? jwtProtocol.replace('jwt-', '') : null - if (!jwt) { - console.error('Auth token not provided') - return new Response('Auth token not provided', { status: 403 }) - } + if (!jwt) { + console.error('Auth token not provided') + return new Response('Auth token not provided', { status: 403 }) + } - const { error, data } = await supabase.auth.getClaims() - if (error) { - console.error(error) - return new Response('Invalid token provided', { status: 403 }) - } + const { error, data } = await supabase.auth.getUser(jwt) + if (error) { + console.error(error) + return new Response('Invalid token provided', { status: 403 }) + } - if (!data.user) { - console.error('user is not authenticated') - return new Response('User is not authenticated', { status: 403 }) - } + if (!data.user) { + console.error('user is not authenticated') + return new Response('User is not authenticated', { status: 403 }) + } - const { socket, response } = Deno.upgradeWebSocket(req) + const { socket, response } = Deno.upgradeWebSocket(req) - socket.onopen = () => console.log('socket opened') - socket.onmessage = (e) => { - console.log('socket message:', e.data) - socket.send(new Date().toString()) - } + socket.onopen = () => console.log('socket opened') + socket.onmessage = (e) => { + console.log('socket message:', e.data) + socket.send(new Date().toString()) + } - socket.onerror = (e) => console.log('socket errored:', e.message) - socket.onclose = () => console.log('socket closed') + socket.onerror = (e) => console.log('socket errored:', e.message) + socket.onclose = () => console.log('socket closed') - return response -}) + return response + }, +} ``` diff --git a/apps/docs/content/guides/getting-started.mdx b/apps/docs/content/guides/getting-started.mdx index 7559d93015f..45a0a7892cc 100644 --- a/apps/docs/content/guides/getting-started.mdx +++ b/apps/docs/content/guides/getting-started.mdx @@ -10,7 +10,7 @@ hideToc: true
- + - + Use the Supabase CLI to develop locally and collaborate between teams. diff --git a/apps/docs/content/guides/getting-started/features.mdx b/apps/docs/content/guides/getting-started/features.mdx index 184be241615..8dcb43769e0 100644 --- a/apps/docs/content/guides/getting-started/features.mdx +++ b/apps/docs/content/guides/getting-started/features.mdx @@ -34,7 +34,7 @@ Encrypt sensitive data and store secrets using our Postgres extension, Supabase ### Replication -Automatically replicate your database to external destinations like data warehouses and analytics platforms. Read [the external replication documentation](/docs/guides/database/replication/external-replication-setup) for more details. +Automatically replicate your database to destination systems like data warehouses and analytics platforms with external replication (ETL), powered by Supabase ETL. Read [the documentation](/docs/guides/database/replication/external-replication-setup) for more details. ## Platform diff --git a/apps/docs/content/guides/getting-started/quickstarts/flutter.mdx b/apps/docs/content/guides/getting-started/quickstarts/flutter.mdx index c68f7cb7c67..498936ca67f 100644 --- a/apps/docs/content/guides/getting-started/quickstarts/flutter.mdx +++ b/apps/docs/content/guides/getting-started/quickstarts/flutter.mdx @@ -73,7 +73,7 @@ hideToc: true await Supabase.initialize( url: 'YOUR_SUPABASE_URL', - anonKey: 'YOUR_SUPABASE_PUBLISHABLE_KEY', + publishableKey: 'YOUR_SUPABASE_PUBLISHABLE_KEY', ); runApp(MyApp()); } diff --git a/apps/docs/content/guides/getting-started/quickstarts/redwoodjs.mdx b/apps/docs/content/guides/getting-started/quickstarts/redwoodjs.mdx index 7f6a4f66a68..3e8a6c42fc3 100644 --- a/apps/docs/content/guides/getting-started/quickstarts/redwoodjs.mdx +++ b/apps/docs/content/guides/getting-started/quickstarts/redwoodjs.mdx @@ -145,7 +145,7 @@ hideToc: true Let's seed the database with a few instruments. - Update the file `scripts/seeds.ts` to contain the following code: + Update the file `scripts/seed.ts` to contain the following code: diff --git a/apps/docs/content/guides/getting-started/tutorials/with-flutter.mdx b/apps/docs/content/guides/getting-started/tutorials/with-flutter.mdx index 257064c7481..9c345a4d4dd 100644 --- a/apps/docs/content/guides/getting-started/tutorials/with-flutter.mdx +++ b/apps/docs/content/guides/getting-started/tutorials/with-flutter.mdx @@ -67,7 +67,7 @@ Add `CFBundleURLTypes` to enable deep linking: <$CodeTabs> -```xml name=ios/Runner/Info.plist" +```xml name=ios/Runner/Info.plist @@ -314,7 +314,7 @@ Let's create a new widget called `account_page.dart` for that. <$CodeTabs> -```dart name=lib/pages/account_page.dart" +```dart name=lib/pages/account_page.dart import 'package:flutter/material.dart'; import 'package:supabase_flutter/supabase_flutter.dart'; import 'package:supabase_quickstart/main.dart'; diff --git a/apps/docs/content/guides/integrations/supabase-for-platforms.mdx b/apps/docs/content/guides/integrations/supabase-for-platforms.mdx index e1204f22222..c1ac2b31012 100644 --- a/apps/docs/content/guides/integrations/supabase-for-platforms.mdx +++ b/apps/docs/content/guides/integrations/supabase-for-platforms.mdx @@ -160,7 +160,7 @@ curl 'https://api.supabase.com/v1/projects/{ref}/branches' \ --data '{ "branch_name": "DEV", "secrets": { - "STRIPE_SECRET_KEY":"sk_test_123..." + "STRIPE_SECRET_KEY":"sk_test_123...", "STRIPE_PUBLISHABLE_KEY":"pk_test_123..." } }' diff --git a/apps/docs/content/guides/local-development/cli/getting-started.mdx b/apps/docs/content/guides/local-development/cli/getting-started.mdx index eb4f2186b2e..8b531f49e4b 100644 --- a/apps/docs/content/guides/local-development/cli/getting-started.mdx +++ b/apps/docs/content/guides/local-development/cli/getting-started.mdx @@ -72,28 +72,12 @@ The Supabase CLI requires **Node.js 20 or later** when run via `npx` or `npm`. O - - -Installing the Supabase CLI globally using `npm install -g supabase` is **not supported**. - -For global usage, install the CLI via Homebrew, Scoop, or the standalone binary. - -Alternatively, you can run the CLI using `npx supabase` or install it locally as a dev dependency. - - - You can also install the CLI as dev dependency via [npm](https://www.npmjs.com/package/supabase): ```sh npm install supabase --save-dev ``` - - -Global installation using `npm install -g supabase` is not supported. For global CLI usage, install via [Homebrew](/docs/guides/local-development/cli/getting-started?queryGroups=platform&platform=macos), [Scoop](/docs/guides/local-development/cli/getting-started?queryGroups=platform&platform=windows), or the [standalone binary](/docs/guides/local-development/cli/getting-started?queryGroups=platform&platform=linux). - - - @@ -157,7 +141,7 @@ npx supabase@beta --help ## Updating the Supabase CLI -When a new [version](https://github.com/supabase/cli/releases) is released, you can update the CLI using the same methods. +When a new [version](https://github.com/supabase/cli/releases) is released, you can update the CLI using the same channels. - - -Docker settings on Mac: Select Integrated, Virtualization Framework, and osxfs - - - - -Docker settings on Windows: Select Integrated, Expose Daemon, WSL2, and Add to /etc/hosts file. - - - - - +The Supabase CLI uses Docker containers to manage the local development stack. Follow the official guide to install and configure [Docker Desktop](https://docs.docker.com/desktop) on your machine. Alternately, you can use a different container tool that offers Docker compatible APIs. @@ -296,15 +241,13 @@ Alternately, you can use a different container tool that offers Docker compatibl - [OrbStack](https://orbstack.dev/) (macOS) - [colima](https://github.com/abiosoft/colima) (macOS) - - Inside the folder where you want to create your project, run: ```bash supabase init ``` -This will create a new `supabase` folder. It's safe to commit this folder to your version control system. +This creates a new `supabase` folder. It's safe to commit this folder to version control. Now, to start the Supabase stack, run: @@ -312,11 +255,11 @@ Now, to start the Supabase stack, run: supabase start ``` -This takes time on your first run because the CLI needs to download the Docker images to your local machine. The CLI includes the entire Supabase toolset, and a few additional images that are useful for local development (like a local SMTP server and a database diff tool). +This takes time on your first run because the CLI needs to download the Docker images to your local machine. The CLI includes the entire Supabase stack, and a few additional images useful for local development (like a local SMTP server and a database diff tool). ## Access your project's services -Once all of the Supabase services are running, you'll see output containing your local Supabase credentials. It should look like this, with urls and keys that you'll use in your local project: +Once all the Supabase services are running, you'll see output containing your local Supabase credentials. It should look like the below, with urls and keys that you use in your local project: ``` Started supabase local development setup. @@ -427,7 +370,7 @@ For advanced logs analysis using the Logs Explorer, it is advised to use the Big -All logs will be stored in the local database under the `_analytics` schema. +All logs are stored in the local database under the `_analytics` schema. diff --git a/apps/docs/content/guides/local-development/cli/testing-and-linting.mdx b/apps/docs/content/guides/local-development/cli/testing-and-linting.mdx index 5246f956484..017961afb7c 100644 --- a/apps/docs/content/guides/local-development/cli/testing-and-linting.mdx +++ b/apps/docs/content/guides/local-development/cli/testing-and-linting.mdx @@ -5,7 +5,7 @@ description: 'Using the CLI to test your Supabase project.' subtitle: 'Using the CLI to test your Supabase project.' --- -The Supabase CLI provides a set of tools to help you test and lint your Postgres database and Edge` Functions. +The Supabase CLI provides a set of tools to help you test and lint your Postgres database and Edge Functions. ## Testing your database diff --git a/apps/docs/content/guides/platform/database-size.mdx b/apps/docs/content/guides/platform/database-size.mdx index 9af02dff399..f2e63601fb7 100644 --- a/apps/docs/content/guides/platform/database-size.mdx +++ b/apps/docs/content/guides/platform/database-size.mdx @@ -26,7 +26,7 @@ Database size is consumed primarily by your data, indexes, and materialized view -Depending on your billing plan, your database can go into read-only mode which can prevent you inserting and deleting data. There are instructions for managing read-only mode in the [Disk Management](#disk-management) section. +Depending on your billing plan, your database can go into read-only mode which can prevent you inserting and deleting data. There are instructions for managing read-only mode in the [Read-Only Mode](#read-only-mode) section. diff --git a/apps/docs/content/guides/platform/performance.mdx b/apps/docs/content/guides/platform/performance.mdx index fbd2666be1d..1bc78848a4c 100644 --- a/apps/docs/content/guides/platform/performance.mdx +++ b/apps/docs/content/guides/platform/performance.mdx @@ -29,7 +29,7 @@ In such a scenario, you can consider: ### Configuring clients to use fewer connections -You can use the [pg_stat_activity](https://www.postgresql.org/docs/current/monitoring-stats.html#MONITORING-PG-STAT-ACTIVITY-VIEW) view to debug which clients are holding open connections on your DB. `pg_stat_activity` only exposes information on direct connections to the database. Information on the number of connections to Supavisor is available [via the metrics endpoint](../platform/metrics). +You can use the [pg_stat_activity](https://www.postgresql.org/docs/current/monitoring-stats.html#MONITORING-PG-STAT-ACTIVITY-VIEW) view to debug which clients are holding open connections on your DB. `pg_stat_activity` only exposes information on direct connections to the database. Information on the number of connections to Supavisor is available [via the metrics endpoint](../telemetry/metrics). Depending on the clients involved, you might be able to configure them to work with fewer connections (e.g. by imposing a limit on the maximum number of connections they're allowed to use), or shift specific workloads to connect via [Supavisor](/docs/guides/database/connecting-to-postgres#connection-pooler) instead. Transient workflows, which can quickly scale up and down in response to traffic (e.g. serverless functions), can especially benefit from using a connection pooler rather than connecting to the DB directly. diff --git a/apps/docs/content/guides/platform/privatelink.mdx b/apps/docs/content/guides/platform/privatelink.mdx index f3db55b4819..4e602ed56cc 100644 --- a/apps/docs/content/guides/platform/privatelink.mdx +++ b/apps/docs/content/guides/platform/privatelink.mdx @@ -178,9 +178,3 @@ The PrivateLink endpoint is a layer 3 solution so behaves like a standard Postgr Ready to enhance your database security with PrivateLink? [Contact our Enterprise team](/contact/enterprise) to discuss your requirements and begin the setup process. Our support team will guide you through the configuration and ensure your private database connectivity meets your security and performance requirements. - -## Regional availability - -PrivateLink is not currently available in the following regions: - -- **eu-central-2 (Zurich)** - Expected availability: April 2026 diff --git a/apps/docs/content/guides/platform/read-replicas.mdx b/apps/docs/content/guides/platform/read-replicas.mdx index ad81e899d34..2fb83ea8c4f 100644 --- a/apps/docs/content/guides/platform/read-replicas.mdx +++ b/apps/docs/content/guides/platform/read-replicas.mdx @@ -143,7 +143,7 @@ When a Read Replica is deployed, it emits logs from the following services: - [PostgREST](/dashboard/project/_/logs/postgrest-logs) - [Supavisor](/dashboard/project/_/logs/pooler-logs) -Views on [Log Explorer](/docs/guides/platform/logs) are automatically filtered by databases, with the logs of the Primary database displayed by default. Viewing logs from other databases can be toggled with the `Source` button found on the upper-right part section of the Logs Explorer page. +Views on [Log Explorer](/docs/guides/telemetry/logs) are automatically filtered by databases, with the logs of the Primary database displayed by default. Viewing logs from other databases can be toggled with the `Source` button found on the upper-right part section of the Logs Explorer page. For API logs, logs can originate from the API Load Balancer as well. The upstream database or the one that eventually handles the request can be found under the `Redirect Identifier` field. This is equivalent to `metadata.load_balancer_redirect_identifier` when querying the underlying logs. @@ -151,7 +151,7 @@ For API logs, logs can originate from the API Load Balancer as well. The upstrea Observability and metrics for Read Replicas are available on the Supabase Dashboard. Resource utilization for a specific Read Replica can be viewed on the [Database Reports page](/dashboard/project/_/observability/database) by toggling for `Source`. Likewise, metrics on API requests going through either a Read Replica or Load Balancer API endpoint are also available on the dashboard through the [API Reports page](/dashboard/project/_/observability/api-overview) -We recommend ingesting your [project's metrics](/docs/guides/platform/metrics#accessing-the-metrics-endpoint) into your own environment. If you have an existing ingestion pipeline set up for your project, you can [update it](https://github.com/supabase/supabase-grafana?tab=readme-ov-file#read-replica-support) to additionally ingest metrics from your Read Replicas. +We recommend ingesting your [project's metrics](/docs/guides/telemetry/metrics) into your own environment. If you have an existing ingestion pipeline set up for your project, you can [update it](https://github.com/supabase/supabase-grafana?tab=readme-ov-file#read-replica-support) to additionally ingest metrics from your Read Replicas. ### Centralized configuration management diff --git a/apps/docs/content/guides/platform/read-replicas/getting-started.mdx b/apps/docs/content/guides/platform/read-replicas/getting-started.mdx index 9a9b17cb961..c4f768b47d5 100644 --- a/apps/docs/content/guides/platform/read-replicas/getting-started.mdx +++ b/apps/docs/content/guides/platform/read-replicas/getting-started.mdx @@ -129,7 +129,7 @@ There is no single threshold to indicate when you should address replication lag -If you are already ingesting your [project's metrics](/docs/guides/platform/metrics#accessing-the-metrics-endpoint) into your own environment, you can also keep track of replication lag and set alarms with the `physical_replication_lag_physical_replica_lag_seconds` metric. +If you are already ingesting your [project's metrics](/docs/guides/telemetry/metrics) into your own environment, you can also keep track of replication lag and set alarms with the `physical_replication_lag_physical_replica_lag_seconds` metric. diff --git a/apps/docs/content/guides/realtime/broadcast.mdx b/apps/docs/content/guides/realtime/broadcast.mdx index a6f73498569..6714da11eca 100644 --- a/apps/docs/content/guides/realtime/broadcast.mdx +++ b/apps/docs/content/guides/realtime/broadcast.mdx @@ -128,6 +128,12 @@ Get the Project URL and key from [the project's **Connect** dialog](/dashboard/p You can receive Broadcast messages by providing a callback to the channel. + + +Binary payloads (`ArrayBuffer` / `ArrayBufferView`) are received automatically from **supabase-js 2.91.0** and **supabase-swift 2.44.0**. On older SDK versions, binary messages are silently dropped and never reach the callback. + + + + +Broadcast payloads can be binary (`ArrayBuffer` or `ArrayBufferView`, e.g. `Uint8Array`) over WebSocket from **supabase-js 2.91.0** and **supabase-swift 2.44.0**. Binary payloads sent to clients running older SDK versions are **silently dropped** and never arrive over the WebSocket. The Dart, Kotlin, and Python clients don't support binary payloads yet. + + + @@ -335,6 +357,12 @@ You can use the Supabase client libraries to send Broadcast messages. <$Show if="sdk:swift"> + + + Binary payloads over WebSocket are supported from supabase-swift 2.44.0. Receivers on older SDK versions will not get binary messages. + + + {/* prettier-ignore */} ```swift let myChannel = await supabase.channel("test-channel") { @@ -440,11 +468,31 @@ By default, all database broadcasts are private, meaning clients must authentica +To broadcast a binary payload from your database, use the `realtime.send_binary()` function with a `bytea` payload: + +{/* prettier-ignore */} +```sql +select + realtime.send_binary( + '\x012345'::bytea, -- bytea payload + 'event', -- Event name + 'topic', -- Topic + true -- Private / Public flag (defaults to true) + ); +``` + +The same public/private matching rule applies: a binary broadcast only reaches channels with the same private setting. Binary messages only reach clients on **supabase-js 2.91.0** and **supabase-swift 2.44.0** or later; older clients silently drop them. + You can use the `realtime.broadcast_changes()` helper function to broadcast messages when a record is created, updated, or deleted. For more details, read [Subscribing to Database Changes](/docs/guides/realtime/subscribing-to-database-changes). ### Broadcast using the REST API -You can send a Broadcast message by making an HTTP request to Realtime servers. +You can send a single Broadcast message by making an HTTP request to Realtime servers. The endpoint embeds the topic and event in the path, and the `Content-Type` header determines the payload type: + +- `application/json` — JSON payload +- `application/octet-stream` — binary payload + +Add `?private=true` to broadcast to a private channel. ' \ -H 'Content-Type: application/json' \ - --data-raw '{ - "messages": [ - { - "topic": "test", - "event": "event", - "payload": { "test": "test" } - } - ] - }' \ - 'https://.supabase.co/realtime/v1/api/broadcast' + --data-raw '{ "test": "test" }' \ + 'https://.supabase.co/realtime/v1/api/broadcast/test/events/event' + + # Binary payload + curl -v \ + -H 'apikey: ' \ + -H 'Content-Type: application/octet-stream' \ + --data-binary @payload.bin \ + 'https://.supabase.co/realtime/v1/api/broadcast/test/events/event?private=true' ``` @@ -477,26 +525,39 @@ You can send a Broadcast message by making an HTTP request to Realtime servers. {/* prettier-ignore */} ```bash - POST /realtime/v1/api/broadcast HTTP/1.1 + POST /realtime/v1/api/broadcast/test/events/event HTTP/1.1 Host: {PROJECT_REF}.supabase.co Content-Type: application/json apikey: {SUPABASE_TOKEN} - { - "messages": [ - { - "topic": "test", - "event": "event", - "payload": { - "test": "test" - } - } - ] - } + { "test": "test" } ``` + + +To send multiple messages in a single request, the batch endpoint `POST /realtime/v1/api/broadcast` is still available. It accepts a JSON body with a `messages` array (JSON payloads only): + +{/* prettier-ignore */} +```bash +curl -v \ +-H 'apikey: ' \ +-H 'Content-Type: application/json' \ +--data-raw '{ + "messages": [ + { + "topic": "test", + "event": "event", + "payload": { "test": "test" } + } + ] +}' \ +'https://.supabase.co/realtime/v1/api/broadcast' +``` + + + ## Broadcast options You can pass configuration options while initializing the Supabase Client. @@ -783,7 +844,7 @@ You can also send a Broadcast message by making an HTTP request to Realtime serv - This is currently available only in the Supabase JavaScript client version 2.37.0 and later. + `channel.httpSend()` always uses the REST API regardless of WebSocket connection state, and is available from the Supabase JavaScript client version 2.107.0 and later. `ArrayBuffer` and `ArrayBufferView` (e.g. `Uint8Array`) payloads are sent as `application/octet-stream`; all other payloads are JSON-encoded. @@ -792,13 +853,11 @@ You can also send a Broadcast message by making an HTTP request to Realtime serv // No need to subscribe to channel - channel - .send({ - type: 'broadcast', - event: 'test', - payload: { message: 'Hi' }, - }) - .then((resp) => console.log(resp)) + // JSON payload + await channel.httpSend('cursor-pos', { x: Math.random(), y: Math.random() }) + + // Binary payload (ArrayBuffer / ArrayBufferView) — sent as application/octet-stream + await channel.httpSend('cursor-pos', new Uint8Array([1, 2, 3]).buffer) // Remember to clean up the channel diff --git a/apps/docs/content/guides/realtime/limits.mdx b/apps/docs/content/guides/realtime/limits.mdx index edea5d6dc2d..5c45b111e4d 100644 --- a/apps/docs/content/guides/realtime/limits.mdx +++ b/apps/docs/content/guides/realtime/limits.mdx @@ -23,6 +23,7 @@ Upgrade your plan to increase your limits. Without a spend cap, or on an Enterpr | **Channels per connection** | 100 | 100 | 100 | 100 | 100+ | | **Presence keys per object** | 10 | 10 | 10 | 10 | 10+ | | **Presence messages per second** | 20 | 50 | 1,000 | 1,000 | 1,000+ | +| **Presence calls per client, per 30 seconds** | 5 | 5 | 5 | 5 | 5 | | **Broadcast payload size** | 256 KB | 3,000 KB | 3,000 KB | 3,000 KB | 3,000+ KB | | **Postgres change payload size ([**read more**](#postgres-changes-payload-limit))** | 1,024 KB | 1,024 KB | 1,024 KB | 1,024 KB | 1,024+ KB | diff --git a/apps/docs/content/guides/self-hosting/self-hosted-auth-keys.mdx b/apps/docs/content/guides/self-hosting/self-hosted-auth-keys.mdx index 08b87dac9ab..63552870758 100644 --- a/apps/docs/content/guides/self-hosting/self-hosted-auth-keys.mdx +++ b/apps/docs/content/guides/self-hosting/self-hosted-auth-keys.mdx @@ -214,15 +214,17 @@ When new API keys have not been added yet, the `kong-entrypoint.sh` script remov To assist with the authorization flows a specialized configuration in `kong.yml` substitutes internal, gateway-level-only pre-signed JWTs for `sb_publishable` and `sb_secret` API keys. These pre-signed JWTs are also auto-configured in `.env` but **should not** be used in any application code. -| Route | Service | API key required | Header substitution | -| -------------------- | -------------------- | ---------------- | ------------------- | -| `/auth/v1/*` | Auth | Yes | `Authorization` | -| `/rest/v1/*` | PostgREST | Yes | `Authorization` | -| `/graphql/v1` | PostgREST | Yes | `Authorization` | -| `/realtime/v1/api/*` | Realtime (REST) | Yes | `Authorization` | -| `/realtime/v1/*` | Realtime (WebSocket) | Yes | `x-api-key` | -| `/storage/v1/*` | Storage | No | `Authorization` | -| `/functions/v1/*` | Edge Functions | No | - | +| Route | Service | API key required | Header substitution | +| -------------------------- | -------------------- | ---------------- | ------------------- | +| `/auth/v1/*` | Auth | Yes | `Authorization` | +| `/rest/v1/*` | PostgREST | Yes | `Authorization` | +| `/graphql/v1` | PostgREST | Yes | `Authorization` | +| `/realtime/v1/api/tenants` | Realtime (REST) | Denied (blocked) | - | +| `/realtime/v1/api/openapi` | Realtime (REST) | Denied (blocked) | - | +| `/realtime/v1/api/*` | Realtime (REST) | Yes | `Authorization` | +| `/realtime/v1/*` | Realtime (WebSocket) | Yes | `x-api-key` | +| `/storage/v1/*` | Storage | No | `Authorization` | +| `/functions/v1/*` | Edge Functions | No | - | ### Request flows diff --git a/apps/docs/content/guides/self-hosting/self-hosted-envoy.mdx b/apps/docs/content/guides/self-hosting/self-hosted-envoy.mdx index 49a6fadbc61..294b3dca21c 100644 --- a/apps/docs/content/guides/self-hosting/self-hosted-envoy.mdx +++ b/apps/docs/content/guides/self-hosting/self-hosted-envoy.mdx @@ -60,13 +60,14 @@ HTTP filter chain ├─ CORS ├─ Basic Auth (dashboard only) ├─ Lua: copy ?apikey query to header + ├─ Lua: 401 for missing/invalid API key ├─ Lua: translate opaque keys in query ├─ Lua: translate opaque keys in header ├─ Lua: mirror apikey to x-api-key (Realtime WS) ├─ Lua: synthesize Authorization header - ├─ Lua: 401 for missing/invalid API key ├─ RBAC (global: service_role → /pg/, apikey → other API routes; - │ per-route DENY override on /mcp) + │ per-route DENY override on /mcp and Realtime + │ /api/tenants, /api/openapi) └─ Router │ ▼ @@ -140,7 +141,9 @@ Routes are matched in the order declared. The first matching prefix wins. Protec | `/auth/v1/` | auth | `/` | API key | Protected Auth endpoints | | `/rest/v1/` | rest | `/` | API key | PostgREST | | `/graphql/v1` | rest | `/rpc/graphql` | API key | pg_graphql (adds `Content-Profile: graphql_public`) | -| `/realtime/v1/api` | realtime | `/api` | API key | Realtime REST API | +| `/realtime/v1/api/tenants` | realtime | - | Denied | Realtime management API (blocked by default) | +| `/realtime/v1/api/openapi` | realtime | - | Denied | Realtime OpenAPI spec (blocked by default) | +| `/realtime/v1/api` | realtime | `/api` | API key | Realtime REST API (broadcast, channels, ping) | | `/realtime/v1/` | realtime | `/socket/` | API key | Realtime WebSocket | | `/pg/` | meta | `/` | Service role only | postgres-meta - used by Studio for database access | | `/api/mcp` | studio | - | Denied | MCP endpoint (blocked by default via RBAC DENY) | @@ -308,6 +311,7 @@ The access log format is a standard combined log with the request method, origin - **`401 Unauthorized` on a protected route.** The `apikey` header is missing or does not match any configured key. Verify that the header value exactly matches one of `ANON_KEY`, `SERVICE_ROLE_KEY`, `SUPABASE_PUBLISHABLE_KEY`, or `SUPABASE_SECRET_KEY` in your `.env` file. Note that `SUPABASE_PUBLISHABLE_KEY` and `SUPABASE_SECRET_KEY` are only accepted when the new key configuration is fully set up - see [New API Keys and Asymmetric Authentication](/docs/guides/self-hosting/self-hosted-auth-keys). - **`403 Forbidden` on `/pg/`.** The `/pg/` route requires a service_role key (`SUPABASE_SECRET_KEY` or legacy `SERVICE_ROLE_KEY`). Anon and publishable keys are rejected. - **`403 Forbidden` on `/api/mcp` or `/mcp`.** These routes are blocked by default. See [Enabling MCP Server Access](/docs/guides/self-hosting/enable-mcp). +- **`403 Forbidden` on `/realtime/v1/api/tenants` or `/realtime/v1/api/openapi`.** These Realtime management endpoints are blocked at the gateway by design and are not reachable by external clients, even with a valid key. - **`SignatureDoesNotMatch` on S3 requests to Storage.** Verify that the Storage service configuration in `docker-compose.yml` contains `REQUEST_ALLOW_X_FORWARDED_PATH=true` and `STORAGE_PUBLIC_URL`. Storage uses the `X-Forwarded-Prefix` header the gateway sends to reconstruct the original request path for SigV4 verification. - **`400 Bad Request` with underscore headers.** `headers_with_underscores_action: REJECT_REQUEST` is enabled. Some clients send headers like `X_Forwarded_For` with underscores; these are rejected. Use hyphens in header names. diff --git a/apps/docs/content/guides/storage/analytics/creating-analytics-buckets.mdx b/apps/docs/content/guides/storage/analytics/creating-analytics-buckets.mdx index 249b722cc4b..2dbb3f27a6a 100644 --- a/apps/docs/content/guides/storage/analytics/creating-analytics-buckets.mdx +++ b/apps/docs/content/guides/storage/analytics/creating-analytics-buckets.mdx @@ -13,7 +13,7 @@ Analytics buckets use [Apache Iceberg](https://iceberg.apache.org/), an open-tab -Analytics Buckets are still available, but managed replication into Analytics Buckets through Supabase ETL is no longer supported. If you need managed replication today, use [external replication](/docs/guides/database/replication/external-replication-setup) with **BigQuery**. If you want to use Analytics Buckets, bring your own ingestion pipeline. +Analytics Buckets are still available, but managed replication into Analytics Buckets through Supabase ETL is no longer supported. If you need managed replication today, use [external replication (ETL)](/docs/guides/database/replication/external-replication-setup) with **BigQuery**. If you want to use Analytics Buckets, bring your own ingestion pipeline. diff --git a/apps/docs/content/guides/storage/analytics/examples/pyiceberg.mdx b/apps/docs/content/guides/storage/analytics/examples/pyiceberg.mdx index 200d39321cc..579d5a9dc60 100644 --- a/apps/docs/content/guides/storage/analytics/examples/pyiceberg.mdx +++ b/apps/docs/content/guides/storage/analytics/examples/pyiceberg.mdx @@ -13,7 +13,7 @@ PyIceberg is a Python client for Apache Iceberg that enables programmatic intera ## Installation ```bash -pip install pyiceberg pyarrow +pip install "supabase[iceberg]" ``` ## Basic setup diff --git a/apps/docs/content/guides/storage/analytics/query-with-postgres.mdx b/apps/docs/content/guides/storage/analytics/query-with-postgres.mdx index 938c6e1d5df..41c296a0999 100644 --- a/apps/docs/content/guides/storage/analytics/query-with-postgres.mdx +++ b/apps/docs/content/guides/storage/analytics/query-with-postgres.mdx @@ -9,7 +9,7 @@ This is made possible by the [Iceberg Foreign Data Wrapper](/docs/guides/databas -Managed replication into Analytics Buckets through Supabase ETL is no longer supported. This guide assumes your Analytics Bucket is being populated by your own ingestion pipeline. +Managed replication into Analytics Buckets through Supabase ETL is no longer supported. This guide assumes your Analytics Bucket is being populated by your own ingestion pipeline. If you need managed replication today, use [external replication (ETL)](/docs/guides/database/replication/external-replication-setup) with **BigQuery**. diff --git a/apps/docs/content/guides/storage/cdn/metrics.mdx b/apps/docs/content/guides/storage/cdn/metrics.mdx index c8c3dd7b851..f6da42077da 100644 --- a/apps/docs/content/guides/storage/cdn/metrics.mdx +++ b/apps/docs/content/guides/storage/cdn/metrics.mdx @@ -5,7 +5,7 @@ description: 'Learn how Supabase Storage caches objects with a CDN.' sidebar_label: 'CDN' --- -Cache hits can be determined via the `metadata.response.headers.cf_cache_status` key in our [Logs Explorer](/docs/guides/platform/logs#logs-explorer). Any value that corresponds to either `HIT`, `STALE`, `REVALIDATED`, or `UPDATING` is categorized as a cache hit. +Cache hits can be determined via the `metadata.response.headers.cf_cache_status` key in our [Logs Explorer](/docs/guides/telemetry/logs#logs-explorer). Any value that corresponds to either `HIT`, `STALE`, `REVALIDATED`, or `UPDATING` is categorized as a cache hit. The following example query will show the top cache misses from the `edge_logs`: ```sql diff --git a/apps/docs/content/guides/storage/management/copy-move-objects.mdx b/apps/docs/content/guides/storage/management/copy-move-objects.mdx index 9103fdbed7d..844bdbf6d52 100644 --- a/apps/docs/content/guides/storage/management/copy-move-objects.mdx +++ b/apps/docs/content/guides/storage/management/copy-move-objects.mdx @@ -94,7 +94,7 @@ on storage.objects for insert to authenticated with check ( - (storage.folder(name))[1] = (select auth.uid()) + (storage.foldername(name))[1] = (select auth.uid()) ); create policy "User can update their own objects (in any buckets)" diff --git a/apps/docs/content/guides/storage/serving/image-transformations.mdx b/apps/docs/content/guides/storage/serving/image-transformations.mdx index fd68c3a2d00..734e2fa391f 100644 --- a/apps/docs/content/guides/storage/serving/image-transformations.mdx +++ b/apps/docs/content/guides/storage/serving/image-transformations.mdx @@ -683,7 +683,13 @@ response = supabase.storage.from_('bucket').download( ## Self hosting -Our solution to image resizing and optimization can be self-hosted as with any other Supabase product. Under the hood we use [imgproxy](https://imgproxy.net/) +Our solution to image resizing and optimization can be self-hosted as with any other Supabase product. Under the hood we use [imgproxy](https://imgproxy.net/). + + + +If you run the official self-hosted stack from the [`supabase/supabase`](https://github.com/supabase/supabase/tree/master/docker) Docker Compose setup, an `imgproxy` service is **already included** and wired up to the `storage` service for you (the `storage` service sets `ENABLE_IMAGE_TRANSFORMATION: "true"` and `IMGPROXY_URL: http://imgproxy:5001`). You only need the steps below if you run `storage-api` outside of that Compose stack and have to provide your own imgproxy container. + + #### imgproxy configuration: diff --git a/apps/docs/content/guides/storage/vector/local-development.mdx b/apps/docs/content/guides/storage/vector/local-development.mdx new file mode 100644 index 00000000000..e81fbab3e91 --- /dev/null +++ b/apps/docs/content/guides/storage/vector/local-development.mdx @@ -0,0 +1,45 @@ +--- +title: 'Vector Bucket Local Development' +subtitle: 'Develop and test vector bucket integrations in your local environment with the Supabase CLI.' +--- + + + +Expect rapid changes, limited features, and possible breaking updates. [Share feedback](https://github.com/orgs/supabase/discussions/40116) as we refine the experience and expand access. + + + +You can now develop and test Vector Bucket integrations in your local environment using the Supabase CLI. + +This allows you to build and iterate on your vector search applications without needing to deploy to a live environment. +Make sure you have the latest version of the Supabase CLI installed to access this feature. + + + +In local development, vector buckets uses pg_vector as the underlying storage engine under the hood. +The Hosted version uses S3Vectors as the Storage engine for vectors, which is optimized for large-scale vector storage and similarity search. This means that while you can develop and test your vector bucket integrations locally, there may be differences in performance and behavior compared to the cloud environment. + +The API remain consistent between local and hosted environments, so you can build your application logic against the local pg_vector implementation and expect it to work with the S3Vectors engine in production. + + +## Setting up local vector buckets + +Make sure you have the feature enabled in your `config.toml` file: + +```toml + +# Store vector embeddings in S3 for large and durable datasets +[storage.vector] +enabled = true +``` + +### Declarative configuration + +You can define your vector buckets in the `config.toml` file using the following syntax: + +```toml +[storage.vector.buckets.documents-openai] +[storage.vector.buckets.images] +``` + +Then use `supabase seed buckets` to create the buckets in your local environment or linked project. diff --git a/apps/docs/content/guides/telemetry/advanced-log-filtering.mdx b/apps/docs/content/guides/telemetry/advanced-log-filtering.mdx index 36dbb69b60c..9b591e483af 100644 --- a/apps/docs/content/guides/telemetry/advanced-log-filtering.mdx +++ b/apps/docs/content/guides/telemetry/advanced-log-filtering.mdx @@ -184,7 +184,7 @@ regexp_contains(event_message, '^connection') ```sql -- find only messages that ends with port=12345 -regexp_contains(event_message, '$port=12345') +regexp_contains(event_message, 'port=12345$') ``` ### Ignore case sensitivity: diff --git a/apps/docs/content/guides/telemetry/reports.mdx b/apps/docs/content/guides/telemetry/reports.mdx index 0e2a487468a..8feb421e00d 100644 --- a/apps/docs/content/guides/telemetry/reports.mdx +++ b/apps/docs/content/guides/telemetry/reports.mdx @@ -119,14 +119,18 @@ height={650} | **Used** | RAM actively used by Postgres and the operating system | | **Cache + buffers** | Memory used for page cache and OS buffers | | **Free** | Available unallocated memory | +| **Swap** | Disk overflow used when physical RAM is exhausted | + +The **Swap** series only appears when the system is swapping. Swap is disk space the operating system uses as an overflow when physical RAM is full. Because disk is much slower than RAM, sustained swap activity indicates memory pressure and can significantly degrade database performance. How it helps debug issues: -| Issue | Description | -| ------------------------------ | ------------------------------------------------ | -| Memory pressure detection | Identify when free memory is consistently low | -| Cache effectiveness monitoring | Monitor cache performance for query optimization | -| Memory leak detection | Detect inefficient memory usage patterns | +| Issue | Description | +| ------------------------------ | ----------------------------------------------------------------------------------------- | +| Memory pressure detection | Identify when free memory is consistently low | +| Cache effectiveness monitoring | Monitor cache performance for query optimization | +| Memory leak detection | Detect inefficient memory usage patterns | +| Swap activity monitoring | Sustained swap usage signals RAM is exhausted and paging to disk is degrading performance | Actions you can take: diff --git a/apps/docs/content/troubleshooting/FWD-wrappers-error-component-verification-failed-94a76b.mdx b/apps/docs/content/troubleshooting/FWD-wrappers-error-component-verification-failed-94a76b.mdx new file mode 100644 index 00000000000..3e066c4be35 --- /dev/null +++ b/apps/docs/content/troubleshooting/FWD-wrappers-error-component-verification-failed-94a76b.mdx @@ -0,0 +1,40 @@ +--- +title = "FDW Wrappers error: 'component verification failed'" +date_created = "2026-06-09T16:04:36+00:00" +topics = [ "platform" ] +keywords = [] +[[errors]] +code = "HV000" +message = "guest fdw error: component verification failed" + +--- + +If you are observing an `ERROR: HV000: guest fdw error: component verification failed` when querying a wrapper foreign tables, it indicates that the configured Wasm package metadata does not match the downloaded component. As a security measure, the Wrappers extension blocks the module when this mismatch occurs. + +To resolve this, update your foreign server configuration to use the correct package version and checksum. Details depend on the exact Wrapper and can be found here: https://fdw.dev/catalog/wasm/ + +**How to fix the configuration:** +Run the following SQL via the [SQL Editor](/dashboard/project/_/sql/new): + +```sql +ALTER SERVER example_server OPTIONS ( + SET fdw_package_url '[THE_CORRECT_URL]', + SET fdw_package_version '[THE_CORRECT_VERSION]', + SET fdw_package_checksum '[INTERNAL_ID]' +); +``` + +**Verify the update:** +You can confirm the update by inspecting the server options: + +```sql +select srvname, unnest(srvoptions) as option +from pg_foreign_server +where srvname = 'example_server'; +``` + +Test the connection by querying your foreign table: + +```sql +select * from example_table limit 1; +``` diff --git a/apps/docs/content/troubleshooting/database-error-saving-new-user-RU_EwB.mdx b/apps/docs/content/troubleshooting/database-error-saving-new-user-RU_EwB.mdx index d054f6f4020..64a2d0b389c 100644 --- a/apps/docs/content/troubleshooting/database-error-saving-new-user-RU_EwB.mdx +++ b/apps/docs/content/troubleshooting/database-error-saving-new-user-RU_EwB.mdx @@ -7,22 +7,88 @@ keywords = [ "users" ] database_id = "5d1c44ed-b2f6-4509-9312-1eeb8838e701" [[errors]] +http_status_code = 500 +code = "unexpected_failure" message = "Database error saving new user" + +[[errors]] +http_status_code = 500 +code = "unexpected_failure" +message = "Database error creating new user" --- -You generally get this error when trying to invite a new user from the dashboard or when trying to insert a user into a table using the table editor in the Supabase dashboard. +You generally get this error when trying to invite a new user from the dashboard or when trying to insert a user into a table using the table editor in the Supabase dashboard. You may also see this error in logs in connection to failed signups. This error is normally associated with a side effect of a database transaction. **Common causes of this error:** -- You have a trigger/trigger function setup on the `auth.users` table +- You have a trigger/trigger function setup on the `auth.users` table that has an error - You have added a constraint on the `auth.users` table which isn't being met - You are using Prisma and it has broken all the permissions on the `auth.users` table -**Debugging this error:** +## Debugging this error: -- You can use the [Auth logs explorer](https://app.supabase.com/project/_/logs/auth-logs) to find the issue with more information -- You can use the [Postgres logs explorer](https://app.supabase.com/project/_/logs/postgres-logs) +**Step 1: Check the Auth logs** -https://user-images.githubusercontent.com/79497/225517698-b6e3ccaf-cd70-4acd-8124-ffbcee310d63.mp4 +Start in the [Auth logs explorer](/dashboard/project/_/logs/auth-logs) in your project dashboard. The logs surface the specific error message and give you the most direct signal about what went wrong. + +**Step 2: Check the Postgres logs** + +If the Auth logs point to a database-level issue, open the [Postgres logs explorer](/dashboard/project/_/logs/postgres-logs) to look for corresponding errors. + +--- + +## Common errors + +### NULL value in auth schema column + +**Example Auth log error:** + +``` +500: Database error querying schema +error finding user: sql: Scan error on column index 8, name "confirmation_token": converting NULL to string is unsupported +``` + +**Cause:** + +The `auth` schema is managed by Supabase and expects specific column formats. This error typically happens when users are inserted directly via SQL or using an AI tool that uses a direct SQL `INSERT`, rather than through the [Auth API](/docs/reference/javascript/auth-api). A direct insert can leave required columns as `NULL` when the Auth service expects an empty string. + +**Fix:** + +Run the following in the [SQL editor](/dashboard/project/_/sql), replacing `confirmation_token` with whichever column appears in your error message: + +```sql +update auth.users +set confirmation_token = '' +where confirmation_token is null; +``` + +This sets all `NULL` values in that column to an empty string, which is what the Auth service expects. + +--- + +### Relation does not exist + +**Example Auth log error:** + +``` +failed to close prepared statement: ERROR: current transaction is aborted, commands ignored until end of transaction block (SQLSTATE 25P02): ERROR: relation "profiles" does not exist (SQLSTATE 42P01) +``` + +**Example Postgres log error:** + +``` +event_message: "relation "profiles" does not exist" +context: "PL/pgSQL function public.handle_new_user() line 3 at SQL statement" +``` + +**Cause:** + +A trigger on `auth.users` is calling a function (in this case `handle_new_user`) that tries to insert into a table that does not exist. This is common when a `profiles` table is referenced in a trigger function but was never created, or was accidentally dropped. + +**Fix:** + +1. Check whether the missing table should exist in your `public` schema. If it should, create the table for the trigger to succeed and the error should resolve. + +2. If the table is not needed, review the function definition and update or remove the reference. You can view and edit your database functions from the [Database Functions](/dashboard/project/_/database/functions) page in the dashboard. diff --git a/apps/docs/content/troubleshooting/exhaust-disk-io.mdx b/apps/docs/content/troubleshooting/exhaust-disk-io.mdx index 5e191365a86..73249158f86 100644 --- a/apps/docs/content/troubleshooting/exhaust-disk-io.mdx +++ b/apps/docs/content/troubleshooting/exhaust-disk-io.mdx @@ -25,7 +25,7 @@ Running out of Disk IO Budget means that your instance is using more disk than i To check your Disk IO Budget on the Supabase Platform, head over to [Database Health in the Observability section](/dashboard/project/_/observability/database). -It is also possible to monitor your resources and set up alerts using Prometheus/Grafana. With Grafana you will be able to pinpoint potential causes and see more fine-grained metrics like how much of your RAM is used for caching and your Swap usage. Read the [Metrics Guide](/docs/guides/platform/metrics) to learn more. +It is also possible to monitor your resources and set up alerts using Prometheus/Grafana. With Grafana you will be able to pinpoint potential causes and see more fine-grained metrics like how much of your RAM is used for caching and your Swap usage. Read the [Metrics Guide](/docs/guides/telemetry/metrics) to learn more. ## Common reasons for high disk IO usage diff --git a/apps/docs/content/troubleshooting/exhaust-ram.mdx b/apps/docs/content/troubleshooting/exhaust-ram.mdx index a19bc56ae64..ccea52cea00 100644 --- a/apps/docs/content/troubleshooting/exhaust-ram.mdx +++ b/apps/docs/content/troubleshooting/exhaust-ram.mdx @@ -31,7 +31,7 @@ High RAM usage could come with a range of issues: To check your RAM usage on the Supabase Platform, head over to [Database Health in the Observability section](/dashboard/project/_/observability/database). -It is also possible to monitor your resources and set up alerts using Prometheus/Grafana. With Grafana you will be able to see how much of your RAM is used for caching and you can track other metrics such as your Swap usage. Read the [Metrics Guide](/docs/guides/platform/metrics) to learn more. +It is also possible to monitor your resources and set up alerts using Prometheus/Grafana. With Grafana you will be able to see how much of your RAM is used for caching and you can track other metrics such as your Swap usage. Read the [Metrics Guide](/docs/guides/telemetry/metrics) to learn more. ## Common reasons for high RAM usage diff --git a/apps/docs/content/troubleshooting/exhaust-swap.mdx b/apps/docs/content/troubleshooting/exhaust-swap.mdx index 7b6272dabfb..c137d293a86 100644 --- a/apps/docs/content/troubleshooting/exhaust-swap.mdx +++ b/apps/docs/content/troubleshooting/exhaust-swap.mdx @@ -33,7 +33,7 @@ High Swap usage can affect your database performance. For example, you might see ## Monitor your swap -You can monitor your resources and set up alerts using Prometheus/Grafana. See the [metrics guide](/docs/guides/platform/metrics) for more information. +You can monitor your resources and set up alerts using Prometheus/Grafana. See the [metrics guide](/docs/guides/telemetry/metrics) for more information. An [example repository](https://github.com/supabase/supabase-grafana) to ingest metrics and visualize them with Grafana is provided in the linked guide, where we maintain a [list of the exported metrics](https://github.com/supabase/supabase-grafana/blob/main/docs/metrics.md). diff --git a/apps/docs/content/troubleshooting/google-auth-fails-for-some-users-XcFXEu.mdx b/apps/docs/content/troubleshooting/google-auth-fails-for-some-users-XcFXEu.mdx index b4deff01c56..c83f76463f9 100644 --- a/apps/docs/content/troubleshooting/google-auth-fails-for-some-users-XcFXEu.mdx +++ b/apps/docs/content/troubleshooting/google-auth-fails-for-some-users-XcFXEu.mdx @@ -42,9 +42,10 @@ It is happening because some Google Suite requires the explicit request of email ```js const { data, error } = await supabase.auth.signInWithOAuth({ - provider: 'google' + provider: 'google', options: { - scopes: 'https://www.googleapis.com/auth/userinfo.email' + scopes: 'https://www.googleapis.com/auth/userinfo.email', + }, } }) ``` diff --git a/apps/docs/content/troubleshooting/high-cpu-usage.mdx b/apps/docs/content/troubleshooting/high-cpu-usage.mdx index 943461aee2a..e710d5df09e 100644 --- a/apps/docs/content/troubleshooting/high-cpu-usage.mdx +++ b/apps/docs/content/troubleshooting/high-cpu-usage.mdx @@ -25,7 +25,7 @@ You can check your CPU usage directly on the Supabase Platform. For this go to d ![CPU usage reported on Supabase dashboard](/docs/img/guides/platform/exhaust-cpu-report.png) -It is also possible to monitor your resources and set up alerts using Prometheus/Grafana. You can find a guide for this [here](/docs/guides/platform/metrics). +It is also possible to monitor your resources and set up alerts using Prometheus/Grafana. You can find a guide for this [here](/docs/guides/telemetry/metrics). ## Common reasons for high CPU usage diff --git a/apps/docs/content/troubleshooting/how-to-interpret-and-explore-the-postgres-logs-OuCIOj.mdx b/apps/docs/content/troubleshooting/how-to-interpret-and-explore-the-postgres-logs-OuCIOj.mdx index 3a0ac0ea1e1..9b2c0a21edf 100644 --- a/apps/docs/content/troubleshooting/how-to-interpret-and-explore-the-postgres-logs-OuCIOj.mdx +++ b/apps/docs/content/troubleshooting/how-to-interpret-and-explore-the-postgres-logs-OuCIOj.mdx @@ -136,7 +136,7 @@ When exploring the logs for atypical behavior, it's often strategic to filter ou ...query where -- Excluding routine events related to cron, PgBouncer, checkpoints, and successful connections - not regexp_contains(event_message, '^cron|PgBouncer|checkpoint|connection received|authenticated|authorized'; + not regexp_contains(event_message, '^cron|PgBouncer|checkpoint|connection received|authenticated|authorized'); ``` ### By timeframe @@ -398,5 +398,5 @@ To see the default types of events that are logged, you can check this [guide](h - [Debugging with the DB API logs](https://github.com/orgs/supabase/discussions/22849) - [Debugging Database Functions](/docs/guides/database/functions#debugging-functions) - [pg_audit](/docs/guides/database/extensions/pgaudit) -- [Supabase Logging](/docs/guides/platform/logs) +- [Supabase Logging](/docs/guides/telemetry/logs) - [Self-Hosting Logs](/docs/reference/self-hosting-analytics/introduction) diff --git a/apps/docs/content/troubleshooting/how-to-view-database-metrics-uqf2z_.mdx b/apps/docs/content/troubleshooting/how-to-view-database-metrics-uqf2z_.mdx index 86ea9f1a726..e5a1b47614d 100644 --- a/apps/docs/content/troubleshooting/how-to-view-database-metrics-uqf2z_.mdx +++ b/apps/docs/content/troubleshooting/how-to-view-database-metrics-uqf2z_.mdx @@ -7,6 +7,6 @@ keywords = [ "metrics", "grafana", "monitoring" ] database_id = "da2d95e5-abc5-47c8-8389-1554d12abf91" --- -To monitor real-time metrics of your database, like CPU, EBS, active database connections, and memory usage, you can deploy a Grafana Dashboard. Check our [GitHub repo](https://github.com/supabase/supabase-grafana) for setup instructions for local or free [Fly.io](http://fly.io/) deployments. Refer to our concise [documentation](/docs/guides/platform/metrics) to learn more about the metrics endpoint. +To monitor real-time metrics of your database, like CPU, EBS, active database connections, and memory usage, you can deploy a Grafana Dashboard. Check our [GitHub repo](https://github.com/supabase/supabase-grafana) for setup instructions for local or free [Fly.io](http://fly.io/) deployments. Refer to our concise [documentation](/docs/guides/telemetry/metrics) to learn more about the metrics endpoint. While the [Dashboard's Reports Page](/dashboard/project/_/observability) displays some metric data, it provides hourly averages, not real-time by the second data. However, it offers query metrics, which the Grafana Dashboard does not include. diff --git a/apps/docs/content/troubleshooting/http-status-codes.mdx b/apps/docs/content/troubleshooting/http-status-codes.mdx index 299287c0dff..25c3346858c 100644 --- a/apps/docs/content/troubleshooting/http-status-codes.mdx +++ b/apps/docs/content/troubleshooting/http-status-codes.mdx @@ -21,7 +21,7 @@ http_status_code = 546 message = "Edge Functions resource limit" --- -The Supabase platform offers several HTTP APIs for each project. These APIs can use the status codes to indicate the state of the project, and the request being processed. The status codes returned for requests can be access via the [logs explorer](../platform/logs#logs-explorer). +The Supabase platform offers several HTTP APIs for each project. These APIs can use the status codes to indicate the state of the project, and the request being processed. The status codes returned for requests can be access via the [logs explorer](../telemetry/logs#logs-explorer). ## 2XX success diff --git a/apps/docs/content/troubleshooting/increase-vector-lookup-speeds-by-applying-an-hsnw-index-ohLHUM.mdx b/apps/docs/content/troubleshooting/increase-vector-lookup-speeds-by-applying-an-hsnw-index-ohLHUM.mdx index 0557d1b156a..6c5e0f6365b 100644 --- a/apps/docs/content/troubleshooting/increase-vector-lookup-speeds-by-applying-an-hsnw-index-ohLHUM.mdx +++ b/apps/docs/content/troubleshooting/increase-vector-lookup-speeds-by-applying-an-hsnw-index-ohLHUM.mdx @@ -58,7 +58,7 @@ If an address is returned, you should use your direct connection string found on **3. Increase memory for index creation (optional)** -The `maintance_work_mem` variable limits the maximum amount of memory that can be used by maintenance operations, such as vacuuming, altering, and indexing tables. In your session you should try to set it to a reasonably high value: +The `maintenance_work_mem` variable limits the maximum amount of memory that can be used by maintenance operations, such as vacuuming, altering, and indexing tables. In your session you should try to set it to a reasonably high value: ```sql set maintenance_work_mem to ; -- '#GB' diff --git a/apps/docs/content/troubleshooting/interpreting-supabase-grafana-io-charts-MUynDR.mdx b/apps/docs/content/troubleshooting/interpreting-supabase-grafana-io-charts-MUynDR.mdx index 9d5e0b77009..bb66f23d10a 100644 --- a/apps/docs/content/troubleshooting/interpreting-supabase-grafana-io-charts-MUynDR.mdx +++ b/apps/docs/content/troubleshooting/interpreting-supabase-grafana-io-charts-MUynDR.mdx @@ -7,7 +7,7 @@ keywords = [ "io", "disk", "database", "grafana" ] database_id = "0056cd40-df04-4045-bbfb-c245cb15b85d" --- -> [Supabase Grafana Installation Guide](/docs/guides/platform/metrics#deploying-supabase-grafana) +> [Supabase Grafana Installation Guide](/docs/guides/telemetry/metrics/grafana-self-hosted) There are two primary values that matter for IO: diff --git a/apps/docs/content/troubleshooting/monitor-supavisor-postgres-connections.mdx b/apps/docs/content/troubleshooting/monitor-supavisor-postgres-connections.mdx index da380ce6df5..53f589b8b87 100644 --- a/apps/docs/content/troubleshooting/monitor-supavisor-postgres-connections.mdx +++ b/apps/docs/content/troubleshooting/monitor-supavisor-postgres-connections.mdx @@ -19,7 +19,7 @@ _Visual of Grafana Dashboard_ It can be run locally within Docker. Alternatively, you can deploy it to fly.io or Grafana Cloud, which are better for long-term data collection. -Installation instructions can be found in it the [metrics docs ](/docs/guides/platform/metrics#deploying-supabase-grafana) +Installation instructions can be found in it the [metrics docs ](/docs/guides/telemetry/metrics/grafana-self-hosted) ## Observing connections diff --git a/apps/docs/content/troubleshooting/pgcron-debugging-guide-n1KTaz.mdx b/apps/docs/content/troubleshooting/pgcron-debugging-guide-n1KTaz.mdx index f6da4a213cf..7c027809550 100644 --- a/apps/docs/content/troubleshooting/pgcron-debugging-guide-n1KTaz.mdx +++ b/apps/docs/content/troubleshooting/pgcron-debugging-guide-n1KTaz.mdx @@ -58,7 +58,7 @@ If the query does not return a row, the worker has died. To revive it, you must ### Check the `cron.job_run_details` table for more information -pg_cron creates logs in its own table `cron.job_run_details"`. The below query checks for issues from the past 5 days : +pg_cron creates logs in its own table `cron.job_run_details`. The below query checks for issues from the past 5 days : ```sql SELECT * diff --git a/apps/docs/content/troubleshooting/realtime-warn-sending-broadcast-message.mdx b/apps/docs/content/troubleshooting/realtime-warn-sending-broadcast-message.mdx new file mode 100644 index 00000000000..bbdf7013e0a --- /dev/null +++ b/apps/docs/content/troubleshooting/realtime-warn-sending-broadcast-message.mdx @@ -0,0 +1,52 @@ +--- +title = "Realtime: WarnSendingBroadcastMessage when broadcasting from the database" +date_created = "2026-06-05T00:00:00+00:00" +topics = [ "realtime" ] +keywords = [ "broadcast", "realtime.send", "realtime.send_binary", "WarnSendingBroadcastMessage", "partition", "messages", "replication" ] +database_id = "027fba24-c7bc-4c54-9e6b-6f13ec85ad56" +--- + +If you broadcast from the database with `realtime.send` or `realtime.send_binary`, you may see this in your Postgres logs: + +``` +WARNING: WarnSendingBroadcastMessage: +``` + +It means the function could not insert the row into `realtime.messages`, so that message was not broadcast. This shows up in an edge case where the message would not have reached anyone anyway. This guide explains when that is the case and when the warning points to a real problem. + +## Why the dropped message would not have been delivered + +Realtime broadcasts database changes by streaming the `realtime.messages` table through a replication slot. That slot only starts once a client connects over WebSocket and the connection process begins streaming. The slot is temporary and does not replay history, so it only delivers messages inserted _after_ a client connected. + +So if you call `realtime.send` while nobody is connected, the message would not reach anyone even if the insert succeeded. No connection means no listener. Dropping it is the same outcome. + +This is why the log line is a warning and not an error. + +## What usually triggers it + +The most common cause is a missing daily partition on `realtime.messages`. The table is partitioned by day, and `realtime.send` or `realtime.send_binary` does not create partitions itself. If no partition exists for the current day, the insert fails with a message like `no partition of relation "messages" found for row`, and you get the `WarnSendingBroadcastMessage` warning. + +Partitions are created in three occasions: + +| Where | When it runs | +| -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| A client connects over WebSocket | The first time a client joins a channel for the project, after database migrations run | +| The tenant health check endpoint | When the health endpoint is called and the project either has an active database connection or has connected clients. Opening the Realtime section of your project dashboard calls this endpoint | +| The scheduled janitor | Periodically (roughly every 4 hours), when it deletes old messages and recreates the partition window. It only runs for projects that have had a connection established at least once | + +Each of these creates a rolling window of partitions: yesterday, today, and the next three days. + + + +Calling `realtime.send` / `realtime.send_binary`, the broadcast REST endpoint, and subscribe or replication operations do not create partitions. So a project that has never had a WebSocket client connect, and whose health check and janitor have not yet run for the day, has no partition to insert into. Broadcasting from the database before that point produces the warning. + + + +## How to avoid it + +- Connect a client before broadcasting from the database. A live WebSocket connection both creates the partitions and starts the consumer that actually receives the message. +- If you broadcast from the database on a schedule, make sure at least one subscriber is connected when you send. Otherwise the messages have no destination. + +## When it is a real problem + +If you see this warning repeatedly while clients are connected and partitions exist, the insert is failing for another reason. The actual cause is in the `` part of the log line (the underlying `SQLERRM`). Check your Postgres logs for that text rather than assuming it is a missing partition. Common examples are a constraint violation or a permissions issue on `realtime.messages`. diff --git a/apps/docs/content/troubleshooting/relation-objects-does-not-exist-error-during-storage-uploads-8f21f0.mdx b/apps/docs/content/troubleshooting/relation-objects-does-not-exist-error-during-storage-uploads-8f21f0.mdx new file mode 100644 index 00000000000..69de7d3fbb2 --- /dev/null +++ b/apps/docs/content/troubleshooting/relation-objects-does-not-exist-error-during-storage-uploads-8f21f0.mdx @@ -0,0 +1,30 @@ +--- +title = "Postgres error 'relation objects does not exist' during Storage uploads" +date_created = "2026-06-10T15:05:10+00:00" +topics = [ "auth", "database", "storage" ] +keywords = [] +[[errors]] +code = "42P01" +message = "relation 'objects' does not exist" + +[[errors]] +http_status_code = 500 +message = "Internal Server Error" +--- + +If authenticated users receive a `500 Internal Server Error` during file uploads and your database logs report `error: relation "objects" does not exist`, it typically indicates the database cannot locate the required internal storage tables. + +**Why Does This Happen?** +This error occurs when the `authenticated` role's `search_path` does not include the `storage` schema. Because the schema is missing from the path, the database fails to find the `objects` table (which resides in `storage.objects`) during the upload process. + +**How to Fix:** +You can resolve this by updating the role configuration via the [SQL Editor](/dashboard/project/_/sql/new): + +1. Execute the following command to append the storage schema to the role's search path: + `ALTER ROLE authenticated SET search_path = public, storage;` +2. Verify that uploads from authenticated users now succeed. + +**Best Practices:** + +- To maintain compatibility with default schema permissions, avoid creating custom Postgres roles for application users. +- Instead, use custom claims within `auth.users.raw_app_meta_data` to manage user-specific logic or permissions. diff --git a/apps/docs/content/troubleshooting/rls-performance-and-best-practices-Z5Jjwv.mdx b/apps/docs/content/troubleshooting/rls-performance-and-best-practices-Z5Jjwv.mdx index a2ef2eaa839..ec8820dff09 100644 --- a/apps/docs/content/troubleshooting/rls-performance-and-best-practices-Z5Jjwv.mdx +++ b/apps/docs/content/troubleshooting/rls-performance-and-best-practices-Z5Jjwv.mdx @@ -85,7 +85,7 @@ CREATE OR REPLACE FUNCTION has_role() RETURNS boolean as $$ begin - return exists (select 1 from roles_table where auth.uid() = user_id and role = 'good_role') + return exists (select 1 from roles_table where auth.uid() = user_id and role = 'good_role'); end; $$ language plpgsql security definer; ``` diff --git a/apps/docs/content/troubleshooting/steps-to-improve-query-performance-with-indexes-q8PoC9.mdx b/apps/docs/content/troubleshooting/steps-to-improve-query-performance-with-indexes-q8PoC9.mdx index 29d1228cde3..edabf7e92c2 100644 --- a/apps/docs/content/troubleshooting/steps-to-improve-query-performance-with-indexes-q8PoC9.mdx +++ b/apps/docs/content/troubleshooting/steps-to-improve-query-performance-with-indexes-q8PoC9.mdx @@ -23,7 +23,7 @@ Supabase has an [open-source Grafana Repo](https://github.com/supabase/supabase- _Visual of Grafana Dashboard_ ![image](/docs/img/troubleshooting/18ed2c88-332e-4e66-b9b4-c37e99a39104.png) -It can be run locally within Docker or can be deployed for free to fly.io. Installation instructions can be found in [Supabase's metrics docs](/docs/guides/platform/metrics#deploying-supabase-grafana) +It can be run locally within Docker or can be deployed for free to fly.io. Installation instructions can be found in [Supabase's metrics docs](/docs/guides/telemetry/metrics/grafana-self-hosted) ## Query optimization through indexes diff --git a/apps/docs/content/troubleshooting/supabase-grafana-memory-charts.mdx b/apps/docs/content/troubleshooting/supabase-grafana-memory-charts.mdx index 0e7eeb60dcd..3f7239eeeb5 100644 --- a/apps/docs/content/troubleshooting/supabase-grafana-memory-charts.mdx +++ b/apps/docs/content/troubleshooting/supabase-grafana-memory-charts.mdx @@ -7,7 +7,7 @@ date_created = "2024-06-05" database_id = "179d70f3-1e26-4346-9ee8-d340fad382a3" --- -> [Supabase Grafana Installation Guide](/docs/guides/platform/metrics#deploying-supabase-grafana) +> [Supabase Grafana Installation Guide](/docs/guides/telemetry/metrics/grafana-self-hosted) Here are examples of unhealthy memory usage: ![image](https://github.com/supabase/supabase/assets/91111415/baebfc74-642d-4988-992c-bb0f473a05ad) diff --git a/apps/docs/content/troubleshooting/supavisor-faq-YyP5tI.mdx b/apps/docs/content/troubleshooting/supavisor-faq-YyP5tI.mdx index dbb15fb1d1b..f75c004363a 100644 --- a/apps/docs/content/troubleshooting/supavisor-faq-YyP5tI.mdx +++ b/apps/docs/content/troubleshooting/supavisor-faq-YyP5tI.mdx @@ -103,7 +103,7 @@ CREATE DATABASE another_database; Similarly, a database can have many database users, but most people just rely on the default user `postgres`. ```sql -CREATE USER postgres WITH PASSWORD 'super-secret-password; +CREATE USER postgres WITH PASSWORD 'super-secret-password'; CREATE USER some_new_user WITH PASSWORD 'password'; ``` @@ -159,7 +159,7 @@ As a rule of thumb, if you're using the DB REST API or multiple app-based "user+ Connection usage can be monitored with a Supabase Grafana Dashboard. It provides realtime visibility of over 200 database metrics, such as graphs of CPU, EBS, and active direct/pooler connections. It can be extremely useful for monitoring and debugging instances. -You can check our [GitHub repo](https://github.com/supabase/supabase-grafana) for setup instructions for local deployments or free cloud deployments on [Fly.io](http://fly.io/). Refer to Supabase [documentation](/docs/guides/platform/metrics) to learn more about the metrics endpoint. +You can check our [GitHub repo](https://github.com/supabase/supabase-grafana) for setup instructions for local deployments or free cloud deployments on [Fly.io](http://fly.io/). Refer to Supabase [documentation](/docs/guides/telemetry/metrics) to learn more about the metrics endpoint. ### **Can Supavisor really support a million connections?** diff --git a/apps/docs/content/troubleshooting/troubleshooting-connect_timeout-or-hanging-queries-in-vercel-serverless-functions-775f92.mdx b/apps/docs/content/troubleshooting/troubleshooting-connect_timeout-or-hanging-queries-in-vercel-serverless-functions-775f92.mdx new file mode 100644 index 00000000000..3477600da21 --- /dev/null +++ b/apps/docs/content/troubleshooting/troubleshooting-connect_timeout-or-hanging-queries-in-vercel-serverless-functions-775f92.mdx @@ -0,0 +1,21 @@ +--- +title = "Troubleshooting 'CONNECT_TIMEOUT' or hanging queries in Serverless Functions" +date_created = "2026-06-08T10:04:54+00:00" +topics = [ "database", "functions", "supavisor" ] +keywords = [] +[[errors]] +code = "CONNECT_TIMEOUT" +message = "connection timeout errors" +--- + +Intermittent `CONNECT_TIMEOUT` errors or queries that hang until reaching the execution limit may occur when using persistent clients, such as `postgres-js`, within Serverless Functions. + +**Why Does This Happen?** +Serverless environments may freeze the function between requests. This causes TCP sockets to go stale because the connection pooler or NAT may drop inactive connections while the client-side `keepalive` timers are paused. Upon resuming the function, the client attempts to reuse the dead socket, leading to a hang. + +**How to Resolve This:** + +- **Use the Data API:** Migrate read-heavy workloads to the Supabase Data API (PostgREST). This utilizes stateless HTTP requests and avoids persistent TCP socket issues. +- **Liveness Preflight:** For transactional paths using `postgres-js`, implement a preflight check by racing a `SELECT 1` query against a short timeout (e.g., a few seconds) before executing the primary query. If the preflight times out, recycle the database client. +- **Migrate to Vercel Fluid Compute:** Use Vercel's Fluid Compute with `attachDatabasePool`. This environment supports the `waitUntil` hook, which allows the runtime to close idle connections properly before the instance suspends. +- **Application Retries:** Implement application-level retry logic specifically for connection timeout errors to force a new connection attempt. diff --git a/apps/docs/features/docs/GuidesMdx.utils.tsx b/apps/docs/features/docs/GuidesMdx.utils.tsx index 1cd8e04a9eb..e719d2caa9f 100644 --- a/apps/docs/features/docs/GuidesMdx.utils.tsx +++ b/apps/docs/features/docs/GuidesMdx.utils.tsx @@ -14,10 +14,10 @@ import { fromMarkdown } from 'mdast-util-from-markdown' import { gfmFromMarkdown } from 'mdast-util-gfm' import { gfm } from 'micromark-extension-gfm' import { type Metadata, type ResolvingMetadata } from 'next' -import { notFound } from 'next/navigation' import { newEditLink } from './GuidesMdx.template' import { checkGuidePageEnabled } from './NavigationPageStatus.utils' +import { notFoundWithPathname } from './notFound.utils' const { metadataTitle } = getCustomContent(['metadata:title']) @@ -56,7 +56,7 @@ const getGuidesMarkdownInternal = async (slug: string[]) => { !fullPath.startsWith(GUIDES_DIRECTORY) || !PUBLISHED_SECTIONS.some((section) => relPath.startsWith(section)) ) { - notFound() + notFoundWithPathname(guidesPath) } /** @@ -65,7 +65,7 @@ const getGuidesMarkdownInternal = async (slug: string[]) => { */ if (!checkGuidePageEnabled(guidesPath)) { console.log('Page is disabled: %s', guidesPath) - notFound() + notFoundWithPathname(guidesPath) } try { @@ -100,7 +100,7 @@ const getGuidesMarkdownInternal = async (slug: string[]) => { ) Sentry.captureException(error) } - notFound() + notFoundWithPathname(guidesPath) } } diff --git a/apps/docs/features/docs/MdxAnchor.tsx b/apps/docs/features/docs/MdxAnchor.tsx new file mode 100644 index 00000000000..30b2b54db42 --- /dev/null +++ b/apps/docs/features/docs/MdxAnchor.tsx @@ -0,0 +1,46 @@ +import { ExternalLink as ExternalLinkIcon } from 'lucide-react' +import { type ComponentPropsWithoutRef } from 'react' +import { cn } from 'ui' + +const isExternalHref = (href?: string) => { + if (!href || !/^https?:\/\//i.test(href)) return false + try { + return !/(^|\.)supabase\.com$/i.test(new URL(href).hostname) + } catch { + return false + } +} + +// Walk the tree and concatenate text so the aria-label matches the visible link +const flattenChildrenToText = (node: unknown): string => { + if (node == null || typeof node === 'boolean') return '' + if (typeof node === 'string' || typeof node === 'number') return String(node) + if (Array.isArray(node)) return node.map(flattenChildrenToText).join('') + if (typeof node === 'object' && node !== null && 'props' in node) { + const props = (node as { props?: { children?: unknown } }).props + return flattenChildrenToText(props?.children) + } + return '' +} + +export function MdxAnchor({ href, children, ...rest }: ComponentPropsWithoutRef<'a'>) { + if (!isExternalHref(href)) { + return ( + + {children} + + ) + } + const label = flattenChildrenToText(children).trim() + return ( + + {children} + + ) +} diff --git a/apps/docs/features/docs/MdxBase.shared.tsx b/apps/docs/features/docs/MdxBase.shared.tsx index 134ffc1ed31..591a8bf20cb 100644 --- a/apps/docs/features/docs/MdxBase.shared.tsx +++ b/apps/docs/features/docs/MdxBase.shared.tsx @@ -19,6 +19,7 @@ import { SharedData } from '~/components/SharedData' import StepHikeCompact from '~/components/StepHikeCompact' import { CodeSampleDummy, CodeSampleWrapper } from '~/features/directives/CodeSample.client' import { NamedCodeBlock } from '~/features/directives/CodeTabs.components' +import { MdxAnchor } from '~/features/docs/MdxAnchor' import { Accordion, AccordionItem } from '~/features/ui/Accordion' import { CodeBlock } from '~/features/ui/CodeBlock/CodeBlock' import InfoTooltip from '~/features/ui/InfoTooltip' @@ -100,6 +101,7 @@ const components = { Tabs, TabPanel, InfoTooltip, + a: MdxAnchor, h2: (props: any) => ( {props.children} diff --git a/apps/docs/features/docs/notFound.utils.ts b/apps/docs/features/docs/notFound.utils.ts new file mode 100644 index 00000000000..cd090a1e546 --- /dev/null +++ b/apps/docs/features/docs/notFound.utils.ts @@ -0,0 +1,19 @@ +import * as Sentry from '@sentry/nextjs' +import { notFound } from 'next/navigation' + +/** + * Triggers a Next.js 404 while recording the requested path as a Sentry tag. + * + * `notFound()` itself does not create a Sentry event, but tagging the active + * scope means any error captured during the same request (and any event the + * Sentry SDK records for the render) carries the exact path under + * `404.pathname`. That makes 404s filterable and groupable in Sentry/Discover + * instead of only being inferable from the route's transaction name. + * + * @param pathname - The user-facing path that was not found, e.g. + * `/guides/functions/runtimes/node-22`. + */ +export function notFoundWithPathname(pathname: string): never { + Sentry.setTag('404.pathname', pathname) + notFound() +} diff --git a/apps/docs/features/ui/AgentPluginsPanel.tsx b/apps/docs/features/ui/AgentPluginsPanel.tsx index bc7ac349273..33518664e6d 100644 --- a/apps/docs/features/ui/AgentPluginsPanel.tsx +++ b/apps/docs/features/ui/AgentPluginsPanel.tsx @@ -38,7 +38,7 @@ const PLUGIN_CLIENTS: PluginClient[] = [ key: 'gemini-cli', label: 'Gemini CLI', icon: 'gemini-cli', - repoUrl: 'https://github.com/supabase-community/gemini-extension', + repoUrl: 'https://github.com/supabase-community/supabase-plugin', docsUrl: 'https://geminicli.com/docs/extensions/', }, { @@ -151,7 +151,7 @@ function PluginInstructions({ client }: { client: PluginClient }) { your terminal.

You can also find the extension in the{' '} ([\s\S]*?)<\/Link>/g, (full, linkAttrs, body) => { const hrefMatch = linkAttrs.match(/\bhref="([^"]+)"/) if (!hrefMatch) return full - const href = hrefMatch[1] + const href = withDocsBasePath(hrefMatch[1]) const panelOpen = body.match(/<(GlassPanel|IconPanel)\b/) if (!panelOpen) return full @@ -195,12 +197,13 @@ function stripJsxTags(content: string): string { async function generate() { const files = await globby(['content/guides/**/!(_)*.mdx']) + const linkBaseUrl = getInternalLinkBaseUrl() let warnings = 0 await Promise.all( files.map(async (filePath) => { const outPath = filePath - .replace(/^content\/guides\//, 'public/docs/guides/') + .replace(/^content\/guides\//, 'public/markdown/guides/') .replace(/\.mdx$/, '.md') let output: string @@ -211,7 +214,8 @@ async function generate() { const withPartials = await inlinePartials(rawContent) const withSteps = convertStepHike(withPartials) const withLinks = convertLinkPanels(withSteps) - const processed = stripJsxTags(withLinks) + const stripped = stripJsxTags(withLinks) + const processed = prefixInternalLinks(stripped, linkBaseUrl) const header = [ data.title ? `# ${data.title}` : '', @@ -234,8 +238,8 @@ async function generate() { } } - // content/guides/ai/vector-columns.mdx → public/docs/guides/ai/vector-columns.md - // Placing under public/docs/ ensures the file is served at /docs/guides/... + // content/guides/ai/vector-columns.mdx → public/markdown/guides/ai/vector-columns.md + // Placing under public/markdown/ ensures the file is served at /docs/guides/... // matching the exact URL of the rendered page. await fs.promises.mkdir(path.dirname(outPath), { recursive: true }) await fs.promises.writeFile(outPath, output) @@ -243,7 +247,7 @@ async function generate() { ) const summary = warnings ? ` (${warnings} with warnings)` : '' - console.log(`Generated ${files.length} markdown files under public/docs/guides/${summary}`) + console.log(`Generated ${files.length} markdown files under public/markdown/guides/${summary}`) } generate() diff --git a/apps/docs/internals/generate-gz-archive.ts b/apps/docs/internals/generate-gz-archive.ts index 4e57d219ccd..491f85441f1 100644 --- a/apps/docs/internals/generate-gz-archive.ts +++ b/apps/docs/internals/generate-gz-archive.ts @@ -5,9 +5,9 @@ async function generate() { // Create a tar.gz archive of the generated docs, served at /docs/docs.tar.gz. // Sorted entries, portable headers, and a fixed mtime keep the output deterministic. const archivePath = 'public/docs.tar.gz' - const entries = (await globby(['**'], { cwd: 'public/docs' })).sort() + const entries = (await globby(['**'], { cwd: 'public/markdown' })).sort() await createTar( - { gzip: true, file: archivePath, cwd: 'public/docs', portable: true, mtime: new Date() }, + { gzip: true, file: archivePath, cwd: 'public/markdown', portable: true, mtime: new Date() }, entries ) console.log(`Created archive at ${archivePath}`) diff --git a/apps/docs/internals/generate-reference-markdown.ts b/apps/docs/internals/generate-reference-markdown.ts new file mode 100644 index 00000000000..6c3b05997ff --- /dev/null +++ b/apps/docs/internals/generate-reference-markdown.ts @@ -0,0 +1,417 @@ +import fs from 'node:fs/promises' +import path from 'node:path' +import matter from 'gray-matter' +import yaml from 'js-yaml' + +import { getInternalLinkBaseUrl, prefixInternalLinks } from './internal-links' + +const GENERATED = path.join(process.cwd(), 'features/docs/generated') +const OUT_DIR = path.join(process.cwd(), 'public/markdown/reference') +const MDX_ROOT = path.join(process.cwd(), 'docs/ref') + +type Section = { + id?: string + title?: string + slug?: string + type?: string + items?: Section[] +} + +type Example = { name?: string; code?: string } + +type LegacyFn = { + id: string + $ref?: string + title?: string + description?: string + notes?: string + examples?: Example[] +} + +type TypeSpec = { + methods: Record +} + +type RefBase = { + title: string + outFile: string + /** Folder under docs/ref/ that holds .mdx sections for `type: "markdown"` entries. */ + mdxDir: string +} + +type SdkLegacyRef = RefBase & { + kind: 'sdk-legacy' + sectionsPath: string + functionsPath: string +} + +type SdkNewRef = RefBase & { + kind: 'sdk-new' + contentDir: string +} + +type ApiRef = RefBase & { + kind: 'api' + sectionsPath: string + endpointsByIdPath: string +} + +type CliRef = RefBase & { + kind: 'cli' + sectionsPath: string + cliSpecPath: string +} + +type Ref = SdkLegacyRef | SdkNewRef | ApiRef | CliRef + +const REFERENCES: Ref[] = [ + { + kind: 'api', + title: 'Management API Reference', + outFile: 'api.md', + mdxDir: path.join(MDX_ROOT, 'api'), + sectionsPath: path.join(GENERATED, 'api.latest.sections.json'), + endpointsByIdPath: path.join(GENERATED, 'api.latest.endpointsById.json'), + }, + { + kind: 'cli', + title: 'Supabase CLI Reference', + outFile: 'cli.md', + mdxDir: path.join(MDX_ROOT, 'cli'), + sectionsPath: path.join(GENERATED, 'cli.latest.sections.json'), + cliSpecPath: path.join(process.cwd(), 'spec/cli_v1_commands.yaml'), + }, + { + kind: 'sdk-new', + title: 'JavaScript Client Library Reference', + outFile: 'js.md', + mdxDir: path.join(MDX_ROOT, 'javascript'), + contentDir: path.join(process.cwd(), 'content/reference/javascript/v2'), + }, + { + kind: 'sdk-legacy', + title: 'Dart Client Library Reference', + outFile: 'dart.md', + mdxDir: path.join(MDX_ROOT, 'dart'), + sectionsPath: path.join(GENERATED, 'dart.v2.sections.json'), + functionsPath: path.join(GENERATED, 'dart.v2.functions.json'), + }, + { + kind: 'sdk-legacy', + title: 'Kotlin Client Library Reference', + outFile: 'kotlin.md', + mdxDir: path.join(MDX_ROOT, 'kotlin'), + sectionsPath: path.join(GENERATED, 'kotlin.v1.sections.json'), + functionsPath: path.join(GENERATED, 'kotlin.v1.functions.json'), + }, + { + kind: 'sdk-legacy', + title: 'Python Client Library Reference', + outFile: 'python.md', + mdxDir: path.join(MDX_ROOT, 'python'), + sectionsPath: path.join(GENERATED, 'python.v2.sections.json'), + functionsPath: path.join(GENERATED, 'python.v2.functions.json'), + }, + { + kind: 'sdk-legacy', + title: 'Swift Client Library Reference', + outFile: 'swift.md', + mdxDir: path.join(MDX_ROOT, 'swift'), + sectionsPath: path.join(GENERATED, 'swift.v2.sections.json'), + functionsPath: path.join(GENERATED, 'swift.v2.functions.json'), + }, + { + kind: 'sdk-legacy', + title: 'C# Client Library Reference', + outFile: 'csharp.md', + mdxDir: path.join(MDX_ROOT, 'csharp'), + sectionsPath: path.join(GENERATED, 'csharp.v0.sections.json'), + functionsPath: path.join(GENERATED, 'csharp.v0.functions.json'), + }, +] + +function flatten(sections: Section[]): Section[] { + return sections.flatMap((s) => (s.items ? [s, ...flatten(s.items)] : [s])) +} + +async function readJson(filePath: string): Promise { + return JSON.parse(await fs.readFile(filePath, 'utf8')) as T +} + +function renderExamples(examples: Example[] | undefined): string { + if (!examples?.length) return '' + const blocks = examples + .map((ex) => { + const header = ex.name ? `#### ${ex.name}\n\n` : '' + const code = (ex.code ?? '').trim() + return code ? `${header}${code}` : header.trim() + }) + .filter(Boolean) + return blocks.length ? `### Examples\n\n${blocks.join('\n\n')}` : '' +} + +function renderFunctionSection(args: { + title: string + description?: string + notes?: string + examples?: Example[] +}): string { + const parts = [`## ${args.title}`] + if (args.description?.trim()) parts.push(args.description.trim()) + if (args.notes?.trim()) parts.push(args.notes.trim()) + const examples = renderExamples(args.examples) + if (examples) parts.push(examples) + return parts.join('\n\n') +} + +/** Remove the minimum common leading whitespace from all non-empty lines. */ +function dedentBlock(text: string): string { + const lines = text.split('\n') + const nonEmpty = lines.filter((l) => /\S/.test(l)) + if (!nonEmpty.length) return text + const minIndent = Math.min(...nonEmpty.map((l) => (l.match(/^([ \t]*)/) ?? ['', ''])[1].length)) + if (!minIndent) return text + return lines.map((l) => l.slice(minIndent)).join('\n') +} + +/** + * Strip MDX comments and JSX component tags while keeping inner prose/code. + * Outside code fences, leading whitespace from JSX nesting is removed. Inside + * code fences, the body is dedented so the closing fence sits flush left. + */ +function stripMdxJsx(content: string): string { + const segments = content.split(/(```[\s\S]*?```)/g) + return segments + .map((seg, i) => { + if (i % 2 === 0) { + let prose = seg + prose = prose.replace(/\{\/\*[\s\S]*?\*\/\}/g, '') + prose = prose.replace(/<[$A-Z][\w.]*(?:\s[^>]*)?\s*\/>/gs, '') + prose = prose.replace(/<[$A-Z][\w.]*(?:\s[^>]*)?\s*>/gs, '') + prose = prose.replace(/<\/[$A-Z][\w.]*>/g, '') + prose = prose.replace(/<\/?(?:div|a|span|p|h[1-6])(?:\s[^>]*)?\s*>/g, '') + return prose.replace(/^[ \t]+/gm, '') + } + return seg.replace( + /^(```[^\n]*\n)([\s\S]*?)(\n[ \t]*```)$/, + (_, open, body) => open + dedentBlock(body) + '\n```' + ) + }) + .join('') + .replace(/^[^\S\n]+$/gm, '') + .replace(/\n{3,}/g, '\n\n') + .trim() +} + +/** + * Read a `type: "markdown"` section's .mdx file and convert it to plain + * markdown. Returns null if the file doesn't exist or has no usable content. + */ +async function renderMarkdownSection(mdxDir: string, section: Section): Promise { + if (!section.slug) return null + let raw: string + try { + raw = await fs.readFile(path.join(mdxDir, `${section.slug}.mdx`), 'utf8') + } catch { + return null + } + const { content, data } = matter(raw) + const body = stripMdxJsx(content) + if (!body) return null + const heading = data.hideTitle + ? null + : ((typeof data.title === 'string' ? data.title : section.title) ?? null) + return heading ? `## ${heading}\n\n${body}` : body +} + +async function renderSdkLegacy(ref: SdkLegacyRef, sharedTypeSpec: TypeSpec): Promise { + const [sections, functions] = await Promise.all([ + readJson(ref.sectionsPath), + readJson(ref.functionsPath), + ]) + const fnsById = new Map(functions.map((fn) => [fn.id, fn])) + const methodsByRef = new Map(Object.entries(sharedTypeSpec.methods ?? {})) + + const parts: string[] = [`# ${ref.title}`] + for (const section of flatten(sections)) { + if (section.type === 'category' && section.title) { + parts.push(`## ${section.title}`) + continue + } + if (section.type === 'markdown') { + const md = await renderMarkdownSection(ref.mdxDir, section) + if (md) parts.push(md) + continue + } + if (section.type !== 'function' || !section.id) continue + const fn = fnsById.get(section.id) + if (!fn) continue + const tsm = fn.$ref ? methodsByRef.get(fn.$ref) : undefined + parts.push( + renderFunctionSection({ + title: fn.title || section.title || fn.id, + description: fn.description ?? tsm?.comment?.shortText, + notes: fn.notes, + examples: fn.examples ?? tsm?.comment?.examples, + }) + ) + } + return parts.join('\n\n') + '\n' +} + +async function renderSdkNew(ref: SdkNewRef): Promise { + const [sections, functions, typeSpec] = await Promise.all([ + readJson(path.join(ref.contentDir, 'sections.json')), + readJson(path.join(ref.contentDir, 'functions.json')), + readJson(path.join(ref.contentDir, 'typeSpec.json')), + ]) + const fnsById = new Map(functions.map((fn) => [fn.id, fn])) + const methods = typeSpec.methods ?? {} + + const parts: string[] = [`# ${ref.title}`] + for (const section of flatten(sections)) { + if (section.type === 'category' && section.title) { + parts.push(`## ${section.title}`) + continue + } + if (section.type === 'markdown') { + const md = await renderMarkdownSection(ref.mdxDir, section) + if (md) parts.push(md) + continue + } + if (section.type !== 'function' || !section.id) continue + const fn = fnsById.get(section.id) + if (!fn) continue + const tsm = fn.$ref ? methods[fn.$ref] : undefined + parts.push( + renderFunctionSection({ + title: fn.title || section.title || fn.id, + description: fn.description ?? tsm?.comment?.shortText, + notes: fn.notes, + examples: fn.examples ?? tsm?.comment?.examples, + }) + ) + } + return parts.join('\n\n') + '\n' +} + +async function renderApi(ref: ApiRef): Promise { + type Endpoint = { + summary?: string + description?: string + path?: string + method?: string + parameters?: Array<{ + name: string + required?: boolean + description?: string + schema?: { type?: string } + }> + } + const [sections, entries] = await Promise.all([ + readJson(ref.sectionsPath), + readJson>(ref.endpointsByIdPath), + ]) + const endpointsById = new Map(entries) + + const parts: string[] = [`# ${ref.title}`] + for (const section of flatten(sections)) { + if (section.type === 'category' && section.title) { + parts.push(`## ${section.title}`) + continue + } + if (section.type === 'markdown') { + const md = await renderMarkdownSection(ref.mdxDir, section) + if (md) parts.push(md) + continue + } + if (section.type !== 'operation' || !section.id) continue + const ep = endpointsById.get(section.id) + if (!ep) continue + const heading = ep.summary || section.title || section.id + const block = [`## ${heading}`] + if (ep.path) block.push(`\`${(ep.method ?? 'GET').toUpperCase()} ${ep.path}\``) + if (ep.description?.trim()) block.push(ep.description.trim()) + if (ep.parameters?.length) { + const list = ep.parameters + .map((p) => { + const required = p.required ? 'required' : 'optional' + const type = p.schema?.type ?? 'string' + return `- \`${p.name}\` (${type}, ${required})${p.description ? `: ${p.description}` : ''}` + }) + .join('\n') + block.push(`### Parameters\n\n${list}`) + } + parts.push(block.join('\n\n')) + } + return parts.join('\n\n') + '\n' +} + +async function renderCli(ref: CliRef): Promise { + type Command = { + id: string + title?: string + summary?: string + description?: string + usage?: string + } + const [sections, spec] = await Promise.all([ + readJson(ref.sectionsPath), + fs.readFile(ref.cliSpecPath, 'utf8').then((raw) => yaml.load(raw) as { commands: Command[] }), + ]) + const cmdsById = new Map((spec.commands ?? []).map((c) => [c.id, c])) + + const parts: string[] = [`# ${ref.title}`] + for (const section of flatten(sections)) { + if (section.type === 'category' && section.title) { + parts.push(`## ${section.title}`) + continue + } + if (section.type === 'markdown') { + const md = await renderMarkdownSection(ref.mdxDir, section) + if (md) parts.push(md) + continue + } + if (section.type !== 'cli-command' || !section.id) continue + const cmd = cmdsById.get(section.id) + if (!cmd) continue + const block = [`## ${cmd.summary || cmd.title || section.title || section.id}`] + if (cmd.description?.trim()) block.push(cmd.description.trim()) + if (cmd.usage?.trim()) block.push('```sh\n' + cmd.usage.trim() + '\n```') + parts.push(block.join('\n\n')) + } + return parts.join('\n\n') + '\n' +} + +async function generate() { + await fs.mkdir(OUT_DIR, { recursive: true }) + const sharedTypeSpec = await readJson( + path.join(process.cwd(), 'content/reference/javascript/v2/typeSpec.json') + ) + const linkBaseUrl = getInternalLinkBaseUrl() + + await Promise.all( + REFERENCES.map(async (ref) => { + let output: string + switch (ref.kind) { + case 'sdk-legacy': + output = await renderSdkLegacy(ref, sharedTypeSpec) + break + case 'sdk-new': + output = await renderSdkNew(ref) + break + case 'api': + output = await renderApi(ref) + break + case 'cli': + output = await renderCli(ref) + break + } + await fs.writeFile(path.join(OUT_DIR, ref.outFile), prefixInternalLinks(output, linkBaseUrl)) + }) + ) + + console.log(`Generated ${REFERENCES.length} markdown files under public/markdown/reference/`) +} + +generate() diff --git a/apps/docs/internals/internal-links.test.ts b/apps/docs/internals/internal-links.test.ts new file mode 100644 index 00000000000..54a4bf783e5 --- /dev/null +++ b/apps/docs/internals/internal-links.test.ts @@ -0,0 +1,241 @@ +import { afterEach, beforeEach, describe, expect, it } from 'vitest' + +import { getInternalLinkBaseUrl, prefixInternalLinks, withDocsBasePath } from './internal-links' + +describe('withDocsBasePath', () => { + it('prepends /docs to a root-relative href', () => { + expect(withDocsBasePath('/guides/self-hosting/docker')).toBe('/docs/guides/self-hosting/docker') + }) + + it('prepends /docs to a single-segment href', () => { + expect(withDocsBasePath('/contribute')).toBe('/docs/contribute') + }) + + it('leaves hrefs that already start with /docs/ alone', () => { + expect(withDocsBasePath('/docs/guides/foo')).toBe('/docs/guides/foo') + }) + + it('leaves the exact /docs href alone', () => { + expect(withDocsBasePath('/docs')).toBe('/docs') + }) + + it('does not match prefixes like /docsx that only share leading chars', () => { + expect(withDocsBasePath('/docsx/foo')).toBe('/docs/docsx/foo') + }) + + it('leaves absolute http(s) URLs alone', () => { + expect(withDocsBasePath('https://example.com/foo')).toBe('https://example.com/foo') + }) + + it('leaves protocol-relative URLs alone', () => { + expect(withDocsBasePath('//cdn.example.com/foo')).toBe('//cdn.example.com/foo') + }) + + it('leaves anchor-only hrefs alone', () => { + expect(withDocsBasePath('#section')).toBe('#section') + }) + + it('leaves mailto: hrefs alone', () => { + expect(withDocsBasePath('mailto:team@example.com')).toBe('mailto:team@example.com') + }) + + it('leaves relative ./ and ../ hrefs alone', () => { + expect(withDocsBasePath('./sibling')).toBe('./sibling') + expect(withDocsBasePath('../parent')).toBe('../parent') + }) + + it('preserves query strings and fragments', () => { + expect(withDocsBasePath('/guides/foo?x=1#bar')).toBe('/docs/guides/foo?x=1#bar') + }) +}) + +describe('getInternalLinkBaseUrl', () => { + const ORIGINAL_ENV = process.env + + beforeEach(() => { + process.env = { ...ORIGINAL_ENV } + delete process.env.VERCEL_ENV + delete process.env.VERCEL_URL + }) + + afterEach(() => { + process.env = ORIGINAL_ENV + }) + + it('returns the production host when VERCEL_ENV=production', () => { + process.env.VERCEL_ENV = 'production' + expect(getInternalLinkBaseUrl()).toBe('https://supabase.com') + }) + + it('production wins even if VERCEL_URL is also set', () => { + process.env.VERCEL_ENV = 'production' + process.env.VERCEL_URL = 'should-be-ignored.vercel.app' + expect(getInternalLinkBaseUrl()).toBe('https://supabase.com') + }) + + it('returns the deployment URL when VERCEL_ENV=preview', () => { + process.env.VERCEL_ENV = 'preview' + process.env.VERCEL_URL = 'supabase-com-abc123.vercel.app' + expect(getInternalLinkBaseUrl()).toBe('https://supabase-com-abc123.vercel.app') + }) + + it('returns empty when preview is set but VERCEL_URL is missing', () => { + process.env.VERCEL_ENV = 'preview' + expect(getInternalLinkBaseUrl()).toBe('') + }) + + it('returns empty when VERCEL_ENV=development', () => { + process.env.VERCEL_ENV = 'development' + process.env.VERCEL_URL = 'localhost-tunnel.vercel.app' + expect(getInternalLinkBaseUrl()).toBe('') + }) + + it('returns empty when VERCEL_ENV is not set (local)', () => { + expect(getInternalLinkBaseUrl()).toBe('') + }) +}) + +describe('prefixInternalLinks', () => { + const BASE = 'https://supabase.com' + + it('returns content unchanged when baseUrl is empty', () => { + const input = 'See [Dashboard](/dashboard/foo).' + expect(prefixInternalLinks(input, '')).toBe(input) + }) + + it('prepends baseUrl to a root-relative link', () => { + expect(prefixInternalLinks('See [Dashboard](/dashboard/foo).', BASE)).toBe( + 'See [Dashboard](https://supabase.com/dashboard/foo).' + ) + }) + + it('rewrites multiple links on the same line', () => { + const input = 'A [one](/a) and [two](/b/c) here.' + expect(prefixInternalLinks(input, BASE)).toBe( + 'A [one](https://supabase.com/a) and [two](https://supabase.com/b/c) here.' + ) + }) + + it('preserves query strings and fragments', () => { + expect(prefixInternalLinks('[link](/foo?bar=1&baz=2#section)', BASE)).toBe( + '[link](https://supabase.com/foo?bar=1&baz=2#section)' + ) + }) + + it('leaves absolute http(s) links alone', () => { + const input = 'See [GitHub](https://github.com/supabase).' + expect(prefixInternalLinks(input, BASE)).toBe(input) + }) + + it('leaves anchor-only links alone', () => { + const input = 'Jump to [section](#installation).' + expect(prefixInternalLinks(input, BASE)).toBe(input) + }) + + it('leaves mailto and other schemes alone', () => { + const input = 'Email [us](mailto:team@example.com) or [call](tel:+1234).' + expect(prefixInternalLinks(input, BASE)).toBe(input) + }) + + it('leaves explicitly relative links (./, ../) alone', () => { + const input = 'See [sibling](./sibling) and [parent](../parent).' + expect(prefixInternalLinks(input, BASE)).toBe(input) + }) + + it('leaves protocol-relative (//host) URLs alone', () => { + const input = 'CDN [asset](//cdn.example.com/img.png).' + expect(prefixInternalLinks(input, BASE)).toBe(input) + }) + + it('does not rewrite image syntax', () => { + const input = 'An image: ![alt text](/static/foo.png).' + expect(prefixInternalLinks(input, BASE)).toBe(input) + }) + + it('rewrites a link adjacent to an image without touching the image', () => { + expect(prefixInternalLinks('![logo](/logo.png) and [home](/dashboard)', BASE)).toBe( + '![logo](/logo.png) and [home](https://supabase.com/dashboard)' + ) + }) + + it('skips links inside fenced code blocks', () => { + const input = [ + 'Before: [yes](/touch-me).', + '', + '```md', + '[ignore me](/leave-alone)', + '```', + '', + 'After: [also yes](/touch-me-too).', + ].join('\n') + + expect(prefixInternalLinks(input, BASE)).toBe( + [ + 'Before: [yes](https://supabase.com/touch-me).', + '', + '```md', + '[ignore me](/leave-alone)', + '```', + '', + 'After: [also yes](https://supabase.com/touch-me-too).', + ].join('\n') + ) + }) + + it('handles multiple fenced code blocks correctly', () => { + const input = [ + '[a](/a)', + '```', + '[skip1](/skip1)', + '```', + '[b](/b)', + '```ts', + '[skip2](/skip2)', + '```', + '[c](/c)', + ].join('\n') + + expect(prefixInternalLinks(input, BASE)).toBe( + [ + '[a](https://supabase.com/a)', + '```', + '[skip1](/skip1)', + '```', + '[b](https://supabase.com/b)', + '```ts', + '[skip2](/skip2)', + '```', + '[c](https://supabase.com/c)', + ].join('\n') + ) + }) + + it('rewrites links with empty text', () => { + expect(prefixInternalLinks('[](/foo)', BASE)).toBe('[](https://supabase.com/foo)') + }) + + it('uses any baseUrl passed in, not just supabase.com', () => { + expect(prefixInternalLinks('[x](/y)', 'https://branch-deploy.vercel.app')).toBe( + '[x](https://branch-deploy.vercel.app/y)' + ) + }) + + it('is a no-op when there are no matching links', () => { + const input = '# Title\n\nJust prose, no links.' + expect(prefixInternalLinks(input, BASE)).toBe(input) + }) + + it('handles an unclosed code fence by leaving the unclosed portion untouched', () => { + // A `split(/(```...```)/)` only pairs complete fences; an unclosed fence + // means everything after it stays in the trailing prose segment. Document + // that behavior rather than promising to parse malformed markdown. + const input = ['[before](/before)', '```', '[inside-unclosed](/inside)'].join('\n') + expect(prefixInternalLinks(input, BASE)).toBe( + [ + '[before](https://supabase.com/before)', + '```', + '[inside-unclosed](https://supabase.com/inside)', + ].join('\n') + ) + }) +}) diff --git a/apps/docs/internals/internal-links.ts b/apps/docs/internals/internal-links.ts new file mode 100644 index 00000000000..ae19af20595 --- /dev/null +++ b/apps/docs/internals/internal-links.ts @@ -0,0 +1,57 @@ +const DOCS_BASE_PATH = process.env.NEXT_PUBLIC_BASE_PATH || '/docs' + +/** + * Prepend the docs basePath to a root-relative href, mirroring what Next.js + * `` does at render time. Used when extracting an `href` attribute out + * of MDX `` components into plain markdown — without this, links like + * `/guides/foo` lose the `/docs` prefix the deployed site adds. + * + * Returns the href unchanged when it's already prefixed, external, anchor- + * only, or relative (`./`, `../`). + */ +export function withDocsBasePath(href: string): string { + if (!href.startsWith('/')) return href + if (href.startsWith('//')) return href + if (href === DOCS_BASE_PATH || href.startsWith(`${DOCS_BASE_PATH}/`)) return href + return `${DOCS_BASE_PATH}${href}` +} + +/** + * Returns the absolute base URL to prepend to root-relative markdown links + * (e.g. `/dashboard/...`). Empty when no rewrite should happen — typically + * local development, where keeping links relative lets them resolve against + * whatever host the dev server is on. + * + * Resolution order: + * - `VERCEL_ENV=production` → `https://supabase.com` + * - `VERCEL_ENV=preview` → `https://${VERCEL_URL}` + * - anything else → '' + */ +export function getInternalLinkBaseUrl(): string { + const env = process.env.VERCEL_ENV + if (env === 'production') return 'https://supabase.com' + if (env === 'preview' && process.env.VERCEL_URL) return `https://${process.env.VERCEL_URL}` + return '' +} + +/** + * Rewrite root-relative markdown links by prepending `baseUrl`: + * `[text](/foo)` → `[text](${baseUrl}/foo)` + * + * Skips fenced code blocks, image syntax (`![alt](...)`), protocol-relative + * URLs (`//host/...`), and non-root-relative targets (`http://`, `mailto:`, + * `#anchor`, `./`, `../`). + */ +export function prefixInternalLinks(content: string, baseUrl: string): string { + if (!baseUrl) return content + const segments = content.split(/(```[\s\S]*?```)/g) + return segments + .map((seg, i) => { + if (i % 2 === 1) return seg + return seg.replace(/(? { + if (url.startsWith('//')) return match + return `${text}(${baseUrl}${url})` + }) + }) + .join('') +} diff --git a/apps/docs/middleware.test.ts b/apps/docs/middleware.test.ts new file mode 100644 index 00000000000..9e447e4afb8 --- /dev/null +++ b/apps/docs/middleware.test.ts @@ -0,0 +1,150 @@ +import { NextRequest } from 'next/server' +import { describe, expect, it } from 'vitest' + +import { middleware } from './middleware' + +// BASE_PATH defaults to '/docs' when NEXT_PUBLIC_BASE_PATH is unset, so test +// paths include the /docs prefix to match the middleware's GUIDES_PATH check. +function makeRequest( + path: string, + { accept, userAgent }: { accept?: string; userAgent?: string } = {} +): NextRequest { + const headers: Record = {} + if (accept) headers.accept = accept + if (userAgent) headers['user-agent'] = userAgent + return new NextRequest(new URL(path, 'https://supabase.com'), { headers }) +} + +const REWRITE_HEADER = 'x-middleware-rewrite' +const GUIDES_MD_REWRITE = (slug: string) => `https://supabase.com/docs/api/guides-md/${slug}` + +describe('docs middleware — /guides/* content negotiation', () => { + it('rewrites to /api/guides-md/ when Accept includes text/markdown', () => { + const req = makeRequest('/docs/guides/auth', { accept: 'text/markdown' }) + expect(middleware(req).headers.get(REWRITE_HEADER)).toBe(GUIDES_MD_REWRITE('auth')) + }) + + it('rewrites /.md to /api/guides-md/ regardless of Accept', () => { + for (const accept of [undefined, 'text/html']) { + const req = makeRequest('/docs/guides/auth.md', accept ? { accept } : {}) + expect(middleware(req).headers.get(REWRITE_HEADER)).toBe(GUIDES_MD_REWRITE('auth')) + } + }) + + it('serves HTML for browser-style Accept', () => { + const req = makeRequest('/docs/guides/auth', { + accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8', + }) + expect(middleware(req).headers.get(REWRITE_HEADER)).toBeNull() + }) + + it('serves markdown when md q-value beats html', () => { + const req = makeRequest('/docs/guides/auth', { + accept: 'text/html;q=0.5, text/markdown;q=1.0', + }) + expect(middleware(req).headers.get(REWRITE_HEADER)).toBe(GUIDES_MD_REWRITE('auth')) + }) + + it('falls through to HTML when no Accept header is sent', () => { + expect(middleware(makeRequest('/docs/guides/auth')).headers.get(REWRITE_HEADER)).toBeNull() + }) + + it('falls through to HTML for bare Accept: */* (no explicit md preference)', () => { + const req = makeRequest('/docs/guides/auth', { accept: '*/*' }) + expect(middleware(req).headers.get(REWRITE_HEADER)).toBeNull() + }) + + it('does not serve markdown when client explicitly rejects it (q=0)', () => { + const req = makeRequest('/docs/guides/auth', { + accept: 'text/markdown;q=0, text/html;q=1.0', + }) + expect(middleware(req).headers.get(REWRITE_HEADER)).toBeNull() + }) + + it('tolerates OWS in q-params and clamps out-of-range q-values', () => { + // OWS around q: html wins. + const ows = makeRequest('/docs/guides/auth', { + accept: 'text/html ; q = 1.0, text/markdown ; q = 0.5', + }) + expect(middleware(ows).headers.get(REWRITE_HEADER)).toBeNull() + // q=2.0 is out-of-range, falls back to default 1.0; tie -> markdown. + const oor = makeRequest('/docs/guides/auth', { + accept: 'text/html;q=2.0, text/markdown;q=1.0', + }) + expect(middleware(oor).headers.get(REWRITE_HEADER)).toBe(GUIDES_MD_REWRITE('auth')) + }) + + it('returns 406 with Cache-Control: no-store and Vary: Accept when Accept excludes every type', () => { + const req = makeRequest('/docs/guides/auth', { + accept: 'application/x-content-negotiation-probe', + }) + const res = middleware(req) + expect(res.status).toBe(406) + expect(res.headers.get('Cache-Control')).toBe('no-store') + expect(res.headers.get('Vary')).toBe('Accept') + }) + + it('does not 406 for LLM UAs or .md suffix paths even with a probe Accept', () => { + const llm = makeRequest('/docs/guides/auth', { + accept: 'application/x-content-negotiation-probe', + userAgent: 'Claude-User/1.0', + }) + expect(middleware(llm).status).not.toBe(406) + expect(middleware(llm).headers.get(REWRITE_HEADER)).toBe(GUIDES_MD_REWRITE('auth')) + + const md = makeRequest('/docs/guides/auth.md', { + accept: 'application/x-content-negotiation-probe', + }) + expect(middleware(md).status).not.toBe(406) + expect(middleware(md).headers.get(REWRITE_HEADER)).toBe(GUIDES_MD_REWRITE('auth')) + }) + + it('does not 406 on /reference/* (negotiation contract is /guides/* only)', () => { + const req = makeRequest('/docs/reference/javascript/introduction', { + accept: 'application/x-content-negotiation-probe', + }) + expect(middleware(req).status).not.toBe(406) + }) + + it('rewrites for each LLM user agent', () => { + for (const ua of [ + 'Claude-User (claude-code/2.1.119; +https://support.anthropic.com/)', + 'Claude-Web/1.0', + 'Mozilla/5.0 (compatible; ChatGPT-User/1.0)', + 'PerplexityBot/1.0', + ]) { + const req = makeRequest('/docs/guides/auth', { userAgent: ua }) + expect(middleware(req).headers.get(REWRITE_HEADER)).toBe(GUIDES_MD_REWRITE('auth')) + } + }) + + it('LLM UA overrides an Accept header that prefers HTML', () => { + const req = makeRequest('/docs/guides/auth', { + accept: 'text/html;q=1.0, text/markdown;q=0.1', + userAgent: 'Claude-User/1.0', + }) + expect(middleware(req).headers.get(REWRITE_HEADER)).toBe(GUIDES_MD_REWRITE('auth')) + }) + + it('falls through for non-LLM UAs (browsers, training crawlers, substring embeds)', () => { + for (const ua of [ + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36', + 'GPTBot/1.0', + 'ClaudeBot/1.0', + 'CCBot/2.0', + 'chatgpt-userscript/2.0', + 'NotPerplexityBot', + ]) { + const req = makeRequest('/docs/guides/auth', { userAgent: ua }) + expect(middleware(req).headers.get(REWRITE_HEADER)).toBeNull() + } + }) + + it('does not apply LLM UA rewrite to /reference/* (guides-only)', () => { + const req = makeRequest('/docs/reference/javascript/introduction', { + userAgent: 'Claude-User/1.0', + }) + const rewrite = middleware(req).headers.get(REWRITE_HEADER) ?? '' + expect(rewrite).not.toContain('/api/guides-md/') + }) +}) diff --git a/apps/docs/middleware.ts b/apps/docs/middleware.ts index 34cf26138b5..42817c237c7 100644 --- a/apps/docs/middleware.ts +++ b/apps/docs/middleware.ts @@ -1,33 +1,47 @@ +import { clientSdkIds } from '~/content/navigation.references' +import { BASE_PATH } from '~/lib/constants' +import { negotiateMarkdown } from 'common/markdown-negotiation' import { isbot } from 'isbot' import { NextResponse, type NextRequest } from 'next/server' -import { clientSdkIds } from '~/content/navigation.references' -import { BASE_PATH } from '~/lib/constants' - const REFERENCE_PATH = `${BASE_PATH ?? ''}/reference` - const GUIDES_PATH = `${BASE_PATH ?? ''}/guides` export function middleware(request: NextRequest) { const url = new URL(request.url) + const { pathname } = url - const requestsMarkdown = - request.headers.get('Accept')?.includes('text/markdown') || url.pathname.endsWith('.md') + if (pathname.startsWith(GUIDES_PATH + '/')) { + const isMdSuffix = pathname.endsWith('.md') + const slug = pathname.replace(`${GUIDES_PATH}/`, '').replace(/\.md$/, '') + const decision = negotiateMarkdown( + { + acceptHeader: request.headers.get('accept') ?? '', + userAgent: request.headers.get('user-agent') ?? '', + }, + { hasMarkdownVariant: true, isMarkdownSuffix: isMdSuffix } + ) - // Serve pre-generated .md files before the [[...slug]] page route can intercept them - if (url.pathname.startsWith(GUIDES_PATH + '/') && requestsMarkdown) { - const slug = url.pathname.replace(`${GUIDES_PATH}/`, '').replace(/\.md$/, '') - const rewriteUrl = new URL(url) - rewriteUrl.pathname = `${BASE_PATH ?? ''}/api/guides-md/${slug}` - return NextResponse.rewrite(rewriteUrl) + if (decision === 'not-acceptable') { + return new NextResponse('Not Acceptable', { + status: 406, + headers: { 'Cache-Control': 'no-store', Vary: 'Accept' }, + }) + } + + if (decision === 'markdown') { + const rewriteUrl = new URL(url) + rewriteUrl.pathname = `${BASE_PATH ?? ''}/api/guides-md/${slug}` + return NextResponse.rewrite(rewriteUrl) + } } - if (!url.pathname.startsWith(REFERENCE_PATH)) { + if (!pathname.startsWith(REFERENCE_PATH)) { return NextResponse.next() } if (isbot(request.headers.get('user-agent'))) { - let [, lib, maybeVersion, ...slug] = url.pathname.replace(REFERENCE_PATH, '').split('/') + let [, lib, maybeVersion, ...slug] = pathname.replace(REFERENCE_PATH, '').split('/') if (clientSdkIds.includes(lib)) { const version = /v\d+/.test(maybeVersion) ? maybeVersion : undefined @@ -43,7 +57,7 @@ export function middleware(request: NextRequest) { } } - const [, lib, maybeVersion] = url.pathname.replace(REFERENCE_PATH, '').split('/') + const [, lib, maybeVersion] = pathname.replace(REFERENCE_PATH, '').split('/') if (lib === 'cli') { const rewritePath = [REFERENCE_PATH, 'cli'].join('/') diff --git a/apps/docs/next.config.mjs b/apps/docs/next.config.mjs index 9243af773b2..8fa45e13c6d 100644 --- a/apps/docs/next.config.mjs +++ b/apps/docs/next.config.mjs @@ -61,7 +61,7 @@ const nextConfig = { ], outputFileTracingIncludes: { '/api/crawlers': ['./features/docs/generated/**/*', './docs/ref/**/*'], - '/api/guides-md/**/*': ['./public/docs/guides/**/*'], + '/api/guides-md/**/*': ['./public/markdown/guides/**/*'], '/guides/**/*': ['./content/guides/**/*', './content/troubleshooting/**/*', './examples/**/*'], '/reference/**/*': ['./features/docs/generated/**/*', './docs/ref/**/*'], }, diff --git a/apps/docs/package.json b/apps/docs/package.json index baef799f723..bf086e3a985 100644 --- a/apps/docs/package.json +++ b/apps/docs/package.json @@ -6,16 +6,19 @@ "scripts": { "build": "next build", "build:analyze": "ANALYZE=true next build", - "build:llms": "tsx --conditions=react-server ./scripts/llms.ts", "build:guides-markdown": "tsx ./internals/generate-guides-markdown.ts", + "prebuild:reference-markdown": "pnpm run codegen:references", + "build:reference-markdown": "tsx ./internals/generate-reference-markdown.ts", + "build:markdown": "pnpm build:guides-markdown && pnpm build:reference-markdown", "build:gz-archive": "tsx ./internals/generate-gz-archive.ts", "build:sitemap": "tsx ./internals/generate-sitemap.ts", "clean": "rimraf .next .turbo node_modules features/docs/generated examples __generated__", "codegen:examples": "shx cp -r ../../examples ./examples", "codegen:graphql": "tsx --conditions=react-server ./scripts/graphqlSchema.ts && graphql-codegen --config codegen.ts", - "codegen:references:ensure": "test -f spec/reference/javascript/v2/supabase.json || (cd spec && make download.tsdoc.v2)", - "codegen:references:new": "pnpm run codegen:references:ensure && tsx scripts/build-reference-content.ts", - "codegen:references": "tsx features/docs/Reference.generated.script.ts", + "codegen:references:new:ensure": "test -f spec/reference/javascript/v2/supabase.json || (cd spec && make download.tsdoc.v2)", + "codegen:references:new": "pnpm run codegen:references:new:ensure && tsx scripts/build-reference-content.ts", + "codegen:references:legacy": "tsx features/docs/Reference.generated.script.ts", + "codegen:references": "pnpm codegen:references:legacy && pnpm codegen:references:new", "codemod:frontmatter": "node ./scripts/codemod/mdx-meta.mjs && prettier --cache --write \"content/**/*.mdx\"", "dev": "concurrently --kill-others \"next dev --port 3001\" \"pnpm run dev:watch:troubleshooting\"", "dev:secrets:pull": "AWS_PROFILE=supa-dev node ../../scripts/getSecrets.js -n local/docs", @@ -28,10 +31,10 @@ "last-changed:reset": "pnpm run last-changed -- --reset", "lint": "eslint .", "lint:mdx": "supa-mdx-lint content --config ../../supa-mdx-lint.config.toml", - "postbuild": "pnpm run build:sitemap && pnpm run build:llms && ./../../scripts/upload-static-assets.sh", - "prebuild": "pnpm run codegen:graphql && pnpm run codegen:references && pnpm run codegen:references:new && pnpm run codegen:examples && pnpm run build:guides-markdown && pnpm run build:gz-archive", - "predev": "pnpm run codegen:graphql && pnpm run codegen:references && pnpm run codegen:references:new && pnpm run codegen:examples", - "preembeddings": "pnpm run codegen:references && pnpm run codegen:references:new", + "postbuild": "pnpm run build:sitemap && ./../../scripts/upload-static-assets.sh", + "prebuild": "pnpm run codegen:graphql && pnpm run codegen:references && pnpm run codegen:examples && pnpm run build:markdown && pnpm run build:gz-archive", + "predev": "pnpm run codegen:graphql && pnpm run codegen:references && pnpm run codegen:examples", + "preembeddings": "pnpm run codegen:references", "preinstall": "npx only-allow pnpm", "presync": "pnpm run codegen:graphql", "pretest": "pnpm run codegen:examples", diff --git a/apps/docs/public/humans.txt b/apps/docs/public/humans.txt index c2f9a44d4ff..bd189faec62 100644 --- a/apps/docs/public/humans.txt +++ b/apps/docs/public/humans.txt @@ -12,6 +12,7 @@ Alaister Young Aleksi Immonen Alex Hall Alex Hsu +Alexander Alexandrov Alexander Korotkov Ali Waseem Allan S @@ -22,7 +23,6 @@ Ana Mogul Andrew Valleteau Andrey A Angelico de los Reyes -Anna Weihl Ant Evans Ant Wilson Ariuna K @@ -89,6 +89,7 @@ Eduardo Gurgel Eleftheria Trivyzaki Eliot Whalan Emmett Folger +Erfi Anugrah Eric Kharitonashvili Etienne Stalmans Eyal Ehrlich @@ -110,6 +111,7 @@ Greg P Greg Richardson Gregor Vand Guilherme Souza +Hanefi Önaldı Hannah Bowers Hardik Maheshwari Haritabh Gupta @@ -196,11 +198,13 @@ Michal Kleczek Michelle Jubrey Miranda Limonczenko Monica Khoury +Mrinal Paliwal Mykhailo Mischa Lieibenson Natalie Roberge Nick B Nick Littman Nick Nowlan +Nicola Ferraro Nicolas Nosenzo Noah Moss Nyannyacha diff --git a/apps/docs/public/img/guides/cli/docker-mac-light.png b/apps/docs/public/img/guides/cli/docker-mac-light.png deleted file mode 100644 index ca0c3f88543..00000000000 Binary files a/apps/docs/public/img/guides/cli/docker-mac-light.png and /dev/null differ diff --git a/apps/docs/public/img/guides/cli/docker-mac.png b/apps/docs/public/img/guides/cli/docker-mac.png deleted file mode 100644 index 733eada80a1..00000000000 Binary files a/apps/docs/public/img/guides/cli/docker-mac.png and /dev/null differ diff --git a/apps/docs/public/img/guides/cli/docker-win-light.png b/apps/docs/public/img/guides/cli/docker-win-light.png deleted file mode 100644 index 13778f64577..00000000000 Binary files a/apps/docs/public/img/guides/cli/docker-win-light.png and /dev/null differ diff --git a/apps/docs/public/img/guides/cli/docker-win.png b/apps/docs/public/img/guides/cli/docker-win.png deleted file mode 100644 index 9a2b389deb3..00000000000 Binary files a/apps/docs/public/img/guides/cli/docker-win.png and /dev/null differ diff --git a/apps/docs/resources/guide/guideModelLoader.ts b/apps/docs/resources/guide/guideModelLoader.ts index 551bd98abfe..1fa7858336a 100644 --- a/apps/docs/resources/guide/guideModelLoader.ts +++ b/apps/docs/resources/guide/guideModelLoader.ts @@ -1,13 +1,13 @@ -import matter from 'gray-matter' import { promises as fs } from 'node:fs' import { join, relative, resolve } from 'node:path' - import { extractMessageFromAnyError, FileNotFoundError, MultiError } from '~/app/api/utils' import { preprocessMdxWithDefaults } from '~/features/directives/utils' import { checkGuidePageEnabled } from '~/features/docs/NavigationPageStatus.utils' import { Both, Result } from '~/features/helpers.fn' import { GUIDES_DIRECTORY } from '~/lib/docs' import { processMdx } from '~/scripts/helpers.mdx' +import matter from 'gray-matter' + import { GuideModel } from './guideModel' /** @@ -140,7 +140,7 @@ export class GuideModelLoader { }, (error) => { if (error instanceof Error && 'code' in error && error.code === 'ENOENT') { - throw new FileNotFoundError('', error) + throw new FileNotFoundError(join(GUIDES_DIRECTORY, relPath), error) } throw new Error( `Failed to load guide from ${relPath}: ${extractMessageFromAnyError(error)}`, diff --git a/apps/docs/scripts/__snapshots__/build-reference-content.test.ts.snap b/apps/docs/scripts/__snapshots__/build-reference-content.test.ts.snap deleted file mode 100644 index 6e8a295b385..00000000000 --- a/apps/docs/scripts/__snapshots__/build-reference-content.test.ts.snap +++ /dev/null @@ -1,27316 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`build-reference-content — javascript/v2 > matches snapshot 1`] = ` -{ - "bySlug": { - "analytics-buckets": { - "id": "analytics-buckets", - "slug": "analytics-buckets", - "title": "Analytics Buckets", - "type": "function", - }, - "analytics-buckets-createbucket": { - "id": "analytics-buckets-createbucket", - "product": "storage", - "slug": "analytics-buckets-createbucket", - "title": "createBucket", - "type": "function", - }, - "analytics-buckets-deletebucket": { - "id": "analytics-buckets-deletebucket", - "product": "storage", - "slug": "analytics-buckets-deletebucket", - "title": "deleteBucket", - "type": "function", - }, - "analytics-buckets-from": { - "id": "analytics-buckets-from", - "product": "storage", - "slug": "analytics-buckets-from", - "title": "from", - "type": "function", - }, - "analytics-buckets-listbuckets": { - "id": "analytics-buckets-listbuckets", - "product": "storage", - "slug": "analytics-buckets-listbuckets", - "title": "listBuckets", - "type": "function", - }, - "auth": { - "id": "auth", - "slug": "auth", - "title": "Overview", - "type": "function", - }, - "auth-admin": { - "id": "auth-admin", - "slug": "auth-admin", - "title": "Overview", - "type": "function", - }, - "auth-admin-createprovider": { - "id": "auth-admin-createprovider", - "product": "auth", - "slug": "auth-admin-createprovider", - "title": "createProvider", - "type": "function", - }, - "auth-admin-createuser": { - "id": "auth-admin-createuser", - "product": "auth", - "slug": "auth-admin-createuser", - "title": "createUser", - "type": "function", - }, - "auth-admin-deletefactor": { - "id": "auth-admin-deletefactor", - "product": "auth", - "slug": "auth-admin-deletefactor", - "title": "deleteFactor", - "type": "function", - }, - "auth-admin-deleteprovider": { - "id": "auth-admin-deleteprovider", - "product": "auth", - "slug": "auth-admin-deleteprovider", - "title": "deleteProvider", - "type": "function", - }, - "auth-admin-deleteuser": { - "id": "auth-admin-deleteuser", - "product": "auth", - "slug": "auth-admin-deleteuser", - "title": "deleteUser", - "type": "function", - }, - "auth-admin-generatelink": { - "id": "auth-admin-generatelink", - "product": "auth", - "slug": "auth-admin-generatelink", - "title": "generateLink", - "type": "function", - }, - "auth-admin-getprovider": { - "id": "auth-admin-getprovider", - "product": "auth", - "slug": "auth-admin-getprovider", - "title": "getProvider", - "type": "function", - }, - "auth-admin-getuserbyid": { - "id": "auth-admin-getuserbyid", - "product": "auth", - "slug": "auth-admin-getuserbyid", - "title": "getUserById", - "type": "function", - }, - "auth-admin-inviteuserbyemail": { - "id": "auth-admin-inviteuserbyemail", - "product": "auth", - "slug": "auth-admin-inviteuserbyemail", - "title": "inviteUserByEmail", - "type": "function", - }, - "auth-admin-listfactors": { - "id": "auth-admin-listfactors", - "product": "auth", - "slug": "auth-admin-listfactors", - "title": "listFactors", - "type": "function", - }, - "auth-admin-listproviders": { - "id": "auth-admin-listproviders", - "product": "auth", - "slug": "auth-admin-listproviders", - "title": "listProviders", - "type": "function", - }, - "auth-admin-listusers": { - "id": "auth-admin-listusers", - "product": "auth", - "slug": "auth-admin-listusers", - "title": "listUsers", - "type": "function", - }, - "auth-admin-signout": { - "id": "auth-admin-signout", - "product": "auth", - "slug": "auth-admin-signout", - "title": "signOut", - "type": "function", - }, - "auth-admin-updateprovider": { - "id": "auth-admin-updateprovider", - "product": "auth", - "slug": "auth-admin-updateprovider", - "title": "updateProvider", - "type": "function", - }, - "auth-admin-updateuserbyid": { - "id": "auth-admin-updateuserbyid", - "product": "auth", - "slug": "auth-admin-updateuserbyid", - "title": "updateUserById", - "type": "function", - }, - "auth-dispose": { - "id": "auth-dispose", - "product": "auth", - "slug": "auth-dispose", - "title": "dispose", - "type": "function", - }, - "auth-exchangecodeforsession": { - "id": "auth-exchangecodeforsession", - "product": "auth", - "slug": "auth-exchangecodeforsession", - "title": "exchangeCodeForSession", - "type": "function", - }, - "auth-getclaims": { - "id": "auth-getclaims", - "product": "auth", - "slug": "auth-getclaims", - "title": "getClaims", - "type": "function", - }, - "auth-getsession": { - "id": "auth-getsession", - "product": "auth", - "slug": "auth-getsession", - "title": "getSession", - "type": "function", - }, - "auth-getuser": { - "id": "auth-getuser", - "product": "auth", - "slug": "auth-getuser", - "title": "getUser", - "type": "function", - }, - "auth-getuseridentities": { - "id": "auth-getuseridentities", - "product": "auth", - "slug": "auth-getuseridentities", - "title": "getUserIdentities", - "type": "function", - }, - "auth-initialize": { - "id": "auth-initialize", - "product": "auth", - "slug": "auth-initialize", - "title": "initialize", - "type": "function", - }, - "auth-linkidentity": { - "id": "auth-linkidentity", - "product": "auth", - "slug": "auth-linkidentity", - "title": "linkIdentity", - "type": "function", - }, - "auth-mfa": { - "id": "auth-mfa", - "slug": "auth-mfa", - "title": "Auth MFA", - "type": "function", - }, - "auth-mfa-challenge": { - "id": "auth-mfa-challenge", - "product": "auth", - "slug": "auth-mfa-challenge", - "title": "challenge", - "type": "function", - }, - "auth-mfa-challengeandverify": { - "id": "auth-mfa-challengeandverify", - "product": "auth", - "slug": "auth-mfa-challengeandverify", - "title": "challengeAndVerify", - "type": "function", - }, - "auth-mfa-enroll": { - "id": "auth-mfa-enroll", - "product": "auth", - "slug": "auth-mfa-enroll", - "title": "enroll", - "type": "function", - }, - "auth-mfa-getauthenticatorassurancelevel": { - "id": "auth-mfa-getauthenticatorassurancelevel", - "product": "auth", - "slug": "auth-mfa-getauthenticatorassurancelevel", - "title": "getAuthenticatorAssuranceLevel", - "type": "function", - }, - "auth-mfa-listfactors": { - "id": "auth-mfa-listfactors", - "product": "auth", - "slug": "auth-mfa-listfactors", - "title": "listFactors", - "type": "function", - }, - "auth-mfa-unenroll": { - "id": "auth-mfa-unenroll", - "product": "auth", - "slug": "auth-mfa-unenroll", - "title": "unenroll", - "type": "function", - }, - "auth-mfa-verify": { - "id": "auth-mfa-verify", - "product": "auth", - "slug": "auth-mfa-verify", - "title": "verify", - "type": "function", - }, - "auth-onauthstatechange": { - "id": "auth-onauthstatechange", - "product": "auth", - "slug": "auth-onauthstatechange", - "title": "onAuthStateChange", - "type": "function", - }, - "auth-passkey": { - "id": "auth-passkey", - "slug": "auth-passkey", - "title": "Auth Passkey", - "type": "function", - }, - "auth-passkey-delete": { - "id": "auth-passkey-delete", - "product": "auth", - "slug": "auth-passkey-delete", - "title": "delete", - "type": "function", - }, - "auth-passkey-list": { - "id": "auth-passkey-list", - "product": "auth", - "slug": "auth-passkey-list", - "title": "list", - "type": "function", - }, - "auth-passkey-startauthentication": { - "id": "auth-passkey-startauthentication", - "product": "auth", - "slug": "auth-passkey-startauthentication", - "title": "startAuthentication", - "type": "function", - }, - "auth-passkey-startregistration": { - "id": "auth-passkey-startregistration", - "product": "auth", - "slug": "auth-passkey-startregistration", - "title": "startRegistration", - "type": "function", - }, - "auth-passkey-update": { - "id": "auth-passkey-update", - "product": "auth", - "slug": "auth-passkey-update", - "title": "update", - "type": "function", - }, - "auth-passkey-verifyauthentication": { - "id": "auth-passkey-verifyauthentication", - "product": "auth", - "slug": "auth-passkey-verifyauthentication", - "title": "verifyAuthentication", - "type": "function", - }, - "auth-passkey-verifyregistration": { - "id": "auth-passkey-verifyregistration", - "product": "auth", - "slug": "auth-passkey-verifyregistration", - "title": "verifyRegistration", - "type": "function", - }, - "auth-reauthenticate": { - "id": "auth-reauthenticate", - "product": "auth", - "slug": "auth-reauthenticate", - "title": "reauthenticate", - "type": "function", - }, - "auth-refreshsession": { - "id": "auth-refreshsession", - "product": "auth", - "slug": "auth-refreshsession", - "title": "refreshSession", - "type": "function", - }, - "auth-registerpasskey": { - "id": "auth-registerpasskey", - "product": "auth", - "slug": "auth-registerpasskey", - "title": "registerPasskey", - "type": "function", - }, - "auth-resend": { - "id": "auth-resend", - "product": "auth", - "slug": "auth-resend", - "title": "resend", - "type": "function", - }, - "auth-resetpasswordforemail": { - "id": "auth-resetpasswordforemail", - "product": "auth", - "slug": "auth-resetpasswordforemail", - "title": "resetPasswordForEmail", - "type": "function", - }, - "auth-setsession": { - "id": "auth-setsession", - "product": "auth", - "slug": "auth-setsession", - "title": "setSession", - "type": "function", - }, - "auth-signinanonymously": { - "id": "auth-signinanonymously", - "product": "auth", - "slug": "auth-signinanonymously", - "title": "signInAnonymously", - "type": "function", - }, - "auth-signinwithidtoken": { - "id": "auth-signinwithidtoken", - "product": "auth", - "slug": "auth-signinwithidtoken", - "title": "signInWithIdToken", - "type": "function", - }, - "auth-signinwithoauth": { - "id": "auth-signinwithoauth", - "product": "auth", - "slug": "auth-signinwithoauth", - "title": "signInWithOAuth", - "type": "function", - }, - "auth-signinwithotp": { - "id": "auth-signinwithotp", - "product": "auth", - "slug": "auth-signinwithotp", - "title": "signInWithOtp", - "type": "function", - }, - "auth-signinwithpasskey": { - "id": "auth-signinwithpasskey", - "product": "auth", - "slug": "auth-signinwithpasskey", - "title": "signInWithPasskey", - "type": "function", - }, - "auth-signinwithpassword": { - "id": "auth-signinwithpassword", - "product": "auth", - "slug": "auth-signinwithpassword", - "title": "signInWithPassword", - "type": "function", - }, - "auth-signinwithsso": { - "id": "auth-signinwithsso", - "product": "auth", - "slug": "auth-signinwithsso", - "title": "signInWithSSO", - "type": "function", - }, - "auth-signinwithweb3": { - "id": "auth-signinwithweb3", - "product": "auth", - "slug": "auth-signinwithweb3", - "title": "signInWithWeb3", - "type": "function", - }, - "auth-signout": { - "id": "auth-signout", - "product": "auth", - "slug": "auth-signout", - "title": "signOut", - "type": "function", - }, - "auth-signup": { - "id": "auth-signup", - "product": "auth", - "slug": "auth-signup", - "title": "signUp", - "type": "function", - }, - "auth-startautorefresh": { - "id": "auth-startautorefresh", - "product": "auth", - "slug": "auth-startautorefresh", - "title": "startAutoRefresh", - "type": "function", - }, - "auth-stopautorefresh": { - "id": "auth-stopautorefresh", - "product": "auth", - "slug": "auth-stopautorefresh", - "title": "stopAutoRefresh", - "type": "function", - }, - "auth-unlinkidentity": { - "id": "auth-unlinkidentity", - "product": "auth", - "slug": "auth-unlinkidentity", - "title": "unlinkIdentity", - "type": "function", - }, - "auth-updateuser": { - "id": "auth-updateuser", - "product": "auth", - "slug": "auth-updateuser", - "title": "updateUser", - "type": "function", - }, - "auth-verifyotp": { - "id": "auth-verifyotp", - "product": "auth", - "slug": "auth-verifyotp", - "title": "verifyOtp", - "type": "function", - }, - "channel": { - "id": "channel", - "product": "realtime", - "slug": "channel", - "title": "channel", - "type": "function", - }, - "connect": { - "id": "connect", - "product": "realtime", - "slug": "connect", - "title": "connect", - "type": "function", - }, - "connectionstate": { - "id": "connectionstate", - "product": "realtime", - "slug": "connectionstate", - "title": "connectionState", - "type": "function", - }, - "database": { - "title": "Database", - "type": "category", - }, - "delete": { - "id": "delete", - "product": "database", - "slug": "delete", - "title": "delete", - "type": "function", - }, - "disconnect": { - "id": "disconnect", - "product": "realtime", - "slug": "disconnect", - "title": "disconnect", - "type": "function", - }, - "endpointurl": { - "id": "endpointurl", - "product": "realtime", - "slug": "endpointurl", - "title": "endpointURL", - "type": "function", - }, - "file-buckets": { - "id": "file-buckets", - "slug": "file-buckets", - "title": "File Buckets", - "type": "function", - }, - "file-buckets-copy": { - "id": "file-buckets-copy", - "product": "storage", - "slug": "file-buckets-copy", - "title": "copy", - "type": "function", - }, - "file-buckets-createbucket": { - "id": "file-buckets-createbucket", - "product": "storage", - "slug": "file-buckets-createbucket", - "title": "createBucket", - "type": "function", - }, - "file-buckets-createsigneduploadurl": { - "id": "file-buckets-createsigneduploadurl", - "product": "storage", - "slug": "file-buckets-createsigneduploadurl", - "title": "createSignedUploadUrl", - "type": "function", - }, - "file-buckets-createsignedurl": { - "id": "file-buckets-createsignedurl", - "product": "storage", - "slug": "file-buckets-createsignedurl", - "title": "createSignedUrl", - "type": "function", - }, - "file-buckets-createsignedurls": { - "id": "file-buckets-createsignedurls", - "product": "storage", - "slug": "file-buckets-createsignedurls", - "title": "createSignedUrls", - "type": "function", - }, - "file-buckets-deletebucket": { - "id": "file-buckets-deletebucket", - "product": "storage", - "slug": "file-buckets-deletebucket", - "title": "deleteBucket", - "type": "function", - }, - "file-buckets-download": { - "id": "file-buckets-download", - "product": "storage", - "slug": "file-buckets-download", - "title": "download", - "type": "function", - }, - "file-buckets-emptybucket": { - "id": "file-buckets-emptybucket", - "product": "storage", - "slug": "file-buckets-emptybucket", - "title": "emptyBucket", - "type": "function", - }, - "file-buckets-exists": { - "id": "file-buckets-exists", - "product": "storage", - "slug": "file-buckets-exists", - "title": "exists", - "type": "function", - }, - "file-buckets-from": { - "id": "file-buckets-from", - "product": "storage", - "slug": "file-buckets-from", - "title": "from", - "type": "function", - }, - "file-buckets-getbucket": { - "id": "file-buckets-getbucket", - "product": "storage", - "slug": "file-buckets-getbucket", - "title": "getBucket", - "type": "function", - }, - "file-buckets-getpublicurl": { - "id": "file-buckets-getpublicurl", - "product": "storage", - "slug": "file-buckets-getpublicurl", - "title": "getPublicUrl", - "type": "function", - }, - "file-buckets-info": { - "id": "file-buckets-info", - "product": "storage", - "slug": "file-buckets-info", - "title": "info", - "type": "function", - }, - "file-buckets-list": { - "id": "file-buckets-list", - "product": "storage", - "slug": "file-buckets-list", - "title": "list", - "type": "function", - }, - "file-buckets-listbuckets": { - "id": "file-buckets-listbuckets", - "product": "storage", - "slug": "file-buckets-listbuckets", - "title": "listBuckets", - "type": "function", - }, - "file-buckets-listv2": { - "id": "file-buckets-listv2", - "product": "storage", - "slug": "file-buckets-listv2", - "title": "listV2", - "type": "function", - }, - "file-buckets-move": { - "id": "file-buckets-move", - "product": "storage", - "slug": "file-buckets-move", - "title": "move", - "type": "function", - }, - "file-buckets-remove": { - "id": "file-buckets-remove", - "product": "storage", - "slug": "file-buckets-remove", - "title": "remove", - "type": "function", - }, - "file-buckets-update": { - "id": "file-buckets-update", - "product": "storage", - "slug": "file-buckets-update", - "title": "update", - "type": "function", - }, - "file-buckets-updatebucket": { - "id": "file-buckets-updatebucket", - "product": "storage", - "slug": "file-buckets-updatebucket", - "title": "updateBucket", - "type": "function", - }, - "file-buckets-upload": { - "id": "file-buckets-upload", - "product": "storage", - "slug": "file-buckets-upload", - "title": "upload", - "type": "function", - }, - "file-buckets-uploadtosignedurl": { - "id": "file-buckets-uploadtosignedurl", - "product": "storage", - "slug": "file-buckets-uploadtosignedurl", - "title": "uploadToSignedUrl", - "type": "function", - }, - "from": { - "id": "from", - "product": "database", - "slug": "from", - "title": "from", - "type": "function", - }, - "functions": { - "title": "Edge Functions", - "type": "category", - }, - "functions-corsheaders": { - "id": "functions-corsheaders", - "product": "edge-functions", - "slug": "functions-corsheaders", - "title": "corsHeaders", - "type": "function", - }, - "functions-invoke": { - "id": "functions-invoke", - "product": "edge-functions", - "slug": "functions-invoke", - "title": "invoke", - "type": "function", - }, - "functions-setauth": { - "id": "functions-setauth", - "product": "edge-functions", - "slug": "functions-setauth", - "title": "setAuth", - "type": "function", - }, - "geojson": { - "id": "geojson", - "product": "database", - "slug": "geojson", - "title": "geojson", - "type": "function", - }, - "getchannels": { - "id": "getchannels", - "product": "realtime", - "slug": "getchannels", - "title": "getChannels", - "type": "function", - }, - "getwebsocketconstructor": { - "id": "getwebsocketconstructor", - "product": "realtime", - "slug": "getwebsocketconstructor", - "title": "getWebSocketConstructor", - "type": "function", - }, - "httpsend": { - "id": "httpsend", - "product": "realtime", - "slug": "httpsend", - "title": "httpSend", - "type": "function", - }, - "initializing": { - "id": "initializing", - "slug": "initializing", - "title": "Initializing", - "type": "function", - }, - "insert": { - "id": "insert", - "product": "database", - "slug": "insert", - "title": "insert", - "type": "function", - }, - "installing": { - "id": "installing", - "slug": "installing", - "title": "Installing", - "type": "markdown", - }, - "introduction": { - "id": "introduction", - "slug": "introduction", - "title": "Introduction", - "type": "markdown", - }, - "isconnected": { - "id": "isconnected", - "product": "realtime", - "slug": "isconnected", - "title": "isConnected", - "type": "function", - }, - "isconnecting": { - "id": "isconnecting", - "product": "realtime", - "slug": "isconnecting", - "title": "isConnecting", - "type": "function", - }, - "isdisconnecting": { - "id": "isdisconnecting", - "product": "realtime", - "slug": "isdisconnecting", - "title": "isDisconnecting", - "type": "function", - }, - "iswebsocketsupported": { - "id": "iswebsocketsupported", - "product": "realtime", - "slug": "iswebsocketsupported", - "title": "isWebSocketSupported", - "type": "function", - }, - "log": { - "id": "log", - "product": "realtime", - "slug": "log", - "title": "log", - "type": "function", - }, - "maxaffected": { - "id": "maxaffected", - "product": "database", - "slug": "maxaffected", - "title": "maxAffected", - "type": "function", - }, - "oauth-admin": { - "id": "oauth-admin", - "slug": "oauth-admin", - "title": "OAuth Admin", - "type": "function", - }, - "oauth-admin-createclient": { - "id": "oauth-admin-createclient", - "product": "auth", - "slug": "oauth-admin-createclient", - "title": "createClient", - "type": "function", - }, - "oauth-admin-deleteclient": { - "id": "oauth-admin-deleteclient", - "product": "auth", - "slug": "oauth-admin-deleteclient", - "title": "deleteClient", - "type": "function", - }, - "oauth-admin-getclient": { - "id": "oauth-admin-getclient", - "product": "auth", - "slug": "oauth-admin-getclient", - "title": "getClient", - "type": "function", - }, - "oauth-admin-listclients": { - "id": "oauth-admin-listclients", - "product": "auth", - "slug": "oauth-admin-listclients", - "title": "listClients", - "type": "function", - }, - "oauth-admin-regenerateclientsecret": { - "id": "oauth-admin-regenerateclientsecret", - "product": "auth", - "slug": "oauth-admin-regenerateclientsecret", - "title": "regenerateClientSecret", - "type": "function", - }, - "oauth-admin-updateclient": { - "id": "oauth-admin-updateclient", - "product": "auth", - "slug": "oauth-admin-updateclient", - "title": "updateClient", - "type": "function", - }, - "oauth-server": { - "id": "oauth-server", - "slug": "oauth-server", - "title": "OAuth Server", - "type": "function", - }, - "oauth-server-approveauthorization": { - "id": "oauth-server-approveauthorization", - "product": "auth", - "slug": "oauth-server-approveauthorization", - "title": "approveAuthorization", - "type": "function", - }, - "oauth-server-denyauthorization": { - "id": "oauth-server-denyauthorization", - "product": "auth", - "slug": "oauth-server-denyauthorization", - "title": "denyAuthorization", - "type": "function", - }, - "oauth-server-getauthorizationdetails": { - "id": "oauth-server-getauthorizationdetails", - "product": "auth", - "slug": "oauth-server-getauthorizationdetails", - "title": "getAuthorizationDetails", - "type": "function", - }, - "oauth-server-listgrants": { - "id": "oauth-server-listgrants", - "product": "auth", - "slug": "oauth-server-listgrants", - "title": "listGrants", - "type": "function", - }, - "oauth-server-revokegrant": { - "id": "oauth-server-revokegrant", - "product": "auth", - "slug": "oauth-server-revokegrant", - "title": "revokeGrant", - "type": "function", - }, - "on": { - "id": "on", - "product": "realtime", - "slug": "on", - "title": "on", - "type": "function", - }, - "onheartbeat": { - "id": "onheartbeat", - "product": "realtime", - "slug": "onheartbeat", - "title": "onHeartbeat", - "type": "function", - }, - "passkey-admin": { - "id": "passkey-admin", - "slug": "passkey-admin", - "title": "Passkey admin", - "type": "function", - }, - "passkey-admin-deletepasskey": { - "id": "passkey-admin-deletepasskey", - "product": "auth", - "slug": "passkey-admin-deletepasskey", - "title": "deletePasskey", - "type": "function", - }, - "passkey-admin-listpasskeys": { - "id": "passkey-admin-listpasskeys", - "product": "auth", - "slug": "passkey-admin-listpasskeys", - "title": "listPasskeys", - "type": "function", - }, - "presencestate": { - "id": "presencestate", - "product": "realtime", - "slug": "presencestate", - "title": "presenceState", - "type": "function", - }, - "push": { - "id": "push", - "product": "realtime", - "slug": "push", - "title": "push", - "type": "function", - }, - "realtime": { - "title": "Realtime", - "type": "category", - }, - "removeallchannels": { - "id": "removeallchannels", - "product": "realtime", - "slug": "removeallchannels", - "title": "removeAllChannels", - "type": "function", - }, - "removechannel": { - "id": "removechannel", - "product": "realtime", - "slug": "removechannel", - "title": "removeChannel", - "type": "function", - }, - "retry": { - "id": "retry", - "product": "database", - "slug": "retry", - "title": "retry", - "type": "function", - }, - "returns": { - "id": "returns", - "product": "database", - "slug": "returns", - "title": "returns", - "type": "function", - }, - "rollback": { - "id": "rollback", - "product": "database", - "slug": "rollback", - "title": "rollback", - "type": "function", - }, - "rpc": { - "id": "rpc", - "product": "database", - "slug": "rpc", - "title": "rpc", - "type": "function", - }, - "schema": { - "id": "schema", - "product": "database", - "slug": "schema", - "title": "schema", - "type": "function", - }, - "select": { - "id": "select", - "product": "database", - "slug": "select", - "title": "select", - "type": "function", - }, - "send": { - "id": "send", - "product": "realtime", - "slug": "send", - "title": "send", - "type": "function", - }, - "sendheartbeat": { - "id": "sendheartbeat", - "product": "realtime", - "slug": "sendheartbeat", - "title": "sendHeartbeat", - "type": "function", - }, - "setauth": { - "id": "setauth", - "product": "realtime", - "slug": "setauth", - "title": "setAuth", - "type": "function", - }, - "setheader": { - "id": "setheader", - "product": "database", - "slug": "setheader", - "title": "setHeader", - "type": "function", - }, - "storage": { - "title": "Storage", - "type": "category", - }, - "subscribe": { - "id": "subscribe", - "product": "realtime", - "slug": "subscribe", - "title": "subscribe", - "type": "function", - }, - "teardown": { - "id": "teardown", - "product": "realtime", - "slug": "teardown", - "title": "teardown", - "type": "function", - }, - "throwonerror": { - "id": "throwonerror", - "product": "database", - "slug": "throwonerror", - "title": "throwOnError", - "type": "function", - }, - "track": { - "id": "track", - "product": "realtime", - "slug": "track", - "title": "track", - "type": "function", - }, - "typescript-support": { - "id": "typescript-support", - "slug": "typescript-support", - "title": "TypeScript support", - "type": "markdown", - }, - "unsubscribe": { - "id": "unsubscribe", - "product": "realtime", - "slug": "unsubscribe", - "title": "unsubscribe", - "type": "function", - }, - "untrack": { - "id": "untrack", - "product": "realtime", - "slug": "untrack", - "title": "untrack", - "type": "function", - }, - "update": { - "id": "update", - "product": "database", - "slug": "update", - "title": "update", - "type": "function", - }, - "updatejoinpayload": { - "id": "updatejoinpayload", - "product": "realtime", - "slug": "updatejoinpayload", - "title": "updateJoinPayload", - "type": "function", - }, - "upsert": { - "id": "upsert", - "product": "database", - "slug": "upsert", - "title": "upsert", - "type": "function", - }, - "using-filters": { - "id": "using-filters", - "slug": "using-filters", - "title": "Using Filters", - "type": "function", - }, - "using-filters-containedby": { - "id": "using-filters-containedby", - "product": "database", - "slug": "using-filters-containedby", - "title": "containedBy", - "type": "function", - }, - "using-filters-contains": { - "id": "using-filters-contains", - "product": "database", - "slug": "using-filters-contains", - "title": "contains", - "type": "function", - }, - "using-filters-eq": { - "id": "using-filters-eq", - "product": "database", - "slug": "using-filters-eq", - "title": "eq", - "type": "function", - }, - "using-filters-filter": { - "id": "using-filters-filter", - "product": "database", - "slug": "using-filters-filter", - "title": "filter", - "type": "function", - }, - "using-filters-gt": { - "id": "using-filters-gt", - "product": "database", - "slug": "using-filters-gt", - "title": "gt", - "type": "function", - }, - "using-filters-gte": { - "id": "using-filters-gte", - "product": "database", - "slug": "using-filters-gte", - "title": "gte", - "type": "function", - }, - "using-filters-ilike": { - "id": "using-filters-ilike", - "product": "database", - "slug": "using-filters-ilike", - "title": "ilike", - "type": "function", - }, - "using-filters-ilikeallof": { - "id": "using-filters-ilikeallof", - "product": "database", - "slug": "using-filters-ilikeallof", - "title": "ilikeAllOf", - "type": "function", - }, - "using-filters-ilikeanyof": { - "id": "using-filters-ilikeanyof", - "product": "database", - "slug": "using-filters-ilikeanyof", - "title": "ilikeAnyOf", - "type": "function", - }, - "using-filters-in": { - "id": "using-filters-in", - "product": "database", - "slug": "using-filters-in", - "title": "in", - "type": "function", - }, - "using-filters-is": { - "id": "using-filters-is", - "product": "database", - "slug": "using-filters-is", - "title": "is", - "type": "function", - }, - "using-filters-like": { - "id": "using-filters-like", - "product": "database", - "slug": "using-filters-like", - "title": "like", - "type": "function", - }, - "using-filters-likeallof": { - "id": "using-filters-likeallof", - "product": "database", - "slug": "using-filters-likeallof", - "title": "likeAllOf", - "type": "function", - }, - "using-filters-likeanyof": { - "id": "using-filters-likeanyof", - "product": "database", - "slug": "using-filters-likeanyof", - "title": "likeAnyOf", - "type": "function", - }, - "using-filters-lt": { - "id": "using-filters-lt", - "product": "database", - "slug": "using-filters-lt", - "title": "lt", - "type": "function", - }, - "using-filters-lte": { - "id": "using-filters-lte", - "product": "database", - "slug": "using-filters-lte", - "title": "lte", - "type": "function", - }, - "using-filters-match": { - "id": "using-filters-match", - "product": "database", - "slug": "using-filters-match", - "title": "match", - "type": "function", - }, - "using-filters-neq": { - "id": "using-filters-neq", - "product": "database", - "slug": "using-filters-neq", - "title": "neq", - "type": "function", - }, - "using-filters-not": { - "id": "using-filters-not", - "product": "database", - "slug": "using-filters-not", - "title": "not", - "type": "function", - }, - "using-filters-or": { - "id": "using-filters-or", - "product": "database", - "slug": "using-filters-or", - "title": "or", - "type": "function", - }, - "using-filters-overlaps": { - "id": "using-filters-overlaps", - "product": "database", - "slug": "using-filters-overlaps", - "title": "overlaps", - "type": "function", - }, - "using-filters-rangeadjacent": { - "id": "using-filters-rangeadjacent", - "product": "database", - "slug": "using-filters-rangeadjacent", - "title": "rangeAdjacent", - "type": "function", - }, - "using-filters-rangegt": { - "id": "using-filters-rangegt", - "product": "database", - "slug": "using-filters-rangegt", - "title": "rangeGt", - "type": "function", - }, - "using-filters-rangegte": { - "id": "using-filters-rangegte", - "product": "database", - "slug": "using-filters-rangegte", - "title": "rangeGte", - "type": "function", - }, - "using-filters-rangelt": { - "id": "using-filters-rangelt", - "product": "database", - "slug": "using-filters-rangelt", - "title": "rangeLt", - "type": "function", - }, - "using-filters-rangelte": { - "id": "using-filters-rangelte", - "product": "database", - "slug": "using-filters-rangelte", - "title": "rangeLte", - "type": "function", - }, - "using-filters-textsearch": { - "id": "using-filters-textsearch", - "product": "database", - "slug": "using-filters-textsearch", - "title": "textSearch", - "type": "function", - }, - "using-modifiers": { - "id": "using-modifiers", - "slug": "using-modifiers", - "title": "Using modifiers", - "type": "function", - }, - "using-modifiers-abortsignal": { - "id": "using-modifiers-abortsignal", - "product": "database", - "slug": "using-modifiers-abortsignal", - "title": "abortSignal", - "type": "function", - }, - "using-modifiers-csv": { - "id": "using-modifiers-csv", - "product": "database", - "slug": "using-modifiers-csv", - "title": "csv", - "type": "function", - }, - "using-modifiers-explain": { - "id": "using-modifiers-explain", - "product": "database", - "slug": "using-modifiers-explain", - "title": "explain", - "type": "function", - }, - "using-modifiers-limit": { - "id": "using-modifiers-limit", - "product": "database", - "slug": "using-modifiers-limit", - "title": "limit", - "type": "function", - }, - "using-modifiers-maybesingle": { - "id": "using-modifiers-maybesingle", - "product": "database", - "slug": "using-modifiers-maybesingle", - "title": "maybeSingle", - "type": "function", - }, - "using-modifiers-order": { - "id": "using-modifiers-order", - "product": "database", - "slug": "using-modifiers-order", - "title": "order", - "type": "function", - }, - "using-modifiers-overridetypes": { - "id": "using-modifiers-overridetypes", - "product": "database", - "slug": "using-modifiers-overridetypes", - "title": "overrideTypes", - "type": "function", - }, - "using-modifiers-range": { - "id": "using-modifiers-range", - "product": "database", - "slug": "using-modifiers-range", - "title": "range", - "type": "function", - }, - "using-modifiers-returns": { - "id": "using-modifiers-returns", - "product": "database", - "slug": "using-modifiers-returns", - "title": "returns", - "type": "function", - }, - "using-modifiers-select": { - "id": "using-modifiers-select", - "product": "database", - "slug": "using-modifiers-select", - "title": "select", - "type": "function", - }, - "using-modifiers-single": { - "id": "using-modifiers-single", - "product": "database", - "slug": "using-modifiers-single", - "title": "single", - "type": "function", - }, - "using-modifiers-stripnulls": { - "id": "using-modifiers-stripnulls", - "product": "database", - "slug": "using-modifiers-stripnulls", - "title": "stripNulls", - "type": "function", - }, - "vector-buckets": { - "id": "vector-buckets", - "slug": "vector-buckets", - "title": "Vector Buckets", - "type": "function", - }, - "vector-buckets-createbucket": { - "id": "vector-buckets-createbucket", - "product": "storage", - "slug": "vector-buckets-createbucket", - "title": "createBucket", - "type": "function", - }, - "vector-buckets-createindex": { - "id": "vector-buckets-createindex", - "product": "storage", - "slug": "vector-buckets-createindex", - "title": "createIndex", - "type": "function", - }, - "vector-buckets-deletebucket": { - "id": "vector-buckets-deletebucket", - "product": "storage", - "slug": "vector-buckets-deletebucket", - "title": "deleteBucket", - "type": "function", - }, - "vector-buckets-deleteindex": { - "id": "vector-buckets-deleteindex", - "product": "storage", - "slug": "vector-buckets-deleteindex", - "title": "deleteIndex", - "type": "function", - }, - "vector-buckets-deletevectors": { - "id": "vector-buckets-deletevectors", - "product": "storage", - "slug": "vector-buckets-deletevectors", - "title": "deleteVectors", - "type": "function", - }, - "vector-buckets-from": { - "id": "vector-buckets-from", - "product": "storage", - "slug": "vector-buckets-from", - "title": "from", - "type": "function", - }, - "vector-buckets-getbucket": { - "id": "vector-buckets-getbucket", - "product": "storage", - "slug": "vector-buckets-getbucket", - "title": "getBucket", - "type": "function", - }, - "vector-buckets-getindex": { - "id": "vector-buckets-getindex", - "product": "storage", - "slug": "vector-buckets-getindex", - "title": "getIndex", - "type": "function", - }, - "vector-buckets-getvectors": { - "id": "vector-buckets-getvectors", - "product": "storage", - "slug": "vector-buckets-getvectors", - "title": "getVectors", - "type": "function", - }, - "vector-buckets-index": { - "id": "vector-buckets-index", - "product": "storage", - "slug": "vector-buckets-index", - "title": "index", - "type": "function", - }, - "vector-buckets-listbuckets": { - "id": "vector-buckets-listbuckets", - "product": "storage", - "slug": "vector-buckets-listbuckets", - "title": "listBuckets", - "type": "function", - }, - "vector-buckets-listindexes": { - "id": "vector-buckets-listindexes", - "product": "storage", - "slug": "vector-buckets-listindexes", - "title": "listIndexes", - "type": "function", - }, - "vector-buckets-listvectors": { - "id": "vector-buckets-listvectors", - "product": "storage", - "slug": "vector-buckets-listvectors", - "title": "listVectors", - "type": "function", - }, - "vector-buckets-putvectors": { - "id": "vector-buckets-putvectors", - "product": "storage", - "slug": "vector-buckets-putvectors", - "title": "putVectors", - "type": "function", - }, - "vector-buckets-queryvectors": { - "id": "vector-buckets-queryvectors", - "product": "storage", - "slug": "vector-buckets-queryvectors", - "title": "queryVectors", - "type": "function", - }, - }, - "flat": [ - { - "id": "introduction", - "slug": "introduction", - "title": "Introduction", - "type": "markdown", - }, - { - "id": "installing", - "slug": "installing", - "title": "Installing", - "type": "markdown", - }, - { - "id": "initializing", - "slug": "initializing", - "title": "Initializing", - "type": "function", - }, - { - "id": "typescript-support", - "slug": "typescript-support", - "title": "TypeScript support", - "type": "markdown", - }, - { - "title": "Database", - "type": "category", - }, - { - "id": "delete", - "product": "database", - "slug": "delete", - "title": "delete", - "type": "function", - }, - { - "id": "from", - "product": "database", - "slug": "from", - "title": "from", - "type": "function", - }, - { - "id": "geojson", - "product": "database", - "slug": "geojson", - "title": "geojson", - "type": "function", - }, - { - "id": "insert", - "product": "database", - "slug": "insert", - "title": "insert", - "type": "function", - }, - { - "id": "maxaffected", - "product": "database", - "slug": "maxaffected", - "title": "maxAffected", - "type": "function", - }, - { - "id": "retry", - "product": "database", - "slug": "retry", - "title": "retry", - "type": "function", - }, - { - "id": "returns", - "product": "database", - "slug": "returns", - "title": "returns", - "type": "function", - }, - { - "id": "rollback", - "product": "database", - "slug": "rollback", - "title": "rollback", - "type": "function", - }, - { - "id": "rpc", - "product": "database", - "slug": "rpc", - "title": "rpc", - "type": "function", - }, - { - "id": "schema", - "product": "database", - "slug": "schema", - "title": "schema", - "type": "function", - }, - { - "id": "select", - "product": "database", - "slug": "select", - "title": "select", - "type": "function", - }, - { - "id": "setheader", - "product": "database", - "slug": "setheader", - "title": "setHeader", - "type": "function", - }, - { - "id": "throwonerror", - "product": "database", - "slug": "throwonerror", - "title": "throwOnError", - "type": "function", - }, - { - "id": "update", - "product": "database", - "slug": "update", - "title": "update", - "type": "function", - }, - { - "id": "upsert", - "product": "database", - "slug": "upsert", - "title": "upsert", - "type": "function", - }, - { - "id": "using-filters", - "slug": "using-filters", - "title": "Using Filters", - "type": "function", - }, - { - "id": "using-filters-containedby", - "product": "database", - "slug": "using-filters-containedby", - "title": "containedBy", - "type": "function", - }, - { - "id": "using-filters-contains", - "product": "database", - "slug": "using-filters-contains", - "title": "contains", - "type": "function", - }, - { - "id": "using-filters-eq", - "product": "database", - "slug": "using-filters-eq", - "title": "eq", - "type": "function", - }, - { - "id": "using-filters-filter", - "product": "database", - "slug": "using-filters-filter", - "title": "filter", - "type": "function", - }, - { - "id": "using-filters-gt", - "product": "database", - "slug": "using-filters-gt", - "title": "gt", - "type": "function", - }, - { - "id": "using-filters-gte", - "product": "database", - "slug": "using-filters-gte", - "title": "gte", - "type": "function", - }, - { - "id": "using-filters-ilike", - "product": "database", - "slug": "using-filters-ilike", - "title": "ilike", - "type": "function", - }, - { - "id": "using-filters-ilikeallof", - "product": "database", - "slug": "using-filters-ilikeallof", - "title": "ilikeAllOf", - "type": "function", - }, - { - "id": "using-filters-ilikeanyof", - "product": "database", - "slug": "using-filters-ilikeanyof", - "title": "ilikeAnyOf", - "type": "function", - }, - { - "id": "using-filters-in", - "product": "database", - "slug": "using-filters-in", - "title": "in", - "type": "function", - }, - { - "id": "using-filters-is", - "product": "database", - "slug": "using-filters-is", - "title": "is", - "type": "function", - }, - { - "id": "using-filters-like", - "product": "database", - "slug": "using-filters-like", - "title": "like", - "type": "function", - }, - { - "id": "using-filters-likeallof", - "product": "database", - "slug": "using-filters-likeallof", - "title": "likeAllOf", - "type": "function", - }, - { - "id": "using-filters-likeanyof", - "product": "database", - "slug": "using-filters-likeanyof", - "title": "likeAnyOf", - "type": "function", - }, - { - "id": "using-filters-lt", - "product": "database", - "slug": "using-filters-lt", - "title": "lt", - "type": "function", - }, - { - "id": "using-filters-lte", - "product": "database", - "slug": "using-filters-lte", - "title": "lte", - "type": "function", - }, - { - "id": "using-filters-match", - "product": "database", - "slug": "using-filters-match", - "title": "match", - "type": "function", - }, - { - "id": "using-filters-neq", - "product": "database", - "slug": "using-filters-neq", - "title": "neq", - "type": "function", - }, - { - "id": "using-filters-not", - "product": "database", - "slug": "using-filters-not", - "title": "not", - "type": "function", - }, - { - "id": "using-filters-or", - "product": "database", - "slug": "using-filters-or", - "title": "or", - "type": "function", - }, - { - "id": "using-filters-overlaps", - "product": "database", - "slug": "using-filters-overlaps", - "title": "overlaps", - "type": "function", - }, - { - "id": "using-filters-rangeadjacent", - "product": "database", - "slug": "using-filters-rangeadjacent", - "title": "rangeAdjacent", - "type": "function", - }, - { - "id": "using-filters-rangegt", - "product": "database", - "slug": "using-filters-rangegt", - "title": "rangeGt", - "type": "function", - }, - { - "id": "using-filters-rangegte", - "product": "database", - "slug": "using-filters-rangegte", - "title": "rangeGte", - "type": "function", - }, - { - "id": "using-filters-rangelt", - "product": "database", - "slug": "using-filters-rangelt", - "title": "rangeLt", - "type": "function", - }, - { - "id": "using-filters-rangelte", - "product": "database", - "slug": "using-filters-rangelte", - "title": "rangeLte", - "type": "function", - }, - { - "id": "using-filters-textsearch", - "product": "database", - "slug": "using-filters-textsearch", - "title": "textSearch", - "type": "function", - }, - { - "id": "using-modifiers", - "slug": "using-modifiers", - "title": "Using modifiers", - "type": "function", - }, - { - "id": "using-modifiers-abortsignal", - "product": "database", - "slug": "using-modifiers-abortsignal", - "title": "abortSignal", - "type": "function", - }, - { - "id": "using-modifiers-csv", - "product": "database", - "slug": "using-modifiers-csv", - "title": "csv", - "type": "function", - }, - { - "id": "using-modifiers-explain", - "product": "database", - "slug": "using-modifiers-explain", - "title": "explain", - "type": "function", - }, - { - "id": "using-modifiers-limit", - "product": "database", - "slug": "using-modifiers-limit", - "title": "limit", - "type": "function", - }, - { - "id": "using-modifiers-maybesingle", - "product": "database", - "slug": "using-modifiers-maybesingle", - "title": "maybeSingle", - "type": "function", - }, - { - "id": "using-modifiers-order", - "product": "database", - "slug": "using-modifiers-order", - "title": "order", - "type": "function", - }, - { - "id": "using-modifiers-overridetypes", - "product": "database", - "slug": "using-modifiers-overridetypes", - "title": "overrideTypes", - "type": "function", - }, - { - "id": "using-modifiers-range", - "product": "database", - "slug": "using-modifiers-range", - "title": "range", - "type": "function", - }, - { - "id": "using-modifiers-returns", - "product": "database", - "slug": "using-modifiers-returns", - "title": "returns", - "type": "function", - }, - { - "id": "using-modifiers-select", - "product": "database", - "slug": "using-modifiers-select", - "title": "select", - "type": "function", - }, - { - "id": "using-modifiers-single", - "product": "database", - "slug": "using-modifiers-single", - "title": "single", - "type": "function", - }, - { - "id": "using-modifiers-stripnulls", - "product": "database", - "slug": "using-modifiers-stripnulls", - "title": "stripNulls", - "type": "function", - }, - { - "id": "auth", - "slug": "auth", - "title": "Overview", - "type": "function", - }, - { - "id": "auth-dispose", - "product": "auth", - "slug": "auth-dispose", - "title": "dispose", - "type": "function", - }, - { - "id": "auth-exchangecodeforsession", - "product": "auth", - "slug": "auth-exchangecodeforsession", - "title": "exchangeCodeForSession", - "type": "function", - }, - { - "id": "auth-getclaims", - "product": "auth", - "slug": "auth-getclaims", - "title": "getClaims", - "type": "function", - }, - { - "id": "auth-getsession", - "product": "auth", - "slug": "auth-getsession", - "title": "getSession", - "type": "function", - }, - { - "id": "auth-getuser", - "product": "auth", - "slug": "auth-getuser", - "title": "getUser", - "type": "function", - }, - { - "id": "auth-getuseridentities", - "product": "auth", - "slug": "auth-getuseridentities", - "title": "getUserIdentities", - "type": "function", - }, - { - "id": "auth-initialize", - "product": "auth", - "slug": "auth-initialize", - "title": "initialize", - "type": "function", - }, - { - "id": "auth-linkidentity", - "product": "auth", - "slug": "auth-linkidentity", - "title": "linkIdentity", - "type": "function", - }, - { - "id": "auth-onauthstatechange", - "product": "auth", - "slug": "auth-onauthstatechange", - "title": "onAuthStateChange", - "type": "function", - }, - { - "id": "auth-reauthenticate", - "product": "auth", - "slug": "auth-reauthenticate", - "title": "reauthenticate", - "type": "function", - }, - { - "id": "auth-refreshsession", - "product": "auth", - "slug": "auth-refreshsession", - "title": "refreshSession", - "type": "function", - }, - { - "id": "auth-registerpasskey", - "product": "auth", - "slug": "auth-registerpasskey", - "title": "registerPasskey", - "type": "function", - }, - { - "id": "auth-resend", - "product": "auth", - "slug": "auth-resend", - "title": "resend", - "type": "function", - }, - { - "id": "auth-resetpasswordforemail", - "product": "auth", - "slug": "auth-resetpasswordforemail", - "title": "resetPasswordForEmail", - "type": "function", - }, - { - "id": "auth-setsession", - "product": "auth", - "slug": "auth-setsession", - "title": "setSession", - "type": "function", - }, - { - "id": "auth-signinanonymously", - "product": "auth", - "slug": "auth-signinanonymously", - "title": "signInAnonymously", - "type": "function", - }, - { - "id": "auth-signinwithidtoken", - "product": "auth", - "slug": "auth-signinwithidtoken", - "title": "signInWithIdToken", - "type": "function", - }, - { - "id": "auth-signinwithoauth", - "product": "auth", - "slug": "auth-signinwithoauth", - "title": "signInWithOAuth", - "type": "function", - }, - { - "id": "auth-signinwithotp", - "product": "auth", - "slug": "auth-signinwithotp", - "title": "signInWithOtp", - "type": "function", - }, - { - "id": "auth-signinwithpasskey", - "product": "auth", - "slug": "auth-signinwithpasskey", - "title": "signInWithPasskey", - "type": "function", - }, - { - "id": "auth-signinwithpassword", - "product": "auth", - "slug": "auth-signinwithpassword", - "title": "signInWithPassword", - "type": "function", - }, - { - "id": "auth-signinwithsso", - "product": "auth", - "slug": "auth-signinwithsso", - "title": "signInWithSSO", - "type": "function", - }, - { - "id": "auth-signinwithweb3", - "product": "auth", - "slug": "auth-signinwithweb3", - "title": "signInWithWeb3", - "type": "function", - }, - { - "id": "auth-signout", - "product": "auth", - "slug": "auth-signout", - "title": "signOut", - "type": "function", - }, - { - "id": "auth-signup", - "product": "auth", - "slug": "auth-signup", - "title": "signUp", - "type": "function", - }, - { - "id": "auth-startautorefresh", - "product": "auth", - "slug": "auth-startautorefresh", - "title": "startAutoRefresh", - "type": "function", - }, - { - "id": "auth-stopautorefresh", - "product": "auth", - "slug": "auth-stopautorefresh", - "title": "stopAutoRefresh", - "type": "function", - }, - { - "id": "auth-unlinkidentity", - "product": "auth", - "slug": "auth-unlinkidentity", - "title": "unlinkIdentity", - "type": "function", - }, - { - "id": "auth-updateuser", - "product": "auth", - "slug": "auth-updateuser", - "title": "updateUser", - "type": "function", - }, - { - "id": "auth-verifyotp", - "product": "auth", - "slug": "auth-verifyotp", - "title": "verifyOtp", - "type": "function", - }, - { - "id": "auth-admin", - "slug": "auth-admin", - "title": "Overview", - "type": "function", - }, - { - "id": "auth-admin-createprovider", - "product": "auth", - "slug": "auth-admin-createprovider", - "title": "createProvider", - "type": "function", - }, - { - "id": "auth-admin-createuser", - "product": "auth", - "slug": "auth-admin-createuser", - "title": "createUser", - "type": "function", - }, - { - "id": "auth-admin-deletefactor", - "product": "auth", - "slug": "auth-admin-deletefactor", - "title": "deleteFactor", - "type": "function", - }, - { - "id": "auth-admin-deleteprovider", - "product": "auth", - "slug": "auth-admin-deleteprovider", - "title": "deleteProvider", - "type": "function", - }, - { - "id": "auth-admin-deleteuser", - "product": "auth", - "slug": "auth-admin-deleteuser", - "title": "deleteUser", - "type": "function", - }, - { - "id": "auth-admin-generatelink", - "product": "auth", - "slug": "auth-admin-generatelink", - "title": "generateLink", - "type": "function", - }, - { - "id": "auth-admin-getprovider", - "product": "auth", - "slug": "auth-admin-getprovider", - "title": "getProvider", - "type": "function", - }, - { - "id": "auth-admin-getuserbyid", - "product": "auth", - "slug": "auth-admin-getuserbyid", - "title": "getUserById", - "type": "function", - }, - { - "id": "auth-admin-inviteuserbyemail", - "product": "auth", - "slug": "auth-admin-inviteuserbyemail", - "title": "inviteUserByEmail", - "type": "function", - }, - { - "id": "auth-admin-listfactors", - "product": "auth", - "slug": "auth-admin-listfactors", - "title": "listFactors", - "type": "function", - }, - { - "id": "auth-admin-listproviders", - "product": "auth", - "slug": "auth-admin-listproviders", - "title": "listProviders", - "type": "function", - }, - { - "id": "auth-admin-listusers", - "product": "auth", - "slug": "auth-admin-listusers", - "title": "listUsers", - "type": "function", - }, - { - "id": "auth-admin-signout", - "product": "auth", - "slug": "auth-admin-signout", - "title": "signOut", - "type": "function", - }, - { - "id": "auth-admin-updateprovider", - "product": "auth", - "slug": "auth-admin-updateprovider", - "title": "updateProvider", - "type": "function", - }, - { - "id": "auth-admin-updateuserbyid", - "product": "auth", - "slug": "auth-admin-updateuserbyid", - "title": "updateUserById", - "type": "function", - }, - { - "id": "auth-mfa", - "slug": "auth-mfa", - "title": "Auth MFA", - "type": "function", - }, - { - "id": "auth-mfa-challenge", - "product": "auth", - "slug": "auth-mfa-challenge", - "title": "challenge", - "type": "function", - }, - { - "id": "auth-mfa-challengeandverify", - "product": "auth", - "slug": "auth-mfa-challengeandverify", - "title": "challengeAndVerify", - "type": "function", - }, - { - "id": "auth-mfa-enroll", - "product": "auth", - "slug": "auth-mfa-enroll", - "title": "enroll", - "type": "function", - }, - { - "id": "auth-mfa-getauthenticatorassurancelevel", - "product": "auth", - "slug": "auth-mfa-getauthenticatorassurancelevel", - "title": "getAuthenticatorAssuranceLevel", - "type": "function", - }, - { - "id": "auth-mfa-listfactors", - "product": "auth", - "slug": "auth-mfa-listfactors", - "title": "listFactors", - "type": "function", - }, - { - "id": "auth-mfa-unenroll", - "product": "auth", - "slug": "auth-mfa-unenroll", - "title": "unenroll", - "type": "function", - }, - { - "id": "auth-mfa-verify", - "product": "auth", - "slug": "auth-mfa-verify", - "title": "verify", - "type": "function", - }, - { - "id": "auth-passkey", - "slug": "auth-passkey", - "title": "Auth Passkey", - "type": "function", - }, - { - "id": "auth-passkey-delete", - "product": "auth", - "slug": "auth-passkey-delete", - "title": "delete", - "type": "function", - }, - { - "id": "auth-passkey-list", - "product": "auth", - "slug": "auth-passkey-list", - "title": "list", - "type": "function", - }, - { - "id": "auth-passkey-startauthentication", - "product": "auth", - "slug": "auth-passkey-startauthentication", - "title": "startAuthentication", - "type": "function", - }, - { - "id": "auth-passkey-startregistration", - "product": "auth", - "slug": "auth-passkey-startregistration", - "title": "startRegistration", - "type": "function", - }, - { - "id": "auth-passkey-update", - "product": "auth", - "slug": "auth-passkey-update", - "title": "update", - "type": "function", - }, - { - "id": "auth-passkey-verifyauthentication", - "product": "auth", - "slug": "auth-passkey-verifyauthentication", - "title": "verifyAuthentication", - "type": "function", - }, - { - "id": "auth-passkey-verifyregistration", - "product": "auth", - "slug": "auth-passkey-verifyregistration", - "title": "verifyRegistration", - "type": "function", - }, - { - "id": "oauth-admin", - "slug": "oauth-admin", - "title": "OAuth Admin", - "type": "function", - }, - { - "id": "oauth-admin-createclient", - "product": "auth", - "slug": "oauth-admin-createclient", - "title": "createClient", - "type": "function", - }, - { - "id": "oauth-admin-deleteclient", - "product": "auth", - "slug": "oauth-admin-deleteclient", - "title": "deleteClient", - "type": "function", - }, - { - "id": "oauth-admin-getclient", - "product": "auth", - "slug": "oauth-admin-getclient", - "title": "getClient", - "type": "function", - }, - { - "id": "oauth-admin-listclients", - "product": "auth", - "slug": "oauth-admin-listclients", - "title": "listClients", - "type": "function", - }, - { - "id": "oauth-admin-regenerateclientsecret", - "product": "auth", - "slug": "oauth-admin-regenerateclientsecret", - "title": "regenerateClientSecret", - "type": "function", - }, - { - "id": "oauth-admin-updateclient", - "product": "auth", - "slug": "oauth-admin-updateclient", - "title": "updateClient", - "type": "function", - }, - { - "id": "oauth-server", - "slug": "oauth-server", - "title": "OAuth Server", - "type": "function", - }, - { - "id": "oauth-server-approveauthorization", - "product": "auth", - "slug": "oauth-server-approveauthorization", - "title": "approveAuthorization", - "type": "function", - }, - { - "id": "oauth-server-denyauthorization", - "product": "auth", - "slug": "oauth-server-denyauthorization", - "title": "denyAuthorization", - "type": "function", - }, - { - "id": "oauth-server-getauthorizationdetails", - "product": "auth", - "slug": "oauth-server-getauthorizationdetails", - "title": "getAuthorizationDetails", - "type": "function", - }, - { - "id": "oauth-server-listgrants", - "product": "auth", - "slug": "oauth-server-listgrants", - "title": "listGrants", - "type": "function", - }, - { - "id": "oauth-server-revokegrant", - "product": "auth", - "slug": "oauth-server-revokegrant", - "title": "revokeGrant", - "type": "function", - }, - { - "id": "passkey-admin", - "slug": "passkey-admin", - "title": "Passkey admin", - "type": "function", - }, - { - "id": "passkey-admin-deletepasskey", - "product": "auth", - "slug": "passkey-admin-deletepasskey", - "title": "deletePasskey", - "type": "function", - }, - { - "id": "passkey-admin-listpasskeys", - "product": "auth", - "slug": "passkey-admin-listpasskeys", - "title": "listPasskeys", - "type": "function", - }, - { - "title": "Edge Functions", - "type": "category", - }, - { - "id": "functions-corsheaders", - "product": "edge-functions", - "slug": "functions-corsheaders", - "title": "corsHeaders", - "type": "function", - }, - { - "id": "functions-invoke", - "product": "edge-functions", - "slug": "functions-invoke", - "title": "invoke", - "type": "function", - }, - { - "id": "functions-setauth", - "product": "edge-functions", - "slug": "functions-setauth", - "title": "setAuth", - "type": "function", - }, - { - "title": "Realtime", - "type": "category", - }, - { - "id": "channel", - "product": "realtime", - "slug": "channel", - "title": "channel", - "type": "function", - }, - { - "id": "connect", - "product": "realtime", - "slug": "connect", - "title": "connect", - "type": "function", - }, - { - "id": "connectionstate", - "product": "realtime", - "slug": "connectionstate", - "title": "connectionState", - "type": "function", - }, - { - "id": "disconnect", - "product": "realtime", - "slug": "disconnect", - "title": "disconnect", - "type": "function", - }, - { - "id": "endpointurl", - "product": "realtime", - "slug": "endpointurl", - "title": "endpointURL", - "type": "function", - }, - { - "id": "getchannels", - "product": "realtime", - "slug": "getchannels", - "title": "getChannels", - "type": "function", - }, - { - "id": "getwebsocketconstructor", - "product": "realtime", - "slug": "getwebsocketconstructor", - "title": "getWebSocketConstructor", - "type": "function", - }, - { - "id": "httpsend", - "product": "realtime", - "slug": "httpsend", - "title": "httpSend", - "type": "function", - }, - { - "id": "isconnected", - "product": "realtime", - "slug": "isconnected", - "title": "isConnected", - "type": "function", - }, - { - "id": "isconnecting", - "product": "realtime", - "slug": "isconnecting", - "title": "isConnecting", - "type": "function", - }, - { - "id": "isdisconnecting", - "product": "realtime", - "slug": "isdisconnecting", - "title": "isDisconnecting", - "type": "function", - }, - { - "id": "iswebsocketsupported", - "product": "realtime", - "slug": "iswebsocketsupported", - "title": "isWebSocketSupported", - "type": "function", - }, - { - "id": "log", - "product": "realtime", - "slug": "log", - "title": "log", - "type": "function", - }, - { - "id": "on", - "product": "realtime", - "slug": "on", - "title": "on", - "type": "function", - }, - { - "id": "onheartbeat", - "product": "realtime", - "slug": "onheartbeat", - "title": "onHeartbeat", - "type": "function", - }, - { - "id": "presencestate", - "product": "realtime", - "slug": "presencestate", - "title": "presenceState", - "type": "function", - }, - { - "id": "push", - "product": "realtime", - "slug": "push", - "title": "push", - "type": "function", - }, - { - "id": "removeallchannels", - "product": "realtime", - "slug": "removeallchannels", - "title": "removeAllChannels", - "type": "function", - }, - { - "id": "removechannel", - "product": "realtime", - "slug": "removechannel", - "title": "removeChannel", - "type": "function", - }, - { - "id": "send", - "product": "realtime", - "slug": "send", - "title": "send", - "type": "function", - }, - { - "id": "sendheartbeat", - "product": "realtime", - "slug": "sendheartbeat", - "title": "sendHeartbeat", - "type": "function", - }, - { - "id": "setauth", - "product": "realtime", - "slug": "setauth", - "title": "setAuth", - "type": "function", - }, - { - "id": "subscribe", - "product": "realtime", - "slug": "subscribe", - "title": "subscribe", - "type": "function", - }, - { - "id": "teardown", - "product": "realtime", - "slug": "teardown", - "title": "teardown", - "type": "function", - }, - { - "id": "track", - "product": "realtime", - "slug": "track", - "title": "track", - "type": "function", - }, - { - "id": "unsubscribe", - "product": "realtime", - "slug": "unsubscribe", - "title": "unsubscribe", - "type": "function", - }, - { - "id": "untrack", - "product": "realtime", - "slug": "untrack", - "title": "untrack", - "type": "function", - }, - { - "id": "updatejoinpayload", - "product": "realtime", - "slug": "updatejoinpayload", - "title": "updateJoinPayload", - "type": "function", - }, - { - "title": "Storage", - "type": "category", - }, - { - "id": "analytics-buckets", - "slug": "analytics-buckets", - "title": "Analytics Buckets", - "type": "function", - }, - { - "id": "analytics-buckets-createbucket", - "product": "storage", - "slug": "analytics-buckets-createbucket", - "title": "createBucket", - "type": "function", - }, - { - "id": "analytics-buckets-deletebucket", - "product": "storage", - "slug": "analytics-buckets-deletebucket", - "title": "deleteBucket", - "type": "function", - }, - { - "id": "analytics-buckets-from", - "product": "storage", - "slug": "analytics-buckets-from", - "title": "from", - "type": "function", - }, - { - "id": "analytics-buckets-listbuckets", - "product": "storage", - "slug": "analytics-buckets-listbuckets", - "title": "listBuckets", - "type": "function", - }, - { - "id": "file-buckets", - "slug": "file-buckets", - "title": "File Buckets", - "type": "function", - }, - { - "id": "file-buckets-copy", - "product": "storage", - "slug": "file-buckets-copy", - "title": "copy", - "type": "function", - }, - { - "id": "file-buckets-createbucket", - "product": "storage", - "slug": "file-buckets-createbucket", - "title": "createBucket", - "type": "function", - }, - { - "id": "file-buckets-createsigneduploadurl", - "product": "storage", - "slug": "file-buckets-createsigneduploadurl", - "title": "createSignedUploadUrl", - "type": "function", - }, - { - "id": "file-buckets-createsignedurl", - "product": "storage", - "slug": "file-buckets-createsignedurl", - "title": "createSignedUrl", - "type": "function", - }, - { - "id": "file-buckets-createsignedurls", - "product": "storage", - "slug": "file-buckets-createsignedurls", - "title": "createSignedUrls", - "type": "function", - }, - { - "id": "file-buckets-deletebucket", - "product": "storage", - "slug": "file-buckets-deletebucket", - "title": "deleteBucket", - "type": "function", - }, - { - "id": "file-buckets-download", - "product": "storage", - "slug": "file-buckets-download", - "title": "download", - "type": "function", - }, - { - "id": "file-buckets-emptybucket", - "product": "storage", - "slug": "file-buckets-emptybucket", - "title": "emptyBucket", - "type": "function", - }, - { - "id": "file-buckets-exists", - "product": "storage", - "slug": "file-buckets-exists", - "title": "exists", - "type": "function", - }, - { - "id": "file-buckets-from", - "product": "storage", - "slug": "file-buckets-from", - "title": "from", - "type": "function", - }, - { - "id": "file-buckets-getbucket", - "product": "storage", - "slug": "file-buckets-getbucket", - "title": "getBucket", - "type": "function", - }, - { - "id": "file-buckets-getpublicurl", - "product": "storage", - "slug": "file-buckets-getpublicurl", - "title": "getPublicUrl", - "type": "function", - }, - { - "id": "file-buckets-info", - "product": "storage", - "slug": "file-buckets-info", - "title": "info", - "type": "function", - }, - { - "id": "file-buckets-list", - "product": "storage", - "slug": "file-buckets-list", - "title": "list", - "type": "function", - }, - { - "id": "file-buckets-listbuckets", - "product": "storage", - "slug": "file-buckets-listbuckets", - "title": "listBuckets", - "type": "function", - }, - { - "id": "file-buckets-listv2", - "product": "storage", - "slug": "file-buckets-listv2", - "title": "listV2", - "type": "function", - }, - { - "id": "file-buckets-move", - "product": "storage", - "slug": "file-buckets-move", - "title": "move", - "type": "function", - }, - { - "id": "file-buckets-remove", - "product": "storage", - "slug": "file-buckets-remove", - "title": "remove", - "type": "function", - }, - { - "id": "file-buckets-update", - "product": "storage", - "slug": "file-buckets-update", - "title": "update", - "type": "function", - }, - { - "id": "file-buckets-updatebucket", - "product": "storage", - "slug": "file-buckets-updatebucket", - "title": "updateBucket", - "type": "function", - }, - { - "id": "file-buckets-upload", - "product": "storage", - "slug": "file-buckets-upload", - "title": "upload", - "type": "function", - }, - { - "id": "file-buckets-uploadtosignedurl", - "product": "storage", - "slug": "file-buckets-uploadtosignedurl", - "title": "uploadToSignedUrl", - "type": "function", - }, - { - "id": "vector-buckets", - "slug": "vector-buckets", - "title": "Vector Buckets", - "type": "function", - }, - { - "id": "vector-buckets-createbucket", - "product": "storage", - "slug": "vector-buckets-createbucket", - "title": "createBucket", - "type": "function", - }, - { - "id": "vector-buckets-createindex", - "product": "storage", - "slug": "vector-buckets-createindex", - "title": "createIndex", - "type": "function", - }, - { - "id": "vector-buckets-deletebucket", - "product": "storage", - "slug": "vector-buckets-deletebucket", - "title": "deleteBucket", - "type": "function", - }, - { - "id": "vector-buckets-deleteindex", - "product": "storage", - "slug": "vector-buckets-deleteindex", - "title": "deleteIndex", - "type": "function", - }, - { - "id": "vector-buckets-deletevectors", - "product": "storage", - "slug": "vector-buckets-deletevectors", - "title": "deleteVectors", - "type": "function", - }, - { - "id": "vector-buckets-from", - "product": "storage", - "slug": "vector-buckets-from", - "title": "from", - "type": "function", - }, - { - "id": "vector-buckets-getbucket", - "product": "storage", - "slug": "vector-buckets-getbucket", - "title": "getBucket", - "type": "function", - }, - { - "id": "vector-buckets-getindex", - "product": "storage", - "slug": "vector-buckets-getindex", - "title": "getIndex", - "type": "function", - }, - { - "id": "vector-buckets-getvectors", - "product": "storage", - "slug": "vector-buckets-getvectors", - "title": "getVectors", - "type": "function", - }, - { - "id": "vector-buckets-index", - "product": "storage", - "slug": "vector-buckets-index", - "title": "index", - "type": "function", - }, - { - "id": "vector-buckets-listbuckets", - "product": "storage", - "slug": "vector-buckets-listbuckets", - "title": "listBuckets", - "type": "function", - }, - { - "id": "vector-buckets-listindexes", - "product": "storage", - "slug": "vector-buckets-listindexes", - "title": "listIndexes", - "type": "function", - }, - { - "id": "vector-buckets-listvectors", - "product": "storage", - "slug": "vector-buckets-listvectors", - "title": "listVectors", - "type": "function", - }, - { - "id": "vector-buckets-putvectors", - "product": "storage", - "slug": "vector-buckets-putvectors", - "title": "putVectors", - "type": "function", - }, - { - "id": "vector-buckets-queryvectors", - "product": "storage", - "slug": "vector-buckets-queryvectors", - "title": "queryVectors", - "type": "function", - }, - ], - "functionsList": [ - { - "$ref": "@supabase/supabase-js.SupabaseClient.constructor", - "id": "initializing", - }, - { - "$ref": "@supabase/postgrest-js.PostgrestQueryBuilder.delete", - "id": "delete", - }, - { - "$ref": "@supabase/postgrest-js.PostgrestClient.from", - "id": "from", - }, - { - "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.geojson", - "id": "geojson", - }, - { - "$ref": "@supabase/postgrest-js.PostgrestQueryBuilder.insert", - "id": "insert", - }, - { - "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.maxAffected", - "id": "maxaffected", - }, - { - "$ref": "@supabase/postgrest-js.PostgrestBuilder.retry", - "id": "retry", - }, - { - "$ref": "@supabase/postgrest-js.PostgrestBuilder.returns", - "id": "returns", - }, - { - "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.rollback", - "id": "rollback", - }, - { - "$ref": "@supabase/postgrest-js.PostgrestClient.rpc", - "id": "rpc", - }, - { - "$ref": "@supabase/postgrest-js.PostgrestClient.schema", - "id": "schema", - }, - { - "$ref": "@supabase/postgrest-js.PostgrestQueryBuilder.select", - "id": "select", - }, - { - "$ref": "@supabase/postgrest-js.PostgrestBuilder.setHeader", - "id": "setheader", - }, - { - "$ref": "@supabase/postgrest-js.PostgrestBuilder.throwOnError", - "id": "throwonerror", - }, - { - "$ref": "@supabase/postgrest-js.PostgrestQueryBuilder.update", - "id": "update", - }, - { - "$ref": "@supabase/postgrest-js.PostgrestQueryBuilder.upsert", - "id": "upsert", - }, - { - "description": "Filters allow you to only return rows that match certain conditions. - -Filters can be used on \`select()\`, \`update()\`, \`upsert()\`, and \`delete()\` queries. - -If a Postgres function returns a table response, you can also apply filters. -", - "examples": [ - { - "code": "\`\`\`ts -const { data, error } = await supabase - .from('instruments') - .select('name, section_id') - .eq('name', 'violin') // Correct - -const { data, error } = await supabase - .from('instruments') - .eq('name', 'violin') // Incorrect - .select('name, section_id') -\`\`\` -", - "description": "Filters must be applied after any of \`select()\`, \`update()\`, \`upsert()\`, -\`delete()\`, and \`rpc()\` and before -[modifiers](/docs/reference/javascript/using-modifiers). -", - "id": "applying-filters", - "name": "Applying Filters", - }, - { - "code": "\`\`\`ts -const { data, error } = await supabase - .from('cities') - .select('name, country_id') - .gte('population', 1000) - .lt('population', 10000) -\`\`\` -", - "description": "Filters can be chained together to produce advanced queries. For example, -to query cities with population between 1,000 and 10,000: - -\`\`\`ts -const { data, error } = await supabase - .from('cities') - .select('name, country_id') - .gte('population', 1000) - .lt('population', 10000) -\`\`\` -", - "id": "chaining-filters", - "name": "Chaining", - }, - { - "code": "\`\`\`ts -const filterByName = null -const filterPopLow = 1000 -const filterPopHigh = 10000 - -let query = supabase - .from('cities') - .select('name, country_id') - -if (filterByName) { query = query.eq('name', filterByName) } -if (filterPopLow) { query = query.gte('population', filterPopLow) } -if (filterPopHigh) { query = query.lt('population', filterPopHigh) } - -const { data, error } = await query -\`\`\` -", - "description": "Filters can be built up one step at a time and then executed. For example: - -\`\`\`ts -const filterByName = null -const filterPopLow = 1000 -const filterPopHigh = 10000 - -let query = supabase - .from('cities') - .select('name, country_id') - -if (filterByName) { query = query.eq('name', filterByName) } -if (filterPopLow) { query = query.gte('population', filterPopLow) } -if (filterPopHigh) { query = query.lt('population', filterPopHigh) } - -const { data, error } = await query -\`\`\` -", - "id": "conditional-chaining", - "name": "Conditional Chaining", - }, - { - "code": "\`\`\`ts -const { data, error } = await supabase - .from('users') - .select() - .eq('address->postcode', 90210) -\`\`\` -", - "data": { - "sql": "\`\`\`sql -create table - users ( - id int8 primary key, - name text, - address jsonb - ); - -insert into - users (id, name, address) -values - (1, 'Michael', '{ "postcode": 90210 }'), - (2, 'Jane', null); -\`\`\` -", - }, - "id": "filter-by-value-within-json-column", - "name": "Filter by values within a JSON column", - "response": "\`\`\`json -{ - "data": [ - { - "id": 1, - "name": "Michael", - "address": { - "postcode": 90210 - } - } - ], - "status": 200, - "statusText": "OK" -} -\`\`\` -", - }, - { - "code": "\`\`\`ts -const { data, error } = await supabase - .from('orchestral_sections') - .select(\` - name, - instruments!inner ( - name - ) - \`) - .eq('instruments.name', 'flute') -\`\`\` -", - "data": { - "response": "\`\`\`json -{ - "data": [ - { - "name": "woodwinds", - "characters": [ - { - "name": "flute" - } - ] - } - ], - "status": 200, - "statusText": "OK" -} -\`\`\` -", - "sql": "\`\`\`sql -create table - orchestral_sections (id int8 primary key, name text); -create table - instruments ( - id int8 primary key, - section_id int8 not null references orchestral_sections, - name text - ); - -insert into - orchestral_sections (id, name) -values - (1, 'strings'), - (2, 'woodwinds'); -insert into - instruments (id, section_id, name) -values - (1, 2, 'flute'), - (2, 1, 'violin'); -\`\`\` -", - }, - "description": "You can filter on referenced tables in your \`select()\` query using dot -notation. -", - "id": "filter-referenced-tables", - "name": "Filter referenced tables", - }, - ], - "id": "using-filters", - "title": "Using Filters", - }, - { - "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.containedBy", - "id": "using-filters-containedby", - }, - { - "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.contains", - "id": "using-filters-contains", - }, - { - "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.eq", - "id": "using-filters-eq", - }, - { - "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.filter", - "id": "using-filters-filter", - }, - { - "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.gt", - "id": "using-filters-gt", - }, - { - "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.gte", - "id": "using-filters-gte", - }, - { - "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.ilike", - "id": "using-filters-ilike", - }, - { - "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.ilikeAllOf", - "id": "using-filters-ilikeallof", - }, - { - "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.ilikeAnyOf", - "id": "using-filters-ilikeanyof", - }, - { - "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.in", - "id": "using-filters-in", - }, - { - "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.is", - "id": "using-filters-is", - }, - { - "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.like", - "id": "using-filters-like", - }, - { - "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.likeAllOf", - "id": "using-filters-likeallof", - }, - { - "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.likeAnyOf", - "id": "using-filters-likeanyof", - }, - { - "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.lt", - "id": "using-filters-lt", - }, - { - "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.lte", - "id": "using-filters-lte", - }, - { - "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.match", - "id": "using-filters-match", - }, - { - "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.neq", - "id": "using-filters-neq", - }, - { - "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.not", - "id": "using-filters-not", - }, - { - "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.or", - "id": "using-filters-or", - }, - { - "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.overlaps", - "id": "using-filters-overlaps", - }, - { - "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.rangeAdjacent", - "id": "using-filters-rangeadjacent", - }, - { - "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.rangeGt", - "id": "using-filters-rangegt", - }, - { - "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.rangeGte", - "id": "using-filters-rangegte", - }, - { - "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.rangeLt", - "id": "using-filters-rangelt", - }, - { - "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.rangeLte", - "id": "using-filters-rangelte", - }, - { - "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.textSearch", - "id": "using-filters-textsearch", - }, - { - "description": "Filters work on the row level—they allow you to return rows that only match certain conditions without changing the shape of the rows. Modifiers are everything that don't fit that definition—allowing you to change the format of the response (e.g., returning a CSV string). - -Modifiers must be specified after filters. Some modifiers only apply for queries that return rows (e.g., \`select()\` or \`rpc()\` on a function that returns a table response).", - "id": "using-modifiers", - "title": "Using modifiers", - }, - { - "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.abortSignal", - "id": "using-modifiers-abortsignal", - }, - { - "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.csv", - "id": "using-modifiers-csv", - }, - { - "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.explain", - "id": "using-modifiers-explain", - }, - { - "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.limit", - "id": "using-modifiers-limit", - }, - { - "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.maybeSingle", - "id": "using-modifiers-maybesingle", - }, - { - "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.order", - "id": "using-modifiers-order", - }, - { - "$ref": "@supabase/postgrest-js.PostgrestBuilder.overrideTypes", - "id": "using-modifiers-overridetypes", - }, - { - "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.range", - "id": "using-modifiers-range", - }, - { - "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.returns", - "id": "using-modifiers-returns", - }, - { - "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.select", - "id": "using-modifiers-select", - }, - { - "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.single", - "id": "using-modifiers-single", - }, - { - "$ref": "@supabase/postgrest-js.PostgrestBuilder.stripNulls", - "id": "using-modifiers-stripnulls", - }, - { - "examples": [ - { - "code": "\`\`\`js -import { createClient } from '@supabase/supabase-js' - -const supabase = createClient(supabase_url, publishable_key) -\`\`\` -", - "id": "create-auth-client", - "isSpotlight": true, - "name": "Create auth client", - }, - { - "code": "\`\`\`js -import { createClient } from '@supabase/supabase-js' - -const supabase = createClient(supabase_url, publishable_key, { - auth: { - autoRefreshToken: false, - persistSession: false, - detectSessionInUrl: false - } -}) -\`\`\` -", - "id": "create-auth-client-server-side", - "isSpotlight": false, - "name": "Create auth client (server-side)", - }, - ], - "id": "auth", - "notes": "- The auth methods can be accessed via the \`supabase.auth\` namespace. -- By default, the supabase client sets \`persistSession\` to true and attempts to store the session in local storage. When using the supabase client in an environment that doesn't support local storage, you might notice the following warning message being logged: - - > No storage option exists to persist the session, which may result in unexpected behavior when using auth. If you want to set \`persistSession\` to true, please provide a storage option or you may set \`persistSession\` to false to disable this warning. - - This warning message can be safely ignored if you're not using auth on the server-side. If you are using auth and you want to set \`persistSession\` to true, you will need to provide a custom storage implementation that follows [this interface](https://github.com/supabase/supabase-js/blob/master/packages/core/auth-js/src/lib/types.ts#L1053). -- Any email links and one-time passwords (OTPs) sent have a default expiry of 24 hours. We have the following [rate limits](/docs/guides/platform/going-into-prod#auth-rate-limits) in place to guard against brute force attacks. -- The expiry of an access token can be set in the "JWT expiry limit" field in [your project's auth settings](/dashboard/project/_/auth/providers). A refresh token never expires and can only be used once. -", - "title": "Overview", - }, - { - "$ref": "@supabase/auth-js.GoTrueClient.dispose", - "id": "auth-dispose", - }, - { - "$ref": "@supabase/auth-js.GoTrueClient.exchangeCodeForSession", - "id": "auth-exchangecodeforsession", - }, - { - "$ref": "@supabase/auth-js.GoTrueClient.getClaims", - "id": "auth-getclaims", - }, - { - "$ref": "@supabase/auth-js.GoTrueClient.getSession", - "id": "auth-getsession", - }, - { - "$ref": "@supabase/auth-js.GoTrueClient.getUser", - "id": "auth-getuser", - }, - { - "$ref": "@supabase/auth-js.GoTrueClient.getUserIdentities", - "id": "auth-getuseridentities", - }, - { - "$ref": "@supabase/auth-js.GoTrueClient.initialize", - "id": "auth-initialize", - }, - { - "$ref": "@supabase/auth-js.GoTrueClient.linkIdentity", - "id": "auth-linkidentity", - }, - { - "$ref": "@supabase/auth-js.GoTrueClient.onAuthStateChange", - "id": "auth-onauthstatechange", - }, - { - "$ref": "@supabase/auth-js.GoTrueClient.reauthenticate", - "id": "auth-reauthenticate", - }, - { - "$ref": "@supabase/auth-js.GoTrueClient.refreshSession", - "id": "auth-refreshsession", - }, - { - "$ref": "@supabase/auth-js.GoTrueClient.registerPasskey", - "id": "auth-registerpasskey", - }, - { - "$ref": "@supabase/auth-js.GoTrueClient.resend", - "id": "auth-resend", - }, - { - "$ref": "@supabase/auth-js.GoTrueClient.resetPasswordForEmail", - "id": "auth-resetpasswordforemail", - }, - { - "$ref": "@supabase/auth-js.GoTrueClient.setSession", - "id": "auth-setsession", - }, - { - "$ref": "@supabase/auth-js.GoTrueClient.signInAnonymously", - "id": "auth-signinanonymously", - }, - { - "$ref": "@supabase/auth-js.GoTrueClient.signInWithIdToken", - "id": "auth-signinwithidtoken", - }, - { - "$ref": "@supabase/auth-js.GoTrueClient.signInWithOAuth", - "id": "auth-signinwithoauth", - }, - { - "$ref": "@supabase/auth-js.GoTrueClient.signInWithOtp", - "id": "auth-signinwithotp", - }, - { - "$ref": "@supabase/auth-js.GoTrueClient.signInWithPasskey", - "id": "auth-signinwithpasskey", - }, - { - "$ref": "@supabase/auth-js.GoTrueClient.signInWithPassword", - "id": "auth-signinwithpassword", - }, - { - "$ref": "@supabase/auth-js.GoTrueClient.signInWithSSO", - "id": "auth-signinwithsso", - }, - { - "$ref": "@supabase/auth-js.GoTrueClient.signInWithWeb3", - "id": "auth-signinwithweb3", - }, - { - "$ref": "@supabase/auth-js.GoTrueClient.signOut", - "id": "auth-signout", - }, - { - "$ref": "@supabase/auth-js.GoTrueClient.signUp", - "id": "auth-signup", - }, - { - "$ref": "@supabase/auth-js.GoTrueClient.startAutoRefresh", - "id": "auth-startautorefresh", - }, - { - "$ref": "@supabase/auth-js.GoTrueClient.stopAutoRefresh", - "id": "auth-stopautorefresh", - }, - { - "$ref": "@supabase/auth-js.GoTrueClient.unlinkIdentity", - "id": "auth-unlinkidentity", - }, - { - "$ref": "@supabase/auth-js.GoTrueClient.updateUser", - "id": "auth-updateuser", - }, - { - "$ref": "@supabase/auth-js.GoTrueClient.verifyOtp", - "id": "auth-verifyotp", - }, - { - "examples": [ - { - "code": "\`\`\`js -import { createClient } from '@supabase/supabase-js' - -const supabase = createClient(supabase_url, secret_key, { - auth: { - autoRefreshToken: false, - persistSession: false - } -}) - -// Access auth admin api -const adminAuthClient = supabase.auth.admin -\`\`\` -", - "id": "create-auth-admin-client", - "isSpotlight": true, - "name": "Create server-side auth client", - }, - ], - "id": "auth-admin", - "notes": "- Any method under the \`supabase.auth.admin\` namespace requires a \`secret\` key. -- These methods are considered admin methods and should be called on a trusted server. Never expose your \`secret\` key in the browser. -", - "title": "Overview", - }, - { - "$ref": "@supabase/auth-js.GoTrueAdminCustomProvidersApi.createProvider", - "id": "auth-admin-createprovider", - }, - { - "$ref": "@supabase/auth-js.GoTrueAdminApi.createUser", - "id": "auth-admin-createuser", - }, - { - "$ref": "@supabase/auth-js.GoTrueAdminMFAApi.deleteFactor", - "id": "auth-admin-deletefactor", - }, - { - "$ref": "@supabase/auth-js.GoTrueAdminCustomProvidersApi.deleteProvider", - "id": "auth-admin-deleteprovider", - }, - { - "$ref": "@supabase/auth-js.GoTrueAdminApi.deleteUser", - "id": "auth-admin-deleteuser", - }, - { - "$ref": "@supabase/auth-js.GoTrueAdminApi.generateLink", - "id": "auth-admin-generatelink", - }, - { - "$ref": "@supabase/auth-js.GoTrueAdminCustomProvidersApi.getProvider", - "id": "auth-admin-getprovider", - }, - { - "$ref": "@supabase/auth-js.GoTrueAdminApi.getUserById", - "id": "auth-admin-getuserbyid", - }, - { - "$ref": "@supabase/auth-js.GoTrueAdminApi.inviteUserByEmail", - "id": "auth-admin-inviteuserbyemail", - }, - { - "$ref": "@supabase/auth-js.GoTrueAdminMFAApi.listFactors", - "id": "auth-admin-listfactors", - }, - { - "$ref": "@supabase/auth-js.GoTrueAdminCustomProvidersApi.listProviders", - "id": "auth-admin-listproviders", - }, - { - "$ref": "@supabase/auth-js.GoTrueAdminApi.listUsers", - "id": "auth-admin-listusers", - }, - { - "$ref": "@supabase/auth-js.GoTrueAdminApi.signOut", - "id": "auth-admin-signout", - }, - { - "$ref": "@supabase/auth-js.GoTrueAdminCustomProvidersApi.updateProvider", - "id": "auth-admin-updateprovider", - }, - { - "$ref": "@supabase/auth-js.GoTrueAdminApi.updateUserById", - "id": "auth-admin-updateuserbyid", - }, - { - "description": "This section contains methods commonly used for Multi-Factor Authentication (MFA) and are invoked behind the \`supabase.auth.mfa\` namespace. - -Currently, there is support for time-based one-time password (TOTP) and phone verification code as the 2nd factor. Recovery codes are not supported but users can enroll multiple factors, with an upper limit of 10. - -Having a 2nd factor for recovery frees the user of the burden of having to store their recovery codes somewhere. It also reduces the attack surface since multiple recovery codes are usually generated compared to just having 1 backup factor. - -Learn more about implementing MFA in your application [in the MFA guide](https://supabase.com/docs/guides/auth/auth-mfa#overview).", - "id": "auth-mfa", - "title": "Auth MFA", - }, - { - "$ref": "@supabase/auth-js.GoTrueMFAApi.challenge", - "id": "auth-mfa-challenge", - }, - { - "$ref": "@supabase/auth-js.GoTrueMFAApi.challengeAndVerify", - "id": "auth-mfa-challengeandverify", - }, - { - "$ref": "@supabase/auth-js.GoTrueMFAApi.enroll", - "id": "auth-mfa-enroll", - }, - { - "$ref": "@supabase/auth-js.GoTrueMFAApi.getAuthenticatorAssuranceLevel", - "id": "auth-mfa-getauthenticatorassurancelevel", - }, - { - "$ref": "@supabase/auth-js.GoTrueMFAApi.listFactors", - "id": "auth-mfa-listfactors", - }, - { - "$ref": "@supabase/auth-js.GoTrueMFAApi.unenroll", - "id": "auth-mfa-unenroll", - }, - { - "$ref": "@supabase/auth-js.GoTrueMFAApi.verify", - "id": "auth-mfa-verify", - }, - { - "code": "\`\`\`js -const supabase = createClient(supabaseUrl, publishableKey, { - auth: { - experimental: { passkey: true }, - }, -}) -\`\`\`", - "description": "This section contains methods for WebAuthn passkey registration, authentication, and management. Methods are invoked behind the \`supabase.auth.passkey\` namespace. - -Passkey support is an experimental feature. Enable it when creating the client:", - "id": "auth-passkey", - "title": "Auth Passkey", - }, - { - "$ref": "@supabase/auth-js.AuthPasskeyApi.delete", - "id": "auth-passkey-delete", - }, - { - "$ref": "@supabase/auth-js.AuthPasskeyApi.list", - "id": "auth-passkey-list", - }, - { - "$ref": "@supabase/auth-js.AuthPasskeyApi.startAuthentication", - "id": "auth-passkey-startauthentication", - }, - { - "$ref": "@supabase/auth-js.AuthPasskeyApi.startRegistration", - "id": "auth-passkey-startregistration", - }, - { - "$ref": "@supabase/auth-js.AuthPasskeyApi.update", - "id": "auth-passkey-update", - }, - { - "$ref": "@supabase/auth-js.AuthPasskeyApi.verifyAuthentication", - "id": "auth-passkey-verifyauthentication", - }, - { - "$ref": "@supabase/auth-js.AuthPasskeyApi.verifyRegistration", - "id": "auth-passkey-verifyregistration", - }, - { - "description": "The OAuth Admin API allows you to manage OAuth clients programmatically. Only relevant when the OAuth 2.1 server is enabled in Supabase Auth. These functions should only be called on a server. Never expose your \`secret\` key in the browser.", - "id": "oauth-admin", - "title": "OAuth Admin", - }, - { - "$ref": "@supabase/auth-js.GoTrueAdminOAuthApi.createClient", - "id": "oauth-admin-createclient", - }, - { - "$ref": "@supabase/auth-js.GoTrueAdminOAuthApi.deleteClient", - "id": "oauth-admin-deleteclient", - }, - { - "$ref": "@supabase/auth-js.GoTrueAdminOAuthApi.getClient", - "id": "oauth-admin-getclient", - }, - { - "$ref": "@supabase/auth-js.GoTrueAdminOAuthApi.listClients", - "id": "oauth-admin-listclients", - }, - { - "$ref": "@supabase/auth-js.GoTrueAdminOAuthApi.regenerateClientSecret", - "id": "oauth-admin-regenerateclientsecret", - }, - { - "$ref": "@supabase/auth-js.GoTrueAdminOAuthApi.updateClient", - "id": "oauth-admin-updateclient", - }, - { - "description": "The OAuth Server API allows you to build custom OAuth consent screens for your application. Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.", - "id": "oauth-server", - "title": "OAuth Server", - }, - { - "$ref": "@supabase/auth-js.AuthOAuthServerApi.approveAuthorization", - "id": "oauth-server-approveauthorization", - }, - { - "$ref": "@supabase/auth-js.AuthOAuthServerApi.denyAuthorization", - "id": "oauth-server-denyauthorization", - }, - { - "$ref": "@supabase/auth-js.AuthOAuthServerApi.getAuthorizationDetails", - "id": "oauth-server-getauthorizationdetails", - }, - { - "$ref": "@supabase/auth-js.AuthOAuthServerApi.listGrants", - "id": "oauth-server-listgrants", - }, - { - "$ref": "@supabase/auth-js.AuthOAuthServerApi.revokeGrant", - "id": "oauth-server-revokegrant", - }, - { - "description": "Contains passkey administration methods. Requires a secret key.", - "id": "passkey-admin", - "title": "Passkey admin", - }, - { - "$ref": "@supabase/auth-js.GoTrueAdminPasskeyApi.deletePasskey", - "id": "passkey-admin-deletepasskey", - }, - { - "$ref": "@supabase/auth-js.GoTrueAdminPasskeyApi.listPasskeys", - "id": "passkey-admin-listpasskeys", - }, - { - "$ref": "@supabase/supabase-js.cors.corsHeaders", - "id": "functions-corsheaders", - }, - { - "$ref": "@supabase/functions-js.FunctionsClient.invoke", - "id": "functions-invoke", - }, - { - "$ref": "@supabase/functions-js.FunctionsClient.setAuth", - "id": "functions-setauth", - }, - { - "$ref": "@supabase/realtime-js.RealtimeClient.channel", - "id": "channel", - }, - { - "$ref": "@supabase/realtime-js.RealtimeClient.connect", - "id": "connect", - }, - { - "$ref": "@supabase/realtime-js.RealtimeClient.connectionState", - "id": "connectionstate", - }, - { - "$ref": "@supabase/realtime-js.RealtimeClient.disconnect", - "id": "disconnect", - }, - { - "$ref": "@supabase/realtime-js.RealtimeClient.endpointURL", - "id": "endpointurl", - }, - { - "$ref": "@supabase/realtime-js.RealtimeClient.getChannels", - "id": "getchannels", - }, - { - "$ref": "@supabase/realtime-js.WebSocketFactory.getWebSocketConstructor", - "id": "getwebsocketconstructor", - }, - { - "$ref": "@supabase/realtime-js.RealtimeChannel.httpSend", - "id": "httpsend", - }, - { - "$ref": "@supabase/realtime-js.RealtimeClient.isConnected", - "id": "isconnected", - }, - { - "$ref": "@supabase/realtime-js.RealtimeClient.isConnecting", - "id": "isconnecting", - }, - { - "$ref": "@supabase/realtime-js.RealtimeClient.isDisconnecting", - "id": "isdisconnecting", - }, - { - "$ref": "@supabase/realtime-js.WebSocketFactory.isWebSocketSupported", - "id": "iswebsocketsupported", - }, - { - "$ref": "@supabase/realtime-js.RealtimeClient.log", - "id": "log", - }, - { - "$ref": "@supabase/realtime-js.RealtimeChannel.on", - "id": "on", - }, - { - "$ref": "@supabase/realtime-js.RealtimeClient.onHeartbeat", - "id": "onheartbeat", - }, - { - "$ref": "@supabase/realtime-js.RealtimeChannel.presenceState", - "id": "presencestate", - }, - { - "$ref": "@supabase/realtime-js.RealtimeClient.push", - "id": "push", - }, - { - "$ref": "@supabase/realtime-js.RealtimeClient.removeAllChannels", - "id": "removeallchannels", - }, - { - "$ref": "@supabase/realtime-js.RealtimeClient.removeChannel", - "id": "removechannel", - }, - { - "$ref": "@supabase/realtime-js.RealtimeChannel.send", - "id": "send", - }, - { - "$ref": "@supabase/realtime-js.RealtimeClient.sendHeartbeat", - "id": "sendheartbeat", - }, - { - "$ref": "@supabase/realtime-js.RealtimeClient.setAuth", - "id": "setauth", - }, - { - "$ref": "@supabase/realtime-js.RealtimeChannel.subscribe", - "id": "subscribe", - }, - { - "$ref": "@supabase/realtime-js.RealtimeChannel.teardown", - "id": "teardown", - }, - { - "$ref": "@supabase/realtime-js.RealtimeChannel.track", - "id": "track", - }, - { - "$ref": "@supabase/realtime-js.RealtimeChannel.unsubscribe", - "id": "unsubscribe", - }, - { - "$ref": "@supabase/realtime-js.RealtimeChannel.untrack", - "id": "untrack", - }, - { - "$ref": "@supabase/realtime-js.RealtimeChannel.updateJoinPayload", - "id": "updatejoinpayload", - }, - { - "description": "This section contains methods for working with Analytics Buckets.", - "id": "analytics-buckets", - "title": "Analytics Buckets", - }, - { - "$ref": "@supabase/storage-js.packages/StorageAnalyticsClient.default.createBucket", - "id": "analytics-buckets-createbucket", - }, - { - "$ref": "@supabase/storage-js.packages/StorageAnalyticsClient.default.deleteBucket", - "id": "analytics-buckets-deletebucket", - }, - { - "$ref": "@supabase/storage-js.packages/StorageAnalyticsClient.default.from", - "id": "analytics-buckets-from", - }, - { - "$ref": "@supabase/storage-js.packages/StorageAnalyticsClient.default.listBuckets", - "id": "analytics-buckets-listbuckets", - }, - { - "description": "This section contains methods for working with File Buckets.", - "id": "file-buckets", - "title": "File Buckets", - }, - { - "$ref": "@supabase/storage-js.packages/StorageFileApi.default.copy", - "id": "file-buckets-copy", - }, - { - "$ref": "@supabase/storage-js.StorageClient.createBucket", - "id": "file-buckets-createbucket", - }, - { - "$ref": "@supabase/storage-js.packages/StorageFileApi.default.createSignedUploadUrl", - "id": "file-buckets-createsigneduploadurl", - }, - { - "$ref": "@supabase/storage-js.packages/StorageFileApi.default.createSignedUrl", - "id": "file-buckets-createsignedurl", - }, - { - "$ref": "@supabase/storage-js.packages/StorageFileApi.default.createSignedUrls", - "id": "file-buckets-createsignedurls", - }, - { - "$ref": "@supabase/storage-js.StorageClient.deleteBucket", - "id": "file-buckets-deletebucket", - }, - { - "$ref": "@supabase/storage-js.packages/StorageFileApi.default.download", - "id": "file-buckets-download", - }, - { - "$ref": "@supabase/storage-js.StorageClient.emptyBucket", - "id": "file-buckets-emptybucket", - }, - { - "$ref": "@supabase/storage-js.packages/StorageFileApi.default.exists", - "id": "file-buckets-exists", - }, - { - "$ref": "@supabase/storage-js.StorageClient.from", - "id": "file-buckets-from", - }, - { - "$ref": "@supabase/storage-js.StorageClient.getBucket", - "id": "file-buckets-getbucket", - }, - { - "$ref": "@supabase/storage-js.packages/StorageFileApi.default.getPublicUrl", - "id": "file-buckets-getpublicurl", - }, - { - "$ref": "@supabase/storage-js.packages/StorageFileApi.default.info", - "id": "file-buckets-info", - }, - { - "$ref": "@supabase/storage-js.packages/StorageFileApi.default.list", - "id": "file-buckets-list", - }, - { - "$ref": "@supabase/storage-js.StorageClient.listBuckets", - "id": "file-buckets-listbuckets", - }, - { - "$ref": "@supabase/storage-js.packages/StorageFileApi.default.listV2", - "id": "file-buckets-listv2", - }, - { - "$ref": "@supabase/storage-js.packages/StorageFileApi.default.move", - "id": "file-buckets-move", - }, - { - "$ref": "@supabase/storage-js.packages/StorageFileApi.default.remove", - "id": "file-buckets-remove", - }, - { - "$ref": "@supabase/storage-js.packages/StorageFileApi.default.update", - "id": "file-buckets-update", - }, - { - "$ref": "@supabase/storage-js.StorageClient.updateBucket", - "id": "file-buckets-updatebucket", - }, - { - "$ref": "@supabase/storage-js.packages/StorageFileApi.default.upload", - "id": "file-buckets-upload", - }, - { - "$ref": "@supabase/storage-js.packages/StorageFileApi.default.uploadToSignedUrl", - "id": "file-buckets-uploadtosignedurl", - }, - { - "description": "This section contains methods for working with Vector Buckets.", - "id": "vector-buckets", - "title": "Vector Buckets", - }, - { - "$ref": "@supabase/storage-js.packages/StorageVectorsClient.StorageVectorsClient.createBucket", - "id": "vector-buckets-createbucket", - }, - { - "$ref": "@supabase/storage-js.packages/StorageVectorsClient.VectorBucketScope.createIndex", - "id": "vector-buckets-createindex", - }, - { - "$ref": "@supabase/storage-js.packages/StorageVectorsClient.StorageVectorsClient.deleteBucket", - "id": "vector-buckets-deletebucket", - }, - { - "$ref": "@supabase/storage-js.packages/StorageVectorsClient.VectorBucketScope.deleteIndex", - "id": "vector-buckets-deleteindex", - }, - { - "$ref": "@supabase/storage-js.packages/StorageVectorsClient.VectorIndexScope.deleteVectors", - "id": "vector-buckets-deletevectors", - }, - { - "$ref": "@supabase/storage-js.packages/StorageVectorsClient.StorageVectorsClient.from", - "id": "vector-buckets-from", - }, - { - "$ref": "@supabase/storage-js.packages/StorageVectorsClient.StorageVectorsClient.getBucket", - "id": "vector-buckets-getbucket", - }, - { - "$ref": "@supabase/storage-js.packages/StorageVectorsClient.VectorBucketScope.getIndex", - "id": "vector-buckets-getindex", - }, - { - "$ref": "@supabase/storage-js.packages/StorageVectorsClient.VectorIndexScope.getVectors", - "id": "vector-buckets-getvectors", - }, - { - "$ref": "@supabase/storage-js.packages/StorageVectorsClient.VectorBucketScope", - "id": "vector-buckets-index", - }, - { - "$ref": "@supabase/storage-js.packages/StorageVectorsClient.StorageVectorsClient.listBuckets", - "id": "vector-buckets-listbuckets", - }, - { - "$ref": "@supabase/storage-js.packages/StorageVectorsClient.VectorBucketScope.listIndexes", - "id": "vector-buckets-listindexes", - }, - { - "$ref": "@supabase/storage-js.packages/StorageVectorsClient.VectorIndexScope.listVectors", - "id": "vector-buckets-listvectors", - }, - { - "$ref": "@supabase/storage-js.packages/StorageVectorsClient.VectorIndexScope.putVectors", - "id": "vector-buckets-putvectors", - }, - { - "$ref": "@supabase/storage-js.packages/StorageVectorsClient.VectorIndexScope.queryVectors", - "id": "vector-buckets-queryvectors", - }, - ], - "sections": [ - { - "id": "introduction", - "slug": "introduction", - "title": "Introduction", - "type": "markdown", - }, - { - "id": "installing", - "slug": "installing", - "title": "Installing", - "type": "markdown", - }, - { - "id": "initializing", - "slug": "initializing", - "title": "Initializing", - "type": "function", - }, - { - "id": "typescript-support", - "slug": "typescript-support", - "title": "TypeScript support", - "type": "markdown", - }, - { - "items": [ - { - "id": "delete", - "product": "database", - "slug": "delete", - "title": "delete", - "type": "function", - }, - { - "id": "from", - "product": "database", - "slug": "from", - "title": "from", - "type": "function", - }, - { - "id": "geojson", - "product": "database", - "slug": "geojson", - "title": "geojson", - "type": "function", - }, - { - "id": "insert", - "product": "database", - "slug": "insert", - "title": "insert", - "type": "function", - }, - { - "id": "maxaffected", - "product": "database", - "slug": "maxaffected", - "title": "maxAffected", - "type": "function", - }, - { - "id": "retry", - "product": "database", - "slug": "retry", - "title": "retry", - "type": "function", - }, - { - "id": "returns", - "product": "database", - "slug": "returns", - "title": "returns", - "type": "function", - }, - { - "id": "rollback", - "product": "database", - "slug": "rollback", - "title": "rollback", - "type": "function", - }, - { - "id": "rpc", - "product": "database", - "slug": "rpc", - "title": "rpc", - "type": "function", - }, - { - "id": "schema", - "product": "database", - "slug": "schema", - "title": "schema", - "type": "function", - }, - { - "id": "select", - "product": "database", - "slug": "select", - "title": "select", - "type": "function", - }, - { - "id": "setheader", - "product": "database", - "slug": "setheader", - "title": "setHeader", - "type": "function", - }, - { - "id": "throwonerror", - "product": "database", - "slug": "throwonerror", - "title": "throwOnError", - "type": "function", - }, - { - "id": "update", - "product": "database", - "slug": "update", - "title": "update", - "type": "function", - }, - { - "id": "upsert", - "product": "database", - "slug": "upsert", - "title": "upsert", - "type": "function", - }, - { - "id": "using-filters", - "isFunc": false, - "items": [ - { - "id": "using-filters", - "slug": "using-filters", - "title": "Using Filters", - "type": "function", - }, - { - "id": "using-filters-containedby", - "product": "database", - "slug": "using-filters-containedby", - "title": "containedBy", - "type": "function", - }, - { - "id": "using-filters-contains", - "product": "database", - "slug": "using-filters-contains", - "title": "contains", - "type": "function", - }, - { - "id": "using-filters-eq", - "product": "database", - "slug": "using-filters-eq", - "title": "eq", - "type": "function", - }, - { - "id": "using-filters-filter", - "product": "database", - "slug": "using-filters-filter", - "title": "filter", - "type": "function", - }, - { - "id": "using-filters-gt", - "product": "database", - "slug": "using-filters-gt", - "title": "gt", - "type": "function", - }, - { - "id": "using-filters-gte", - "product": "database", - "slug": "using-filters-gte", - "title": "gte", - "type": "function", - }, - { - "id": "using-filters-ilike", - "product": "database", - "slug": "using-filters-ilike", - "title": "ilike", - "type": "function", - }, - { - "id": "using-filters-ilikeallof", - "product": "database", - "slug": "using-filters-ilikeallof", - "title": "ilikeAllOf", - "type": "function", - }, - { - "id": "using-filters-ilikeanyof", - "product": "database", - "slug": "using-filters-ilikeanyof", - "title": "ilikeAnyOf", - "type": "function", - }, - { - "id": "using-filters-in", - "product": "database", - "slug": "using-filters-in", - "title": "in", - "type": "function", - }, - { - "id": "using-filters-is", - "product": "database", - "slug": "using-filters-is", - "title": "is", - "type": "function", - }, - { - "id": "using-filters-like", - "product": "database", - "slug": "using-filters-like", - "title": "like", - "type": "function", - }, - { - "id": "using-filters-likeallof", - "product": "database", - "slug": "using-filters-likeallof", - "title": "likeAllOf", - "type": "function", - }, - { - "id": "using-filters-likeanyof", - "product": "database", - "slug": "using-filters-likeanyof", - "title": "likeAnyOf", - "type": "function", - }, - { - "id": "using-filters-lt", - "product": "database", - "slug": "using-filters-lt", - "title": "lt", - "type": "function", - }, - { - "id": "using-filters-lte", - "product": "database", - "slug": "using-filters-lte", - "title": "lte", - "type": "function", - }, - { - "id": "using-filters-match", - "product": "database", - "slug": "using-filters-match", - "title": "match", - "type": "function", - }, - { - "id": "using-filters-neq", - "product": "database", - "slug": "using-filters-neq", - "title": "neq", - "type": "function", - }, - { - "id": "using-filters-not", - "product": "database", - "slug": "using-filters-not", - "title": "not", - "type": "function", - }, - { - "id": "using-filters-or", - "product": "database", - "slug": "using-filters-or", - "title": "or", - "type": "function", - }, - { - "id": "using-filters-overlaps", - "product": "database", - "slug": "using-filters-overlaps", - "title": "overlaps", - "type": "function", - }, - { - "id": "using-filters-rangeadjacent", - "product": "database", - "slug": "using-filters-rangeadjacent", - "title": "rangeAdjacent", - "type": "function", - }, - { - "id": "using-filters-rangegt", - "product": "database", - "slug": "using-filters-rangegt", - "title": "rangeGt", - "type": "function", - }, - { - "id": "using-filters-rangegte", - "product": "database", - "slug": "using-filters-rangegte", - "title": "rangeGte", - "type": "function", - }, - { - "id": "using-filters-rangelt", - "product": "database", - "slug": "using-filters-rangelt", - "title": "rangeLt", - "type": "function", - }, - { - "id": "using-filters-rangelte", - "product": "database", - "slug": "using-filters-rangelte", - "title": "rangeLte", - "type": "function", - }, - { - "id": "using-filters-textsearch", - "product": "database", - "slug": "using-filters-textsearch", - "title": "textSearch", - "type": "function", - }, - ], - "product": "database", - "slug": "using-filters", - "title": "Using filters", - "type": "function", - }, - { - "id": "using-modifiers", - "isFunc": false, - "items": [ - { - "id": "using-modifiers", - "slug": "using-modifiers", - "title": "Using modifiers", - "type": "function", - }, - { - "id": "using-modifiers-abortsignal", - "product": "database", - "slug": "using-modifiers-abortsignal", - "title": "abortSignal", - "type": "function", - }, - { - "id": "using-modifiers-csv", - "product": "database", - "slug": "using-modifiers-csv", - "title": "csv", - "type": "function", - }, - { - "id": "using-modifiers-explain", - "product": "database", - "slug": "using-modifiers-explain", - "title": "explain", - "type": "function", - }, - { - "id": "using-modifiers-limit", - "product": "database", - "slug": "using-modifiers-limit", - "title": "limit", - "type": "function", - }, - { - "id": "using-modifiers-maybesingle", - "product": "database", - "slug": "using-modifiers-maybesingle", - "title": "maybeSingle", - "type": "function", - }, - { - "id": "using-modifiers-order", - "product": "database", - "slug": "using-modifiers-order", - "title": "order", - "type": "function", - }, - { - "id": "using-modifiers-overridetypes", - "product": "database", - "slug": "using-modifiers-overridetypes", - "title": "overrideTypes", - "type": "function", - }, - { - "id": "using-modifiers-range", - "product": "database", - "slug": "using-modifiers-range", - "title": "range", - "type": "function", - }, - { - "id": "using-modifiers-returns", - "product": "database", - "slug": "using-modifiers-returns", - "title": "returns", - "type": "function", - }, - { - "id": "using-modifiers-select", - "product": "database", - "slug": "using-modifiers-select", - "title": "select", - "type": "function", - }, - { - "id": "using-modifiers-single", - "product": "database", - "slug": "using-modifiers-single", - "title": "single", - "type": "function", - }, - { - "id": "using-modifiers-stripnulls", - "product": "database", - "slug": "using-modifiers-stripnulls", - "title": "stripNulls", - "type": "function", - }, - ], - "product": "database", - "slug": "using-modifiers", - "title": "Using modifiers", - "type": "function", - }, - ], - "title": "Database", - "type": "category", - }, - { - "items": [ - { - "id": "auth", - "slug": "auth", - "title": "Overview", - "type": "function", - }, - { - "id": "auth-dispose", - "product": "auth", - "slug": "auth-dispose", - "title": "dispose", - "type": "function", - }, - { - "id": "auth-exchangecodeforsession", - "product": "auth", - "slug": "auth-exchangecodeforsession", - "title": "exchangeCodeForSession", - "type": "function", - }, - { - "id": "auth-getclaims", - "product": "auth", - "slug": "auth-getclaims", - "title": "getClaims", - "type": "function", - }, - { - "id": "auth-getsession", - "product": "auth", - "slug": "auth-getsession", - "title": "getSession", - "type": "function", - }, - { - "id": "auth-getuser", - "product": "auth", - "slug": "auth-getuser", - "title": "getUser", - "type": "function", - }, - { - "id": "auth-getuseridentities", - "product": "auth", - "slug": "auth-getuseridentities", - "title": "getUserIdentities", - "type": "function", - }, - { - "id": "auth-initialize", - "product": "auth", - "slug": "auth-initialize", - "title": "initialize", - "type": "function", - }, - { - "id": "auth-linkidentity", - "product": "auth", - "slug": "auth-linkidentity", - "title": "linkIdentity", - "type": "function", - }, - { - "id": "auth-onauthstatechange", - "product": "auth", - "slug": "auth-onauthstatechange", - "title": "onAuthStateChange", - "type": "function", - }, - { - "id": "auth-reauthenticate", - "product": "auth", - "slug": "auth-reauthenticate", - "title": "reauthenticate", - "type": "function", - }, - { - "id": "auth-refreshsession", - "product": "auth", - "slug": "auth-refreshsession", - "title": "refreshSession", - "type": "function", - }, - { - "id": "auth-registerpasskey", - "product": "auth", - "slug": "auth-registerpasskey", - "title": "registerPasskey", - "type": "function", - }, - { - "id": "auth-resend", - "product": "auth", - "slug": "auth-resend", - "title": "resend", - "type": "function", - }, - { - "id": "auth-resetpasswordforemail", - "product": "auth", - "slug": "auth-resetpasswordforemail", - "title": "resetPasswordForEmail", - "type": "function", - }, - { - "id": "auth-setsession", - "product": "auth", - "slug": "auth-setsession", - "title": "setSession", - "type": "function", - }, - { - "id": "auth-signinanonymously", - "product": "auth", - "slug": "auth-signinanonymously", - "title": "signInAnonymously", - "type": "function", - }, - { - "id": "auth-signinwithidtoken", - "product": "auth", - "slug": "auth-signinwithidtoken", - "title": "signInWithIdToken", - "type": "function", - }, - { - "id": "auth-signinwithoauth", - "product": "auth", - "slug": "auth-signinwithoauth", - "title": "signInWithOAuth", - "type": "function", - }, - { - "id": "auth-signinwithotp", - "product": "auth", - "slug": "auth-signinwithotp", - "title": "signInWithOtp", - "type": "function", - }, - { - "id": "auth-signinwithpasskey", - "product": "auth", - "slug": "auth-signinwithpasskey", - "title": "signInWithPasskey", - "type": "function", - }, - { - "id": "auth-signinwithpassword", - "product": "auth", - "slug": "auth-signinwithpassword", - "title": "signInWithPassword", - "type": "function", - }, - { - "id": "auth-signinwithsso", - "product": "auth", - "slug": "auth-signinwithsso", - "title": "signInWithSSO", - "type": "function", - }, - { - "id": "auth-signinwithweb3", - "product": "auth", - "slug": "auth-signinwithweb3", - "title": "signInWithWeb3", - "type": "function", - }, - { - "id": "auth-signout", - "product": "auth", - "slug": "auth-signout", - "title": "signOut", - "type": "function", - }, - { - "id": "auth-signup", - "product": "auth", - "slug": "auth-signup", - "title": "signUp", - "type": "function", - }, - { - "id": "auth-startautorefresh", - "product": "auth", - "slug": "auth-startautorefresh", - "title": "startAutoRefresh", - "type": "function", - }, - { - "id": "auth-stopautorefresh", - "product": "auth", - "slug": "auth-stopautorefresh", - "title": "stopAutoRefresh", - "type": "function", - }, - { - "id": "auth-unlinkidentity", - "product": "auth", - "slug": "auth-unlinkidentity", - "title": "unlinkIdentity", - "type": "function", - }, - { - "id": "auth-updateuser", - "product": "auth", - "slug": "auth-updateuser", - "title": "updateUser", - "type": "function", - }, - { - "id": "auth-verifyotp", - "product": "auth", - "slug": "auth-verifyotp", - "title": "verifyOtp", - "type": "function", - }, - { - "id": "auth-admin", - "isFunc": false, - "items": [ - { - "id": "auth-admin", - "slug": "auth-admin", - "title": "Overview", - "type": "function", - }, - { - "id": "auth-admin-createprovider", - "product": "auth", - "slug": "auth-admin-createprovider", - "title": "createProvider", - "type": "function", - }, - { - "id": "auth-admin-createuser", - "product": "auth", - "slug": "auth-admin-createuser", - "title": "createUser", - "type": "function", - }, - { - "id": "auth-admin-deletefactor", - "product": "auth", - "slug": "auth-admin-deletefactor", - "title": "deleteFactor", - "type": "function", - }, - { - "id": "auth-admin-deleteprovider", - "product": "auth", - "slug": "auth-admin-deleteprovider", - "title": "deleteProvider", - "type": "function", - }, - { - "id": "auth-admin-deleteuser", - "product": "auth", - "slug": "auth-admin-deleteuser", - "title": "deleteUser", - "type": "function", - }, - { - "id": "auth-admin-generatelink", - "product": "auth", - "slug": "auth-admin-generatelink", - "title": "generateLink", - "type": "function", - }, - { - "id": "auth-admin-getprovider", - "product": "auth", - "slug": "auth-admin-getprovider", - "title": "getProvider", - "type": "function", - }, - { - "id": "auth-admin-getuserbyid", - "product": "auth", - "slug": "auth-admin-getuserbyid", - "title": "getUserById", - "type": "function", - }, - { - "id": "auth-admin-inviteuserbyemail", - "product": "auth", - "slug": "auth-admin-inviteuserbyemail", - "title": "inviteUserByEmail", - "type": "function", - }, - { - "id": "auth-admin-listfactors", - "product": "auth", - "slug": "auth-admin-listfactors", - "title": "listFactors", - "type": "function", - }, - { - "id": "auth-admin-listproviders", - "product": "auth", - "slug": "auth-admin-listproviders", - "title": "listProviders", - "type": "function", - }, - { - "id": "auth-admin-listusers", - "product": "auth", - "slug": "auth-admin-listusers", - "title": "listUsers", - "type": "function", - }, - { - "id": "auth-admin-signout", - "product": "auth", - "slug": "auth-admin-signout", - "title": "signOut", - "type": "function", - }, - { - "id": "auth-admin-updateprovider", - "product": "auth", - "slug": "auth-admin-updateprovider", - "title": "updateProvider", - "type": "function", - }, - { - "id": "auth-admin-updateuserbyid", - "product": "auth", - "slug": "auth-admin-updateuserbyid", - "title": "updateUserById", - "type": "function", - }, - ], - "product": "auth", - "slug": "auth-admin", - "title": "Auth Admin", - "type": "function", - }, - { - "id": "auth-mfa", - "isFunc": false, - "items": [ - { - "id": "auth-mfa", - "slug": "auth-mfa", - "title": "Auth MFA", - "type": "function", - }, - { - "id": "auth-mfa-challenge", - "product": "auth", - "slug": "auth-mfa-challenge", - "title": "challenge", - "type": "function", - }, - { - "id": "auth-mfa-challengeandverify", - "product": "auth", - "slug": "auth-mfa-challengeandverify", - "title": "challengeAndVerify", - "type": "function", - }, - { - "id": "auth-mfa-enroll", - "product": "auth", - "slug": "auth-mfa-enroll", - "title": "enroll", - "type": "function", - }, - { - "id": "auth-mfa-getauthenticatorassurancelevel", - "product": "auth", - "slug": "auth-mfa-getauthenticatorassurancelevel", - "title": "getAuthenticatorAssuranceLevel", - "type": "function", - }, - { - "id": "auth-mfa-listfactors", - "product": "auth", - "slug": "auth-mfa-listfactors", - "title": "listFactors", - "type": "function", - }, - { - "id": "auth-mfa-unenroll", - "product": "auth", - "slug": "auth-mfa-unenroll", - "title": "unenroll", - "type": "function", - }, - { - "id": "auth-mfa-verify", - "product": "auth", - "slug": "auth-mfa-verify", - "title": "verify", - "type": "function", - }, - ], - "product": "auth", - "slug": "auth-mfa", - "title": "Auth MFA", - "type": "function", - }, - { - "id": "auth-passkey", - "isFunc": false, - "items": [ - { - "id": "auth-passkey", - "slug": "auth-passkey", - "title": "Auth Passkey", - "type": "function", - }, - { - "id": "auth-passkey-delete", - "product": "auth", - "slug": "auth-passkey-delete", - "title": "delete", - "type": "function", - }, - { - "id": "auth-passkey-list", - "product": "auth", - "slug": "auth-passkey-list", - "title": "list", - "type": "function", - }, - { - "id": "auth-passkey-startauthentication", - "product": "auth", - "slug": "auth-passkey-startauthentication", - "title": "startAuthentication", - "type": "function", - }, - { - "id": "auth-passkey-startregistration", - "product": "auth", - "slug": "auth-passkey-startregistration", - "title": "startRegistration", - "type": "function", - }, - { - "id": "auth-passkey-update", - "product": "auth", - "slug": "auth-passkey-update", - "title": "update", - "type": "function", - }, - { - "id": "auth-passkey-verifyauthentication", - "product": "auth", - "slug": "auth-passkey-verifyauthentication", - "title": "verifyAuthentication", - "type": "function", - }, - { - "id": "auth-passkey-verifyregistration", - "product": "auth", - "slug": "auth-passkey-verifyregistration", - "title": "verifyRegistration", - "type": "function", - }, - ], - "product": "auth", - "slug": "auth-passkey", - "title": "Auth Passkey", - "type": "function", - }, - { - "id": "oauth-admin", - "isFunc": false, - "items": [ - { - "id": "oauth-admin", - "slug": "oauth-admin", - "title": "OAuth Admin", - "type": "function", - }, - { - "id": "oauth-admin-createclient", - "product": "auth", - "slug": "oauth-admin-createclient", - "title": "createClient", - "type": "function", - }, - { - "id": "oauth-admin-deleteclient", - "product": "auth", - "slug": "oauth-admin-deleteclient", - "title": "deleteClient", - "type": "function", - }, - { - "id": "oauth-admin-getclient", - "product": "auth", - "slug": "oauth-admin-getclient", - "title": "getClient", - "type": "function", - }, - { - "id": "oauth-admin-listclients", - "product": "auth", - "slug": "oauth-admin-listclients", - "title": "listClients", - "type": "function", - }, - { - "id": "oauth-admin-regenerateclientsecret", - "product": "auth", - "slug": "oauth-admin-regenerateclientsecret", - "title": "regenerateClientSecret", - "type": "function", - }, - { - "id": "oauth-admin-updateclient", - "product": "auth", - "slug": "oauth-admin-updateclient", - "title": "updateClient", - "type": "function", - }, - ], - "product": "auth", - "slug": "oauth-admin", - "title": "OAuth Admin", - "type": "function", - }, - { - "id": "oauth-server", - "isFunc": false, - "items": [ - { - "id": "oauth-server", - "slug": "oauth-server", - "title": "OAuth Server", - "type": "function", - }, - { - "id": "oauth-server-approveauthorization", - "product": "auth", - "slug": "oauth-server-approveauthorization", - "title": "approveAuthorization", - "type": "function", - }, - { - "id": "oauth-server-denyauthorization", - "product": "auth", - "slug": "oauth-server-denyauthorization", - "title": "denyAuthorization", - "type": "function", - }, - { - "id": "oauth-server-getauthorizationdetails", - "product": "auth", - "slug": "oauth-server-getauthorizationdetails", - "title": "getAuthorizationDetails", - "type": "function", - }, - { - "id": "oauth-server-listgrants", - "product": "auth", - "slug": "oauth-server-listgrants", - "title": "listGrants", - "type": "function", - }, - { - "id": "oauth-server-revokegrant", - "product": "auth", - "slug": "oauth-server-revokegrant", - "title": "revokeGrant", - "type": "function", - }, - ], - "product": "auth", - "slug": "oauth-server", - "title": "OAuth Server", - "type": "function", - }, - { - "id": "passkey-admin", - "isFunc": false, - "items": [ - { - "id": "passkey-admin", - "slug": "passkey-admin", - "title": "Passkey admin", - "type": "function", - }, - { - "id": "passkey-admin-deletepasskey", - "product": "auth", - "slug": "passkey-admin-deletepasskey", - "title": "deletePasskey", - "type": "function", - }, - { - "id": "passkey-admin-listpasskeys", - "product": "auth", - "slug": "passkey-admin-listpasskeys", - "title": "listPasskeys", - "type": "function", - }, - ], - "product": "auth", - "slug": "passkey-admin", - "title": "Passkey Admin", - "type": "function", - }, - ], - "title": "Auth", - "type": "category", - }, - { - "items": [ - { - "id": "functions-corsheaders", - "product": "edge-functions", - "slug": "functions-corsheaders", - "title": "corsHeaders", - "type": "function", - }, - { - "id": "functions-invoke", - "product": "edge-functions", - "slug": "functions-invoke", - "title": "invoke", - "type": "function", - }, - { - "id": "functions-setauth", - "product": "edge-functions", - "slug": "functions-setauth", - "title": "setAuth", - "type": "function", - }, - ], - "title": "Edge Functions", - "type": "category", - }, - { - "items": [ - { - "id": "channel", - "product": "realtime", - "slug": "channel", - "title": "channel", - "type": "function", - }, - { - "id": "connect", - "product": "realtime", - "slug": "connect", - "title": "connect", - "type": "function", - }, - { - "id": "connectionstate", - "product": "realtime", - "slug": "connectionstate", - "title": "connectionState", - "type": "function", - }, - { - "id": "disconnect", - "product": "realtime", - "slug": "disconnect", - "title": "disconnect", - "type": "function", - }, - { - "id": "endpointurl", - "product": "realtime", - "slug": "endpointurl", - "title": "endpointURL", - "type": "function", - }, - { - "id": "getchannels", - "product": "realtime", - "slug": "getchannels", - "title": "getChannels", - "type": "function", - }, - { - "id": "getwebsocketconstructor", - "product": "realtime", - "slug": "getwebsocketconstructor", - "title": "getWebSocketConstructor", - "type": "function", - }, - { - "id": "httpsend", - "product": "realtime", - "slug": "httpsend", - "title": "httpSend", - "type": "function", - }, - { - "id": "isconnected", - "product": "realtime", - "slug": "isconnected", - "title": "isConnected", - "type": "function", - }, - { - "id": "isconnecting", - "product": "realtime", - "slug": "isconnecting", - "title": "isConnecting", - "type": "function", - }, - { - "id": "isdisconnecting", - "product": "realtime", - "slug": "isdisconnecting", - "title": "isDisconnecting", - "type": "function", - }, - { - "id": "iswebsocketsupported", - "product": "realtime", - "slug": "iswebsocketsupported", - "title": "isWebSocketSupported", - "type": "function", - }, - { - "id": "log", - "product": "realtime", - "slug": "log", - "title": "log", - "type": "function", - }, - { - "id": "on", - "product": "realtime", - "slug": "on", - "title": "on", - "type": "function", - }, - { - "id": "onheartbeat", - "product": "realtime", - "slug": "onheartbeat", - "title": "onHeartbeat", - "type": "function", - }, - { - "id": "presencestate", - "product": "realtime", - "slug": "presencestate", - "title": "presenceState", - "type": "function", - }, - { - "id": "push", - "product": "realtime", - "slug": "push", - "title": "push", - "type": "function", - }, - { - "id": "removeallchannels", - "product": "realtime", - "slug": "removeallchannels", - "title": "removeAllChannels", - "type": "function", - }, - { - "id": "removechannel", - "product": "realtime", - "slug": "removechannel", - "title": "removeChannel", - "type": "function", - }, - { - "id": "send", - "product": "realtime", - "slug": "send", - "title": "send", - "type": "function", - }, - { - "id": "sendheartbeat", - "product": "realtime", - "slug": "sendheartbeat", - "title": "sendHeartbeat", - "type": "function", - }, - { - "id": "setauth", - "product": "realtime", - "slug": "setauth", - "title": "setAuth", - "type": "function", - }, - { - "id": "subscribe", - "product": "realtime", - "slug": "subscribe", - "title": "subscribe", - "type": "function", - }, - { - "id": "teardown", - "product": "realtime", - "slug": "teardown", - "title": "teardown", - "type": "function", - }, - { - "id": "track", - "product": "realtime", - "slug": "track", - "title": "track", - "type": "function", - }, - { - "id": "unsubscribe", - "product": "realtime", - "slug": "unsubscribe", - "title": "unsubscribe", - "type": "function", - }, - { - "id": "untrack", - "product": "realtime", - "slug": "untrack", - "title": "untrack", - "type": "function", - }, - { - "id": "updatejoinpayload", - "product": "realtime", - "slug": "updatejoinpayload", - "title": "updateJoinPayload", - "type": "function", - }, - ], - "title": "Realtime", - "type": "category", - }, - { - "items": [ - { - "id": "analytics-buckets", - "isFunc": false, - "items": [ - { - "id": "analytics-buckets", - "slug": "analytics-buckets", - "title": "Analytics Buckets", - "type": "function", - }, - { - "id": "analytics-buckets-createbucket", - "product": "storage", - "slug": "analytics-buckets-createbucket", - "title": "createBucket", - "type": "function", - }, - { - "id": "analytics-buckets-deletebucket", - "product": "storage", - "slug": "analytics-buckets-deletebucket", - "title": "deleteBucket", - "type": "function", - }, - { - "id": "analytics-buckets-from", - "product": "storage", - "slug": "analytics-buckets-from", - "title": "from", - "type": "function", - }, - { - "id": "analytics-buckets-listbuckets", - "product": "storage", - "slug": "analytics-buckets-listbuckets", - "title": "listBuckets", - "type": "function", - }, - ], - "product": "storage", - "slug": "analytics-buckets", - "title": "Analytics Buckets", - "type": "function", - }, - { - "id": "file-buckets", - "isFunc": false, - "items": [ - { - "id": "file-buckets", - "slug": "file-buckets", - "title": "File Buckets", - "type": "function", - }, - { - "id": "file-buckets-copy", - "product": "storage", - "slug": "file-buckets-copy", - "title": "copy", - "type": "function", - }, - { - "id": "file-buckets-createbucket", - "product": "storage", - "slug": "file-buckets-createbucket", - "title": "createBucket", - "type": "function", - }, - { - "id": "file-buckets-createsigneduploadurl", - "product": "storage", - "slug": "file-buckets-createsigneduploadurl", - "title": "createSignedUploadUrl", - "type": "function", - }, - { - "id": "file-buckets-createsignedurl", - "product": "storage", - "slug": "file-buckets-createsignedurl", - "title": "createSignedUrl", - "type": "function", - }, - { - "id": "file-buckets-createsignedurls", - "product": "storage", - "slug": "file-buckets-createsignedurls", - "title": "createSignedUrls", - "type": "function", - }, - { - "id": "file-buckets-deletebucket", - "product": "storage", - "slug": "file-buckets-deletebucket", - "title": "deleteBucket", - "type": "function", - }, - { - "id": "file-buckets-download", - "product": "storage", - "slug": "file-buckets-download", - "title": "download", - "type": "function", - }, - { - "id": "file-buckets-emptybucket", - "product": "storage", - "slug": "file-buckets-emptybucket", - "title": "emptyBucket", - "type": "function", - }, - { - "id": "file-buckets-exists", - "product": "storage", - "slug": "file-buckets-exists", - "title": "exists", - "type": "function", - }, - { - "id": "file-buckets-from", - "product": "storage", - "slug": "file-buckets-from", - "title": "from", - "type": "function", - }, - { - "id": "file-buckets-getbucket", - "product": "storage", - "slug": "file-buckets-getbucket", - "title": "getBucket", - "type": "function", - }, - { - "id": "file-buckets-getpublicurl", - "product": "storage", - "slug": "file-buckets-getpublicurl", - "title": "getPublicUrl", - "type": "function", - }, - { - "id": "file-buckets-info", - "product": "storage", - "slug": "file-buckets-info", - "title": "info", - "type": "function", - }, - { - "id": "file-buckets-list", - "product": "storage", - "slug": "file-buckets-list", - "title": "list", - "type": "function", - }, - { - "id": "file-buckets-listbuckets", - "product": "storage", - "slug": "file-buckets-listbuckets", - "title": "listBuckets", - "type": "function", - }, - { - "id": "file-buckets-listv2", - "product": "storage", - "slug": "file-buckets-listv2", - "title": "listV2", - "type": "function", - }, - { - "id": "file-buckets-move", - "product": "storage", - "slug": "file-buckets-move", - "title": "move", - "type": "function", - }, - { - "id": "file-buckets-remove", - "product": "storage", - "slug": "file-buckets-remove", - "title": "remove", - "type": "function", - }, - { - "id": "file-buckets-update", - "product": "storage", - "slug": "file-buckets-update", - "title": "update", - "type": "function", - }, - { - "id": "file-buckets-updatebucket", - "product": "storage", - "slug": "file-buckets-updatebucket", - "title": "updateBucket", - "type": "function", - }, - { - "id": "file-buckets-upload", - "product": "storage", - "slug": "file-buckets-upload", - "title": "upload", - "type": "function", - }, - { - "id": "file-buckets-uploadtosignedurl", - "product": "storage", - "slug": "file-buckets-uploadtosignedurl", - "title": "uploadToSignedUrl", - "type": "function", - }, - ], - "product": "storage", - "slug": "file-buckets", - "title": "File Buckets", - "type": "function", - }, - { - "id": "vector-buckets", - "isFunc": false, - "items": [ - { - "id": "vector-buckets", - "slug": "vector-buckets", - "title": "Vector Buckets", - "type": "function", - }, - { - "id": "vector-buckets-createbucket", - "product": "storage", - "slug": "vector-buckets-createbucket", - "title": "createBucket", - "type": "function", - }, - { - "id": "vector-buckets-createindex", - "product": "storage", - "slug": "vector-buckets-createindex", - "title": "createIndex", - "type": "function", - }, - { - "id": "vector-buckets-deletebucket", - "product": "storage", - "slug": "vector-buckets-deletebucket", - "title": "deleteBucket", - "type": "function", - }, - { - "id": "vector-buckets-deleteindex", - "product": "storage", - "slug": "vector-buckets-deleteindex", - "title": "deleteIndex", - "type": "function", - }, - { - "id": "vector-buckets-deletevectors", - "product": "storage", - "slug": "vector-buckets-deletevectors", - "title": "deleteVectors", - "type": "function", - }, - { - "id": "vector-buckets-from", - "product": "storage", - "slug": "vector-buckets-from", - "title": "from", - "type": "function", - }, - { - "id": "vector-buckets-getbucket", - "product": "storage", - "slug": "vector-buckets-getbucket", - "title": "getBucket", - "type": "function", - }, - { - "id": "vector-buckets-getindex", - "product": "storage", - "slug": "vector-buckets-getindex", - "title": "getIndex", - "type": "function", - }, - { - "id": "vector-buckets-getvectors", - "product": "storage", - "slug": "vector-buckets-getvectors", - "title": "getVectors", - "type": "function", - }, - { - "id": "vector-buckets-index", - "product": "storage", - "slug": "vector-buckets-index", - "title": "index", - "type": "function", - }, - { - "id": "vector-buckets-listbuckets", - "product": "storage", - "slug": "vector-buckets-listbuckets", - "title": "listBuckets", - "type": "function", - }, - { - "id": "vector-buckets-listindexes", - "product": "storage", - "slug": "vector-buckets-listindexes", - "title": "listIndexes", - "type": "function", - }, - { - "id": "vector-buckets-listvectors", - "product": "storage", - "slug": "vector-buckets-listvectors", - "title": "listVectors", - "type": "function", - }, - { - "id": "vector-buckets-putvectors", - "product": "storage", - "slug": "vector-buckets-putvectors", - "title": "putVectors", - "type": "function", - }, - { - "id": "vector-buckets-queryvectors", - "product": "storage", - "slug": "vector-buckets-queryvectors", - "title": "queryVectors", - "type": "function", - }, - ], - "product": "storage", - "slug": "vector-buckets", - "title": "Vector Buckets", - "type": "function", - }, - ], - "title": "Storage", - "type": "category", - }, - ], - "typeSpec": { - "methods": { - "@supabase/auth-js.AuthApiError.constructor": { - "comment": undefined, - "name": "@supabase/auth-js.AuthApiError.constructor", - "params": [ - { - "name": "message", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "status", - "type": { - "name": "number", - "type": "intrinsic", - }, - }, - { - "name": "code", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "name": "undefined", - "type": "intrinsic", - }, - { - "name": "string", - "type": "intrinsic", - }, - ], - "type": "union", - }, - }, - ], - "ret": { - "type": { - "name": "AuthApiError", - "type": "nameOnly", - }, - }, - }, - "@supabase/auth-js.AuthApiError.toJSON": { - "comment": undefined, - "name": "@supabase/auth-js.AuthApiError.toJSON", - "params": [], - "ret": { - "type": { - "name": Symbol(anonymous), - "properties": [ - { - "name": "code", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "name": "undefined", - "type": "intrinsic", - }, - undefined, - { - "name": "ErrorCode", - "type": "nameOnly", - }, - ], - "type": "union", - }, - }, - { - "name": "message", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "status", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "name": "undefined", - "type": "intrinsic", - }, - { - "name": "number", - "type": "intrinsic", - }, - ], - "type": "union", - }, - }, - ], - "type": "object", - }, - }, - }, - "@supabase/auth-js.AuthError.constructor": { - "comment": undefined, - "name": "@supabase/auth-js.AuthError.constructor", - "params": [ - { - "name": "message", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "status", - "type": { - "name": "number", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "code", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "ret": { - "type": { - "name": "AuthError", - "type": "nameOnly", - }, - }, - }, - "@supabase/auth-js.AuthError.toJSON": { - "comment": undefined, - "name": "@supabase/auth-js.AuthError.toJSON", - "params": [], - "ret": { - "type": { - "name": Symbol(anonymous), - "properties": [ - { - "name": "code", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "name": "undefined", - "type": "intrinsic", - }, - undefined, - { - "name": "ErrorCode", - "type": "nameOnly", - }, - ], - "type": "union", - }, - }, - { - "name": "message", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "status", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "name": "undefined", - "type": "intrinsic", - }, - { - "name": "number", - "type": "intrinsic", - }, - ], - "type": "union", - }, - }, - ], - "type": "object", - }, - }, - }, - "@supabase/auth-js.AuthImplicitGrantRedirectError.constructor": { - "comment": undefined, - "name": "@supabase/auth-js.AuthImplicitGrantRedirectError.constructor", - "params": [ - { - "name": "message", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "details", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": null, - }, - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "code", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "error", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - ], - "type": "union", - }, - }, - ], - "ret": { - "type": { - "name": "AuthImplicitGrantRedirectError", - "type": "nameOnly", - }, - }, - }, - "@supabase/auth-js.AuthImplicitGrantRedirectError.toJSON": { - "comment": undefined, - "name": "@supabase/auth-js.AuthImplicitGrantRedirectError.toJSON", - "params": [], - "ret": { - "type": { - "name": Symbol(anonymous), - "properties": [ - { - "name": "code", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "name": "undefined", - "type": "intrinsic", - }, - undefined, - { - "name": "ErrorCode", - "type": "nameOnly", - }, - ], - "type": "union", - }, - }, - { - "name": "details", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": null, - }, - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "code", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "error", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - ], - "type": "union", - }, - }, - { - "name": "message", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "status", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "name": "undefined", - "type": "intrinsic", - }, - { - "name": "number", - "type": "intrinsic", - }, - ], - "type": "union", - }, - }, - ], - "type": "object", - }, - }, - }, - "@supabase/auth-js.AuthInvalidCredentialsError.constructor": { - "comment": undefined, - "name": "@supabase/auth-js.AuthInvalidCredentialsError.constructor", - "params": [ - { - "name": "message", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "ret": { - "type": { - "name": "AuthInvalidCredentialsError", - "type": "nameOnly", - }, - }, - }, - "@supabase/auth-js.AuthInvalidCredentialsError.toJSON": { - "comment": undefined, - "name": "@supabase/auth-js.AuthInvalidCredentialsError.toJSON", - "params": [], - "ret": { - "type": { - "name": Symbol(anonymous), - "properties": [ - { - "name": "code", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "name": "undefined", - "type": "intrinsic", - }, - undefined, - { - "name": "ErrorCode", - "type": "nameOnly", - }, - ], - "type": "union", - }, - }, - { - "name": "message", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "status", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "name": "undefined", - "type": "intrinsic", - }, - { - "name": "number", - "type": "intrinsic", - }, - ], - "type": "union", - }, - }, - ], - "type": "object", - }, - }, - }, - "@supabase/auth-js.AuthInvalidJwtError.constructor": { - "comment": undefined, - "name": "@supabase/auth-js.AuthInvalidJwtError.constructor", - "params": [ - { - "name": "message", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "ret": { - "type": { - "name": "AuthInvalidJwtError", - "type": "nameOnly", - }, - }, - }, - "@supabase/auth-js.AuthInvalidJwtError.toJSON": { - "comment": undefined, - "name": "@supabase/auth-js.AuthInvalidJwtError.toJSON", - "params": [], - "ret": { - "type": { - "name": Symbol(anonymous), - "properties": [ - { - "name": "code", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "name": "undefined", - "type": "intrinsic", - }, - undefined, - { - "name": "ErrorCode", - "type": "nameOnly", - }, - ], - "type": "union", - }, - }, - { - "name": "message", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "status", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "name": "undefined", - "type": "intrinsic", - }, - { - "name": "number", - "type": "intrinsic", - }, - ], - "type": "union", - }, - }, - ], - "type": "object", - }, - }, - }, - "@supabase/auth-js.AuthInvalidTokenResponseError.constructor": { - "comment": undefined, - "name": "@supabase/auth-js.AuthInvalidTokenResponseError.constructor", - "params": [], - "ret": { - "type": { - "name": "AuthInvalidTokenResponseError", - "type": "nameOnly", - }, - }, - }, - "@supabase/auth-js.AuthInvalidTokenResponseError.toJSON": { - "comment": undefined, - "name": "@supabase/auth-js.AuthInvalidTokenResponseError.toJSON", - "params": [], - "ret": { - "type": { - "name": Symbol(anonymous), - "properties": [ - { - "name": "code", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "name": "undefined", - "type": "intrinsic", - }, - undefined, - { - "name": "ErrorCode", - "type": "nameOnly", - }, - ], - "type": "union", - }, - }, - { - "name": "message", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "status", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "name": "undefined", - "type": "intrinsic", - }, - { - "name": "number", - "type": "intrinsic", - }, - ], - "type": "union", - }, - }, - ], - "type": "object", - }, - }, - }, - "@supabase/auth-js.AuthOAuthServerApi.approveAuthorization": { - "comment": { - "shortText": "Approves an OAuth authorization request. -Only relevant when the OAuth 2.1 server is enabled in Supabase Auth. - -After approval, the user's consent is stored and an authorization code is generated. -The response contains a complete redirect URL with the authorization code and state.", - }, - "name": "@supabase/auth-js.AuthOAuthServerApi.approveAuthorization", - "params": [ - { - "comment": { - "shortText": "The authorization ID to approve", - }, - "name": "authorizationId", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Optional parameters", - }, - "isOptional": true, - "name": "options", - "type": { - "name": Symbol(anonymous), - "properties": [ - { - "comment": { - "shortText": "If false (default), automatically redirects the browser to the OAuth client. If true, returns the redirect_url without automatic redirect (useful for custom handling).", - }, - "isOptional": true, - "name": "skipBrowserRedirect", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - }, - ], - "ret": { - "type": { - "awaited": { - "name": "AuthOAuthConsentResponse", - "subTypes": [ - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "name": "OAuthRedirect", - "properties": [ - { - "comment": { - "shortText": "Complete redirect URL with authorization code and state parameters (e.g., "https://app.com/callback?code=xxx&state=yyy")", - }, - "name": "redirect_url", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - }, - { - "name": "error", - "type": { - "type": "literal", - "value": null, - }, - }, - ], - "type": "object", - }, - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "type": "literal", - "value": null, - }, - }, - { - "name": "error", - "type": undefined, - }, - ], - "type": "object", - }, - ], - "type": "union", - }, - "name": "Promise", - "type": "promise", - }, - }, - }, - "@supabase/auth-js.AuthOAuthServerApi.denyAuthorization": { - "comment": { - "shortText": "Denies an OAuth authorization request. -Only relevant when the OAuth 2.1 server is enabled in Supabase Auth. - -After denial, the response contains a redirect URL with an OAuth error -(access_denied) to inform the OAuth client that the user rejected the request.", - }, - "name": "@supabase/auth-js.AuthOAuthServerApi.denyAuthorization", - "params": [ - { - "comment": { - "shortText": "The authorization ID to deny", - }, - "name": "authorizationId", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Optional parameters", - }, - "isOptional": true, - "name": "options", - "type": { - "name": Symbol(anonymous), - "properties": [ - { - "comment": { - "shortText": "If false (default), automatically redirects the browser to the OAuth client. If true, returns the redirect_url without automatic redirect (useful for custom handling).", - }, - "isOptional": true, - "name": "skipBrowserRedirect", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - }, - ], - "ret": { - "type": { - "awaited": { - "name": "AuthOAuthConsentResponse", - "subTypes": [ - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "name": "OAuthRedirect", - "properties": [ - { - "comment": { - "shortText": "Complete redirect URL with authorization code and state parameters (e.g., "https://app.com/callback?code=xxx&state=yyy")", - }, - "name": "redirect_url", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - }, - { - "name": "error", - "type": { - "type": "literal", - "value": null, - }, - }, - ], - "type": "object", - }, - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "type": "literal", - "value": null, - }, - }, - { - "name": "error", - "type": undefined, - }, - ], - "type": "object", - }, - ], - "type": "union", - }, - "name": "Promise", - "type": "promise", - }, - }, - }, - "@supabase/auth-js.AuthOAuthServerApi.getAuthorizationDetails": { - "comment": { - "shortText": "Retrieves details about an OAuth authorization request. -Used to display consent information to the user. -Only relevant when the OAuth 2.1 server is enabled in Supabase Auth. - -This method returns one of two response types: -- \`OAuthAuthorizationDetails\`: User needs to consent - show consent page with client info -- \`OAuthRedirect\`: User already consented - redirect immediately to the OAuth client - -Use type narrowing to distinguish between the responses: -\`\`\`typescript -if ('authorization_id' in data) { - // Show consent page -} else { - // Redirect to data.redirect_url -} -\`\`\`", - }, - "name": "@supabase/auth-js.AuthOAuthServerApi.getAuthorizationDetails", - "params": [ - { - "comment": { - "shortText": "The authorization ID from the authorization request", - }, - "name": "authorizationId", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "ret": { - "type": { - "awaited": { - "name": "AuthOAuthAuthorizationDetailsResponse", - "subTypes": [ - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "name": "OAuthAuthorizationDetails", - "properties": [ - { - "comment": { - "shortText": "The authorization ID used to approve or deny the request", - }, - "name": "authorization_id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "OAuth client requesting authorization", - }, - "name": "client", - "type": { - "name": "OAuthAuthorizationClient", - "properties": [ - { - "comment": { - "shortText": "Unique identifier for the OAuth client (UUID)", - }, - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "URI of the OAuth client's logo", - }, - "name": "logo_uri", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Human-readable name of the OAuth client", - }, - "name": "name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "URI of the OAuth client's website", - }, - "name": "uri", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - }, - { - "comment": { - "shortText": "The OAuth client's registered redirect URI (base URI without query parameters)", - }, - "name": "redirect_uri", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Space-separated list of requested scopes (e.g., "openid profile email")", - }, - "name": "scope", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "User object associated with the authorization", - }, - "name": "user", - "type": { - "name": Symbol(anonymous), - "properties": [ - { - "comment": { - "shortText": "User email", - }, - "name": "email", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "User ID (UUID)", - }, - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - }, - ], - "type": "object", - }, - { - "name": "OAuthRedirect", - "properties": [ - { - "comment": { - "shortText": "Complete redirect URL with authorization code and state parameters (e.g., "https://app.com/callback?code=xxx&state=yyy")", - }, - "name": "redirect_url", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - ], - "type": "union", - }, - }, - { - "name": "error", - "type": { - "type": "literal", - "value": null, - }, - }, - ], - "type": "object", - }, - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "type": "literal", - "value": null, - }, - }, - { - "name": "error", - "type": undefined, - }, - ], - "type": "object", - }, - ], - "type": "union", - }, - "name": "Promise", - "type": "promise", - }, - }, - }, - "@supabase/auth-js.AuthOAuthServerApi.listGrants": { - "comment": { - "shortText": "Lists all OAuth grants that the authenticated user has authorized. -Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.", - }, - "name": "@supabase/auth-js.AuthOAuthServerApi.listGrants", - "params": [], - "ret": { - "type": { - "awaited": { - "name": "AuthOAuthGrantsResponse", - "subTypes": [ - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "elemType": { - "name": "OAuthGrant", - "properties": [ - { - "comment": { - "shortText": "OAuth client information", - }, - "name": "client", - "type": { - "name": "OAuthAuthorizationClient", - "properties": [ - { - "comment": { - "shortText": "Unique identifier for the OAuth client (UUID)", - }, - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "URI of the OAuth client's logo", - }, - "name": "logo_uri", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Human-readable name of the OAuth client", - }, - "name": "name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "URI of the OAuth client's website", - }, - "name": "uri", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - }, - { - "comment": { - "shortText": "Timestamp when the grant was created (ISO 8601 date-time)", - }, - "name": "granted_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Array of scopes granted to this client", - }, - "name": "scopes", - "type": { - "elemType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - ], - "type": "object", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "name": "error", - "type": { - "type": "literal", - "value": null, - }, - }, - ], - "type": "object", - }, - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "type": "literal", - "value": null, - }, - }, - { - "name": "error", - "type": undefined, - }, - ], - "type": "object", - }, - ], - "type": "union", - }, - "name": "Promise", - "type": "promise", - }, - }, - }, - "@supabase/auth-js.AuthOAuthServerApi.revokeGrant": { - "comment": { - "shortText": "Revokes a user's OAuth grant for a specific client. -Only relevant when the OAuth 2.1 server is enabled in Supabase Auth. - -Revocation marks consent as revoked, deletes active sessions for that OAuth client, -and invalidates associated refresh tokens.", - }, - "name": "@supabase/auth-js.AuthOAuthServerApi.revokeGrant", - "params": [ - { - "comment": { - "shortText": "Revocation options", - }, - "name": "options", - "type": { - "name": Symbol(anonymous), - "properties": [ - { - "comment": { - "shortText": "The OAuth client identifier (UUID) to revoke access for", - }, - "name": "clientId", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - }, - ], - "ret": { - "type": { - "awaited": { - "name": "AuthOAuthRevokeGrantResponse", - "subTypes": [ - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": undefined, - }, - { - "name": "error", - "type": { - "type": "literal", - "value": null, - }, - }, - ], - "type": "object", - }, - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "type": "literal", - "value": null, - }, - }, - { - "name": "error", - "type": undefined, - }, - ], - "type": "object", - }, - ], - "type": "union", - }, - "name": "Promise", - "type": "promise", - }, - }, - }, - "@supabase/auth-js.AuthPKCECodeVerifierMissingError.constructor": { - "comment": undefined, - "name": "@supabase/auth-js.AuthPKCECodeVerifierMissingError.constructor", - "params": [], - "ret": { - "type": { - "name": "AuthPKCECodeVerifierMissingError", - "type": "nameOnly", - }, - }, - }, - "@supabase/auth-js.AuthPKCECodeVerifierMissingError.toJSON": { - "comment": undefined, - "name": "@supabase/auth-js.AuthPKCECodeVerifierMissingError.toJSON", - "params": [], - "ret": { - "type": { - "name": Symbol(anonymous), - "properties": [ - { - "name": "code", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "name": "undefined", - "type": "intrinsic", - }, - undefined, - { - "name": "ErrorCode", - "type": "nameOnly", - }, - ], - "type": "union", - }, - }, - { - "name": "message", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "status", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "name": "undefined", - "type": "intrinsic", - }, - { - "name": "number", - "type": "intrinsic", - }, - ], - "type": "union", - }, - }, - ], - "type": "object", - }, - }, - }, - "@supabase/auth-js.AuthPKCEGrantCodeExchangeError.constructor": { - "comment": undefined, - "name": "@supabase/auth-js.AuthPKCEGrantCodeExchangeError.constructor", - "params": [ - { - "name": "message", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "details", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": null, - }, - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "code", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "error", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - ], - "type": "union", - }, - }, - ], - "ret": { - "type": { - "name": "AuthPKCEGrantCodeExchangeError", - "type": "nameOnly", - }, - }, - }, - "@supabase/auth-js.AuthPKCEGrantCodeExchangeError.toJSON": { - "comment": undefined, - "name": "@supabase/auth-js.AuthPKCEGrantCodeExchangeError.toJSON", - "params": [], - "ret": { - "type": { - "name": Symbol(anonymous), - "properties": [ - { - "name": "code", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "name": "undefined", - "type": "intrinsic", - }, - undefined, - { - "name": "ErrorCode", - "type": "nameOnly", - }, - ], - "type": "union", - }, - }, - { - "name": "details", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": null, - }, - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "code", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "error", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - ], - "type": "union", - }, - }, - { - "name": "message", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "status", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "name": "undefined", - "type": "intrinsic", - }, - { - "name": "number", - "type": "intrinsic", - }, - ], - "type": "union", - }, - }, - ], - "type": "object", - }, - }, - }, - "@supabase/auth-js.AuthPasskeyApi.delete": { - "comment": { - "shortText": "Deletes a passkey for the currently signed-in user.", - }, - "name": "@supabase/auth-js.AuthPasskeyApi.delete", - "params": [ - { - "name": "params", - "type": { - "name": "PasskeyDeleteParams", - "properties": [ - { - "comment": { - "shortText": "UUID of the passkey to delete", - }, - "name": "passkeyId", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - }, - ], - "ret": { - "type": { - "awaited": { - "name": "AuthPasskeyDeleteResponse", - "subTypes": [ - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "type": "literal", - "value": null, - }, - }, - { - "name": "error", - "type": { - "type": "literal", - "value": null, - }, - }, - ], - "type": "object", - }, - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "type": "literal", - "value": null, - }, - }, - { - "name": "error", - "type": undefined, - }, - ], - "type": "object", - }, - ], - "type": "union", - }, - "name": "Promise", - "type": "promise", - }, - }, - }, - "@supabase/auth-js.AuthPasskeyApi.list": { - "comment": { - "shortText": "Lists all passkeys registered for the currently signed-in user.", - }, - "name": "@supabase/auth-js.AuthPasskeyApi.list", - "params": [], - "ret": { - "type": { - "awaited": { - "name": "AuthPasskeyListResponse", - "subTypes": [ - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "elemType": { - "name": "PasskeyListItem", - "properties": [ - { - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "friendly_name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_used_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "name": "error", - "type": { - "type": "literal", - "value": null, - }, - }, - ], - "type": "object", - }, - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "type": "literal", - "value": null, - }, - }, - { - "name": "error", - "type": undefined, - }, - ], - "type": "object", - }, - ], - "type": "union", - }, - "name": "Promise", - "type": "promise", - }, - }, - }, - "@supabase/auth-js.AuthPasskeyApi.startAuthentication": { - "comment": { - "shortText": "Starts the passkey authentication ceremony. Fetches an authentication -challenge and credential request options from the server. Used as the -first step of a two-step sign-in flow when the caller wants to handle -\`navigator.credentials.get()\` themselves.", - }, - "name": "@supabase/auth-js.AuthPasskeyApi.startAuthentication", - "params": [ - { - "isOptional": true, - "name": "params", - "type": { - "name": "StartPasskeyAuthenticationParams", - "properties": [ - { - "isOptional": true, - "name": "options", - "type": { - "name": Symbol(anonymous), - "properties": [ - { - "isOptional": true, - "name": "captchaToken", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - }, - ], - "type": "object", - }, - }, - ], - "ret": { - "type": { - "awaited": { - "name": "AuthPasskeyAuthenticationOptionsResponse", - "subTypes": [ - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "name": "PasskeyAuthenticationOptionsResponse", - "properties": [ - { - "name": "challenge_id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "expires_at", - "type": { - "name": "number", - "type": "intrinsic", - }, - }, - { - "name": "options", - "type": { - "name": "ServerCredentialRequestOptions", - "type": "nameOnly", - }, - }, - ], - "type": "object", - }, - }, - { - "name": "error", - "type": { - "type": "literal", - "value": null, - }, - }, - ], - "type": "object", - }, - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "type": "literal", - "value": null, - }, - }, - { - "name": "error", - "type": undefined, - }, - ], - "type": "object", - }, - ], - "type": "union", - }, - "name": "Promise", - "type": "promise", - }, - }, - }, - "@supabase/auth-js.AuthPasskeyApi.startRegistration": { - "comment": { - "shortText": "Starts the passkey registration ceremony. Fetches a registration challenge -and credential creation options from the server. Used as the first step of -a two-step registration flow when the caller wants to handle -\`navigator.credentials.create()\` themselves.", - }, - "name": "@supabase/auth-js.AuthPasskeyApi.startRegistration", - "params": [], - "ret": { - "type": { - "awaited": { - "name": "AuthPasskeyRegistrationOptionsResponse", - "subTypes": [ - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "name": "PasskeyRegistrationOptionsResponse", - "properties": [ - { - "name": "challenge_id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "expires_at", - "type": { - "name": "number", - "type": "intrinsic", - }, - }, - { - "name": "options", - "type": { - "name": "ServerCredentialCreationOptions", - "type": "nameOnly", - }, - }, - ], - "type": "object", - }, - }, - { - "name": "error", - "type": { - "type": "literal", - "value": null, - }, - }, - ], - "type": "object", - }, - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "type": "literal", - "value": null, - }, - }, - { - "name": "error", - "type": undefined, - }, - ], - "type": "object", - }, - ], - "type": "union", - }, - "name": "Promise", - "type": "promise", - }, - }, - }, - "@supabase/auth-js.AuthPasskeyApi.update": { - "comment": { - "shortText": "Updates a passkey's friendly name.", - }, - "name": "@supabase/auth-js.AuthPasskeyApi.update", - "params": [ - { - "name": "params", - "type": { - "name": "PasskeyUpdateParams", - "properties": [ - { - "comment": { - "shortText": "New friendly name (max 120 chars)", - }, - "name": "friendlyName", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "UUID of the passkey to update", - }, - "name": "passkeyId", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - }, - ], - "ret": { - "type": { - "awaited": { - "name": "AuthPasskeyUpdateResponse", - "subTypes": [ - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "name": "PasskeyListItem", - "properties": [ - { - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "friendly_name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_used_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - }, - { - "name": "error", - "type": { - "type": "literal", - "value": null, - }, - }, - ], - "type": "object", - }, - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "type": "literal", - "value": null, - }, - }, - { - "name": "error", - "type": undefined, - }, - ], - "type": "object", - }, - ], - "type": "union", - }, - "name": "Promise", - "type": "promise", - }, - }, - }, - "@supabase/auth-js.AuthPasskeyApi.verifyAuthentication": { - "comment": { - "shortText": "Verifies a passkey authentication credential against a previously issued -challenge. Used as the second step of a two-step sign-in flow.", - }, - "name": "@supabase/auth-js.AuthPasskeyApi.verifyAuthentication", - "params": [ - { - "name": "params", - "type": { - "name": "VerifyPasskeyAuthenticationParams", - "properties": [ - { - "comment": { - "shortText": "Challenge ID from startAuthentication", - }, - "name": "challengeId", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Serialized credential from navigator.credentials.get()", - }, - "name": "credential", - "type": { - "name": "ServerCredentialResponse", - "type": "nameOnly", - }, - }, - ], - "type": "object", - }, - }, - ], - "ret": { - "type": { - "awaited": { - "name": "AuthPasskeyAuthenticationVerifyResponse", - "subTypes": [ - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "name": Symbol(anonymous), - "properties": [ - { - "name": "session", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "name": "Session", - "properties": [ - { - "comment": { - "shortText": "The access token jwt. It is recommended to set the JWT_EXPIRY to a shorter expiry value.", - }, - "name": "access_token", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "A timestamp of when the token will expire. Returned when a login is confirmed.", - }, - "isOptional": true, - "name": "expires_at", - "type": { - "name": "number", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The number of seconds until the token expires (since it was issued). Returned when a login is confirmed.", - }, - "name": "expires_in", - "type": { - "name": "number", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The oauth provider refresh token. If present, this can be used to refresh the provider_token via the oauth provider's API. -Not all oauth providers return a provider refresh token. If the provider_refresh_token is missing, please refer to the oauth provider's documentation for information on how to obtain the provider refresh token.", - }, - "isOptional": true, - "name": "provider_refresh_token", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": null, - }, - { - "name": "string", - "type": "intrinsic", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "The oauth provider token. If present, this can be used to make external API requests to the oauth provider used.", - }, - "isOptional": true, - "name": "provider_token", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": null, - }, - { - "name": "string", - "type": "intrinsic", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "A one-time used refresh token that never expires.", - }, - "name": "refresh_token", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "token_type", - "type": { - "type": "literal", - "value": "bearer", - }, - }, - { - "comment": { - "shortText": "When using a separate user storage, accessing properties of this object will throw an error.", - }, - "name": "user", - "type": { - "name": "User", - "properties": [ - { - "isOptional": true, - "name": "action_link", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "app_metadata", - "type": { - "name": "UserAppMetadata", - "properties": [ - { - "comment": { - "shortText": "The first provider that the user used to sign up with.", - }, - "isOptional": true, - "name": "provider", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "A list of all providers that the user has linked to their account.", - }, - "isOptional": true, - "name": "providers", - "type": { - "elemType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - ], - "type": "object", - }, - }, - { - "name": "aud", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "banned_until", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "confirmation_sent_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "confirmed_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "deleted_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "email", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "email_change_sent_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "email_confirmed_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "factors", - "type": { - "elemType": { - "name": Symbol(anonymous), - "subTypes": [ - { - "name": "Factor", - "properties": [ - { - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Type of factor. \`totp\` and \`phone\` supported with this version", - }, - "name": "factor_type", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors.", - }, - "isOptional": true, - "name": "friendly_name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "ID of the factor.", - }, - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_challenged_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The verification status of the factor, default is \`unverified\` after \`.enroll()\`, then \`verified\` after the user verifies it with \`.verify()\`", - }, - "name": "status", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - { - "name": "Factor", - "properties": [ - { - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Type of factor. \`totp\` and \`phone\` supported with this version", - }, - "name": "factor_type", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors.", - }, - "isOptional": true, - "name": "friendly_name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "ID of the factor.", - }, - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_challenged_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The verification status of the factor, default is \`unverified\` after \`.enroll()\`, then \`verified\` after the user verifies it with \`.verify()\`", - }, - "name": "status", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - ], - "type": "union", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "identities", - "type": { - "elemType": { - "name": "UserIdentity", - "properties": [ - { - "isOptional": true, - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "identity_data", - "type": { - "keyType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "index signature", - "valueType": { - "name": "any", - "type": "intrinsic", - }, - }, - }, - { - "name": "identity_id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_sign_in_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "provider", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "user_id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "isOptional": true, - "name": "invited_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "is_anonymous", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "is_sso_user", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_sign_in_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "new_email", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "new_phone", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "phone", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "phone_confirmed_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "recovery_sent_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "role", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "user_metadata", - "type": { - "name": "UserMetadata", - "properties": [], - "type": "object", - }, - }, - ], - "type": "object", - }, - }, - ], - "type": "object", - }, - { - "type": "literal", - "value": null, - }, - ], - "type": "union", - }, - }, - { - "name": "user", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "name": "User", - "properties": [ - { - "isOptional": true, - "name": "action_link", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "app_metadata", - "type": { - "name": "UserAppMetadata", - "properties": [ - { - "comment": { - "shortText": "The first provider that the user used to sign up with.", - }, - "isOptional": true, - "name": "provider", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "A list of all providers that the user has linked to their account.", - }, - "isOptional": true, - "name": "providers", - "type": { - "elemType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - ], - "type": "object", - }, - }, - { - "name": "aud", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "banned_until", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "confirmation_sent_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "confirmed_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "deleted_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "email", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "email_change_sent_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "email_confirmed_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "factors", - "type": { - "elemType": { - "name": Symbol(anonymous), - "subTypes": [ - { - "name": "Factor", - "properties": [ - { - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Type of factor. \`totp\` and \`phone\` supported with this version", - }, - "name": "factor_type", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors.", - }, - "isOptional": true, - "name": "friendly_name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "ID of the factor.", - }, - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_challenged_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The verification status of the factor, default is \`unverified\` after \`.enroll()\`, then \`verified\` after the user verifies it with \`.verify()\`", - }, - "name": "status", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - { - "name": "Factor", - "properties": [ - { - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Type of factor. \`totp\` and \`phone\` supported with this version", - }, - "name": "factor_type", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors.", - }, - "isOptional": true, - "name": "friendly_name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "ID of the factor.", - }, - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_challenged_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The verification status of the factor, default is \`unverified\` after \`.enroll()\`, then \`verified\` after the user verifies it with \`.verify()\`", - }, - "name": "status", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - ], - "type": "union", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "identities", - "type": { - "elemType": { - "name": "UserIdentity", - "properties": [ - { - "isOptional": true, - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "identity_data", - "type": { - "keyType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "index signature", - "valueType": { - "name": "any", - "type": "intrinsic", - }, - }, - }, - { - "name": "identity_id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_sign_in_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "provider", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "user_id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "isOptional": true, - "name": "invited_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "is_anonymous", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "is_sso_user", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_sign_in_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "new_email", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "new_phone", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "phone", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "phone_confirmed_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "recovery_sent_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "role", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "user_metadata", - "type": { - "name": "UserMetadata", - "properties": [], - "type": "object", - }, - }, - ], - "type": "object", - }, - { - "type": "literal", - "value": null, - }, - ], - "type": "union", - }, - }, - ], - "type": "object", - }, - }, - { - "name": "error", - "type": { - "type": "literal", - "value": null, - }, - }, - ], - "type": "object", - }, - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "type": "literal", - "value": null, - }, - }, - { - "name": "error", - "type": undefined, - }, - ], - "type": "object", - }, - ], - "type": "union", - }, - "name": "Promise", - "type": "promise", - }, - }, - }, - "@supabase/auth-js.AuthPasskeyApi.verifyRegistration": { - "comment": { - "shortText": "Verifies a passkey registration credential against a previously issued -challenge. Used as the second step of a two-step registration flow.", - }, - "name": "@supabase/auth-js.AuthPasskeyApi.verifyRegistration", - "params": [ - { - "name": "params", - "type": { - "name": "VerifyPasskeyRegistrationParams", - "properties": [ - { - "comment": { - "shortText": "Challenge ID from startRegistration", - }, - "name": "challengeId", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Serialized credential from navigator.credentials.create()", - }, - "name": "credential", - "type": { - "name": "ServerCredentialResponse", - "type": "nameOnly", - }, - }, - ], - "type": "object", - }, - }, - ], - "ret": { - "type": { - "awaited": { - "name": "AuthPasskeyRegistrationVerifyResponse", - "subTypes": [ - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "name": "PasskeyMetadata", - "properties": [ - { - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "friendly_name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - }, - { - "name": "error", - "type": { - "type": "literal", - "value": null, - }, - }, - ], - "type": "object", - }, - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "type": "literal", - "value": null, - }, - }, - { - "name": "error", - "type": undefined, - }, - ], - "type": "object", - }, - ], - "type": "union", - }, - "name": "Promise", - "type": "promise", - }, - }, - }, - "@supabase/auth-js.AuthRefreshDiscardedError.constructor": { - "comment": undefined, - "name": "@supabase/auth-js.AuthRefreshDiscardedError.constructor", - "params": [ - { - "name": "message", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "ret": { - "type": { - "name": "AuthRefreshDiscardedError", - "type": "nameOnly", - }, - }, - }, - "@supabase/auth-js.AuthRefreshDiscardedError.toJSON": { - "comment": undefined, - "name": "@supabase/auth-js.AuthRefreshDiscardedError.toJSON", - "params": [], - "ret": { - "type": { - "name": Symbol(anonymous), - "properties": [ - { - "name": "code", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "name": "undefined", - "type": "intrinsic", - }, - undefined, - { - "name": "ErrorCode", - "type": "nameOnly", - }, - ], - "type": "union", - }, - }, - { - "name": "message", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "status", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "name": "undefined", - "type": "intrinsic", - }, - { - "name": "number", - "type": "intrinsic", - }, - ], - "type": "union", - }, - }, - ], - "type": "object", - }, - }, - }, - "@supabase/auth-js.AuthRetryableFetchError.constructor": { - "comment": undefined, - "name": "@supabase/auth-js.AuthRetryableFetchError.constructor", - "params": [ - { - "name": "message", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "status", - "type": { - "name": "number", - "type": "intrinsic", - }, - }, - ], - "ret": { - "type": { - "name": "AuthRetryableFetchError", - "type": "nameOnly", - }, - }, - }, - "@supabase/auth-js.AuthRetryableFetchError.toJSON": { - "comment": undefined, - "name": "@supabase/auth-js.AuthRetryableFetchError.toJSON", - "params": [], - "ret": { - "type": { - "name": Symbol(anonymous), - "properties": [ - { - "name": "code", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "name": "undefined", - "type": "intrinsic", - }, - undefined, - { - "name": "ErrorCode", - "type": "nameOnly", - }, - ], - "type": "union", - }, - }, - { - "name": "message", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "status", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "name": "undefined", - "type": "intrinsic", - }, - { - "name": "number", - "type": "intrinsic", - }, - ], - "type": "union", - }, - }, - ], - "type": "object", - }, - }, - }, - "@supabase/auth-js.AuthSessionMissingError.constructor": { - "comment": undefined, - "name": "@supabase/auth-js.AuthSessionMissingError.constructor", - "params": [], - "ret": { - "type": { - "name": "AuthSessionMissingError", - "type": "nameOnly", - }, - }, - }, - "@supabase/auth-js.AuthSessionMissingError.toJSON": { - "comment": undefined, - "name": "@supabase/auth-js.AuthSessionMissingError.toJSON", - "params": [], - "ret": { - "type": { - "name": Symbol(anonymous), - "properties": [ - { - "name": "code", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "name": "undefined", - "type": "intrinsic", - }, - undefined, - { - "name": "ErrorCode", - "type": "nameOnly", - }, - ], - "type": "union", - }, - }, - { - "name": "message", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "status", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "name": "undefined", - "type": "intrinsic", - }, - { - "name": "number", - "type": "intrinsic", - }, - ], - "type": "union", - }, - }, - ], - "type": "object", - }, - }, - }, - "@supabase/auth-js.AuthUnknownError.constructor": { - "comment": undefined, - "name": "@supabase/auth-js.AuthUnknownError.constructor", - "params": [ - { - "name": "message", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "originalError", - "type": { - "name": "unknown", - "type": "intrinsic", - }, - }, - ], - "ret": { - "type": { - "name": "AuthUnknownError", - "type": "nameOnly", - }, - }, - }, - "@supabase/auth-js.AuthUnknownError.toJSON": { - "comment": undefined, - "name": "@supabase/auth-js.AuthUnknownError.toJSON", - "params": [], - "ret": { - "type": { - "name": Symbol(anonymous), - "properties": [ - { - "name": "code", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "name": "undefined", - "type": "intrinsic", - }, - undefined, - { - "name": "ErrorCode", - "type": "nameOnly", - }, - ], - "type": "union", - }, - }, - { - "name": "message", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "status", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "name": "undefined", - "type": "intrinsic", - }, - { - "name": "number", - "type": "intrinsic", - }, - ], - "type": "union", - }, - }, - ], - "type": "object", - }, - }, - }, - "@supabase/auth-js.AuthWeakPasswordError.constructor": { - "comment": undefined, - "name": "@supabase/auth-js.AuthWeakPasswordError.constructor", - "params": [ - { - "name": "message", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "status", - "type": { - "name": "number", - "type": "intrinsic", - }, - }, - { - "name": "reasons", - "type": { - "elemType": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "length", - }, - { - "type": "literal", - "value": "characters", - }, - { - "type": "literal", - "value": "pwned", - }, - ], - "type": "union", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - ], - "ret": { - "type": { - "name": "AuthWeakPasswordError", - "type": "nameOnly", - }, - }, - }, - "@supabase/auth-js.AuthWeakPasswordError.toJSON": { - "comment": undefined, - "name": "@supabase/auth-js.AuthWeakPasswordError.toJSON", - "params": [], - "ret": { - "type": { - "name": Symbol(anonymous), - "properties": [ - { - "name": "code", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "name": "undefined", - "type": "intrinsic", - }, - undefined, - { - "name": "ErrorCode", - "type": "nameOnly", - }, - ], - "type": "union", - }, - }, - { - "name": "message", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "reasons", - "type": { - "elemType": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "length", - }, - { - "type": "literal", - "value": "characters", - }, - { - "type": "literal", - "value": "pwned", - }, - ], - "type": "union", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "name": "status", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "name": "undefined", - "type": "intrinsic", - }, - { - "name": "number", - "type": "intrinsic", - }, - ], - "type": "union", - }, - }, - ], - "type": "object", - }, - }, - }, - "@supabase/auth-js.CustomAuthError.constructor": { - "comment": undefined, - "name": "@supabase/auth-js.CustomAuthError.constructor", - "params": [ - { - "name": "message", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "status", - "type": { - "name": "number", - "type": "intrinsic", - }, - }, - { - "name": "code", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "name": "undefined", - "type": "intrinsic", - }, - { - "name": "string", - "type": "intrinsic", - }, - ], - "type": "union", - }, - }, - ], - "ret": { - "type": { - "name": "CustomAuthError", - "type": "nameOnly", - }, - }, - }, - "@supabase/auth-js.CustomAuthError.toJSON": { - "comment": undefined, - "name": "@supabase/auth-js.CustomAuthError.toJSON", - "params": [], - "ret": { - "type": { - "name": Symbol(anonymous), - "properties": [ - { - "name": "code", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "name": "undefined", - "type": "intrinsic", - }, - undefined, - { - "name": "ErrorCode", - "type": "nameOnly", - }, - ], - "type": "union", - }, - }, - { - "name": "message", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "status", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "name": "undefined", - "type": "intrinsic", - }, - { - "name": "number", - "type": "intrinsic", - }, - ], - "type": "union", - }, - }, - ], - "type": "object", - }, - }, - }, - "@supabase/auth-js.GoTrueAdminApi.constructor": { - "comment": { - "examples": [ - { - "code": "\`\`\`ts -import { createClient } from '@supabase/supabase-js' - -const supabase = createClient('https://xyzcompany.supabase.co', 'your-secret-key') -const { data, error } = await supabase.auth.admin.listUsers() -\`\`\`", - "data": undefined, - "description": undefined, - "id": "using-supabase-js-recommended", - "name": "Using supabase-js (recommended)", - "response": undefined, - }, - { - "code": "\`\`\`ts -import { GoTrueAdminApi } from '@supabase/auth-js' - -const admin = new GoTrueAdminApi({ - url: 'https://xyzcompany.supabase.co/auth/v1', - headers: { Authorization: \`Bearer \${process.env.SUPABASE_SECRET_KEY}\` }, -}) -\`\`\`", - "data": undefined, - "description": undefined, - "id": "standalone-import-for-bundle-sensitive-environments", - "name": "Standalone import for bundle-sensitive environments", - "response": undefined, - }, - ], - "shortText": "Creates an admin API client that can be used to manage users and OAuth clients.", - }, - "name": "@supabase/auth-js.GoTrueAdminApi.constructor", - "params": [ - { - "name": Symbol(anonymous), - "type": { - "name": Symbol(anonymous), - "properties": [ - { - "isOptional": true, - "name": "experimental", - "type": { - "name": "ExperimentalFeatureFlags", - "properties": [ - { - "comment": { - "shortText": "Enables passkey support: - - \`auth.signInWithPasskey()\`, \`auth.registerPasskey()\` - - \`auth.passkey.*\` - - \`auth.admin.passkey.*\` - -Defaults to \`false\`. Calling any passkey method while this flag is -disabled throws a descriptive error at call time.", - }, - "isOptional": true, - "name": "passkey", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - }, - { - "isOptional": true, - "name": "fetch", - "type": { - "comment": { - "shortText": "[MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch)", - }, - "name": Symbol(anonymous), - "params": [ - { - "name": "input", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "name": "URL", - "type": "nameOnly", - }, - { - "name": "RequestInfo", - "type": "nameOnly", - }, - ], - "type": "union", - }, - }, - { - "isOptional": true, - "name": "init", - "type": { - "name": "RequestInit", - "type": "nameOnly", - }, - }, - ], - "ret": { - "type": { - "awaited": { - "name": "Response", - "type": "nameOnly", - }, - "name": "Promise", - "type": "promise", - }, - }, - "type": "function", - }, - }, - { - "isOptional": true, - "name": "headers", - "type": { - "keyType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "index signature", - "valueType": { - "name": "string", - "type": "intrinsic", - }, - }, - }, - { - "name": "url", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - }, - ], - "ret": { - "type": { - "name": "GoTrueAdminApi", - "type": "nameOnly", - }, - }, - }, - "@supabase/auth-js.GoTrueAdminApi.createUser": { - "comment": { - "examples": [ - { - "code": "\`\`\`js -const { data, error } = await supabase.auth.admin.createUser({ - email: 'user@email.com', - password: 'password', - user_metadata: { name: 'Yoda' } -}) -\`\`\`", - "data": undefined, - "description": undefined, - "id": "with-custom-user-metadata", - "name": "With custom user metadata", - "response": "\`\`\`json -{ - data: { - user: { - id: '1', - aud: 'authenticated', - role: 'authenticated', - email: 'example@email.com', - email_confirmed_at: '2024-01-01T00:00:00Z', - phone: '', - confirmation_sent_at: '2024-01-01T00:00:00Z', - confirmed_at: '2024-01-01T00:00:00Z', - last_sign_in_at: '2024-01-01T00:00:00Z', - app_metadata: {}, - user_metadata: {}, - identities: [ - { - "identity_id": "22222222-2222-2222-2222-222222222222", - "id": "1", - "user_id": "1", - "identity_data": { - "email": "example@email.com", - "email_verified": true, - "phone_verified": false, - "sub": "1" - }, - "provider": "email", - "last_sign_in_at": "2024-01-01T00:00:00Z", - "created_at": "2024-01-01T00:00:00Z", - "updated_at": "2024-01-01T00:00:00Z", - "email": "email@example.com" - }, - ], - created_at: '2024-01-01T00:00:00Z', - updated_at: '2024-01-01T00:00:00Z', - is_anonymous: false, - } - } - error: null -} -\`\`\`", - }, - { - "code": "\`\`\`js -const { data, error } = await supabase.auth.admin.createUser({ - email: 'user@email.com', - email_confirm: true -}) -\`\`\`", - "data": undefined, - "description": undefined, - "id": "auto-confirm-the-user-s-email", - "name": "Auto-confirm the user's email", - "response": undefined, - }, - { - "code": "\`\`\`js -const { data, error } = await supabase.auth.admin.createUser({ - phone: '1234567890', - phone_confirm: true -}) -\`\`\`", - "data": undefined, - "description": undefined, - "id": "auto-confirm-the-user-s-phone-number", - "name": "Auto-confirm the user's phone number", - "response": undefined, - }, - ], - "shortText": "Creates a new user. -This function should only be called on a server. Never expose your \`service_role\` key in the browser.", - "text": "- To confirm the user's email address or phone number, set \`email_confirm\` or \`phone_confirm\` to true. Both arguments default to false. -- \`createUser()\` will not send a confirmation email to the user. You can use [\`inviteUserByEmail()\`](/docs/reference/javascript/auth-admin-inviteuserbyemail) if you want to send them an email invite instead. -- If you are sure that the created user's email or phone number is legitimate and verified, you can set the \`email_confirm\` or \`phone_confirm\` param to \`true\`.", - }, - "name": "@supabase/auth-js.GoTrueAdminApi.createUser", - "params": [ - { - "name": "attributes", - "type": { - "name": "AdminUserAttributes", - "properties": [ - { - "comment": { - "shortText": "A custom data object to store the user's application specific metadata. This maps to the \`auth.users.app_metadata\` column. - -Only a service role can modify. - -The \`app_metadata\` should be a JSON object that includes app-specific info, such as identity providers, roles, and other -access control information.", - }, - "isOptional": true, - "name": "app_metadata", - "type": { - "name": "object", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Determines how long a user is banned for. - -The format for the ban duration follows a strict sequence of decimal numbers with a unit suffix. -Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". - -For example, some possible durations include: '300ms', '2h45m'. - -Setting the ban duration to 'none' lifts the ban on the user.", - }, - "isOptional": true, - "name": "ban_duration", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The user's current password - -This is only ever present when the user is resetting -their password and GOTRUE_SECURITY_UPDATE_PASSWORD_REQUIRE_CURRENT_PASSWORD is true.", - }, - "isOptional": true, - "name": "current_password", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The user's email.", - }, - "isOptional": true, - "name": "email", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Sets the user's email as confirmed when true, or unconfirmed when false. - -Only a service role can modify.", - }, - "isOptional": true, - "name": "email_confirm", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The \`id\` for the user. - -Allows you to overwrite the default \`id\` set for the user.", - }, - "isOptional": true, - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The nonce sent for reauthentication if the user's password is to be updated. - -Call reauthenticate() to obtain the nonce first.", - }, - "isOptional": true, - "name": "nonce", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The user's password.", - }, - "isOptional": true, - "name": "password", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The \`password_hash\` for the user's password. - -Allows you to specify a password hash for the user. This is useful for migrating a user's password hash from another service. - -Supports bcrypt, scrypt (firebase), and argon2 password hashes.", - }, - "isOptional": true, - "name": "password_hash", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The user's phone.", - }, - "isOptional": true, - "name": "phone", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Sets the user's phone as confirmed when true, or unconfirmed when false. - -Only a service role can modify.", - }, - "isOptional": true, - "name": "phone_confirm", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The \`role\` claim set in the user's access token JWT. - -When a user signs up, this role is set to \`authenticated\` by default. You should only modify the \`role\` if you need to provision several levels of admin access that have different permissions on individual columns in your database. - -Setting this role to \`service_role\` is not recommended as it grants the user admin privileges.", - }, - "isOptional": true, - "name": "role", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "A custom data object to store the user's metadata. This maps to the \`auth.users.raw_user_meta_data\` column. - - -The \`user_metadata\` should be a JSON object that includes user-specific info, such as their first and last name. - -Note: When using the GoTrueAdminApi and wanting to modify a user's metadata, -this attribute is used instead of UserAttributes data.", - }, - "isOptional": true, - "name": "user_metadata", - "type": { - "name": "object", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - }, - ], - "ret": { - "type": { - "awaited": { - "name": "UserResponse", - "subTypes": [ - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "name": Symbol(anonymous), - "properties": [ - { - "name": "user", - "type": { - "name": "User", - "properties": [ - { - "isOptional": true, - "name": "action_link", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "app_metadata", - "type": { - "name": "UserAppMetadata", - "properties": [ - { - "comment": { - "shortText": "The first provider that the user used to sign up with.", - }, - "isOptional": true, - "name": "provider", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "A list of all providers that the user has linked to their account.", - }, - "isOptional": true, - "name": "providers", - "type": { - "elemType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - ], - "type": "object", - }, - }, - { - "name": "aud", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "banned_until", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "confirmation_sent_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "confirmed_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "deleted_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "email", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "email_change_sent_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "email_confirmed_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "factors", - "type": { - "elemType": { - "name": Symbol(anonymous), - "subTypes": [ - { - "name": "Factor", - "properties": [ - { - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Type of factor. \`totp\` and \`phone\` supported with this version", - }, - "name": "factor_type", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors.", - }, - "isOptional": true, - "name": "friendly_name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "ID of the factor.", - }, - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_challenged_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The verification status of the factor, default is \`unverified\` after \`.enroll()\`, then \`verified\` after the user verifies it with \`.verify()\`", - }, - "name": "status", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - { - "name": "Factor", - "properties": [ - { - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Type of factor. \`totp\` and \`phone\` supported with this version", - }, - "name": "factor_type", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors.", - }, - "isOptional": true, - "name": "friendly_name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "ID of the factor.", - }, - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_challenged_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The verification status of the factor, default is \`unverified\` after \`.enroll()\`, then \`verified\` after the user verifies it with \`.verify()\`", - }, - "name": "status", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - ], - "type": "union", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "identities", - "type": { - "elemType": { - "name": "UserIdentity", - "properties": [ - { - "isOptional": true, - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "identity_data", - "type": { - "keyType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "index signature", - "valueType": { - "name": "any", - "type": "intrinsic", - }, - }, - }, - { - "name": "identity_id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_sign_in_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "provider", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "user_id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "isOptional": true, - "name": "invited_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "is_anonymous", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "is_sso_user", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_sign_in_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "new_email", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "new_phone", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "phone", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "phone_confirmed_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "recovery_sent_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "role", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "user_metadata", - "type": { - "name": "UserMetadata", - "properties": [], - "type": "object", - }, - }, - ], - "type": "object", - }, - }, - ], - "type": "object", - }, - }, - { - "name": "error", - "type": { - "type": "literal", - "value": null, - }, - }, - ], - "type": "object", - }, - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "properties": [ - { - "name": "user", - "type": { - "type": "literal", - "value": null, - }, - }, - ], - "type": "object", - }, - }, - { - "name": "error", - "type": { - "name": "AuthError", - "type": "nameOnly", - }, - }, - ], - "type": "object", - }, - ], - "type": "union", - }, - "name": "Promise", - "type": "promise", - }, - }, - }, - "@supabase/auth-js.GoTrueAdminApi.deleteUser": { - "comment": { - "examples": [ - { - "code": "\`\`\`js -const { data, error } = await supabase.auth.admin.deleteUser( - '715ed5db-f090-4b8c-a067-640ecee36aa0' -) -\`\`\`", - "data": undefined, - "description": undefined, - "id": "removes-a-user", - "name": "Removes a user", - "response": "\`\`\`json -{ - "data": { - "user": {} - }, - "error": null -} -\`\`\`", - }, - ], - "shortText": "Delete a user. Requires a \`service_role\` key.", - "text": "- The \`deleteUser()\` method requires the user's ID, which maps to the \`auth.users.id\` column.", - }, - "name": "@supabase/auth-js.GoTrueAdminApi.deleteUser", - "params": [ - { - "comment": { - "shortText": "The user id you want to remove.", - }, - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "If true, then the user will be soft-deleted from the auth schema. Soft deletion allows user identification from the hashed user ID but is not reversible. -Defaults to false for backward compatibility. - -This function should only be called on a server. Never expose your \`service_role\` key in the browser.", - }, - "name": "shouldSoftDelete", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - ], - "ret": { - "type": { - "awaited": { - "name": "UserResponse", - "subTypes": [ - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "name": Symbol(anonymous), - "properties": [ - { - "name": "user", - "type": { - "name": "User", - "properties": [ - { - "isOptional": true, - "name": "action_link", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "app_metadata", - "type": { - "name": "UserAppMetadata", - "properties": [ - { - "comment": { - "shortText": "The first provider that the user used to sign up with.", - }, - "isOptional": true, - "name": "provider", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "A list of all providers that the user has linked to their account.", - }, - "isOptional": true, - "name": "providers", - "type": { - "elemType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - ], - "type": "object", - }, - }, - { - "name": "aud", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "banned_until", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "confirmation_sent_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "confirmed_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "deleted_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "email", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "email_change_sent_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "email_confirmed_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "factors", - "type": { - "elemType": { - "name": Symbol(anonymous), - "subTypes": [ - { - "name": "Factor", - "properties": [ - { - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Type of factor. \`totp\` and \`phone\` supported with this version", - }, - "name": "factor_type", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors.", - }, - "isOptional": true, - "name": "friendly_name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "ID of the factor.", - }, - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_challenged_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The verification status of the factor, default is \`unverified\` after \`.enroll()\`, then \`verified\` after the user verifies it with \`.verify()\`", - }, - "name": "status", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - { - "name": "Factor", - "properties": [ - { - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Type of factor. \`totp\` and \`phone\` supported with this version", - }, - "name": "factor_type", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors.", - }, - "isOptional": true, - "name": "friendly_name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "ID of the factor.", - }, - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_challenged_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The verification status of the factor, default is \`unverified\` after \`.enroll()\`, then \`verified\` after the user verifies it with \`.verify()\`", - }, - "name": "status", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - ], - "type": "union", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "identities", - "type": { - "elemType": { - "name": "UserIdentity", - "properties": [ - { - "isOptional": true, - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "identity_data", - "type": { - "keyType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "index signature", - "valueType": { - "name": "any", - "type": "intrinsic", - }, - }, - }, - { - "name": "identity_id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_sign_in_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "provider", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "user_id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "isOptional": true, - "name": "invited_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "is_anonymous", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "is_sso_user", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_sign_in_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "new_email", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "new_phone", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "phone", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "phone_confirmed_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "recovery_sent_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "role", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "user_metadata", - "type": { - "name": "UserMetadata", - "properties": [], - "type": "object", - }, - }, - ], - "type": "object", - }, - }, - ], - "type": "object", - }, - }, - { - "name": "error", - "type": { - "type": "literal", - "value": null, - }, - }, - ], - "type": "object", - }, - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "properties": [ - { - "name": "user", - "type": { - "type": "literal", - "value": null, - }, - }, - ], - "type": "object", - }, - }, - { - "name": "error", - "type": { - "name": "AuthError", - "type": "nameOnly", - }, - }, - ], - "type": "object", - }, - ], - "type": "union", - }, - "name": "Promise", - "type": "promise", - }, - }, - }, - "@supabase/auth-js.GoTrueAdminApi.generateLink": { - "comment": { - "examples": [ - { - "code": "\`\`\`js -const { data, error } = await supabase.auth.admin.generateLink({ - type: 'signup', - email: 'email@example.com', - password: 'secret' -}) -\`\`\`", - "data": undefined, - "description": undefined, - "id": "generate-a-signup-link", - "name": "Generate a signup link", - "response": "\`\`\`json -{ - "data": { - "properties": { - "action_link": "", - "email_otp": "999999", - "hashed_token": "", - "verification_type": "signup" - }, - "user": { - "id": "11111111-1111-1111-1111-111111111111", - "aud": "authenticated", - "role": "authenticated", - "email": "email@example.com", - "phone": "", - "confirmation_sent_at": "2024-01-01T00:00:00Z", - "app_metadata": { - "provider": "email", - "providers": [ - "email" - ] - }, - "user_metadata": {}, - "identities": [ - { - "identity_id": "22222222-2222-2222-2222-222222222222", - "id": "11111111-1111-1111-1111-111111111111", - "user_id": "11111111-1111-1111-1111-111111111111", - "identity_data": { - "email": "email@example.com", - "email_verified": false, - "phone_verified": false, - "sub": "11111111-1111-1111-1111-111111111111" - }, - "provider": "email", - "last_sign_in_at": "2024-01-01T00:00:00Z", - "created_at": "2024-01-01T00:00:00Z", - "updated_at": "2024-01-01T00:00:00Z", - "email": "email@example.com" - } - ], - "created_at": "2024-01-01T00:00:00Z", - "updated_at": "2024-01-01T00:00:00Z", - "is_anonymous": false - } - }, - "error": null -} -\`\`\`", - }, - { - "code": "\`\`\`js -const { data, error } = await supabase.auth.admin.generateLink({ - type: 'invite', - email: 'email@example.com' -}) -\`\`\`", - "data": undefined, - "description": undefined, - "id": "generate-an-invite-link", - "name": "Generate an invite link", - "response": undefined, - }, - { - "code": "\`\`\`js -const { data, error } = await supabase.auth.admin.generateLink({ - type: 'magiclink', - email: 'email@example.com' -}) -\`\`\`", - "data": undefined, - "description": undefined, - "id": "generate-a-magic-link", - "name": "Generate a magic link", - "response": undefined, - }, - { - "code": "\`\`\`js -const { data, error } = await supabase.auth.admin.generateLink({ - type: 'recovery', - email: 'email@example.com' -}) -\`\`\`", - "data": undefined, - "description": undefined, - "id": "generate-a-recovery-link", - "name": "Generate a recovery link", - "response": undefined, - }, - { - "code": "\`\`\`js -// generate an email change link to be sent to the current email address -const { data, error } = await supabase.auth.admin.generateLink({ - type: 'email_change_current', - email: 'current.email@example.com', - newEmail: 'new.email@example.com' -}) - -// generate an email change link to be sent to the new email address -const { data, error } = await supabase.auth.admin.generateLink({ - type: 'email_change_new', - email: 'current.email@example.com', - newEmail: 'new.email@example.com' -}) -\`\`\`", - "data": undefined, - "description": undefined, - "id": "generate-links-to-change-current-email-address", - "name": "Generate links to change current email address", - "response": undefined, - }, - ], - "shortText": "Generates email links and OTPs to be sent via a custom email provider.", - "text": "- The following types can be passed into \`generateLink()\`: \`signup\`, \`magiclink\`, \`invite\`, \`recovery\`, \`email_change_current\`, \`email_change_new\`, \`phone_change\`. -- \`generateLink()\` only generates the email link for \`email_change_email\` if the **Secure email change** is enabled in your project's [email auth provider settings](/dashboard/project/_/auth/providers). -- \`generateLink()\` handles the creation of the user for \`signup\`, \`invite\` and \`magiclink\`.", - }, - "name": "@supabase/auth-js.GoTrueAdminApi.generateLink", - "params": [ - { - "name": "params", - "type": { - "name": "GenerateLinkParams", - "subTypes": [ - { - "name": "GenerateSignupLinkParams", - "properties": [ - { - "name": "email", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "options", - "type": undefined, - }, - { - "name": "password", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "type", - "type": { - "type": "literal", - "value": "signup", - }, - }, - ], - "type": "object", - }, - { - "name": "GenerateInviteOrMagiclinkParams", - "properties": [ - { - "comment": { - "shortText": "The user's email", - }, - "name": "email", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "options", - "type": undefined, - }, - { - "name": "type", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "invite", - }, - { - "type": "literal", - "value": "magiclink", - }, - ], - "type": "union", - }, - }, - ], - "type": "object", - }, - { - "name": "GenerateRecoveryLinkParams", - "properties": [ - { - "comment": { - "shortText": "The user's email", - }, - "name": "email", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "options", - "type": undefined, - }, - { - "name": "type", - "type": { - "type": "literal", - "value": "recovery", - }, - }, - ], - "type": "object", - }, - { - "name": "GenerateEmailChangeLinkParams", - "properties": [ - { - "comment": { - "shortText": "The user's email", - }, - "name": "email", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The user's new email. Only required if type is 'email_change_current' or 'email_change_new'.", - }, - "name": "newEmail", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "options", - "type": undefined, - }, - { - "name": "type", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "email_change_current", - }, - { - "type": "literal", - "value": "email_change_new", - }, - ], - "type": "union", - }, - }, - ], - "type": "object", - }, - ], - "type": "union", - }, - }, - ], - "ret": { - "type": { - "awaited": { - "name": "GenerateLinkResponse", - "subTypes": [ - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "name": Symbol(anonymous), - "properties": [ - { - "name": "properties", - "type": { - "name": "GenerateLinkProperties", - "properties": [ - { - "comment": { - "shortText": "The email link to send to the user. -The action_link follows the following format: auth/v1/verify?type={verification_type}&token={hashed_token}&redirect_to={redirect_to}", - }, - "name": "action_link", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The raw email OTP. -You should send this in the email if you want your users to verify using an OTP instead of the action link.", - }, - "name": "email_otp", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The hashed token appended to the action link.", - }, - "name": "hashed_token", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The URL appended to the action link.", - }, - "name": "redirect_to", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The verification type that the email link is associated to.", - }, - "name": "verification_type", - "type": { - "name": "GenerateLinkType", - "subTypes": [ - { - "type": "literal", - "value": "signup", - }, - { - "type": "literal", - "value": "invite", - }, - { - "type": "literal", - "value": "magiclink", - }, - { - "type": "literal", - "value": "recovery", - }, - { - "type": "literal", - "value": "email_change_current", - }, - { - "type": "literal", - "value": "email_change_new", - }, - ], - "type": "union", - }, - }, - ], - "type": "object", - }, - }, - { - "name": "user", - "type": { - "name": "User", - "properties": [ - { - "isOptional": true, - "name": "action_link", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "app_metadata", - "type": { - "name": "UserAppMetadata", - "properties": [ - { - "comment": { - "shortText": "The first provider that the user used to sign up with.", - }, - "isOptional": true, - "name": "provider", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "A list of all providers that the user has linked to their account.", - }, - "isOptional": true, - "name": "providers", - "type": { - "elemType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - ], - "type": "object", - }, - }, - { - "name": "aud", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "banned_until", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "confirmation_sent_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "confirmed_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "deleted_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "email", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "email_change_sent_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "email_confirmed_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "factors", - "type": { - "elemType": { - "name": Symbol(anonymous), - "subTypes": [ - { - "name": "Factor", - "properties": [ - { - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Type of factor. \`totp\` and \`phone\` supported with this version", - }, - "name": "factor_type", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors.", - }, - "isOptional": true, - "name": "friendly_name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "ID of the factor.", - }, - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_challenged_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The verification status of the factor, default is \`unverified\` after \`.enroll()\`, then \`verified\` after the user verifies it with \`.verify()\`", - }, - "name": "status", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - { - "name": "Factor", - "properties": [ - { - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Type of factor. \`totp\` and \`phone\` supported with this version", - }, - "name": "factor_type", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors.", - }, - "isOptional": true, - "name": "friendly_name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "ID of the factor.", - }, - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_challenged_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The verification status of the factor, default is \`unverified\` after \`.enroll()\`, then \`verified\` after the user verifies it with \`.verify()\`", - }, - "name": "status", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - ], - "type": "union", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "identities", - "type": { - "elemType": { - "name": "UserIdentity", - "properties": [ - { - "isOptional": true, - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "identity_data", - "type": { - "keyType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "index signature", - "valueType": { - "name": "any", - "type": "intrinsic", - }, - }, - }, - { - "name": "identity_id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_sign_in_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "provider", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "user_id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "isOptional": true, - "name": "invited_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "is_anonymous", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "is_sso_user", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_sign_in_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "new_email", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "new_phone", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "phone", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "phone_confirmed_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "recovery_sent_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "role", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "user_metadata", - "type": { - "name": "UserMetadata", - "properties": [], - "type": "object", - }, - }, - ], - "type": "object", - }, - }, - ], - "type": "object", - }, - }, - { - "name": "error", - "type": { - "type": "literal", - "value": null, - }, - }, - ], - "type": "object", - }, - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "properties": [ - { - "name": "properties", - "type": { - "type": "literal", - "value": null, - }, - }, - { - "name": "user", - "type": { - "type": "literal", - "value": null, - }, - }, - ], - "type": "object", - }, - }, - { - "name": "error", - "type": { - "name": "AuthError", - "type": "nameOnly", - }, - }, - ], - "type": "object", - }, - ], - "type": "union", - }, - "name": "Promise", - "type": "promise", - }, - }, - }, - "@supabase/auth-js.GoTrueAdminApi.getUserById": { - "comment": { - "examples": [ - { - "code": "\`\`\`js -const { data, error } = await supabase.auth.admin.getUserById(1) -\`\`\`", - "data": undefined, - "description": undefined, - "id": "fetch-the-user-object-using-the-access-token-jwt", - "name": "Fetch the user object using the access_token jwt", - "response": "\`\`\`json -{ - data: { - user: { - id: '1', - aud: 'authenticated', - role: 'authenticated', - email: 'example@email.com', - email_confirmed_at: '2024-01-01T00:00:00Z', - phone: '', - confirmation_sent_at: '2024-01-01T00:00:00Z', - confirmed_at: '2024-01-01T00:00:00Z', - last_sign_in_at: '2024-01-01T00:00:00Z', - app_metadata: {}, - user_metadata: {}, - identities: [ - { - "identity_id": "22222222-2222-2222-2222-222222222222", - "id": "1", - "user_id": "1", - "identity_data": { - "email": "example@email.com", - "email_verified": true, - "phone_verified": false, - "sub": "1" - }, - "provider": "email", - "last_sign_in_at": "2024-01-01T00:00:00Z", - "created_at": "2024-01-01T00:00:00Z", - "updated_at": "2024-01-01T00:00:00Z", - "email": "email@example.com" - }, - ], - created_at: '2024-01-01T00:00:00Z', - updated_at: '2024-01-01T00:00:00Z', - is_anonymous: false, - } - } - error: null -} -\`\`\`", - }, - ], - "shortText": "Get user by id.", - "text": "- Fetches the user object from the database based on the user's id. -- The \`getUserById()\` method requires the user's id which maps to the \`auth.users.id\` column.", - }, - "name": "@supabase/auth-js.GoTrueAdminApi.getUserById", - "params": [ - { - "comment": { - "shortText": "The user's unique identifier - -This function should only be called on a server. Never expose your \`service_role\` key in the browser.", - }, - "name": "uid", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "ret": { - "type": { - "awaited": { - "name": "UserResponse", - "subTypes": [ - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "name": Symbol(anonymous), - "properties": [ - { - "name": "user", - "type": { - "name": "User", - "properties": [ - { - "isOptional": true, - "name": "action_link", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "app_metadata", - "type": { - "name": "UserAppMetadata", - "properties": [ - { - "comment": { - "shortText": "The first provider that the user used to sign up with.", - }, - "isOptional": true, - "name": "provider", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "A list of all providers that the user has linked to their account.", - }, - "isOptional": true, - "name": "providers", - "type": { - "elemType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - ], - "type": "object", - }, - }, - { - "name": "aud", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "banned_until", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "confirmation_sent_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "confirmed_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "deleted_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "email", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "email_change_sent_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "email_confirmed_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "factors", - "type": { - "elemType": { - "name": Symbol(anonymous), - "subTypes": [ - { - "name": "Factor", - "properties": [ - { - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Type of factor. \`totp\` and \`phone\` supported with this version", - }, - "name": "factor_type", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors.", - }, - "isOptional": true, - "name": "friendly_name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "ID of the factor.", - }, - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_challenged_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The verification status of the factor, default is \`unverified\` after \`.enroll()\`, then \`verified\` after the user verifies it with \`.verify()\`", - }, - "name": "status", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - { - "name": "Factor", - "properties": [ - { - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Type of factor. \`totp\` and \`phone\` supported with this version", - }, - "name": "factor_type", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors.", - }, - "isOptional": true, - "name": "friendly_name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "ID of the factor.", - }, - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_challenged_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The verification status of the factor, default is \`unverified\` after \`.enroll()\`, then \`verified\` after the user verifies it with \`.verify()\`", - }, - "name": "status", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - ], - "type": "union", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "identities", - "type": { - "elemType": { - "name": "UserIdentity", - "properties": [ - { - "isOptional": true, - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "identity_data", - "type": { - "keyType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "index signature", - "valueType": { - "name": "any", - "type": "intrinsic", - }, - }, - }, - { - "name": "identity_id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_sign_in_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "provider", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "user_id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "isOptional": true, - "name": "invited_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "is_anonymous", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "is_sso_user", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_sign_in_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "new_email", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "new_phone", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "phone", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "phone_confirmed_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "recovery_sent_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "role", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "user_metadata", - "type": { - "name": "UserMetadata", - "properties": [], - "type": "object", - }, - }, - ], - "type": "object", - }, - }, - ], - "type": "object", - }, - }, - { - "name": "error", - "type": { - "type": "literal", - "value": null, - }, - }, - ], - "type": "object", - }, - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "properties": [ - { - "name": "user", - "type": { - "type": "literal", - "value": null, - }, - }, - ], - "type": "object", - }, - }, - { - "name": "error", - "type": { - "name": "AuthError", - "type": "nameOnly", - }, - }, - ], - "type": "object", - }, - ], - "type": "union", - }, - "name": "Promise", - "type": "promise", - }, - }, - }, - "@supabase/auth-js.GoTrueAdminApi.inviteUserByEmail": { - "comment": { - "examples": [ - { - "code": "\`\`\`js -const { data, error } = await supabase.auth.admin.inviteUserByEmail('email@example.com') -\`\`\`", - "data": undefined, - "description": undefined, - "id": "invite-a-user", - "name": "Invite a user", - "response": "\`\`\`json -{ - "data": { - "user": { - "id": "11111111-1111-1111-1111-111111111111", - "aud": "authenticated", - "role": "authenticated", - "email": "example@email.com", - "invited_at": "2024-01-01T00:00:00Z", - "phone": "", - "confirmation_sent_at": "2024-01-01T00:00:00Z", - "app_metadata": { - "provider": "email", - "providers": [ - "email" - ] - }, - "user_metadata": {}, - "identities": [ - { - "identity_id": "22222222-2222-2222-2222-222222222222", - "id": "11111111-1111-1111-1111-111111111111", - "user_id": "11111111-1111-1111-1111-111111111111", - "identity_data": { - "email": "example@email.com", - "email_verified": false, - "phone_verified": false, - "sub": "11111111-1111-1111-1111-111111111111" - }, - "provider": "email", - "last_sign_in_at": "2024-01-01T00:00:00Z", - "created_at": "2024-01-01T00:00:00Z", - "updated_at": "2024-01-01T00:00:00Z", - "email": "example@email.com" - } - ], - "created_at": "2024-01-01T00:00:00Z", - "updated_at": "2024-01-01T00:00:00Z", - "is_anonymous": false - } - }, - "error": null -} -\`\`\`", - }, - ], - "shortText": "Sends an invite link to an email address.", - "text": "- Sends an invite link to the user's email address. -- The \`inviteUserByEmail()\` method is typically used by administrators to invite users to join the application. -- Note that PKCE is not supported when using \`inviteUserByEmail\`. This is because the browser initiating the invite is often different from the browser accepting the invite which makes it difficult to provide the security guarantees required of the PKCE flow.", - }, - "name": "@supabase/auth-js.GoTrueAdminApi.inviteUserByEmail", - "params": [ - { - "comment": { - "shortText": "The email address of the user.", - }, - "name": "email", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Additional options to be included when inviting.", - }, - "name": "options", - "type": { - "name": Symbol(anonymous), - "properties": [ - { - "comment": { - "shortText": "A custom data object to store additional metadata about the user. This maps to the \`auth.users.user_metadata\` column.", - }, - "isOptional": true, - "name": "data", - "type": { - "name": "object", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The URL which will be appended to the email link sent to the user's email address. Once clicked the user will end up on this URL.", - }, - "isOptional": true, - "name": "redirectTo", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - }, - ], - "ret": { - "type": { - "awaited": { - "name": "UserResponse", - "subTypes": [ - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "name": Symbol(anonymous), - "properties": [ - { - "name": "user", - "type": { - "name": "User", - "properties": [ - { - "isOptional": true, - "name": "action_link", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "app_metadata", - "type": { - "name": "UserAppMetadata", - "properties": [ - { - "comment": { - "shortText": "The first provider that the user used to sign up with.", - }, - "isOptional": true, - "name": "provider", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "A list of all providers that the user has linked to their account.", - }, - "isOptional": true, - "name": "providers", - "type": { - "elemType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - ], - "type": "object", - }, - }, - { - "name": "aud", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "banned_until", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "confirmation_sent_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "confirmed_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "deleted_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "email", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "email_change_sent_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "email_confirmed_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "factors", - "type": { - "elemType": { - "name": Symbol(anonymous), - "subTypes": [ - { - "name": "Factor", - "properties": [ - { - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Type of factor. \`totp\` and \`phone\` supported with this version", - }, - "name": "factor_type", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors.", - }, - "isOptional": true, - "name": "friendly_name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "ID of the factor.", - }, - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_challenged_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The verification status of the factor, default is \`unverified\` after \`.enroll()\`, then \`verified\` after the user verifies it with \`.verify()\`", - }, - "name": "status", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - { - "name": "Factor", - "properties": [ - { - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Type of factor. \`totp\` and \`phone\` supported with this version", - }, - "name": "factor_type", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors.", - }, - "isOptional": true, - "name": "friendly_name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "ID of the factor.", - }, - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_challenged_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The verification status of the factor, default is \`unverified\` after \`.enroll()\`, then \`verified\` after the user verifies it with \`.verify()\`", - }, - "name": "status", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - ], - "type": "union", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "identities", - "type": { - "elemType": { - "name": "UserIdentity", - "properties": [ - { - "isOptional": true, - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "identity_data", - "type": { - "keyType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "index signature", - "valueType": { - "name": "any", - "type": "intrinsic", - }, - }, - }, - { - "name": "identity_id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_sign_in_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "provider", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "user_id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "isOptional": true, - "name": "invited_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "is_anonymous", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "is_sso_user", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_sign_in_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "new_email", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "new_phone", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "phone", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "phone_confirmed_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "recovery_sent_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "role", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "user_metadata", - "type": { - "name": "UserMetadata", - "properties": [], - "type": "object", - }, - }, - ], - "type": "object", - }, - }, - ], - "type": "object", - }, - }, - { - "name": "error", - "type": { - "type": "literal", - "value": null, - }, - }, - ], - "type": "object", - }, - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "properties": [ - { - "name": "user", - "type": { - "type": "literal", - "value": null, - }, - }, - ], - "type": "object", - }, - }, - { - "name": "error", - "type": { - "name": "AuthError", - "type": "nameOnly", - }, - }, - ], - "type": "object", - }, - ], - "type": "union", - }, - "name": "Promise", - "type": "promise", - }, - }, - }, - "@supabase/auth-js.GoTrueAdminApi.listUsers": { - "comment": { - "examples": [ - { - "code": "\`\`\`js -const { data: { users }, error } = await supabase.auth.admin.listUsers() -\`\`\`", - "data": undefined, - "description": undefined, - "id": "get-a-page-of-users", - "name": "Get a page of users", - "response": undefined, - }, - { - "code": "\`\`\`js -const { data: { users }, error } = await supabase.auth.admin.listUsers({ - page: 1, - perPage: 1000 -}) -\`\`\`", - "data": undefined, - "description": undefined, - "id": "paginated-list-of-users", - "name": "Paginated list of users", - "response": undefined, - }, - ], - "shortText": "Get a list of users. - -This function should only be called on a server. Never expose your \`service_role\` key in the browser.", - "text": "- Defaults to return 50 users per page.", - }, - "name": "@supabase/auth-js.GoTrueAdminApi.listUsers", - "params": [ - { - "comment": { - "shortText": "An object which supports \`page\` and \`perPage\` as numbers, to alter the paginated results.", - }, - "isOptional": true, - "name": "params", - "type": { - "name": "PageParams", - "properties": [ - { - "comment": { - "shortText": "The page number", - }, - "isOptional": true, - "name": "page", - "type": { - "name": "number", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Number of items returned per page", - }, - "isOptional": true, - "name": "perPage", - "type": { - "name": "number", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - }, - ], - "ret": { - "type": { - "awaited": { - "name": Symbol(anonymous), - "subTypes": [ - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": undefined, - }, - { - "name": "error", - "type": { - "type": "literal", - "value": null, - }, - }, - ], - "type": "object", - }, - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "name": Symbol(anonymous), - "properties": [ - { - "name": "users", - "type": undefined, - }, - ], - "type": "object", - }, - }, - { - "name": "error", - "type": { - "name": "AuthError", - "type": "nameOnly", - }, - }, - ], - "type": "object", - }, - ], - "type": "union", - }, - "name": "Promise", - "type": "promise", - }, - }, - }, - "@supabase/auth-js.GoTrueAdminApi.signOut": { - "comment": { - "shortText": "Removes a logged-in session.", - }, - "name": "@supabase/auth-js.GoTrueAdminApi.signOut", - "params": [ - { - "comment": { - "shortText": "A valid, logged-in JWT.", - }, - "name": "jwt", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The logout sope.", - }, - "name": "scope", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "global", - }, - { - "type": "literal", - "value": "local", - }, - { - "type": "literal", - "value": "others", - }, - ], - "type": "union", - }, - }, - ], - "ret": { - "type": { - "awaited": { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "type": "literal", - "value": null, - }, - }, - { - "name": "error", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": null, - }, - { - "name": "AuthError", - "type": "nameOnly", - }, - ], - "type": "union", - }, - }, - ], - "type": "object", - }, - "name": "Promise", - "type": "promise", - }, - }, - }, - "@supabase/auth-js.GoTrueAdminApi.updateUserById": { - "comment": { - "examples": [ - { - "code": "\`\`\`typescript -// Server-side (Edge Function) -const { data, error } = await supabase.auth.admin.updateUserById( - userId, - { user_metadata: { preferences: { theme: 'dark' } } } -) - -// Client-side (to sync the changes) -const { data, error } = await supabase.auth.refreshSession() -// onAuthStateChange listeners will now be notified with updated user -\`\`\`", - "data": undefined, - "description": undefined, - "id": "example-1", - "name": "Example 1", - "response": undefined, - }, - { - "code": "\`\`\`js -const { data: user, error } = await supabase.auth.admin.updateUserById( - '11111111-1111-1111-1111-111111111111', - { email: 'new@email.com' } -) -\`\`\`", - "data": undefined, - "description": undefined, - "id": "updates-a-user-s-email", - "name": "Updates a user's email", - "response": "\`\`\`json -{ - "data": { - "user": { - "id": "11111111-1111-1111-1111-111111111111", - "aud": "authenticated", - "role": "authenticated", - "email": "new@email.com", - "email_confirmed_at": "2024-01-01T00:00:00Z", - "phone": "", - "confirmed_at": "2024-01-01T00:00:00Z", - "recovery_sent_at": "2024-01-01T00:00:00Z", - "last_sign_in_at": "2024-01-01T00:00:00Z", - "app_metadata": { - "provider": "email", - "providers": [ - "email" - ] - }, - "user_metadata": { - "email": "example@email.com", - "email_verified": false, - "phone_verified": false, - "sub": "11111111-1111-1111-1111-111111111111" - }, - "identities": [ - { - "identity_id": "22222222-2222-2222-2222-222222222222", - "id": "11111111-1111-1111-1111-111111111111", - "user_id": "11111111-1111-1111-1111-111111111111", - "identity_data": { - "email": "example@email.com", - "email_verified": false, - "phone_verified": false, - "sub": "11111111-1111-1111-1111-111111111111" - }, - "provider": "email", - "last_sign_in_at": "2024-01-01T00:00:00Z", - "created_at": "2024-01-01T00:00:00Z", - "updated_at": "2024-01-01T00:00:00Z", - "email": "example@email.com" - } - ], - "created_at": "2024-01-01T00:00:00Z", - "updated_at": "2024-01-01T00:00:00Z", - "is_anonymous": false - } - }, - "error": null -} -\`\`\`", - }, - { - "code": "\`\`\`js -const { data: user, error } = await supabase.auth.admin.updateUserById( - '6aa5d0d4-2a9f-4483-b6c8-0cf4c6c98ac4', - { password: 'new_password' } -) -\`\`\`", - "data": undefined, - "description": undefined, - "id": "updates-a-user-s-password", - "name": "Updates a user's password", - "response": undefined, - }, - { - "code": "\`\`\`js -const { data: user, error } = await supabase.auth.admin.updateUserById( - '6aa5d0d4-2a9f-4483-b6c8-0cf4c6c98ac4', - { user_metadata: { hello: 'world' } } -) -\`\`\`", - "data": undefined, - "description": undefined, - "id": "updates-a-user-s-metadata", - "name": "Updates a user's metadata", - "response": undefined, - }, - { - "code": "\`\`\`js -const { data: user, error } = await supabase.auth.admin.updateUserById( - '6aa5d0d4-2a9f-4483-b6c8-0cf4c6c98ac4', - { app_metadata: { plan: 'trial' } } -) -\`\`\`", - "data": undefined, - "description": undefined, - "id": "updates-a-user-s-app-metadata", - "name": "Updates a user's app_metadata", - "response": undefined, - }, - { - "code": "\`\`\`js -const { data: user, error } = await supabase.auth.admin.updateUserById( - '6aa5d0d4-2a9f-4483-b6c8-0cf4c6c98ac4', - { email_confirm: true } -) -\`\`\`", - "data": undefined, - "description": undefined, - "id": "confirms-a-user-s-email-address", - "name": "Confirms a user's email address", - "response": undefined, - }, - { - "code": "\`\`\`js -const { data: user, error } = await supabase.auth.admin.updateUserById( - '6aa5d0d4-2a9f-4483-b6c8-0cf4c6c98ac4', - { phone_confirm: true } -) -\`\`\`", - "data": undefined, - "description": undefined, - "id": "confirms-a-user-s-phone-number", - "name": "Confirms a user's phone number", - "response": undefined, - }, - { - "code": "\`\`\`js -const { data: user, error } = await supabase.auth.admin.updateUserById( - '6aa5d0d4-2a9f-4483-b6c8-0cf4c6c98ac4', - { ban_duration: '876000h' } -) -\`\`\`", - "data": undefined, - "description": undefined, - "id": "ban-a-user-for-100-years", - "name": "Ban a user for 100 years", - "response": undefined, - }, - ], - "shortText": "Updates the user data. Changes are applied directly without confirmation flows.", - "text": "**Important:** This is a server-side operation and does **not** trigger client-side -\`onAuthStateChange\` listeners. The admin API has no connection to client state. - -To sync changes to the client after calling this method: -1. On the client, call \`supabase.auth.refreshSession()\` to fetch the updated user data -2. This will trigger the \`TOKEN_REFRESHED\` event and notify all listeners", - }, - "name": "@supabase/auth-js.GoTrueAdminApi.updateUserById", - "params": [ - { - "comment": { - "shortText": "The user's unique identifier", - }, - "name": "uid", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The data you want to update. - -This function should only be called on a server. Never expose your \`service_role\` key in the browser.", - }, - "name": "attributes", - "type": { - "name": "AdminUserAttributes", - "properties": [ - { - "comment": { - "shortText": "A custom data object to store the user's application specific metadata. This maps to the \`auth.users.app_metadata\` column. - -Only a service role can modify. - -The \`app_metadata\` should be a JSON object that includes app-specific info, such as identity providers, roles, and other -access control information.", - }, - "isOptional": true, - "name": "app_metadata", - "type": { - "name": "object", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Determines how long a user is banned for. - -The format for the ban duration follows a strict sequence of decimal numbers with a unit suffix. -Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". - -For example, some possible durations include: '300ms', '2h45m'. - -Setting the ban duration to 'none' lifts the ban on the user.", - }, - "isOptional": true, - "name": "ban_duration", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The user's current password - -This is only ever present when the user is resetting -their password and GOTRUE_SECURITY_UPDATE_PASSWORD_REQUIRE_CURRENT_PASSWORD is true.", - }, - "isOptional": true, - "name": "current_password", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The user's email.", - }, - "isOptional": true, - "name": "email", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Sets the user's email as confirmed when true, or unconfirmed when false. - -Only a service role can modify.", - }, - "isOptional": true, - "name": "email_confirm", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The \`id\` for the user. - -Allows you to overwrite the default \`id\` set for the user.", - }, - "isOptional": true, - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The nonce sent for reauthentication if the user's password is to be updated. - -Call reauthenticate() to obtain the nonce first.", - }, - "isOptional": true, - "name": "nonce", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The user's password.", - }, - "isOptional": true, - "name": "password", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The \`password_hash\` for the user's password. - -Allows you to specify a password hash for the user. This is useful for migrating a user's password hash from another service. - -Supports bcrypt, scrypt (firebase), and argon2 password hashes.", - }, - "isOptional": true, - "name": "password_hash", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The user's phone.", - }, - "isOptional": true, - "name": "phone", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Sets the user's phone as confirmed when true, or unconfirmed when false. - -Only a service role can modify.", - }, - "isOptional": true, - "name": "phone_confirm", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The \`role\` claim set in the user's access token JWT. - -When a user signs up, this role is set to \`authenticated\` by default. You should only modify the \`role\` if you need to provision several levels of admin access that have different permissions on individual columns in your database. - -Setting this role to \`service_role\` is not recommended as it grants the user admin privileges.", - }, - "isOptional": true, - "name": "role", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "A custom data object to store the user's metadata. This maps to the \`auth.users.raw_user_meta_data\` column. - - -The \`user_metadata\` should be a JSON object that includes user-specific info, such as their first and last name. - -Note: When using the GoTrueAdminApi and wanting to modify a user's metadata, -this attribute is used instead of UserAttributes data.", - }, - "isOptional": true, - "name": "user_metadata", - "type": { - "name": "object", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - }, - ], - "ret": { - "type": { - "awaited": { - "name": "UserResponse", - "subTypes": [ - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "name": Symbol(anonymous), - "properties": [ - { - "name": "user", - "type": { - "name": "User", - "properties": [ - { - "isOptional": true, - "name": "action_link", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "app_metadata", - "type": { - "name": "UserAppMetadata", - "properties": [ - { - "comment": { - "shortText": "The first provider that the user used to sign up with.", - }, - "isOptional": true, - "name": "provider", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "A list of all providers that the user has linked to their account.", - }, - "isOptional": true, - "name": "providers", - "type": { - "elemType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - ], - "type": "object", - }, - }, - { - "name": "aud", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "banned_until", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "confirmation_sent_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "confirmed_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "deleted_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "email", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "email_change_sent_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "email_confirmed_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "factors", - "type": { - "elemType": { - "name": Symbol(anonymous), - "subTypes": [ - { - "name": "Factor", - "properties": [ - { - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Type of factor. \`totp\` and \`phone\` supported with this version", - }, - "name": "factor_type", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors.", - }, - "isOptional": true, - "name": "friendly_name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "ID of the factor.", - }, - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_challenged_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The verification status of the factor, default is \`unverified\` after \`.enroll()\`, then \`verified\` after the user verifies it with \`.verify()\`", - }, - "name": "status", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - { - "name": "Factor", - "properties": [ - { - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Type of factor. \`totp\` and \`phone\` supported with this version", - }, - "name": "factor_type", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors.", - }, - "isOptional": true, - "name": "friendly_name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "ID of the factor.", - }, - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_challenged_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The verification status of the factor, default is \`unverified\` after \`.enroll()\`, then \`verified\` after the user verifies it with \`.verify()\`", - }, - "name": "status", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - ], - "type": "union", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "identities", - "type": { - "elemType": { - "name": "UserIdentity", - "properties": [ - { - "isOptional": true, - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "identity_data", - "type": { - "keyType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "index signature", - "valueType": { - "name": "any", - "type": "intrinsic", - }, - }, - }, - { - "name": "identity_id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_sign_in_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "provider", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "user_id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "isOptional": true, - "name": "invited_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "is_anonymous", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "is_sso_user", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_sign_in_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "new_email", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "new_phone", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "phone", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "phone_confirmed_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "recovery_sent_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "role", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "user_metadata", - "type": { - "name": "UserMetadata", - "properties": [], - "type": "object", - }, - }, - ], - "type": "object", - }, - }, - ], - "type": "object", - }, - }, - { - "name": "error", - "type": { - "type": "literal", - "value": null, - }, - }, - ], - "type": "object", - }, - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "properties": [ - { - "name": "user", - "type": { - "type": "literal", - "value": null, - }, - }, - ], - "type": "object", - }, - }, - { - "name": "error", - "type": { - "name": "AuthError", - "type": "nameOnly", - }, - }, - ], - "type": "object", - }, - ], - "type": "union", - }, - "name": "Promise", - "type": "promise", - }, - }, - }, - "@supabase/auth-js.GoTrueAdminCustomProvidersApi.createProvider": { - "comment": { - "shortText": "Creates a new custom OIDC/OAuth provider. - -For OIDC providers, the server fetches and validates the OpenID Connect discovery document -from the issuer's well-known endpoint (or the provided \`discovery_url\`) at creation time. -This may return a validation error (\`error_code: "validation_failed"\`) if the discovery -document is unreachable, not valid JSON, missing required fields, or if the issuer -in the document does not match the expected issuer. - -This function should only be called on a server. Never expose your \`service_role\` key in the browser.", - }, - "name": "@supabase/auth-js.GoTrueAdminCustomProvidersApi.createProvider", - "params": [ - { - "name": "params", - "type": { - "name": "CreateCustomProviderParams", - "properties": [ - { - "comment": { - "shortText": "Additional client IDs accepted during token validation", - }, - "isOptional": true, - "name": "acceptable_client_ids", - "type": { - "elemType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "comment": { - "shortText": "Mapping of provider attributes to Supabase user attributes", - }, - "isOptional": true, - "name": "attribute_mapping", - "type": { - "keyType": { - "name": "string", - "type": "intrinsic", - }, - "name": "Record", - "type": "record", - "valueType": { - "name": "any", - "type": "intrinsic", - }, - }, - }, - { - "comment": { - "shortText": "Additional parameters sent with the authorization request", - }, - "isOptional": true, - "name": "authorization_params", - "type": { - "keyType": { - "name": "string", - "type": "intrinsic", - }, - "name": "Record", - "type": "record", - "valueType": { - "name": "string", - "type": "intrinsic", - }, - }, - }, - { - "comment": { - "shortText": "OAuth2 authorization URL", - }, - "isOptional": true, - "name": "authorization_url", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "OAuth client ID", - }, - "name": "client_id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "OAuth client secret (write-only, not returned in responses)", - }, - "name": "client_secret", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "OIDC discovery URL", - }, - "isOptional": true, - "name": "discovery_url", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Whether email is optional for this provider", - }, - "isOptional": true, - "name": "email_optional", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Whether the provider is enabled", - }, - "isOptional": true, - "name": "enabled", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Provider identifier (e.g. \`custom:mycompany\`)", - }, - "name": "identifier", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "OIDC issuer URL", - }, - "isOptional": true, - "name": "issuer", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "JWKS URI for token verification", - }, - "isOptional": true, - "name": "jwks_uri", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Human-readable name", - }, - "name": "name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Whether PKCE is enabled", - }, - "isOptional": true, - "name": "pkce_enabled", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Provider type", - }, - "name": "provider_type", - "type": { - "name": "CustomProviderType", - "subTypes": [ - { - "type": "literal", - "value": "oauth2", - }, - { - "type": "literal", - "value": "oidc", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "OAuth scopes requested during authorization", - }, - "isOptional": true, - "name": "scopes", - "type": { - "elemType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "comment": { - "shortText": "Whether to skip nonce check (OIDC)", - }, - "isOptional": true, - "name": "skip_nonce_check", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "OAuth2 token URL", - }, - "isOptional": true, - "name": "token_url", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "OAuth2 userinfo URL", - }, - "isOptional": true, - "name": "userinfo_url", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - }, - ], - "ret": { - "type": { - "awaited": { - "name": "CustomProviderResponse", - "subTypes": [ - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "name": "CustomOAuthProvider", - "properties": [ - { - "comment": { - "shortText": "Additional client IDs accepted during token validation", - }, - "isOptional": true, - "name": "acceptable_client_ids", - "type": { - "elemType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "comment": { - "shortText": "Mapping of provider attributes to Supabase user attributes", - }, - "isOptional": true, - "name": "attribute_mapping", - "type": { - "keyType": { - "name": "string", - "type": "intrinsic", - }, - "name": "Record", - "type": "record", - "valueType": { - "name": "any", - "type": "intrinsic", - }, - }, - }, - { - "comment": { - "shortText": "Additional parameters sent with the authorization request", - }, - "isOptional": true, - "name": "authorization_params", - "type": { - "keyType": { - "name": "string", - "type": "intrinsic", - }, - "name": "Record", - "type": "record", - "valueType": { - "name": "string", - "type": "intrinsic", - }, - }, - }, - { - "comment": { - "shortText": "OAuth2 authorization URL", - }, - "isOptional": true, - "name": "authorization_url", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "OAuth client ID", - }, - "name": "client_id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Timestamp when the provider was created", - }, - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "OIDC discovery document (OIDC providers only)", - }, - "isOptional": true, - "name": "discovery_document", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "name": "OIDCDiscoveryDocument", - "properties": [ - { - "comment": { - "shortText": "URL of the authorization endpoint", - }, - "name": "authorization_endpoint", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The issuer identifier", - }, - "name": "issuer", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "URL of the JSON Web Key Set", - }, - "name": "jwks_uri", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "URL of the revocation endpoint", - }, - "isOptional": true, - "name": "revocation_endpoint", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "List of supported ID token signing algorithms", - }, - "isOptional": true, - "name": "supported_id_token_signing_algs", - "type": { - "elemType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "comment": { - "shortText": "List of supported response types", - }, - "isOptional": true, - "name": "supported_response_types", - "type": { - "elemType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "comment": { - "shortText": "List of supported scopes", - }, - "isOptional": true, - "name": "supported_scopes", - "type": { - "elemType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "comment": { - "shortText": "List of supported subject types", - }, - "isOptional": true, - "name": "supported_subject_types", - "type": { - "elemType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "comment": { - "shortText": "URL of the token endpoint", - }, - "name": "token_endpoint", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "URL of the userinfo endpoint", - }, - "isOptional": true, - "name": "userinfo_endpoint", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - { - "type": "literal", - "value": null, - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "OIDC discovery URL", - }, - "isOptional": true, - "name": "discovery_url", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Whether email is optional for this provider", - }, - "isOptional": true, - "name": "email_optional", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Whether the provider is enabled", - }, - "isOptional": true, - "name": "enabled", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Unique identifier (UUID)", - }, - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Provider identifier (e.g. \`custom:mycompany\`)", - }, - "name": "identifier", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "OIDC issuer URL", - }, - "isOptional": true, - "name": "issuer", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "JWKS URI for token verification", - }, - "isOptional": true, - "name": "jwks_uri", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Human-readable name", - }, - "name": "name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Whether PKCE is enabled", - }, - "isOptional": true, - "name": "pkce_enabled", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Provider type", - }, - "name": "provider_type", - "type": { - "name": "CustomProviderType", - "subTypes": [ - { - "type": "literal", - "value": "oauth2", - }, - { - "type": "literal", - "value": "oidc", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "OAuth scopes requested during authorization", - }, - "isOptional": true, - "name": "scopes", - "type": { - "elemType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "comment": { - "shortText": "Whether to skip nonce check (OIDC)", - }, - "isOptional": true, - "name": "skip_nonce_check", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "OAuth2 token URL", - }, - "isOptional": true, - "name": "token_url", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Timestamp when the provider was last updated", - }, - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "OAuth2 userinfo URL", - }, - "isOptional": true, - "name": "userinfo_url", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - }, - { - "name": "error", - "type": { - "type": "literal", - "value": null, - }, - }, - ], - "type": "object", - }, - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "type": "literal", - "value": null, - }, - }, - { - "name": "error", - "type": undefined, - }, - ], - "type": "object", - }, - ], - "type": "union", - }, - "name": "Promise", - "type": "promise", - }, - }, - }, - "@supabase/auth-js.GoTrueAdminCustomProvidersApi.deleteProvider": { - "comment": { - "shortText": "Deletes a custom provider. - -This function should only be called on a server. Never expose your \`service_role\` key in the browser.", - }, - "name": "@supabase/auth-js.GoTrueAdminCustomProvidersApi.deleteProvider", - "params": [ - { - "name": "identifier", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "ret": { - "type": { - "awaited": { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "type": "literal", - "value": null, - }, - }, - { - "name": "error", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": null, - }, - { - "name": "AuthError", - "type": "nameOnly", - }, - ], - "type": "union", - }, - }, - ], - "type": "object", - }, - "name": "Promise", - "type": "promise", - }, - }, - }, - "@supabase/auth-js.GoTrueAdminCustomProvidersApi.getProvider": { - "comment": { - "shortText": "Gets details of a specific custom provider by identifier. - -This function should only be called on a server. Never expose your \`service_role\` key in the browser.", - }, - "name": "@supabase/auth-js.GoTrueAdminCustomProvidersApi.getProvider", - "params": [ - { - "name": "identifier", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "ret": { - "type": { - "awaited": { - "name": "CustomProviderResponse", - "subTypes": [ - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "name": "CustomOAuthProvider", - "properties": [ - { - "comment": { - "shortText": "Additional client IDs accepted during token validation", - }, - "isOptional": true, - "name": "acceptable_client_ids", - "type": { - "elemType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "comment": { - "shortText": "Mapping of provider attributes to Supabase user attributes", - }, - "isOptional": true, - "name": "attribute_mapping", - "type": { - "keyType": { - "name": "string", - "type": "intrinsic", - }, - "name": "Record", - "type": "record", - "valueType": { - "name": "any", - "type": "intrinsic", - }, - }, - }, - { - "comment": { - "shortText": "Additional parameters sent with the authorization request", - }, - "isOptional": true, - "name": "authorization_params", - "type": { - "keyType": { - "name": "string", - "type": "intrinsic", - }, - "name": "Record", - "type": "record", - "valueType": { - "name": "string", - "type": "intrinsic", - }, - }, - }, - { - "comment": { - "shortText": "OAuth2 authorization URL", - }, - "isOptional": true, - "name": "authorization_url", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "OAuth client ID", - }, - "name": "client_id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Timestamp when the provider was created", - }, - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "OIDC discovery document (OIDC providers only)", - }, - "isOptional": true, - "name": "discovery_document", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "name": "OIDCDiscoveryDocument", - "properties": [ - { - "comment": { - "shortText": "URL of the authorization endpoint", - }, - "name": "authorization_endpoint", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The issuer identifier", - }, - "name": "issuer", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "URL of the JSON Web Key Set", - }, - "name": "jwks_uri", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "URL of the revocation endpoint", - }, - "isOptional": true, - "name": "revocation_endpoint", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "List of supported ID token signing algorithms", - }, - "isOptional": true, - "name": "supported_id_token_signing_algs", - "type": { - "elemType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "comment": { - "shortText": "List of supported response types", - }, - "isOptional": true, - "name": "supported_response_types", - "type": { - "elemType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "comment": { - "shortText": "List of supported scopes", - }, - "isOptional": true, - "name": "supported_scopes", - "type": { - "elemType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "comment": { - "shortText": "List of supported subject types", - }, - "isOptional": true, - "name": "supported_subject_types", - "type": { - "elemType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "comment": { - "shortText": "URL of the token endpoint", - }, - "name": "token_endpoint", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "URL of the userinfo endpoint", - }, - "isOptional": true, - "name": "userinfo_endpoint", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - { - "type": "literal", - "value": null, - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "OIDC discovery URL", - }, - "isOptional": true, - "name": "discovery_url", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Whether email is optional for this provider", - }, - "isOptional": true, - "name": "email_optional", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Whether the provider is enabled", - }, - "isOptional": true, - "name": "enabled", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Unique identifier (UUID)", - }, - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Provider identifier (e.g. \`custom:mycompany\`)", - }, - "name": "identifier", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "OIDC issuer URL", - }, - "isOptional": true, - "name": "issuer", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "JWKS URI for token verification", - }, - "isOptional": true, - "name": "jwks_uri", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Human-readable name", - }, - "name": "name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Whether PKCE is enabled", - }, - "isOptional": true, - "name": "pkce_enabled", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Provider type", - }, - "name": "provider_type", - "type": { - "name": "CustomProviderType", - "subTypes": [ - { - "type": "literal", - "value": "oauth2", - }, - { - "type": "literal", - "value": "oidc", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "OAuth scopes requested during authorization", - }, - "isOptional": true, - "name": "scopes", - "type": { - "elemType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "comment": { - "shortText": "Whether to skip nonce check (OIDC)", - }, - "isOptional": true, - "name": "skip_nonce_check", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "OAuth2 token URL", - }, - "isOptional": true, - "name": "token_url", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Timestamp when the provider was last updated", - }, - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "OAuth2 userinfo URL", - }, - "isOptional": true, - "name": "userinfo_url", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - }, - { - "name": "error", - "type": { - "type": "literal", - "value": null, - }, - }, - ], - "type": "object", - }, - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "type": "literal", - "value": null, - }, - }, - { - "name": "error", - "type": undefined, - }, - ], - "type": "object", - }, - ], - "type": "union", - }, - "name": "Promise", - "type": "promise", - }, - }, - }, - "@supabase/auth-js.GoTrueAdminCustomProvidersApi.listProviders": { - "comment": { - "shortText": "Lists all custom providers with optional type filter. - -This function should only be called on a server. Never expose your \`service_role\` key in the browser.", - }, - "name": "@supabase/auth-js.GoTrueAdminCustomProvidersApi.listProviders", - "params": [ - { - "isOptional": true, - "name": "params", - "type": { - "name": "ListCustomProvidersParams", - "properties": [ - { - "comment": { - "shortText": "Filter by provider type", - }, - "isOptional": true, - "name": "type", - "type": { - "name": "CustomProviderType", - "subTypes": [ - { - "type": "literal", - "value": "oauth2", - }, - { - "type": "literal", - "value": "oidc", - }, - ], - "type": "union", - }, - }, - ], - "type": "object", - }, - }, - ], - "ret": { - "type": { - "awaited": { - "name": "CustomProviderListResponse", - "subTypes": [ - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "name": Symbol(anonymous), - "properties": [ - { - "name": "providers", - "type": { - "elemType": { - "name": "CustomOAuthProvider", - "properties": [ - { - "comment": { - "shortText": "Additional client IDs accepted during token validation", - }, - "isOptional": true, - "name": "acceptable_client_ids", - "type": { - "elemType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "comment": { - "shortText": "Mapping of provider attributes to Supabase user attributes", - }, - "isOptional": true, - "name": "attribute_mapping", - "type": { - "keyType": { - "name": "string", - "type": "intrinsic", - }, - "name": "Record", - "type": "record", - "valueType": { - "name": "any", - "type": "intrinsic", - }, - }, - }, - { - "comment": { - "shortText": "Additional parameters sent with the authorization request", - }, - "isOptional": true, - "name": "authorization_params", - "type": { - "keyType": { - "name": "string", - "type": "intrinsic", - }, - "name": "Record", - "type": "record", - "valueType": { - "name": "string", - "type": "intrinsic", - }, - }, - }, - { - "comment": { - "shortText": "OAuth2 authorization URL", - }, - "isOptional": true, - "name": "authorization_url", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "OAuth client ID", - }, - "name": "client_id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Timestamp when the provider was created", - }, - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "OIDC discovery document (OIDC providers only)", - }, - "isOptional": true, - "name": "discovery_document", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "name": "OIDCDiscoveryDocument", - "properties": [ - { - "comment": { - "shortText": "URL of the authorization endpoint", - }, - "name": "authorization_endpoint", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The issuer identifier", - }, - "name": "issuer", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "URL of the JSON Web Key Set", - }, - "name": "jwks_uri", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "URL of the revocation endpoint", - }, - "isOptional": true, - "name": "revocation_endpoint", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "List of supported ID token signing algorithms", - }, - "isOptional": true, - "name": "supported_id_token_signing_algs", - "type": { - "elemType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "comment": { - "shortText": "List of supported response types", - }, - "isOptional": true, - "name": "supported_response_types", - "type": { - "elemType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "comment": { - "shortText": "List of supported scopes", - }, - "isOptional": true, - "name": "supported_scopes", - "type": { - "elemType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "comment": { - "shortText": "List of supported subject types", - }, - "isOptional": true, - "name": "supported_subject_types", - "type": { - "elemType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "comment": { - "shortText": "URL of the token endpoint", - }, - "name": "token_endpoint", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "URL of the userinfo endpoint", - }, - "isOptional": true, - "name": "userinfo_endpoint", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - { - "type": "literal", - "value": null, - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "OIDC discovery URL", - }, - "isOptional": true, - "name": "discovery_url", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Whether email is optional for this provider", - }, - "isOptional": true, - "name": "email_optional", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Whether the provider is enabled", - }, - "isOptional": true, - "name": "enabled", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Unique identifier (UUID)", - }, - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Provider identifier (e.g. \`custom:mycompany\`)", - }, - "name": "identifier", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "OIDC issuer URL", - }, - "isOptional": true, - "name": "issuer", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "JWKS URI for token verification", - }, - "isOptional": true, - "name": "jwks_uri", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Human-readable name", - }, - "name": "name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Whether PKCE is enabled", - }, - "isOptional": true, - "name": "pkce_enabled", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Provider type", - }, - "name": "provider_type", - "type": { - "name": "CustomProviderType", - "subTypes": [ - { - "type": "literal", - "value": "oauth2", - }, - { - "type": "literal", - "value": "oidc", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "OAuth scopes requested during authorization", - }, - "isOptional": true, - "name": "scopes", - "type": { - "elemType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "comment": { - "shortText": "Whether to skip nonce check (OIDC)", - }, - "isOptional": true, - "name": "skip_nonce_check", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "OAuth2 token URL", - }, - "isOptional": true, - "name": "token_url", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Timestamp when the provider was last updated", - }, - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "OAuth2 userinfo URL", - }, - "isOptional": true, - "name": "userinfo_url", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - ], - "type": "object", - }, - }, - { - "name": "error", - "type": { - "type": "literal", - "value": null, - }, - }, - ], - "type": "object", - }, - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "name": Symbol(anonymous), - "properties": [ - { - "name": "providers", - "type": undefined, - }, - ], - "type": "object", - }, - }, - { - "name": "error", - "type": { - "name": "AuthError", - "type": "nameOnly", - }, - }, - ], - "type": "object", - }, - ], - "type": "union", - }, - "name": "Promise", - "type": "promise", - }, - }, - }, - "@supabase/auth-js.GoTrueAdminCustomProvidersApi.updateProvider": { - "comment": { - "shortText": "Updates an existing custom provider. - -When \`issuer\` or \`discovery_url\` is changed on an OIDC provider, the server re-fetches and -validates the discovery document before persisting. This may return a validation error -(\`error_code: "validation_failed"\`) if the discovery document is unreachable, invalid, or -the issuer does not match. - -This function should only be called on a server. Never expose your \`service_role\` key in the browser.", - }, - "name": "@supabase/auth-js.GoTrueAdminCustomProvidersApi.updateProvider", - "params": [ - { - "name": "identifier", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "params", - "type": { - "name": "UpdateCustomProviderParams", - "properties": [ - { - "comment": { - "shortText": "Additional client IDs accepted during token validation", - }, - "isOptional": true, - "name": "acceptable_client_ids", - "type": { - "elemType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "comment": { - "shortText": "Mapping of provider attributes to Supabase user attributes", - }, - "isOptional": true, - "name": "attribute_mapping", - "type": { - "keyType": { - "name": "string", - "type": "intrinsic", - }, - "name": "Record", - "type": "record", - "valueType": { - "name": "any", - "type": "intrinsic", - }, - }, - }, - { - "comment": { - "shortText": "Additional parameters sent with the authorization request", - }, - "isOptional": true, - "name": "authorization_params", - "type": { - "keyType": { - "name": "string", - "type": "intrinsic", - }, - "name": "Record", - "type": "record", - "valueType": { - "name": "string", - "type": "intrinsic", - }, - }, - }, - { - "comment": { - "shortText": "OAuth2 authorization URL", - }, - "isOptional": true, - "name": "authorization_url", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "OAuth client ID", - }, - "isOptional": true, - "name": "client_id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "OAuth client secret (write-only, not returned in responses)", - }, - "isOptional": true, - "name": "client_secret", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "OIDC discovery URL", - }, - "isOptional": true, - "name": "discovery_url", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Whether email is optional for this provider", - }, - "isOptional": true, - "name": "email_optional", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Whether the provider is enabled", - }, - "isOptional": true, - "name": "enabled", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "OIDC issuer URL", - }, - "isOptional": true, - "name": "issuer", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "JWKS URI for token verification", - }, - "isOptional": true, - "name": "jwks_uri", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Human-readable name", - }, - "isOptional": true, - "name": "name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Whether PKCE is enabled", - }, - "isOptional": true, - "name": "pkce_enabled", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "OAuth scopes requested during authorization", - }, - "isOptional": true, - "name": "scopes", - "type": { - "elemType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "comment": { - "shortText": "Whether to skip nonce check (OIDC)", - }, - "isOptional": true, - "name": "skip_nonce_check", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "OAuth2 token URL", - }, - "isOptional": true, - "name": "token_url", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "OAuth2 userinfo URL", - }, - "isOptional": true, - "name": "userinfo_url", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - }, - ], - "ret": { - "type": { - "awaited": { - "name": "CustomProviderResponse", - "subTypes": [ - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "name": "CustomOAuthProvider", - "properties": [ - { - "comment": { - "shortText": "Additional client IDs accepted during token validation", - }, - "isOptional": true, - "name": "acceptable_client_ids", - "type": { - "elemType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "comment": { - "shortText": "Mapping of provider attributes to Supabase user attributes", - }, - "isOptional": true, - "name": "attribute_mapping", - "type": { - "keyType": { - "name": "string", - "type": "intrinsic", - }, - "name": "Record", - "type": "record", - "valueType": { - "name": "any", - "type": "intrinsic", - }, - }, - }, - { - "comment": { - "shortText": "Additional parameters sent with the authorization request", - }, - "isOptional": true, - "name": "authorization_params", - "type": { - "keyType": { - "name": "string", - "type": "intrinsic", - }, - "name": "Record", - "type": "record", - "valueType": { - "name": "string", - "type": "intrinsic", - }, - }, - }, - { - "comment": { - "shortText": "OAuth2 authorization URL", - }, - "isOptional": true, - "name": "authorization_url", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "OAuth client ID", - }, - "name": "client_id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Timestamp when the provider was created", - }, - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "OIDC discovery document (OIDC providers only)", - }, - "isOptional": true, - "name": "discovery_document", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "name": "OIDCDiscoveryDocument", - "properties": [ - { - "comment": { - "shortText": "URL of the authorization endpoint", - }, - "name": "authorization_endpoint", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The issuer identifier", - }, - "name": "issuer", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "URL of the JSON Web Key Set", - }, - "name": "jwks_uri", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "URL of the revocation endpoint", - }, - "isOptional": true, - "name": "revocation_endpoint", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "List of supported ID token signing algorithms", - }, - "isOptional": true, - "name": "supported_id_token_signing_algs", - "type": { - "elemType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "comment": { - "shortText": "List of supported response types", - }, - "isOptional": true, - "name": "supported_response_types", - "type": { - "elemType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "comment": { - "shortText": "List of supported scopes", - }, - "isOptional": true, - "name": "supported_scopes", - "type": { - "elemType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "comment": { - "shortText": "List of supported subject types", - }, - "isOptional": true, - "name": "supported_subject_types", - "type": { - "elemType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "comment": { - "shortText": "URL of the token endpoint", - }, - "name": "token_endpoint", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "URL of the userinfo endpoint", - }, - "isOptional": true, - "name": "userinfo_endpoint", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - { - "type": "literal", - "value": null, - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "OIDC discovery URL", - }, - "isOptional": true, - "name": "discovery_url", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Whether email is optional for this provider", - }, - "isOptional": true, - "name": "email_optional", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Whether the provider is enabled", - }, - "isOptional": true, - "name": "enabled", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Unique identifier (UUID)", - }, - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Provider identifier (e.g. \`custom:mycompany\`)", - }, - "name": "identifier", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "OIDC issuer URL", - }, - "isOptional": true, - "name": "issuer", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "JWKS URI for token verification", - }, - "isOptional": true, - "name": "jwks_uri", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Human-readable name", - }, - "name": "name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Whether PKCE is enabled", - }, - "isOptional": true, - "name": "pkce_enabled", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Provider type", - }, - "name": "provider_type", - "type": { - "name": "CustomProviderType", - "subTypes": [ - { - "type": "literal", - "value": "oauth2", - }, - { - "type": "literal", - "value": "oidc", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "OAuth scopes requested during authorization", - }, - "isOptional": true, - "name": "scopes", - "type": { - "elemType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "comment": { - "shortText": "Whether to skip nonce check (OIDC)", - }, - "isOptional": true, - "name": "skip_nonce_check", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "OAuth2 token URL", - }, - "isOptional": true, - "name": "token_url", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Timestamp when the provider was last updated", - }, - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "OAuth2 userinfo URL", - }, - "isOptional": true, - "name": "userinfo_url", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - }, - { - "name": "error", - "type": { - "type": "literal", - "value": null, - }, - }, - ], - "type": "object", - }, - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "type": "literal", - "value": null, - }, - }, - { - "name": "error", - "type": undefined, - }, - ], - "type": "object", - }, - ], - "type": "union", - }, - "name": "Promise", - "type": "promise", - }, - }, - }, - "@supabase/auth-js.GoTrueAdminMFAApi.deleteFactor": { - "comment": { - "examples": [ - { - "code": "\`\`\`js -const { data, error } = await supabase.auth.admin.mfa.deleteFactor({ - id: '34e770dd-9ff9-416c-87fa-43b31d7ef225', - userId: 'a89baba7-b1b7-440f-b4bb-91026967f66b', -}) -\`\`\`", - "data": undefined, - "description": undefined, - "id": "delete-a-factor-for-a-user", - "name": "Delete a factor for a user", - "response": "\`\`\`json -{ - data: { - id: '34e770dd-9ff9-416c-87fa-43b31d7ef225' - }, - error: null -} -\`\`\`", - }, - ], - "shortText": "Deletes a factor on a user. This will log the user out of all active -sessions if the deleted factor was verified.", - }, - "name": "@supabase/auth-js.GoTrueAdminMFAApi.deleteFactor", - "params": [ - { - "name": "params", - "type": { - "name": "AuthMFAAdminDeleteFactorParams", - "properties": [ - { - "comment": { - "shortText": "ID of the MFA factor to delete.", - }, - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "ID of the user whose factor is being deleted.", - }, - "name": "userId", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - }, - ], - "ret": { - "type": { - "awaited": { - "name": "AuthMFAAdminDeleteFactorResponse", - "subTypes": [ - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "name": Symbol(anonymous), - "properties": [ - { - "comment": { - "shortText": "ID of the factor that was successfully deleted.", - }, - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - }, - { - "name": "error", - "type": { - "type": "literal", - "value": null, - }, - }, - ], - "type": "object", - }, - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "type": "literal", - "value": null, - }, - }, - { - "name": "error", - "type": undefined, - }, - ], - "type": "object", - }, - ], - "type": "union", - }, - "name": "Promise", - "type": "promise", - }, - }, - }, - "@supabase/auth-js.GoTrueAdminMFAApi.listFactors": { - "comment": { - "examples": [ - { - "code": "\`\`\`js -const { data, error } = await supabase.auth.admin.mfa.listFactors() -\`\`\`", - "data": undefined, - "description": undefined, - "id": "list-all-factors-for-a-user", - "name": "List all factors for a user", - "response": "\`\`\`json -{ - data: { - factors: Factor[ - { - id: '', - friendly_name: 'Auth App Factor', - factor_type: 'totp', - status: 'verified', - created_at: '2024-01-01T00:00:00Z', - updated_at: '2024-01-01T00:00:00Z' - } - ] - }, - error: null -} -\`\`\`", - }, - ], - "shortText": "Lists all factors associated to a user.", - }, - "name": "@supabase/auth-js.GoTrueAdminMFAApi.listFactors", - "params": [ - { - "name": "params", - "type": { - "name": "AuthMFAAdminListFactorsParams", - "properties": [ - { - "comment": { - "shortText": "ID of the user.", - }, - "name": "userId", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - }, - ], - "ret": { - "type": { - "awaited": { - "name": "AuthMFAAdminListFactorsResponse", - "subTypes": [ - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "name": Symbol(anonymous), - "properties": [ - { - "comment": { - "shortText": "All factors attached to the user.", - }, - "name": "factors", - "type": { - "elemType": { - "name": "Factor", - "properties": [ - { - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Type of factor. \`totp\` and \`phone\` supported with this version", - }, - "name": "factor_type", - "type": { - "name": "Type", - "type": "nameOnly", - }, - }, - { - "comment": { - "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors.", - }, - "isOptional": true, - "name": "friendly_name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "ID of the factor.", - }, - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_challenged_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The verification status of the factor, default is \`unverified\` after \`.enroll()\`, then \`verified\` after the user verifies it with \`.verify()\`", - }, - "name": "status", - "type": { - "name": "Status", - "type": "nameOnly", - }, - }, - { - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - ], - "type": "object", - }, - }, - { - "name": "error", - "type": { - "type": "literal", - "value": null, - }, - }, - ], - "type": "object", - }, - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "type": "literal", - "value": null, - }, - }, - { - "name": "error", - "type": undefined, - }, - ], - "type": "object", - }, - ], - "type": "union", - }, - "name": "Promise", - "type": "promise", - }, - }, - }, - "@supabase/auth-js.GoTrueAdminOAuthApi.createClient": { - "comment": { - "shortText": "Creates a new OAuth client. -Only relevant when the OAuth 2.1 server is enabled in Supabase Auth. - -This function should only be called on a server. Never expose your \`service_role\` key in the browser.", - }, - "name": "@supabase/auth-js.GoTrueAdminOAuthApi.createClient", - "params": [ - { - "name": "params", - "type": { - "name": "CreateOAuthClientParams", - "properties": [ - { - "comment": { - "shortText": "Human-readable name of the OAuth client", - }, - "name": "client_name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "URI of the OAuth client", - }, - "isOptional": true, - "name": "client_uri", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Array of allowed grant types (optional, defaults to authorization_code and refresh_token)", - }, - "isOptional": true, - "name": "grant_types", - "type": { - "elemType": { - "name": "OAuthClientGrantType", - "subTypes": [ - { - "type": "literal", - "value": "authorization_code", - }, - { - "type": "literal", - "value": "refresh_token", - }, - undefined, - ], - "type": "union", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "comment": { - "shortText": "Array of allowed redirect URIs", - }, - "name": "redirect_uris", - "type": { - "elemType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "comment": { - "shortText": "Array of allowed response types (optional, defaults to code)", - }, - "isOptional": true, - "name": "response_types", - "type": { - "elemType": { - "name": "OAuthClientResponseType", - "type": "literal", - "value": "code", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "comment": { - "shortText": "Scope of the OAuth client", - }, - "isOptional": true, - "name": "scope", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Token endpoint authentication method (defaults to server default if not specified)", - }, - "isOptional": true, - "name": "token_endpoint_auth_method", - "type": { - "name": "OAuthClientTokenEndpointAuthMethod", - "subTypes": [ - { - "type": "literal", - "value": "none", - }, - { - "type": "literal", - "value": "client_secret_basic", - }, - { - "type": "literal", - "value": "client_secret_post", - }, - ], - "type": "union", - }, - }, - ], - "type": "object", - }, - }, - ], - "ret": { - "type": { - "awaited": { - "name": "OAuthClientResponse", - "subTypes": [ - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "name": "OAuthClient", - "properties": [ - { - "comment": { - "shortText": "Unique identifier for the OAuth client", - }, - "name": "client_id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Human-readable name of the OAuth client", - }, - "name": "client_name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Client secret (only returned on registration and regeneration)", - }, - "isOptional": true, - "name": "client_secret", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Type of OAuth client", - }, - "name": "client_type", - "type": { - "name": "OAuthClientType", - "subTypes": [ - { - "type": "literal", - "value": "public", - }, - { - "type": "literal", - "value": "confidential", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "URI of the OAuth client", - }, - "isOptional": true, - "name": "client_uri", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Timestamp when the client was created", - }, - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Array of allowed grant types", - }, - "name": "grant_types", - "type": { - "elemType": { - "name": "OAuthClientGrantType", - "subTypes": [ - { - "type": "literal", - "value": "authorization_code", - }, - { - "type": "literal", - "value": "refresh_token", - }, - undefined, - ], - "type": "union", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "comment": { - "shortText": "URI of the OAuth client's logo", - }, - "isOptional": true, - "name": "logo_uri", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Array of allowed redirect URIs", - }, - "name": "redirect_uris", - "type": { - "elemType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "comment": { - "shortText": "Registration type of the client", - }, - "name": "registration_type", - "type": { - "name": "OAuthClientRegistrationType", - "subTypes": [ - { - "type": "literal", - "value": "dynamic", - }, - { - "type": "literal", - "value": "manual", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "Array of allowed response types", - }, - "name": "response_types", - "type": { - "elemType": { - "name": "OAuthClientResponseType", - "type": "literal", - "value": "code", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "comment": { - "shortText": "Scope of the OAuth client", - }, - "isOptional": true, - "name": "scope", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Token endpoint authentication method", - }, - "name": "token_endpoint_auth_method", - "type": { - "name": "OAuthClientTokenEndpointAuthMethod", - "subTypes": [ - { - "type": "literal", - "value": "none", - }, - { - "type": "literal", - "value": "client_secret_basic", - }, - { - "type": "literal", - "value": "client_secret_post", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "Timestamp when the client was last updated", - }, - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - }, - { - "name": "error", - "type": { - "type": "literal", - "value": null, - }, - }, - ], - "type": "object", - }, - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "type": "literal", - "value": null, - }, - }, - { - "name": "error", - "type": undefined, - }, - ], - "type": "object", - }, - ], - "type": "union", - }, - "name": "Promise", - "type": "promise", - }, - }, - }, - "@supabase/auth-js.GoTrueAdminOAuthApi.deleteClient": { - "comment": { - "shortText": "Deletes an OAuth client. -Only relevant when the OAuth 2.1 server is enabled in Supabase Auth. - -This function should only be called on a server. Never expose your \`service_role\` key in the browser.", - }, - "name": "@supabase/auth-js.GoTrueAdminOAuthApi.deleteClient", - "params": [ - { - "name": "clientId", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "ret": { - "type": { - "awaited": { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "type": "literal", - "value": null, - }, - }, - { - "name": "error", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": null, - }, - { - "name": "AuthError", - "type": "nameOnly", - }, - ], - "type": "union", - }, - }, - ], - "type": "object", - }, - "name": "Promise", - "type": "promise", - }, - }, - }, - "@supabase/auth-js.GoTrueAdminOAuthApi.getClient": { - "comment": { - "shortText": "Gets details of a specific OAuth client. -Only relevant when the OAuth 2.1 server is enabled in Supabase Auth. - -This function should only be called on a server. Never expose your \`service_role\` key in the browser.", - }, - "name": "@supabase/auth-js.GoTrueAdminOAuthApi.getClient", - "params": [ - { - "name": "clientId", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "ret": { - "type": { - "awaited": { - "name": "OAuthClientResponse", - "subTypes": [ - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "name": "OAuthClient", - "properties": [ - { - "comment": { - "shortText": "Unique identifier for the OAuth client", - }, - "name": "client_id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Human-readable name of the OAuth client", - }, - "name": "client_name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Client secret (only returned on registration and regeneration)", - }, - "isOptional": true, - "name": "client_secret", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Type of OAuth client", - }, - "name": "client_type", - "type": { - "name": "OAuthClientType", - "subTypes": [ - { - "type": "literal", - "value": "public", - }, - { - "type": "literal", - "value": "confidential", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "URI of the OAuth client", - }, - "isOptional": true, - "name": "client_uri", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Timestamp when the client was created", - }, - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Array of allowed grant types", - }, - "name": "grant_types", - "type": { - "elemType": { - "name": "OAuthClientGrantType", - "subTypes": [ - { - "type": "literal", - "value": "authorization_code", - }, - { - "type": "literal", - "value": "refresh_token", - }, - undefined, - ], - "type": "union", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "comment": { - "shortText": "URI of the OAuth client's logo", - }, - "isOptional": true, - "name": "logo_uri", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Array of allowed redirect URIs", - }, - "name": "redirect_uris", - "type": { - "elemType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "comment": { - "shortText": "Registration type of the client", - }, - "name": "registration_type", - "type": { - "name": "OAuthClientRegistrationType", - "subTypes": [ - { - "type": "literal", - "value": "dynamic", - }, - { - "type": "literal", - "value": "manual", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "Array of allowed response types", - }, - "name": "response_types", - "type": { - "elemType": { - "name": "OAuthClientResponseType", - "type": "literal", - "value": "code", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "comment": { - "shortText": "Scope of the OAuth client", - }, - "isOptional": true, - "name": "scope", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Token endpoint authentication method", - }, - "name": "token_endpoint_auth_method", - "type": { - "name": "OAuthClientTokenEndpointAuthMethod", - "subTypes": [ - { - "type": "literal", - "value": "none", - }, - { - "type": "literal", - "value": "client_secret_basic", - }, - { - "type": "literal", - "value": "client_secret_post", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "Timestamp when the client was last updated", - }, - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - }, - { - "name": "error", - "type": { - "type": "literal", - "value": null, - }, - }, - ], - "type": "object", - }, - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "type": "literal", - "value": null, - }, - }, - { - "name": "error", - "type": undefined, - }, - ], - "type": "object", - }, - ], - "type": "union", - }, - "name": "Promise", - "type": "promise", - }, - }, - }, - "@supabase/auth-js.GoTrueAdminOAuthApi.listClients": { - "comment": { - "shortText": "Lists all OAuth clients with optional pagination. -Only relevant when the OAuth 2.1 server is enabled in Supabase Auth. - -This function should only be called on a server. Never expose your \`service_role\` key in the browser.", - }, - "name": "@supabase/auth-js.GoTrueAdminOAuthApi.listClients", - "params": [ - { - "isOptional": true, - "name": "params", - "type": { - "name": "PageParams", - "properties": [ - { - "comment": { - "shortText": "The page number", - }, - "isOptional": true, - "name": "page", - "type": { - "name": "number", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Number of items returned per page", - }, - "isOptional": true, - "name": "perPage", - "type": { - "name": "number", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - }, - ], - "ret": { - "type": { - "awaited": { - "name": "OAuthClientListResponse", - "subTypes": [ - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": undefined, - }, - { - "name": "error", - "type": { - "type": "literal", - "value": null, - }, - }, - ], - "type": "object", - }, - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "name": Symbol(anonymous), - "properties": [ - { - "name": "clients", - "type": undefined, - }, - ], - "type": "object", - }, - }, - { - "name": "error", - "type": { - "name": "AuthError", - "type": "nameOnly", - }, - }, - ], - "type": "object", - }, - ], - "type": "union", - }, - "name": "Promise", - "type": "promise", - }, - }, - }, - "@supabase/auth-js.GoTrueAdminOAuthApi.regenerateClientSecret": { - "comment": { - "shortText": "Regenerates the secret for an OAuth client. -Only relevant when the OAuth 2.1 server is enabled in Supabase Auth. - -This function should only be called on a server. Never expose your \`service_role\` key in the browser.", - }, - "name": "@supabase/auth-js.GoTrueAdminOAuthApi.regenerateClientSecret", - "params": [ - { - "name": "clientId", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "ret": { - "type": { - "awaited": { - "name": "OAuthClientResponse", - "subTypes": [ - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "name": "OAuthClient", - "properties": [ - { - "comment": { - "shortText": "Unique identifier for the OAuth client", - }, - "name": "client_id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Human-readable name of the OAuth client", - }, - "name": "client_name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Client secret (only returned on registration and regeneration)", - }, - "isOptional": true, - "name": "client_secret", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Type of OAuth client", - }, - "name": "client_type", - "type": { - "name": "OAuthClientType", - "subTypes": [ - { - "type": "literal", - "value": "public", - }, - { - "type": "literal", - "value": "confidential", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "URI of the OAuth client", - }, - "isOptional": true, - "name": "client_uri", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Timestamp when the client was created", - }, - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Array of allowed grant types", - }, - "name": "grant_types", - "type": { - "elemType": { - "name": "OAuthClientGrantType", - "subTypes": [ - { - "type": "literal", - "value": "authorization_code", - }, - { - "type": "literal", - "value": "refresh_token", - }, - undefined, - ], - "type": "union", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "comment": { - "shortText": "URI of the OAuth client's logo", - }, - "isOptional": true, - "name": "logo_uri", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Array of allowed redirect URIs", - }, - "name": "redirect_uris", - "type": { - "elemType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "comment": { - "shortText": "Registration type of the client", - }, - "name": "registration_type", - "type": { - "name": "OAuthClientRegistrationType", - "subTypes": [ - { - "type": "literal", - "value": "dynamic", - }, - { - "type": "literal", - "value": "manual", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "Array of allowed response types", - }, - "name": "response_types", - "type": { - "elemType": { - "name": "OAuthClientResponseType", - "type": "literal", - "value": "code", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "comment": { - "shortText": "Scope of the OAuth client", - }, - "isOptional": true, - "name": "scope", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Token endpoint authentication method", - }, - "name": "token_endpoint_auth_method", - "type": { - "name": "OAuthClientTokenEndpointAuthMethod", - "subTypes": [ - { - "type": "literal", - "value": "none", - }, - { - "type": "literal", - "value": "client_secret_basic", - }, - { - "type": "literal", - "value": "client_secret_post", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "Timestamp when the client was last updated", - }, - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - }, - { - "name": "error", - "type": { - "type": "literal", - "value": null, - }, - }, - ], - "type": "object", - }, - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "type": "literal", - "value": null, - }, - }, - { - "name": "error", - "type": undefined, - }, - ], - "type": "object", - }, - ], - "type": "union", - }, - "name": "Promise", - "type": "promise", - }, - }, - }, - "@supabase/auth-js.GoTrueAdminOAuthApi.updateClient": { - "comment": { - "shortText": "Updates an existing OAuth client. -Only relevant when the OAuth 2.1 server is enabled in Supabase Auth. - -This function should only be called on a server. Never expose your \`service_role\` key in the browser.", - }, - "name": "@supabase/auth-js.GoTrueAdminOAuthApi.updateClient", - "params": [ - { - "name": "clientId", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "params", - "type": { - "name": "UpdateOAuthClientParams", - "properties": [ - { - "comment": { - "shortText": "Human-readable name of the OAuth client", - }, - "isOptional": true, - "name": "client_name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "URI of the OAuth client", - }, - "isOptional": true, - "name": "client_uri", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Array of allowed grant types", - }, - "isOptional": true, - "name": "grant_types", - "type": { - "elemType": { - "name": "OAuthClientGrantType", - "subTypes": [ - { - "type": "literal", - "value": "authorization_code", - }, - { - "type": "literal", - "value": "refresh_token", - }, - undefined, - ], - "type": "union", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "comment": { - "shortText": "URI of the OAuth client's logo", - }, - "isOptional": true, - "name": "logo_uri", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Array of allowed redirect URIs", - }, - "isOptional": true, - "name": "redirect_uris", - "type": { - "elemType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "comment": { - "shortText": "Token endpoint authentication method", - }, - "isOptional": true, - "name": "token_endpoint_auth_method", - "type": { - "name": "OAuthClientTokenEndpointAuthMethod", - "subTypes": [ - { - "type": "literal", - "value": "none", - }, - { - "type": "literal", - "value": "client_secret_basic", - }, - { - "type": "literal", - "value": "client_secret_post", - }, - ], - "type": "union", - }, - }, - ], - "type": "object", - }, - }, - ], - "ret": { - "type": { - "awaited": { - "name": "OAuthClientResponse", - "subTypes": [ - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "name": "OAuthClient", - "properties": [ - { - "comment": { - "shortText": "Unique identifier for the OAuth client", - }, - "name": "client_id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Human-readable name of the OAuth client", - }, - "name": "client_name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Client secret (only returned on registration and regeneration)", - }, - "isOptional": true, - "name": "client_secret", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Type of OAuth client", - }, - "name": "client_type", - "type": { - "name": "OAuthClientType", - "subTypes": [ - { - "type": "literal", - "value": "public", - }, - { - "type": "literal", - "value": "confidential", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "URI of the OAuth client", - }, - "isOptional": true, - "name": "client_uri", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Timestamp when the client was created", - }, - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Array of allowed grant types", - }, - "name": "grant_types", - "type": { - "elemType": { - "name": "OAuthClientGrantType", - "subTypes": [ - { - "type": "literal", - "value": "authorization_code", - }, - { - "type": "literal", - "value": "refresh_token", - }, - undefined, - ], - "type": "union", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "comment": { - "shortText": "URI of the OAuth client's logo", - }, - "isOptional": true, - "name": "logo_uri", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Array of allowed redirect URIs", - }, - "name": "redirect_uris", - "type": { - "elemType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "comment": { - "shortText": "Registration type of the client", - }, - "name": "registration_type", - "type": { - "name": "OAuthClientRegistrationType", - "subTypes": [ - { - "type": "literal", - "value": "dynamic", - }, - { - "type": "literal", - "value": "manual", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "Array of allowed response types", - }, - "name": "response_types", - "type": { - "elemType": { - "name": "OAuthClientResponseType", - "type": "literal", - "value": "code", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "comment": { - "shortText": "Scope of the OAuth client", - }, - "isOptional": true, - "name": "scope", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Token endpoint authentication method", - }, - "name": "token_endpoint_auth_method", - "type": { - "name": "OAuthClientTokenEndpointAuthMethod", - "subTypes": [ - { - "type": "literal", - "value": "none", - }, - { - "type": "literal", - "value": "client_secret_basic", - }, - { - "type": "literal", - "value": "client_secret_post", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "Timestamp when the client was last updated", - }, - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - }, - { - "name": "error", - "type": { - "type": "literal", - "value": null, - }, - }, - ], - "type": "object", - }, - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "type": "literal", - "value": null, - }, - }, - { - "name": "error", - "type": undefined, - }, - ], - "type": "object", - }, - ], - "type": "union", - }, - "name": "Promise", - "type": "promise", - }, - }, - }, - "@supabase/auth-js.GoTrueAdminPasskeyApi.deletePasskey": { - "comment": { - "shortText": "Deletes a specific passkey for a specific user. - -This function should only be called on a server. Never expose your \`service_role\` key in the browser.", - }, - "name": "@supabase/auth-js.GoTrueAdminPasskeyApi.deletePasskey", - "params": [ - { - "name": "params", - "type": { - "name": "AuthPasskeyAdminDeleteParams", - "properties": [ - { - "name": "passkeyId", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "userId", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - }, - ], - "ret": { - "type": { - "awaited": { - "name": "AuthPasskeyDeleteResponse", - "subTypes": [ - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "type": "literal", - "value": null, - }, - }, - { - "name": "error", - "type": { - "type": "literal", - "value": null, - }, - }, - ], - "type": "object", - }, - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "type": "literal", - "value": null, - }, - }, - { - "name": "error", - "type": undefined, - }, - ], - "type": "object", - }, - ], - "type": "union", - }, - "name": "Promise", - "type": "promise", - }, - }, - }, - "@supabase/auth-js.GoTrueAdminPasskeyApi.listPasskeys": { - "comment": { - "shortText": "Lists all passkeys registered for a specific user. - -This function should only be called on a server. Never expose your \`service_role\` key in the browser.", - }, - "name": "@supabase/auth-js.GoTrueAdminPasskeyApi.listPasskeys", - "params": [ - { - "name": "params", - "type": { - "name": "AuthPasskeyAdminListParams", - "properties": [ - { - "name": "userId", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - }, - ], - "ret": { - "type": { - "awaited": { - "name": "AuthPasskeyListResponse", - "subTypes": [ - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "elemType": { - "name": "PasskeyListItem", - "properties": [ - { - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "friendly_name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_used_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "name": "error", - "type": { - "type": "literal", - "value": null, - }, - }, - ], - "type": "object", - }, - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "type": "literal", - "value": null, - }, - }, - { - "name": "error", - "type": undefined, - }, - ], - "type": "object", - }, - ], - "type": "union", - }, - "name": "Promise", - "type": "promise", - }, - }, - }, - "@supabase/auth-js.GoTrueClient.constructor": { - "comment": { - "examples": [ - { - "code": "\`\`\`ts -import { createClient } from '@supabase/supabase-js' - -const supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key') -const { data, error } = await supabase.auth.getUser() -\`\`\`", - "data": undefined, - "description": undefined, - "id": "using-supabase-js-recommended", - "name": "Using supabase-js (recommended)", - "response": undefined, - }, - { - "code": "\`\`\`ts -import { GoTrueClient } from '@supabase/auth-js' - -const auth = new GoTrueClient({ - url: 'https://xyzcompany.supabase.co/auth/v1', - headers: { apikey: 'your-publishable-key' }, - storageKey: 'supabase-auth', -}) -\`\`\`", - "data": undefined, - "description": undefined, - "id": "standalone-import-for-bundle-sensitive-environments", - "name": "Standalone import for bundle-sensitive environments", - "response": undefined, - }, - ], - "shortText": "Create a new client for use in the browser.", - }, - "name": "@supabase/auth-js.GoTrueClient.constructor", - "params": [ - { - "name": "options", - "type": { - "name": "GoTrueClientOptions", - "properties": [ - { - "isOptional": true, - "name": "autoRefreshToken", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "debug", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "name": "boolean", - "type": "intrinsic", - }, - { - "comment": undefined, - "name": Symbol(anonymous), - "params": [ - { - "name": "message", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "args", - "type": { - "elemType": { - "name": "any", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - ], - "ret": { - "type": { - "name": "void", - "type": "intrinsic", - }, - }, - "type": "function", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "examples": [ - { - "code": "\`\`\`ts -detectSessionInUrl: (url, params) => { - // Ignore Facebook OAuth redirects - if (url.pathname === '/facebook/redirect') return false - // Use default detection for other URLs - return Boolean(params.access_token || params.error_description) -} -\`\`\`", - "data": undefined, - "description": undefined, - "id": "example-1", - "name": "Example 1", - "response": undefined, - }, - ], - "shortText": "Set to "true" if you want to automatically detect OAuth grants in the URL and sign in the user. -Set to "false" to disable automatic detection. -Set to a function to provide custom logic for determining if a URL contains a Supabase auth callback. -The function receives the current URL and parsed parameters, and should return true if the URL -should be processed as a Supabase auth callback, or false to ignore it. - -This is useful when your app uses other OAuth providers (e.g., Facebook Login) that also return -access_token in the URL fragment, which would otherwise be incorrectly intercepted by Supabase Auth.", - }, - "isOptional": true, - "name": "detectSessionInUrl", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "name": "boolean", - "type": "intrinsic", - }, - { - "comment": undefined, - "name": Symbol(anonymous), - "params": [ - { - "name": "url", - "type": { - "name": "URL", - "type": "nameOnly", - }, - }, - { - "name": "params", - "type": { - "keyType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "index signature", - "valueType": { - "name": "string", - "type": "intrinsic", - }, - }, - }, - ], - "ret": { - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - "type": "function", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "Opt-in flags for experimental features. These APIs may change without -notice and are disabled by default.", - "tags": [ - { - "tag": "experimental", - "text": "", - }, - ], - }, - "isOptional": true, - "name": "experimental", - "type": { - "name": "ExperimentalFeatureFlags", - "properties": [ - { - "comment": { - "shortText": "Enables passkey support: - - \`auth.signInWithPasskey()\`, \`auth.registerPasskey()\` - - \`auth.passkey.*\` - - \`auth.admin.passkey.*\` - -Defaults to \`false\`. Calling any passkey method while this flag is -disabled throws a descriptive error at call time.", - }, - "isOptional": true, - "name": "passkey", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - }, - { - "isOptional": true, - "name": "fetch", - "type": { - "name": "Fetch", - "type": "nameOnly", - }, - }, - { - "isOptional": true, - "name": "flowType", - "type": { - "name": "AuthFlowType", - "subTypes": [ - { - "type": "literal", - "value": "implicit", - }, - { - "type": "literal", - "value": "pkce", - }, - undefined, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "Set to "true" if there is a custom authorization header set globally.", - "tags": [ - { - "tag": "experimental", - "text": "", - }, - ], - }, - "isOptional": true, - "name": "hasCustomAuthorizationHeader", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "headers", - "type": { - "keyType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "index signature", - "valueType": { - "name": "string", - "type": "intrinsic", - }, - }, - }, - { - "comment": { - "shortText": "Provide your own locking mechanism based on the environment. By default -the client coordinates refreshes itself (single-flight via -\`refreshingDeferred\` + commit guard) and relies on the GoTrue server to -resolve cross-tab refresh races. Passing a custom lock opts into a -legacy path that wraps every auth operation in your supplied lock — this -path is preserved for backwards compatibility (typically React Native -\`processLock\` or Node multi-process setups).", - }, - "isOptional": true, - "name": "lock", - "type": { - "comment": undefined, - "name": "LockFunc", - "params": [ - { - "comment": { - "shortText": "Name of the lock to be acquired.", - }, - "name": "name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "If negative, no timeout should occur. If positive it - should throw an Error with an \`isAcquireTimeout\` - property set to true if the operation fails to be - acquired after this much time (ms).", - }, - "name": "acquireTimeout", - "type": { - "name": "number", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The operation to execute when the lock is acquired.", - }, - "name": "fn", - "type": { - "comment": undefined, - "name": Symbol(anonymous), - "params": [], - "ret": { - "type": { - "awaited": { - "name": "R", - "type": "nameOnly", - }, - "name": "Promise", - "type": "promise", - }, - }, - "type": "function", - }, - }, - ], - "ret": { - "type": { - "awaited": { - "name": "R", - "type": "nameOnly", - }, - "name": "Promise", - "type": "promise", - }, - }, - "type": "function", - }, - }, - { - "comment": { - "shortText": "The maximum time in milliseconds to wait for acquiring the custom lock -supplied via the \`lock\` option. Only consulted when a custom \`lock\` is -passed — the default lockless path doesn't use this timeout.", - }, - "isOptional": true, - "name": "lockAcquireTimeout", - "type": { - "name": "number", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "persistSession", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "If true, skips automatic initialization in constructor. Useful for SSR -contexts where initialization timing must be controlled to prevent race -conditions with HTTP response generation.", - }, - "isOptional": true, - "name": "skipAutoInitialize", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "storage", - "type": { - "name": "SupportedStorage", - "type": "nameOnly", - }, - }, - { - "isOptional": true, - "name": "storageKey", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "If there is an error with the query, throwOnError will reject the promise by -throwing the error instead of returning it as part of a successful response.", - }, - "isOptional": true, - "name": "throwOnError", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "url", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Stores the user object in a separate storage location from the rest of the session data. When non-null, \`storage\` will only store a JSON object containing the access and refresh token and some adjacent metadata, while \`userStorage\` will only contain the user object under the key \`storageKey + '-user'\`. - -When this option is set and cookie storage is used, \`getSession()\` and other functions that load a session from the cookie store might not return back a user. It's very important to always use \`getUser()\` to fetch a user object in those scenarios.", - "tags": [ - { - "tag": "experimental", - "text": "", - }, - ], - }, - "isOptional": true, - "name": "userStorage", - "type": { - "name": "SupportedStorage", - "type": "nameOnly", - }, - }, - ], - "type": "object", - }, - }, - ], - "ret": { - "type": { - "name": "GoTrueClient", - "type": "nameOnly", - }, - }, - }, - "@supabase/auth-js.GoTrueClient.dispose": { - "comment": { - "examples": [ - { - "code": "\`\`\`ts -useEffect(() => { - const client = createClient(...) - return () => { client.auth.dispose() } -}, []) -\`\`\`", - "data": undefined, - "description": undefined, - "id": "cleanup-on-react-unmount", - "name": "Cleanup on React unmount", - "response": undefined, - }, - ], - "shortText": "Tears down the client's background work: stops the auto-refresh interval, -removes the \`visibilitychange\` listener, closes the cross-tab -\`BroadcastChannel\`, and clears registered \`onAuthStateChange\` subscribers. - -Call this from cleanup hooks when the client is being replaced before -its JS realm is destroyed. React Strict Mode and HMR are the common -cases. Any in-flight \`fetch\` calls continue to completion and may still -write to storage; dispose doesn't abort them or erase storage. - -Lifecycle caveat: because in-flight refreshes are not aborted, a -disposed instance can still persist a rotated session to storage after -\`dispose()\` returns. A subsequent \`createClient\` against the same -\`storageKey\` will pick up that session on its next read. If you need -strict isolation between client lifecycles, await any pending auth -operation before calling \`dispose()\` (or change the \`storageKey\` for -the replacement client). - -Safe to call repeatedly.", - }, - "name": "@supabase/auth-js.GoTrueClient.dispose", - "params": [], - "ret": { - "type": { - "awaited": { - "name": "void", - "type": "intrinsic", - }, - "name": "Promise", - "type": "promise", - }, - }, - }, - "@supabase/auth-js.GoTrueClient.exchangeCodeForSession": { - "comment": { - "examples": [ - { - "code": "\`\`\`js -supabase.auth.exchangeCodeForSession('34e770dd-9ff9-416c-87fa-43b31d7ef225') -\`\`\`", - "data": undefined, - "description": undefined, - "id": "exchange-auth-code", - "name": "Exchange Auth Code", - "response": "\`\`\`json -{ - "data": { - session: { - access_token: '', - token_type: 'bearer', - expires_in: 3600, - expires_at: 1700000000, - refresh_token: '', - user: { - id: '11111111-1111-1111-1111-111111111111', - aud: 'authenticated', - role: 'authenticated', - email: 'example@email.com' - email_confirmed_at: '2024-01-01T00:00:00Z', - phone: '', - confirmation_sent_at: '2024-01-01T00:00:00Z', - confirmed_at: '2024-01-01T00:00:00Z', - last_sign_in_at: '2024-01-01T00:00:00Z', - app_metadata: { - "provider": "email", - "providers": [ - "email", - "" - ] - }, - user_metadata: { - email: 'email@email.com', - email_verified: true, - full_name: 'User Name', - iss: '', - name: 'User Name', - phone_verified: false, - provider_id: '', - sub: '' - }, - identities: [ - { - "identity_id": "22222222-2222-2222-2222-222222222222", - "id": "11111111-1111-1111-1111-111111111111", - "user_id": "11111111-1111-1111-1111-111111111111", - "identity_data": { - "email": "example@email.com", - "email_verified": false, - "phone_verified": false, - "sub": "11111111-1111-1111-1111-111111111111" - }, - "provider": "email", - "last_sign_in_at": "2024-01-01T00:00:00Z", - "created_at": "2024-01-01T00:00:00Z", - "updated_at": "2024-01-01T00:00:00Z", - "email": "email@example.com" - }, - { - "identity_id": "33333333-3333-3333-3333-333333333333", - "id": "", - "user_id": "", - "identity_data": { - "email": "example@email.com", - "email_verified": true, - "full_name": "User Name", - "iss": "", - "name": "User Name", - "phone_verified": false, - "provider_id": "", - "sub": "" - }, - "provider": "", - "last_sign_in_at": "2024-01-01T00:00:00Z", - "created_at": "2024-01-01T00:00:00Z", - "updated_at": "2024-01-01T00:00:00Z", - "email": "example@email.com" - } - ], - created_at: '2024-01-01T00:00:00Z', - updated_at: '2024-01-01T00:00:00Z', - is_anonymous: false - }, - provider_token: '', - provider_refresh_token: '' - }, - user: { - id: '11111111-1111-1111-1111-111111111111', - aud: 'authenticated', - role: 'authenticated', - email: 'example@email.com', - email_confirmed_at: '2024-01-01T00:00:00Z', - phone: '', - confirmation_sent_at: '2024-01-01T00:00:00Z', - confirmed_at: '2024-01-01T00:00:00Z', - last_sign_in_at: '2024-01-01T00:00:00Z', - app_metadata: { - provider: 'email', - providers: [ - "email", - "" - ] - }, - user_metadata: { - email: 'email@email.com', - email_verified: true, - full_name: 'User Name', - iss: '', - name: 'User Name', - phone_verified: false, - provider_id: '', - sub: '' - }, - identities: [ - { - "identity_id": "22222222-2222-2222-2222-222222222222", - "id": "11111111-1111-1111-1111-111111111111", - "user_id": "11111111-1111-1111-1111-111111111111", - "identity_data": { - "email": "example@email.com", - "email_verified": false, - "phone_verified": false, - "sub": "11111111-1111-1111-1111-111111111111" - }, - "provider": "email", - "last_sign_in_at": "2024-01-01T00:00:00Z", - "created_at": "2024-01-01T00:00:00Z", - "updated_at": "2024-01-01T00:00:00Z", - "email": "email@example.com" - }, - { - "identity_id": "33333333-3333-3333-3333-333333333333", - "id": "", - "user_id": "", - "identity_data": { - "email": "example@email.com", - "email_verified": true, - "full_name": "User Name", - "iss": "", - "name": "User Name", - "phone_verified": false, - "provider_id": "", - "sub": "" - }, - "provider": "", - "last_sign_in_at": "2024-01-01T00:00:00Z", - "created_at": "2024-01-01T00:00:00Z", - "updated_at": "2024-01-01T00:00:00Z", - "email": "example@email.com" - } - ], - created_at: '2024-01-01T00:00:00Z', - updated_at: '2024-01-01T00:00:00Z', - is_anonymous: false - }, - redirectType: null - }, - "error": null -} -\`\`\`", - }, - ], - "shortText": "Log in an existing user by exchanging an Auth Code issued during the PKCE flow.", - "text": "- Used when \`flowType\` is set to \`pkce\` in client options.", - }, - "name": "@supabase/auth-js.GoTrueClient.exchangeCodeForSession", - "params": [ - { - "name": "authCode", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "ret": { - "type": { - "awaited": { - "name": "AuthTokenResponse", - "subTypes": [ - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "name": Symbol(anonymous), - "properties": [ - { - "name": "session", - "type": { - "name": "Session", - "properties": [ - { - "comment": { - "shortText": "The access token jwt. It is recommended to set the JWT_EXPIRY to a shorter expiry value.", - }, - "name": "access_token", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "A timestamp of when the token will expire. Returned when a login is confirmed.", - }, - "isOptional": true, - "name": "expires_at", - "type": { - "name": "number", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The number of seconds until the token expires (since it was issued). Returned when a login is confirmed.", - }, - "name": "expires_in", - "type": { - "name": "number", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The oauth provider refresh token. If present, this can be used to refresh the provider_token via the oauth provider's API. -Not all oauth providers return a provider refresh token. If the provider_refresh_token is missing, please refer to the oauth provider's documentation for information on how to obtain the provider refresh token.", - }, - "isOptional": true, - "name": "provider_refresh_token", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": null, - }, - { - "name": "string", - "type": "intrinsic", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "The oauth provider token. If present, this can be used to make external API requests to the oauth provider used.", - }, - "isOptional": true, - "name": "provider_token", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": null, - }, - { - "name": "string", - "type": "intrinsic", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "A one-time used refresh token that never expires.", - }, - "name": "refresh_token", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "token_type", - "type": { - "type": "literal", - "value": "bearer", - }, - }, - { - "comment": { - "shortText": "When using a separate user storage, accessing properties of this object will throw an error.", - }, - "name": "user", - "type": { - "name": "User", - "properties": [ - { - "isOptional": true, - "name": "action_link", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "app_metadata", - "type": { - "name": "UserAppMetadata", - "properties": [ - { - "comment": { - "shortText": "The first provider that the user used to sign up with.", - }, - "isOptional": true, - "name": "provider", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "A list of all providers that the user has linked to their account.", - }, - "isOptional": true, - "name": "providers", - "type": { - "elemType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - ], - "type": "object", - }, - }, - { - "name": "aud", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "banned_until", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "confirmation_sent_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "confirmed_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "deleted_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "email", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "email_change_sent_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "email_confirmed_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "factors", - "type": { - "elemType": { - "name": Symbol(anonymous), - "subTypes": [ - { - "name": "Factor", - "properties": [ - { - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Type of factor. \`totp\` and \`phone\` supported with this version", - }, - "name": "factor_type", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors.", - }, - "isOptional": true, - "name": "friendly_name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "ID of the factor.", - }, - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_challenged_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The verification status of the factor, default is \`unverified\` after \`.enroll()\`, then \`verified\` after the user verifies it with \`.verify()\`", - }, - "name": "status", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - { - "name": "Factor", - "properties": [ - { - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Type of factor. \`totp\` and \`phone\` supported with this version", - }, - "name": "factor_type", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors.", - }, - "isOptional": true, - "name": "friendly_name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "ID of the factor.", - }, - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_challenged_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The verification status of the factor, default is \`unverified\` after \`.enroll()\`, then \`verified\` after the user verifies it with \`.verify()\`", - }, - "name": "status", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - ], - "type": "union", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "identities", - "type": { - "elemType": { - "name": "UserIdentity", - "properties": [ - { - "isOptional": true, - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "identity_data", - "type": { - "keyType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "index signature", - "valueType": { - "name": "any", - "type": "intrinsic", - }, - }, - }, - { - "name": "identity_id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_sign_in_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "provider", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "user_id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "isOptional": true, - "name": "invited_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "is_anonymous", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "is_sso_user", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_sign_in_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "new_email", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "new_phone", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "phone", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "phone_confirmed_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "recovery_sent_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "role", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "user_metadata", - "type": { - "name": "UserMetadata", - "properties": [], - "type": "object", - }, - }, - ], - "type": "object", - }, - }, - ], - "type": "object", - }, - }, - { - "name": "user", - "type": { - "name": "User", - "properties": [ - { - "isOptional": true, - "name": "action_link", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "app_metadata", - "type": { - "name": "UserAppMetadata", - "properties": [ - { - "comment": { - "shortText": "The first provider that the user used to sign up with.", - }, - "isOptional": true, - "name": "provider", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "A list of all providers that the user has linked to their account.", - }, - "isOptional": true, - "name": "providers", - "type": { - "elemType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - ], - "type": "object", - }, - }, - { - "name": "aud", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "banned_until", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "confirmation_sent_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "confirmed_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "deleted_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "email", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "email_change_sent_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "email_confirmed_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "factors", - "type": { - "elemType": { - "name": Symbol(anonymous), - "subTypes": [ - { - "name": "Factor", - "properties": [ - { - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Type of factor. \`totp\` and \`phone\` supported with this version", - }, - "name": "factor_type", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors.", - }, - "isOptional": true, - "name": "friendly_name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "ID of the factor.", - }, - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_challenged_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The verification status of the factor, default is \`unverified\` after \`.enroll()\`, then \`verified\` after the user verifies it with \`.verify()\`", - }, - "name": "status", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - { - "name": "Factor", - "properties": [ - { - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Type of factor. \`totp\` and \`phone\` supported with this version", - }, - "name": "factor_type", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors.", - }, - "isOptional": true, - "name": "friendly_name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "ID of the factor.", - }, - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_challenged_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The verification status of the factor, default is \`unverified\` after \`.enroll()\`, then \`verified\` after the user verifies it with \`.verify()\`", - }, - "name": "status", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - ], - "type": "union", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "identities", - "type": { - "elemType": { - "name": "UserIdentity", - "properties": [ - { - "isOptional": true, - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "identity_data", - "type": { - "keyType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "index signature", - "valueType": { - "name": "any", - "type": "intrinsic", - }, - }, - }, - { - "name": "identity_id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_sign_in_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "provider", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "user_id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "isOptional": true, - "name": "invited_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "is_anonymous", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "is_sso_user", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_sign_in_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "new_email", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "new_phone", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "phone", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "phone_confirmed_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "recovery_sent_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "role", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "user_metadata", - "type": { - "name": "UserMetadata", - "properties": [], - "type": "object", - }, - }, - ], - "type": "object", - }, - }, - ], - "type": "object", - }, - }, - { - "name": "error", - "type": { - "type": "literal", - "value": null, - }, - }, - ], - "type": "object", - }, - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "properties": [ - { - "name": "session", - "type": { - "type": "literal", - "value": null, - }, - }, - { - "name": "user", - "type": { - "type": "literal", - "value": null, - }, - }, - ], - "type": "object", - }, - }, - { - "name": "error", - "type": { - "name": "AuthError", - "type": "nameOnly", - }, - }, - ], - "type": "object", - }, - ], - "type": "union", - }, - "name": "Promise", - "type": "promise", - }, - }, - }, - "@supabase/auth-js.GoTrueClient.getClaims": { - "comment": { - "examples": [ - { - "code": "\`\`\`js -const { data, error } = await supabase.auth.getClaims() -\`\`\`", - "data": undefined, - "description": undefined, - "id": "get-jwt-claims-header-and-signature", - "name": "Get JWT claims, header and signature", - "response": "\`\`\`json -{ - "data": { - "claims": { - "aal": "aal1", - "amr": [{ - "method": "email", - "timestamp": 1715766000 - }], - "app_metadata": {}, - "aud": "authenticated", - "email": "example@email.com", - "exp": 1715769600, - "iat": 1715766000, - "is_anonymous": false, - "iss": "https://project-id.supabase.co/auth/v1", - "phone": "+13334445555", - "role": "authenticated", - "session_id": "11111111-1111-1111-1111-111111111111", - "sub": "11111111-1111-1111-1111-111111111111", - "user_metadata": {} - }, - "header": { - "alg": "RS256", - "typ": "JWT", - "kid": "11111111-1111-1111-1111-111111111111" - }, - "signature": [/** Uint8Array */], - }, - "error": null -} -\`\`\`", - }, - ], - "shortText": "Extracts the JWT claims present in the access token by first verifying the -JWT against the server's JSON Web Key Set endpoint -\`/.well-known/jwks.json\` which is often cached, resulting in significantly -faster responses. Prefer this method over #getUser which always -sends a request to the Auth server for each JWT. - -If the project is not using an asymmetric JWT signing key (like ECC or -RSA) it always sends a request to the Auth server (similar to #getUser) to verify the JWT.", - "text": "- Parses the user's [access token](/docs/guides/auth/sessions#access-token-jwt-claims) as a [JSON Web Token (JWT)](/docs/guides/auth/jwts) and returns its components if valid and not expired. -- If your project is using asymmetric JWT signing keys, then the verification is done locally usually without a network request using the [WebCrypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API). -- A network request is sent to your project's JWT signing key discovery endpoint \`https://project-id.supabase.co/auth/v1/.well-known/jwks.json\`, which is cached locally. If your environment is ephemeral, such as a Lambda function that is destroyed after every request, a network request will be sent for each new invocation. Supabase provides a network-edge cache providing fast responses for these situations. -- If the user's access token is about to expire when calling this function, the user's session will first be refreshed before validating the JWT. -- If your project is using a symmetric secret to sign the JWT, it always sends a request similar to \`getUser()\` to validate the JWT at the server before returning the decoded token. This is also used if the WebCrypto API is not available in the environment. Make sure you polyfill it in such situations. -- The returned claims can be customized per project using the [Custom Access Token Hook](/docs/guides/auth/auth-hooks/custom-access-token-hook).", - }, - "name": "@supabase/auth-js.GoTrueClient.getClaims", - "params": [ - { - "comment": { - "shortText": "An optional specific JWT you wish to verify, not the one you - can obtain from #getSession.", - }, - "isOptional": true, - "name": "jwt", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Various additional options that allow you to customize the - behavior of this method.", - }, - "name": "options", - "type": { - "name": Symbol(anonymous), - "properties": [ - { - "comment": { - "shortText": "If set to \`true\` the \`exp\` claim will not be validated against the current time.", - }, - "isOptional": true, - "name": "allowExpired", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "If set, this JSON Web Key Set is going to have precedence over the cached value available on the server.", - }, - "isOptional": true, - "name": "jwks", - "type": { - "name": Symbol(anonymous), - "properties": [ - { - "name": "keys", - "type": { - "elemType": { - "name": "JWK", - "properties": [ - { - "isOptional": true, - "name": "alg", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "key_ops", - "type": { - "elemType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "isOptional": true, - "name": "kid", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "kty", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - undefined, - { - "type": "literal", - "value": "RSA", - }, - { - "type": "literal", - "value": "EC", - }, - { - "type": "literal", - "value": "oct", - }, - ], - "type": "union", - }, - }, - ], - "type": "object", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - ], - "type": "object", - }, - }, - { - "comment": { - "shortText": "", - }, - "isOptional": true, - "name": "keys", - "type": { - "elemType": { - "name": "JWK", - "properties": [ - { - "isOptional": true, - "name": "alg", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "key_ops", - "type": { - "elemType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "isOptional": true, - "name": "kid", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "kty", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - undefined, - { - "type": "literal", - "value": "RSA", - }, - { - "type": "literal", - "value": "EC", - }, - { - "type": "literal", - "value": "oct", - }, - ], - "type": "union", - }, - }, - ], - "type": "object", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - ], - "type": "object", - }, - }, - ], - "ret": { - "type": { - "awaited": { - "name": Symbol(anonymous), - "subTypes": [ - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "name": Symbol(anonymous), - "properties": [ - { - "name": "claims", - "type": { - "name": "JwtPayload", - "properties": [ - { - "name": "aal", - "type": { - "name": "AuthenticatorAssuranceLevels", - "subTypes": [ - { - "type": "literal", - "value": "aal1", - }, - { - "type": "literal", - "value": "aal2", - }, - undefined, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "Authentication Method References. -Supports both RFC-8176 compliant format (string[]) and detailed format (AMREntry[]). -- String format: ['password', 'otp'] - RFC-8176 compliant -- Object format: [{ method: 'password', timestamp: 1234567890 }] - includes timestamps", - }, - "isOptional": true, - "name": "amr", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "elemType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "array", - }, - { - "elemType": { - "name": "AMREntry", - "properties": [ - { - "comment": { - "shortText": "Authentication method name.", - }, - "name": "method", - "type": { - "name": "AMRMethod", - "subTypes": [ - { - "name": "['number']", - "type": "nameOnly", - }, - undefined, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "Timestamp when the method was successfully used. Represents number of -seconds since 1st January 1970 (UNIX epoch) in UTC.", - }, - "name": "timestamp", - "type": { - "name": "number", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - "name": Symbol(anonymous), - "type": "array", - }, - ], - "type": "union", - }, - }, - { - "isOptional": true, - "name": "app_metadata", - "type": { - "name": "UserAppMetadata", - "properties": [ - { - "comment": { - "shortText": "The first provider that the user used to sign up with.", - }, - "isOptional": true, - "name": "provider", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "A list of all providers that the user has linked to their account.", - }, - "isOptional": true, - "name": "providers", - "type": { - "elemType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - ], - "type": "object", - }, - }, - { - "name": "aud", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "name": "string", - "type": "intrinsic", - }, - { - "elemType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "array", - }, - ], - "type": "union", - }, - }, - { - "isOptional": true, - "name": "email", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "exp", - "type": { - "name": "number", - "type": "intrinsic", - }, - }, - { - "name": "iat", - "type": { - "name": "number", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "is_anonymous", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "name": "iss", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "jti", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "nbf", - "type": { - "name": "number", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "phone", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "ref", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "role", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "session_id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "sub", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "user_metadata", - "type": { - "name": "UserMetadata", - "properties": [], - "type": "object", - }, - }, - ], - "type": "object", - }, - }, - { - "name": "header", - "type": { - "name": "JwtHeader", - "properties": [ - { - "name": "alg", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "RS256", - }, - { - "type": "literal", - "value": "ES256", - }, - { - "type": "literal", - "value": "HS256", - }, - undefined, - ], - "type": "union", - }, - }, - { - "name": "kid", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "typ", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - }, - { - "name": "signature", - "type": { - "name": "Uint8Array", - "type": "nameOnly", - }, - }, - ], - "type": "object", - }, - }, - { - "name": "error", - "type": { - "type": "literal", - "value": null, - }, - }, - ], - "type": "object", - }, - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "type": "literal", - "value": null, - }, - }, - { - "name": "error", - "type": { - "name": "AuthError", - "type": "nameOnly", - }, - }, - ], - "type": "object", - }, - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "type": "literal", - "value": null, - }, - }, - { - "name": "error", - "type": { - "type": "literal", - "value": null, - }, - }, - ], - "type": "object", - }, - ], - "type": "union", - }, - "name": "Promise", - "type": "promise", - }, - }, - }, - "@supabase/auth-js.GoTrueClient.getSession": { - "comment": { - "examples": [ - { - "code": "\`\`\`js -const { data, error } = await supabase.auth.getSession() -\`\`\`", - "data": undefined, - "description": undefined, - "id": "get-the-session-data", - "name": "Get the session data", - "response": "\`\`\`json -{ - "data": { - "session": { - "access_token": "", - "token_type": "bearer", - "expires_in": 3600, - "expires_at": 1700000000, - "refresh_token": "", - "user": { - "id": "11111111-1111-1111-1111-111111111111", - "aud": "authenticated", - "role": "authenticated", - "email": "example@email.com", - "email_confirmed_at": "2024-01-01T00:00:00Z", - "phone": "", - "last_sign_in_at": "2024-01-01T00:00:00Z", - "app_metadata": { - "provider": "email", - "providers": [ - "email" - ] - }, - "user_metadata": { - "email": "example@email.com", - "email_verified": false, - "phone_verified": false, - "sub": "11111111-1111-1111-1111-111111111111" - }, - "identities": [ - { - "identity_id": "22222222-2222-2222-2222-222222222222", - "id": "11111111-1111-1111-1111-111111111111", - "user_id": "11111111-1111-1111-1111-111111111111", - "identity_data": { - "email": "example@email.com", - "email_verified": false, - "phone_verified": false, - "sub": "11111111-1111-1111-1111-111111111111" - }, - "provider": "email", - "last_sign_in_at": "2024-01-01T00:00:00Z", - "created_at": "2024-01-01T00:00:00Z", - "updated_at": "2024-01-01T00:00:00Z", - "email": "example@email.com" - } - ], - "created_at": "2024-01-01T00:00:00Z", - "updated_at": "2024-01-01T00:00:00Z", - "is_anonymous": false - } - } - }, - "error": null -} -\`\`\`", - }, - ], - "shortText": "Returns the session, refreshing it if necessary. - -The session returned can be null if the session is not detected which can happen in the event a user is not signed-in or has logged out. - -**IMPORTANT:** This method loads values directly from the storage attached -to the client. If that storage is based on request cookies for example, -the values in it may not be authentic and therefore it's strongly advised -against using this method and its results in such circumstances. A warning -will be emitted if this is detected. Use #getUser() instead.", - "text": "- Since the introduction of [asymmetric JWT signing keys](/docs/guides/auth/signing-keys), this method is considered low-level and we encourage you to use \`getClaims()\` or \`getUser()\` instead. -- Retrieves the current [user session](/docs/guides/auth/sessions) from the storage medium (local storage, cookies). -- The session contains an access token (signed JWT), a refresh token and the user object. -- If the session's access token is expired or is about to expire, this method will use the refresh token to refresh the session. -- When using in a browser, or you've called \`startAutoRefresh()\` in your environment (React Native, etc.) this function always returns a valid access token without refreshing the session itself, as this is done in the background. This function returns very fast. -- **IMPORTANT SECURITY NOTICE:** If using an insecure storage medium, such as cookies or request headers, the user object returned by this function **must not be trusted**. Always verify the JWT using \`getClaims()\` or your own JWT verification library to securely establish the user's identity and access. You can also use \`getUser()\` to fetch the user object directly from the Auth server for this purpose. -- Cross-tab refresh races are handled by the GoTrue server (the rotated token from the first tab is returned to subsequent tabs via the parent-of-active mechanism), so no client-side serialization is needed.", - }, - "name": "@supabase/auth-js.GoTrueClient.getSession", - "params": [], - "ret": { - "type": { - "awaited": { - "name": Symbol(anonymous), - "subTypes": [ - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "name": Symbol(anonymous), - "properties": [ - { - "name": "session", - "type": { - "name": "Session", - "properties": [ - { - "comment": { - "shortText": "The access token jwt. It is recommended to set the JWT_EXPIRY to a shorter expiry value.", - }, - "name": "access_token", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "A timestamp of when the token will expire. Returned when a login is confirmed.", - }, - "isOptional": true, - "name": "expires_at", - "type": { - "name": "number", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The number of seconds until the token expires (since it was issued). Returned when a login is confirmed.", - }, - "name": "expires_in", - "type": { - "name": "number", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The oauth provider refresh token. If present, this can be used to refresh the provider_token via the oauth provider's API. -Not all oauth providers return a provider refresh token. If the provider_refresh_token is missing, please refer to the oauth provider's documentation for information on how to obtain the provider refresh token.", - }, - "isOptional": true, - "name": "provider_refresh_token", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": null, - }, - { - "name": "string", - "type": "intrinsic", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "The oauth provider token. If present, this can be used to make external API requests to the oauth provider used.", - }, - "isOptional": true, - "name": "provider_token", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": null, - }, - { - "name": "string", - "type": "intrinsic", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "A one-time used refresh token that never expires.", - }, - "name": "refresh_token", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "token_type", - "type": { - "type": "literal", - "value": "bearer", - }, - }, - { - "comment": { - "shortText": "When using a separate user storage, accessing properties of this object will throw an error.", - }, - "name": "user", - "type": { - "name": "User", - "properties": [ - { - "isOptional": true, - "name": "action_link", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "app_metadata", - "type": { - "name": "UserAppMetadata", - "properties": [ - { - "comment": { - "shortText": "The first provider that the user used to sign up with.", - }, - "isOptional": true, - "name": "provider", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "A list of all providers that the user has linked to their account.", - }, - "isOptional": true, - "name": "providers", - "type": { - "elemType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - ], - "type": "object", - }, - }, - { - "name": "aud", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "banned_until", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "confirmation_sent_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "confirmed_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "deleted_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "email", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "email_change_sent_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "email_confirmed_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "factors", - "type": { - "elemType": { - "name": Symbol(anonymous), - "subTypes": [ - { - "name": "Factor", - "properties": [ - { - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Type of factor. \`totp\` and \`phone\` supported with this version", - }, - "name": "factor_type", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors.", - }, - "isOptional": true, - "name": "friendly_name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "ID of the factor.", - }, - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_challenged_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The verification status of the factor, default is \`unverified\` after \`.enroll()\`, then \`verified\` after the user verifies it with \`.verify()\`", - }, - "name": "status", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - { - "name": "Factor", - "properties": [ - { - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Type of factor. \`totp\` and \`phone\` supported with this version", - }, - "name": "factor_type", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors.", - }, - "isOptional": true, - "name": "friendly_name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "ID of the factor.", - }, - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_challenged_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The verification status of the factor, default is \`unverified\` after \`.enroll()\`, then \`verified\` after the user verifies it with \`.verify()\`", - }, - "name": "status", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - ], - "type": "union", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "identities", - "type": { - "elemType": { - "name": "UserIdentity", - "properties": [ - { - "isOptional": true, - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "identity_data", - "type": { - "keyType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "index signature", - "valueType": { - "name": "any", - "type": "intrinsic", - }, - }, - }, - { - "name": "identity_id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_sign_in_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "provider", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "user_id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "isOptional": true, - "name": "invited_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "is_anonymous", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "is_sso_user", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_sign_in_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "new_email", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "new_phone", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "phone", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "phone_confirmed_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "recovery_sent_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "role", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "user_metadata", - "type": { - "name": "UserMetadata", - "properties": [], - "type": "object", - }, - }, - ], - "type": "object", - }, - }, - ], - "type": "object", - }, - }, - ], - "type": "object", - }, - }, - { - "name": "error", - "type": { - "type": "literal", - "value": null, - }, - }, - ], - "type": "object", - }, - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "name": Symbol(anonymous), - "properties": [ - { - "name": "session", - "type": { - "type": "literal", - "value": null, - }, - }, - ], - "type": "object", - }, - }, - { - "name": "error", - "type": { - "name": "AuthError", - "type": "nameOnly", - }, - }, - ], - "type": "object", - }, - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "name": Symbol(anonymous), - "properties": [ - { - "name": "session", - "type": { - "type": "literal", - "value": null, - }, - }, - ], - "type": "object", - }, - }, - { - "name": "error", - "type": { - "type": "literal", - "value": null, - }, - }, - ], - "type": "object", - }, - ], - "type": "union", - }, - "name": "Promise", - "type": "promise", - }, - }, - }, - "@supabase/auth-js.GoTrueClient.getUser": { - "comment": { - "examples": [ - { - "code": "\`\`\`js -const { data: { user } } = await supabase.auth.getUser() -\`\`\`", - "data": undefined, - "description": undefined, - "id": "get-the-logged-in-user-with-the-current-existing-session", - "name": "Get the logged in user with the current existing session", - "response": "\`\`\`json -{ - "data": { - "user": { - "id": "11111111-1111-1111-1111-111111111111", - "aud": "authenticated", - "role": "authenticated", - "email": "example@email.com", - "email_confirmed_at": "2024-01-01T00:00:00Z", - "phone": "", - "confirmed_at": "2024-01-01T00:00:00Z", - "last_sign_in_at": "2024-01-01T00:00:00Z", - "app_metadata": { - "provider": "email", - "providers": [ - "email" - ] - }, - "user_metadata": { - "email": "example@email.com", - "email_verified": false, - "phone_verified": false, - "sub": "11111111-1111-1111-1111-111111111111" - }, - "identities": [ - { - "identity_id": "22222222-2222-2222-2222-222222222222", - "id": "11111111-1111-1111-1111-111111111111", - "user_id": "11111111-1111-1111-1111-111111111111", - "identity_data": { - "email": "example@email.com", - "email_verified": false, - "phone_verified": false, - "sub": "11111111-1111-1111-1111-111111111111" - }, - "provider": "email", - "last_sign_in_at": "2024-01-01T00:00:00Z", - "created_at": "2024-01-01T00:00:00Z", - "updated_at": "2024-01-01T00:00:00Z", - "email": "example@email.com" - } - ], - "created_at": "2024-01-01T00:00:00Z", - "updated_at": "2024-01-01T00:00:00Z", - "is_anonymous": false - } - }, - "error": null -} -\`\`\`", - }, - { - "code": "\`\`\`js -const { data: { user } } = await supabase.auth.getUser(jwt) -\`\`\`", - "data": undefined, - "description": undefined, - "id": "get-the-logged-in-user-with-a-custom-access-token-jwt", - "name": "Get the logged in user with a custom access token jwt", - "response": undefined, - }, - ], - "shortText": "Gets the current user details if there is an existing session. This method -performs a network request to the Supabase Auth server, so the returned -value is authentic and can be used to base authorization rules on.", - "text": "- This method fetches the user object from the database instead of local session. -- This method is useful for checking if the user is authorized because it validates the user's access token JWT on the server. -- Should always be used when checking for user authorization on the server. On the client, you can instead use \`getSession().session.user\` for faster results. \`getSession\` is insecure on the server.", - }, - "name": "@supabase/auth-js.GoTrueClient.getUser", - "params": [ - { - "comment": { - "shortText": "Takes in an optional access token JWT. If no JWT is provided, the JWT from the current session is used.", - }, - "isOptional": true, - "name": "jwt", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "ret": { - "type": { - "awaited": { - "name": "UserResponse", - "subTypes": [ - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "name": Symbol(anonymous), - "properties": [ - { - "name": "user", - "type": { - "name": "User", - "properties": [ - { - "isOptional": true, - "name": "action_link", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "app_metadata", - "type": { - "name": "UserAppMetadata", - "properties": [ - { - "comment": { - "shortText": "The first provider that the user used to sign up with.", - }, - "isOptional": true, - "name": "provider", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "A list of all providers that the user has linked to their account.", - }, - "isOptional": true, - "name": "providers", - "type": { - "elemType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - ], - "type": "object", - }, - }, - { - "name": "aud", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "banned_until", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "confirmation_sent_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "confirmed_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "deleted_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "email", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "email_change_sent_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "email_confirmed_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "factors", - "type": { - "elemType": { - "name": Symbol(anonymous), - "subTypes": [ - { - "name": "Factor", - "properties": [ - { - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Type of factor. \`totp\` and \`phone\` supported with this version", - }, - "name": "factor_type", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors.", - }, - "isOptional": true, - "name": "friendly_name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "ID of the factor.", - }, - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_challenged_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The verification status of the factor, default is \`unverified\` after \`.enroll()\`, then \`verified\` after the user verifies it with \`.verify()\`", - }, - "name": "status", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - { - "name": "Factor", - "properties": [ - { - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Type of factor. \`totp\` and \`phone\` supported with this version", - }, - "name": "factor_type", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors.", - }, - "isOptional": true, - "name": "friendly_name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "ID of the factor.", - }, - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_challenged_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The verification status of the factor, default is \`unverified\` after \`.enroll()\`, then \`verified\` after the user verifies it with \`.verify()\`", - }, - "name": "status", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - ], - "type": "union", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "identities", - "type": { - "elemType": { - "name": "UserIdentity", - "properties": [ - { - "isOptional": true, - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "identity_data", - "type": { - "keyType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "index signature", - "valueType": { - "name": "any", - "type": "intrinsic", - }, - }, - }, - { - "name": "identity_id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_sign_in_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "provider", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "user_id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "isOptional": true, - "name": "invited_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "is_anonymous", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "is_sso_user", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_sign_in_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "new_email", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "new_phone", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "phone", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "phone_confirmed_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "recovery_sent_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "role", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "user_metadata", - "type": { - "name": "UserMetadata", - "properties": [], - "type": "object", - }, - }, - ], - "type": "object", - }, - }, - ], - "type": "object", - }, - }, - { - "name": "error", - "type": { - "type": "literal", - "value": null, - }, - }, - ], - "type": "object", - }, - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "properties": [ - { - "name": "user", - "type": { - "type": "literal", - "value": null, - }, - }, - ], - "type": "object", - }, - }, - { - "name": "error", - "type": { - "name": "AuthError", - "type": "nameOnly", - }, - }, - ], - "type": "object", - }, - ], - "type": "union", - }, - "name": "Promise", - "type": "promise", - }, - }, - }, - "@supabase/auth-js.GoTrueClient.getUserIdentities": { - "comment": { - "examples": [ - { - "code": "\`\`\`js -const { data, error } = await supabase.auth.getUserIdentities() -\`\`\`", - "data": undefined, - "description": undefined, - "id": "returns-a-list-of-identities-linked-to-the-user", - "name": "Returns a list of identities linked to the user", - "response": "\`\`\`json -{ - "data": { - "identities": [ - { - "identity_id": "22222222-2222-2222-2222-222222222222", - "id": "2024-01-01T00:00:00Z", - "user_id": "2024-01-01T00:00:00Z", - "identity_data": { - "email": "example@email.com", - "email_verified": false, - "phone_verified": false, - "sub": "11111111-1111-1111-1111-111111111111" - }, - "provider": "email", - "last_sign_in_at": "2024-01-01T00:00:00Z", - "created_at": "2024-01-01T00:00:00Z", - "updated_at": "2024-01-01T00:00:00Z", - "email": "example@email.com" - } - ] - }, - "error": null -} -\`\`\`", - }, - ], - "shortText": "Gets all the identities linked to a user.", - "text": "- The user needs to be signed in to call \`getUserIdentities()\`.", - }, - "name": "@supabase/auth-js.GoTrueClient.getUserIdentities", - "params": [], - "ret": { - "type": { - "awaited": { - "name": Symbol(anonymous), - "subTypes": [ - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "name": Symbol(anonymous), - "properties": [ - { - "name": "identities", - "type": { - "elemType": { - "name": "UserIdentity", - "properties": [ - { - "isOptional": true, - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "identity_data", - "type": { - "keyType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "index signature", - "valueType": { - "name": "any", - "type": "intrinsic", - }, - }, - }, - { - "name": "identity_id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_sign_in_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "provider", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "user_id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - ], - "type": "object", - }, - }, - { - "name": "error", - "type": { - "type": "literal", - "value": null, - }, - }, - ], - "type": "object", - }, - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "type": "literal", - "value": null, - }, - }, - { - "name": "error", - "type": { - "name": "AuthError", - "type": "nameOnly", - }, - }, - ], - "type": "object", - }, - ], - "type": "union", - }, - "name": "Promise", - "type": "promise", - }, - }, - }, - "@supabase/auth-js.GoTrueClient.initialize": { - "comment": { - "shortText": "Initializes the client session either from the url or from storage. -This method is automatically called when instantiating the client, but should also be called -manually when checking for an error from an auth redirect (oauth, magiclink, password recovery, etc).", - }, - "name": "@supabase/auth-js.GoTrueClient.initialize", - "params": [], - "ret": { - "type": { - "awaited": { - "name": "InitializeResult", - "properties": [ - { - "name": "error", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "name": "AuthError", - "type": "nameOnly", - }, - { - "type": "literal", - "value": null, - }, - ], - "type": "union", - }, - }, - ], - "type": "object", - }, - "name": "Promise", - "type": "promise", - }, - }, - }, - "@supabase/auth-js.GoTrueClient.isThrowOnErrorEnabled": { - "comment": { - "shortText": "Returns whether error throwing mode is enabled for this client.", - }, - "name": "@supabase/auth-js.GoTrueClient.isThrowOnErrorEnabled", - "params": [], - "ret": { - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - }, - "@supabase/auth-js.GoTrueClient.linkIdentity": { - "altSignatures": [ - { - "params": [ - { - "name": "credentials", - "type": { - "name": "SignInWithIdTokenCredentials", - "properties": [ - { - "comment": { - "shortText": "If the ID token contains an \`at_hash\` claim, then the hash of this value is compared to the value in the ID token.", - }, - "isOptional": true, - "name": "access_token", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "If the ID token contains a \`nonce\` claim, then the hash of this value is compared to the value in the ID token.", - }, - "isOptional": true, - "name": "nonce", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "options", - "type": { - "name": Symbol(anonymous), - "properties": [ - { - "comment": { - "shortText": "Verification token received when the user completes the captcha on the site.", - }, - "isOptional": true, - "name": "captchaToken", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - }, - { - "comment": { - "shortText": "Provider name or OIDC \`iss\` value identifying which provider should be used to verify the provided token. Supported names: \`google\`, \`apple\`, \`azure\`, \`facebook\`, \`kakao\`. Use the \`custom:\` prefix for custom OIDC providers (e.g. \`custom:my-oidc-provider\`).", - }, - "name": "provider", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "google", - }, - { - "type": "literal", - "value": "apple", - }, - { - "type": "literal", - "value": "azure", - }, - { - "type": "literal", - "value": "facebook", - }, - { - "type": "literal", - "value": "kakao", - }, - undefined, - undefined, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "OIDC ID token issued by the specified provider. The \`iss\` claim in the ID token must match the supplied provider. Some ID tokens contain an \`at_hash\` which require that you provide an \`access_token\` value to be accepted properly. If the token contains a \`nonce\` claim you must supply the nonce used to obtain the ID token.", - }, - "name": "token", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - }, - ], - "ret": { - "type": { - "awaited": { - "name": "AuthTokenResponse", - "subTypes": [ - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "name": Symbol(anonymous), - "properties": [ - { - "name": "session", - "type": { - "name": "Session", - "properties": [ - { - "comment": { - "shortText": "The access token jwt. It is recommended to set the JWT_EXPIRY to a shorter expiry value.", - }, - "name": "access_token", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "A timestamp of when the token will expire. Returned when a login is confirmed.", - }, - "isOptional": true, - "name": "expires_at", - "type": { - "name": "number", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The number of seconds until the token expires (since it was issued). Returned when a login is confirmed.", - }, - "name": "expires_in", - "type": { - "name": "number", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The oauth provider refresh token. If present, this can be used to refresh the provider_token via the oauth provider's API. -Not all oauth providers return a provider refresh token. If the provider_refresh_token is missing, please refer to the oauth provider's documentation for information on how to obtain the provider refresh token.", - }, - "isOptional": true, - "name": "provider_refresh_token", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": null, - }, - { - "name": "string", - "type": "intrinsic", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "The oauth provider token. If present, this can be used to make external API requests to the oauth provider used.", - }, - "isOptional": true, - "name": "provider_token", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": null, - }, - { - "name": "string", - "type": "intrinsic", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "A one-time used refresh token that never expires.", - }, - "name": "refresh_token", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "token_type", - "type": { - "type": "literal", - "value": "bearer", - }, - }, - { - "comment": { - "shortText": "When using a separate user storage, accessing properties of this object will throw an error.", - }, - "name": "user", - "type": { - "name": "User", - "properties": [ - { - "isOptional": true, - "name": "action_link", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "app_metadata", - "type": { - "name": "UserAppMetadata", - "properties": [ - { - "comment": { - "shortText": "The first provider that the user used to sign up with.", - }, - "isOptional": true, - "name": "provider", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "A list of all providers that the user has linked to their account.", - }, - "isOptional": true, - "name": "providers", - "type": { - "elemType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - ], - "type": "object", - }, - }, - { - "name": "aud", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "banned_until", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "confirmation_sent_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "confirmed_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "deleted_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "email", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "email_change_sent_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "email_confirmed_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "factors", - "type": { - "elemType": { - "name": Symbol(anonymous), - "subTypes": [ - { - "name": "Factor", - "properties": [ - { - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Type of factor. \`totp\` and \`phone\` supported with this version", - }, - "name": "factor_type", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors.", - }, - "isOptional": true, - "name": "friendly_name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "ID of the factor.", - }, - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_challenged_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The verification status of the factor, default is \`unverified\` after \`.enroll()\`, then \`verified\` after the user verifies it with \`.verify()\`", - }, - "name": "status", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - { - "name": "Factor", - "properties": [ - { - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Type of factor. \`totp\` and \`phone\` supported with this version", - }, - "name": "factor_type", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors.", - }, - "isOptional": true, - "name": "friendly_name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "ID of the factor.", - }, - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_challenged_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The verification status of the factor, default is \`unverified\` after \`.enroll()\`, then \`verified\` after the user verifies it with \`.verify()\`", - }, - "name": "status", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - ], - "type": "union", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "identities", - "type": { - "elemType": { - "name": "UserIdentity", - "properties": [ - { - "isOptional": true, - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "identity_data", - "type": { - "keyType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "index signature", - "valueType": { - "name": "any", - "type": "intrinsic", - }, - }, - }, - { - "name": "identity_id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_sign_in_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "provider", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "user_id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "isOptional": true, - "name": "invited_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "is_anonymous", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "is_sso_user", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_sign_in_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "new_email", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "new_phone", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "phone", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "phone_confirmed_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "recovery_sent_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "role", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "user_metadata", - "type": { - "name": "UserMetadata", - "properties": [], - "type": "object", - }, - }, - ], - "type": "object", - }, - }, - ], - "type": "object", - }, - }, - { - "name": "user", - "type": { - "name": "User", - "properties": [ - { - "isOptional": true, - "name": "action_link", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "app_metadata", - "type": { - "name": "UserAppMetadata", - "properties": [ - { - "comment": { - "shortText": "The first provider that the user used to sign up with.", - }, - "isOptional": true, - "name": "provider", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "A list of all providers that the user has linked to their account.", - }, - "isOptional": true, - "name": "providers", - "type": { - "elemType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - ], - "type": "object", - }, - }, - { - "name": "aud", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "banned_until", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "confirmation_sent_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "confirmed_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "deleted_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "email", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "email_change_sent_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "email_confirmed_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "factors", - "type": { - "elemType": { - "name": Symbol(anonymous), - "subTypes": [ - { - "name": "Factor", - "properties": [ - { - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Type of factor. \`totp\` and \`phone\` supported with this version", - }, - "name": "factor_type", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors.", - }, - "isOptional": true, - "name": "friendly_name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "ID of the factor.", - }, - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_challenged_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The verification status of the factor, default is \`unverified\` after \`.enroll()\`, then \`verified\` after the user verifies it with \`.verify()\`", - }, - "name": "status", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - { - "name": "Factor", - "properties": [ - { - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Type of factor. \`totp\` and \`phone\` supported with this version", - }, - "name": "factor_type", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors.", - }, - "isOptional": true, - "name": "friendly_name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "ID of the factor.", - }, - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_challenged_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The verification status of the factor, default is \`unverified\` after \`.enroll()\`, then \`verified\` after the user verifies it with \`.verify()\`", - }, - "name": "status", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - ], - "type": "union", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "identities", - "type": { - "elemType": { - "name": "UserIdentity", - "properties": [ - { - "isOptional": true, - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "identity_data", - "type": { - "keyType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "index signature", - "valueType": { - "name": "any", - "type": "intrinsic", - }, - }, - }, - { - "name": "identity_id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_sign_in_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "provider", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "user_id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "isOptional": true, - "name": "invited_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "is_anonymous", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "is_sso_user", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_sign_in_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "new_email", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "new_phone", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "phone", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "phone_confirmed_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "recovery_sent_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "role", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "user_metadata", - "type": { - "name": "UserMetadata", - "properties": [], - "type": "object", - }, - }, - ], - "type": "object", - }, - }, - ], - "type": "object", - }, - }, - { - "name": "error", - "type": { - "type": "literal", - "value": null, - }, - }, - ], - "type": "object", - }, - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "properties": [ - { - "name": "session", - "type": { - "type": "literal", - "value": null, - }, - }, - { - "name": "user", - "type": { - "type": "literal", - "value": null, - }, - }, - ], - "type": "object", - }, - }, - { - "name": "error", - "type": { - "name": "AuthError", - "type": "nameOnly", - }, - }, - ], - "type": "object", - }, - ], - "type": "union", - }, - "name": "Promise", - "type": "promise", - }, - }, - }, - ], - "comment": { - "examples": [ - { - "code": "\`\`\`js -const { data, error } = await supabase.auth.linkIdentity({ - provider: 'github' -}) -\`\`\`", - "data": undefined, - "description": undefined, - "id": "link-an-identity-to-a-user", - "name": "Link an identity to a user", - "response": "\`\`\`json -{ - data: { - provider: 'github', - url: - }, - error: null -} -\`\`\`", - }, - ], - "shortText": "Links an oauth identity to an existing user. -This method supports the PKCE flow.", - "text": "- The **Enable Manual Linking** option must be enabled from your [project's authentication settings](/dashboard/project/_/auth/providers). -- The user needs to be signed in to call \`linkIdentity()\`. -- If the candidate identity is already linked to the existing user or another user, \`linkIdentity()\` will fail. -- If \`linkIdentity\` is run in the browser, the user is automatically redirected to the returned URL. On the server, you should handle the redirect.", - }, - "name": "@supabase/auth-js.GoTrueClient.linkIdentity", - "params": [ - { - "name": "credentials", - "type": { - "name": "SignInWithOAuthCredentials", - "properties": [ - { - "isOptional": true, - "name": "options", - "type": { - "name": Symbol(anonymous), - "properties": [ - { - "comment": { - "shortText": "An object of query params", - }, - "isOptional": true, - "name": "queryParams", - "type": { - "keyType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "index signature", - "valueType": { - "name": "string", - "type": "intrinsic", - }, - }, - }, - { - "comment": { - "shortText": "A URL to send the user to after they are confirmed.", - }, - "isOptional": true, - "name": "redirectTo", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "A space-separated list of scopes granted to the OAuth application.", - }, - "isOptional": true, - "name": "scopes", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "If set to true does not immediately redirect the current browser context to visit the OAuth authorization page for the provider.", - }, - "isOptional": true, - "name": "skipBrowserRedirect", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - }, - { - "comment": { - "shortText": "One of the providers supported by GoTrue.", - }, - "name": "provider", - "type": { - "name": "Provider", - "subTypes": [ - { - "type": "literal", - "value": "apple", - }, - { - "type": "literal", - "value": "azure", - }, - { - "type": "literal", - "value": "bitbucket", - }, - { - "type": "literal", - "value": "discord", - }, - { - "type": "literal", - "value": "facebook", - }, - { - "type": "literal", - "value": "figma", - }, - { - "type": "literal", - "value": "github", - }, - { - "type": "literal", - "value": "gitlab", - }, - { - "type": "literal", - "value": "google", - }, - { - "type": "literal", - "value": "kakao", - }, - { - "type": "literal", - "value": "keycloak", - }, - { - "type": "literal", - "value": "linkedin", - }, - { - "type": "literal", - "value": "linkedin_oidc", - }, - { - "type": "literal", - "value": "notion", - }, - { - "type": "literal", - "value": "slack", - }, - { - "type": "literal", - "value": "slack_oidc", - }, - { - "type": "literal", - "value": "spotify", - }, - { - "type": "literal", - "value": "twitch", - }, - { - "type": "literal", - "value": "twitter", - }, - { - "type": "literal", - "value": "x", - }, - { - "type": "literal", - "value": "workos", - }, - { - "type": "literal", - "value": "zoom", - }, - { - "type": "literal", - "value": "fly", - }, - undefined, - ], - "type": "union", - }, - }, - ], - "type": "object", - }, - }, - ], - "ret": { - "type": { - "awaited": { - "name": "OAuthResponse", - "subTypes": [ - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "name": Symbol(anonymous), - "properties": [ - { - "name": "provider", - "type": { - "name": "Provider", - "subTypes": [ - { - "type": "literal", - "value": "apple", - }, - { - "type": "literal", - "value": "azure", - }, - { - "type": "literal", - "value": "bitbucket", - }, - { - "type": "literal", - "value": "discord", - }, - { - "type": "literal", - "value": "facebook", - }, - { - "type": "literal", - "value": "figma", - }, - { - "type": "literal", - "value": "github", - }, - { - "type": "literal", - "value": "gitlab", - }, - { - "type": "literal", - "value": "google", - }, - { - "type": "literal", - "value": "kakao", - }, - { - "type": "literal", - "value": "keycloak", - }, - { - "type": "literal", - "value": "linkedin", - }, - { - "type": "literal", - "value": "linkedin_oidc", - }, - { - "type": "literal", - "value": "notion", - }, - { - "type": "literal", - "value": "slack", - }, - { - "type": "literal", - "value": "slack_oidc", - }, - { - "type": "literal", - "value": "spotify", - }, - { - "type": "literal", - "value": "twitch", - }, - { - "type": "literal", - "value": "twitter", - }, - { - "type": "literal", - "value": "x", - }, - { - "type": "literal", - "value": "workos", - }, - { - "type": "literal", - "value": "zoom", - }, - { - "type": "literal", - "value": "fly", - }, - undefined, - ], - "type": "union", - }, - }, - { - "name": "url", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - }, - { - "name": "error", - "type": { - "type": "literal", - "value": null, - }, - }, - ], - "type": "object", - }, - { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "name": Symbol(anonymous), - "properties": [ - { - "name": "provider", - "type": { - "name": "Provider", - "subTypes": [ - { - "type": "literal", - "value": "apple", - }, - { - "type": "literal", - "value": "azure", - }, - { - "type": "literal", - "value": "bitbucket", - }, - { - "type": "literal", - "value": "discord", - }, - { - "type": "literal", - "value": "facebook", - }, - { - "type": "literal", - "value": "figma", - }, - { - "type": "literal", - "value": "github", - }, - { - "type": "literal", - "value": "gitlab", - }, - { - "type": "literal", - "value": "google", - }, - { - "type": "literal", - "value": "kakao", - }, - { - "type": "literal", - "value": "keycloak", - }, - { - "type": "literal", - "value": "linkedin", - }, - { - "type": "literal", - "value": "linkedin_oidc", - }, - { - "type": "literal", - "value": "notion", - }, - { - "type": "literal", - "value": "slack", - }, - { - "type": "literal", - "value": "slack_oidc", - }, - { - "type": "literal", - "value": "spotify", - }, - { - "type": "literal", - "value": "twitch", - }, - { - "type": "literal", - "value": "twitter", - }, - { - "type": "literal", - "value": "x", - }, - { - "type": "literal", - "value": "workos", - }, - { - "type": "literal", - "value": "zoom", - }, - { - "type": "literal", - "value": "fly", - }, - undefined, - ], - "type": "union", - }, - }, - { - "name": "url", - "type": { - "type": "literal", - "value": null, - }, - }, - ], - "type": "object", - }, - }, - { - "name": "error", - "type": { - "name": "AuthError", - "type": "nameOnly", - }, - }, - ], - "type": "object", - }, - ], - "type": "union", - }, - "name": "Promise", - "type": "promise", - }, - }, - }, - "@supabase/auth-js.GoTrueClient.onAuthStateChange": { - "altSignatures": [ - { - "params": [ - { - "comment": { - "shortText": "A callback function to be invoked when an auth event happens.", - }, - "name": "callback", - "type": { - "comment": undefined, - "name": Symbol(anonymous), - "params": [ - { - "name": "event", - "type": { - "name": "AuthChangeEvent", - "subTypes": [ - { - "type": "literal", - "value": "INITIAL_SESSION", - }, - { - "type": "literal", - "value": "PASSWORD_RECOVERY", - }, - { - "type": "literal", - "value": "SIGNED_IN", - }, - { - "type": "literal", - "value": "SIGNED_OUT", - }, - { - "type": "literal", - "value": "TOKEN_REFRESHED", - }, - { - "type": "literal", - "value": "USER_UPDATED", - }, - { - "name": "AuthChangeEventMFA", - "type": "literal", - "value": "MFA_CHALLENGE_VERIFIED", - }, - ], - "type": "union", - }, - }, - { - "name": "session", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": null, - }, - { - "name": "Session", - "properties": [ - { - "comment": { - "shortText": "The access token jwt. It is recommended to set the JWT_EXPIRY to a shorter expiry value.", - }, - "name": "access_token", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "A timestamp of when the token will expire. Returned when a login is confirmed.", - }, - "isOptional": true, - "name": "expires_at", - "type": { - "name": "number", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The number of seconds until the token expires (since it was issued). Returned when a login is confirmed.", - }, - "name": "expires_in", - "type": { - "name": "number", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The oauth provider refresh token. If present, this can be used to refresh the provider_token via the oauth provider's API. -Not all oauth providers return a provider refresh token. If the provider_refresh_token is missing, please refer to the oauth provider's documentation for information on how to obtain the provider refresh token.", - }, - "isOptional": true, - "name": "provider_refresh_token", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": null, - }, - { - "name": "string", - "type": "intrinsic", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "The oauth provider token. If present, this can be used to make external API requests to the oauth provider used.", - }, - "isOptional": true, - "name": "provider_token", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": null, - }, - { - "name": "string", - "type": "intrinsic", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "A one-time used refresh token that never expires.", - }, - "name": "refresh_token", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "token_type", - "type": { - "type": "literal", - "value": "bearer", - }, - }, - { - "comment": { - "shortText": "When using a separate user storage, accessing properties of this object will throw an error.", - }, - "name": "user", - "type": { - "name": "User", - "properties": [ - { - "isOptional": true, - "name": "action_link", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "app_metadata", - "type": { - "name": "UserAppMetadata", - "properties": [ - { - "comment": { - "shortText": "The first provider that the user used to sign up with.", - }, - "isOptional": true, - "name": "provider", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "A list of all providers that the user has linked to their account.", - }, - "isOptional": true, - "name": "providers", - "type": { - "elemType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - ], - "type": "object", - }, - }, - { - "name": "aud", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "banned_until", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "confirmation_sent_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "confirmed_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "deleted_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "email", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "email_change_sent_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "email_confirmed_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "factors", - "type": { - "elemType": { - "name": Symbol(anonymous), - "subTypes": [ - { - "name": "Factor", - "properties": [ - { - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Type of factor. \`totp\` and \`phone\` supported with this version", - }, - "name": "factor_type", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors.", - }, - "isOptional": true, - "name": "friendly_name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "ID of the factor.", - }, - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_challenged_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The verification status of the factor, default is \`unverified\` after \`.enroll()\`, then \`verified\` after the user verifies it with \`.verify()\`", - }, - "name": "status", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - { - "name": "Factor", - "properties": [ - { - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Type of factor. \`totp\` and \`phone\` supported with this version", - }, - "name": "factor_type", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors.", - }, - "isOptional": true, - "name": "friendly_name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "ID of the factor.", - }, - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_challenged_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The verification status of the factor, default is \`unverified\` after \`.enroll()\`, then \`verified\` after the user verifies it with \`.verify()\`", - }, - "name": "status", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - ], - "type": "union", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "identities", - "type": { - "elemType": { - "name": "UserIdentity", - "properties": [ - { - "isOptional": true, - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "identity_data", - "type": { - "keyType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "index signature", - "valueType": { - "name": "any", - "type": "intrinsic", - }, - }, - }, - { - "name": "identity_id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_sign_in_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "provider", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "user_id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "isOptional": true, - "name": "invited_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "is_anonymous", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "is_sso_user", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_sign_in_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "new_email", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "new_phone", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "phone", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "phone_confirmed_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "recovery_sent_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "role", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "user_metadata", - "type": { - "name": "UserMetadata", - "properties": [], - "type": "object", - }, - }, - ], - "type": "object", - }, - }, - ], - "type": "object", - }, - ], - "type": "union", - }, - }, - ], - "ret": { - "type": { - "awaited": { - "name": "void", - "type": "intrinsic", - }, - "name": "Promise", - "type": "promise", - }, - }, - "type": "function", - }, - }, - ], - "ret": { - "type": { - "name": Symbol(anonymous), - "properties": [ - { - "name": "data", - "type": { - "name": Symbol(anonymous), - "properties": [ - { - "name": "subscription", - "type": { - "name": "Subscription", - "properties": [ - { - "comment": { - "shortText": "The function to call every time there is an event. eg: (eventName) => {}", - }, - "name": "callback", - "type": { - "comment": undefined, - "name": Symbol(anonymous), - "params": [ - { - "name": "event", - "type": { - "name": "AuthChangeEvent", - "subTypes": [ - { - "type": "literal", - "value": "INITIAL_SESSION", - }, - { - "type": "literal", - "value": "PASSWORD_RECOVERY", - }, - { - "type": "literal", - "value": "SIGNED_IN", - }, - { - "type": "literal", - "value": "SIGNED_OUT", - }, - { - "type": "literal", - "value": "TOKEN_REFRESHED", - }, - { - "type": "literal", - "value": "USER_UPDATED", - }, - { - "name": "AuthChangeEventMFA", - "type": "literal", - "value": "MFA_CHALLENGE_VERIFIED", - }, - ], - "type": "union", - }, - }, - { - "name": "session", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": null, - }, - { - "name": "Session", - "properties": [ - { - "comment": { - "shortText": "The access token jwt. It is recommended to set the JWT_EXPIRY to a shorter expiry value.", - }, - "name": "access_token", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "A timestamp of when the token will expire. Returned when a login is confirmed.", - }, - "isOptional": true, - "name": "expires_at", - "type": { - "name": "number", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The number of seconds until the token expires (since it was issued). Returned when a login is confirmed.", - }, - "name": "expires_in", - "type": { - "name": "number", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The oauth provider refresh token. If present, this can be used to refresh the provider_token via the oauth provider's API. -Not all oauth providers return a provider refresh token. If the provider_refresh_token is missing, please refer to the oauth provider's documentation for information on how to obtain the provider refresh token.", - }, - "isOptional": true, - "name": "provider_refresh_token", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": null, - }, - { - "name": "string", - "type": "intrinsic", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "The oauth provider token. If present, this can be used to make external API requests to the oauth provider used.", - }, - "isOptional": true, - "name": "provider_token", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": null, - }, - { - "name": "string", - "type": "intrinsic", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "A one-time used refresh token that never expires.", - }, - "name": "refresh_token", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "token_type", - "type": { - "type": "literal", - "value": "bearer", - }, - }, - { - "comment": { - "shortText": "When using a separate user storage, accessing properties of this object will throw an error.", - }, - "name": "user", - "type": { - "name": "User", - "properties": [ - { - "isOptional": true, - "name": "action_link", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "app_metadata", - "type": { - "name": "UserAppMetadata", - "properties": [ - { - "comment": { - "shortText": "The first provider that the user used to sign up with.", - }, - "isOptional": true, - "name": "provider", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "A list of all providers that the user has linked to their account.", - }, - "isOptional": true, - "name": "providers", - "type": { - "elemType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - ], - "type": "object", - }, - }, - { - "name": "aud", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "banned_until", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "confirmation_sent_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "confirmed_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "deleted_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "email", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "email_change_sent_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "email_confirmed_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "factors", - "type": { - "elemType": { - "name": Symbol(anonymous), - "subTypes": [ - { - "name": "Factor", - "properties": [ - { - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Type of factor. \`totp\` and \`phone\` supported with this version", - }, - "name": "factor_type", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors.", - }, - "isOptional": true, - "name": "friendly_name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "ID of the factor.", - }, - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_challenged_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The verification status of the factor, default is \`unverified\` after \`.enroll()\`, then \`verified\` after the user verifies it with \`.verify()\`", - }, - "name": "status", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - { - "name": "Factor", - "properties": [ - { - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "Type of factor. \`totp\` and \`phone\` supported with this version", - }, - "name": "factor_type", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors.", - }, - "isOptional": true, - "name": "friendly_name", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "ID of the factor.", - }, - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_challenged_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "comment": { - "shortText": "The verification status of the factor, default is \`unverified\` after \`.enroll()\`, then \`verified\` after the user verifies it with \`.verify()\`", - }, - "name": "status", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "type": "literal", - "value": "totp", - }, - { - "type": "literal", - "value": "phone", - }, - { - "type": "literal", - "value": "webauthn", - }, - ], - "type": "union", - }, - }, - { - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - ], - "type": "union", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "identities", - "type": { - "elemType": { - "name": "UserIdentity", - "properties": [ - { - "isOptional": true, - "name": "created_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "identity_data", - "type": { - "keyType": { - "name": "string", - "type": "intrinsic", - }, - "name": Symbol(anonymous), - "type": "index signature", - "valueType": { - "name": "any", - "type": "intrinsic", - }, - }, - }, - { - "name": "identity_id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_sign_in_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "provider", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "user_id", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - ], - "type": "object", - }, - "name": Symbol(anonymous), - "type": "array", - }, - }, - { - "isOptional": true, - "name": "invited_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "is_anonymous", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "is_sso_user", - "type": { - "name": "boolean", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "last_sign_in_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "new_email", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "new_phone", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "phone", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "phone_confirmed_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "recovery_sent_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "role", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "isOptional": true, - "name": "updated_at", - "type": { - "name": "string", - "type": "intrinsic", - }, - }, - { - "name": "user_metadata", - "type": { - "name": "UserMetadata", - "properties": [], - "type": "object", - }, - }, - ], - "type": "object", - }, - }, - ], - "type": "object", - }, - ], - "type": "union", - }, - }, - ], - "ret": { - "type": { - "name": "void", - "type": "intrinsic", - }, - }, - "type": "function", - }, - }, - { - "comment": { - "shortText": "A unique identifier for this subscription, set by the client. -This is an internal identifier used for managing callbacks and should not be -relied upon by application code. Use the unsubscribe() method to remove listeners.", - }, - "name": "id", - "type": { - "name": Symbol(anonymous), - "subTypes": [ - { - "name": "string", - "type": "intrinsic", - }, - { - "name": "symbol", - "type": "intrinsic", - }, - ], - "type": "union", - }, - }, - { - "comment": { - "shortText": "Call this to remove the listener.", - }, - "name": "unsubscribe", - "type": { - "comment": undefined, - "name": Symbol(anonymous), - "params": [], - "ret": { - "type": { - "name": "void", - "type": "intrinsic", - }, - }, - "type": "function", - }, - }, - ], - "type": "object", - }, - }, - ], - "type": "object", - }, - }, - ], - "type": "object", - }, - }, - }, - ], - "comment": { - "examples": [ - { - "code": "\`\`\`js -const { data } = supabase.auth.onAuthStateChange((event, session) => { - console.log(event, session) - - if (event === 'INITIAL_SESSION') { - // handle initial session - } else if (event === 'SIGNED_IN') { - // handle sign in event - } else if (event === 'SIGNED_OUT') { - // handle sign out event - } else if (event === 'PASSWORD_RECOVERY') { - // handle password recovery event - } else if (event === 'TOKEN_REFRESHED') { - // handle token refreshed event - } else if (event === 'USER_UPDATED') { - // handle user updated event - } -}) - -// call unsubscribe to remove the callback -data.subscription.unsubscribe() -\`\`\`", - "data": undefined, - "description": undefined, - "id": "listen-to-auth-changes", - "name": "Listen to auth changes", - "response": undefined, - }, - { - "code": "\`\`\`js -supabase.auth.onAuthStateChange((event, session) => { - if (event === 'SIGNED_OUT') { - console.log('SIGNED_OUT', session) - - // clear local and session storage - [ - window.localStorage, - window.sessionStorage, - ].forEach((storage) => { - Object.entries(storage) - .forEach(([key]) => { - storage.removeItem(key) - }) - }) - } -}) -\`\`\`", - "data": undefined, - "description": "Make sure you clear out any local data, such as local and session storage, after the client library has detected the user's sign out.", - "id": "listen-to-sign-out", - "name": "Listen to sign out", - "response": undefined, - }, - { - "code": "\`\`\`js -// Register this immediately after calling createClient! -// Because signInWithOAuth causes a redirect, you need to fetch the -// provider tokens from the callback. -supabase.auth.onAuthStateChange((event, session) => { - if (session && session.provider_token) { - window.localStorage.setItem('oauth_provider_token', session.provider_token) - } - - if (session && session.provider_refresh_token) { - window.localStorage.setItem('oauth_provider_refresh_token', session.provider_refresh_token) - } - - if (event === 'SIGNED_OUT') { - window.localStorage.removeItem('oauth_provider_token') - window.localStorage.removeItem('oauth_provider_refresh_token') - } -}) -\`\`\`", - "data": undefined, - "description": "When using [OAuth (Social Login)](/docs/guides/auth/social-login) you sometimes wish to get access to the provider's access token and refresh token, in order to call provider APIs in the name of the user. - -For example, if you are using [Sign in with Google](/docs/guides/auth/social-login/auth-google) you may want to use the provider token to call Google APIs on behalf of the user. Supabase Auth does not keep track of the provider access and refresh token, but does return them for you once, immediately after sign in. You can use the \`onAuthStateChange\` method to listen for the presence of the provider tokens and store them in local storage. You can further send them to your server's APIs for use on the backend. - -Finally, make sure you remove them from local storage on the \`SIGNED_OUT\` event. If the OAuth provider supports token revocation, make sure you call those APIs either from the frontend or schedule them to be called on the backend.", - "id": "store-oauth-provider-tokens-on-sign-in", - "name": "Store OAuth provider tokens on sign in", - "response": undefined, - }, - { - "code": "\`\`\`js -const SessionContext = React.createContext(null) - -function main() { - const [session, setSession] = React.useState(null) - - React.useEffect(() => { - const {data: { subscription }} = supabase.auth.onAuthStateChange( - (event, session) => { - if (event === 'SIGNED_OUT') { - setSession(null) - } else if (session) { - setSession(session) - } - }) - - return () => { - subscription.unsubscribe() - } - }, []) - - return ( - - - - ) -} -\`\`\`", - "data": undefined, - "description": "Instead of relying on \`supabase.auth.getSession()\` within your React components, you can use a [React Context](https://react.dev/reference/react/createContext) to store the latest session information from the \`onAuthStateChange\` callback and access it that way.", - "id": "use-react-context-for-the-user-s-session", - "name": "Use React Context for the User's session", - "response": undefined, - }, - { - "code": "\`\`\`js -supabase.auth.onAuthStateChange((event, session) => { - if (event === 'PASSWORD_RECOVERY') { - console.log('PASSWORD_RECOVERY', session) - // show screen to update user's password - showPasswordResetScreen(true) - } -}) -\`\`\`", - "data": undefined, - "description": undefined, - "id": "listen-to-password-recovery-events", - "name": "Listen to password recovery events", - "response": undefined, - }, - { - "code": "\`\`\`js -supabase.auth.onAuthStateChange((event, session) => { - if (event === 'SIGNED_IN') console.log('SIGNED_IN', session) -}) -\`\`\`", - "data": undefined, - "description": undefined, - "id": "listen-to-sign-in", - "name": "Listen to sign in", - "response": undefined, - }, - { - "code": "\`\`\`js -supabase.auth.onAuthStateChange((event, session) => { - if (event === 'TOKEN_REFRESHED') console.log('TOKEN_REFRESHED', session) -}) -\`\`\`", - "data": undefined, - "description": undefined, - "id": "listen-to-token-refresh", - "name": "Listen to token refresh", - "response": undefined, - }, - { - "code": "\`\`\`js -supabase.auth.onAuthStateChange((event, session) => { - if (event === 'USER_UPDATED') console.log('USER_UPDATED', session) -}) -\`\`\`", - "data": undefined, - "description": undefined, - "id": "listen-to-user-updates", - "name": "Listen to user updates", - "response": undefined, - }, - ], - "shortText": "Receive a notification every time an auth event happens. -Safe to use without an async function as callback.", - "text": "- Subscribes to important events occurring on the user's session. -- Use on the frontend/client. It is less useful on the server. -- Events are emitted across tabs to keep your application's UI up-to-date. Some events can fire very frequently, based on the number of tabs open. Use a quick and efficient callback function, and defer or debounce as many operations as you can to be performed outside of the callback. -- Callbacks can be \`async\` and can safely call other Supabase auth methods (\`getUser\`, \`setSession\`, etc.) from inside the callback. -- Keep callbacks quick. Events are awaited in order, so a slow callback delays subsequent events to subscribers in this tab. -- Emitted events: - - \`INITIAL_SESSION\` - - Emitted right after the Supabase client is constructed and the initial session from storage is loaded. - - \`SIGNED_IN\` - - Emitted each time a user session is confirmed or re-established, including on user sign in and when refocusing a tab. - - Avoid making assumptions as to when this event is fired, this may occur even when the user is already signed in. Instead, check the user object attached to the event to see if a new user has signed in and update your application's UI. - - This event can fire very frequently depending on the number of tabs open in your application. - - \`SIGNED_OUT\` - - Emitted when the user signs out. This can be after: - - A call to \`supabase.auth.signOut()\`. - - After the user's session has expired for any reason: - - User has signed out on another device. - - The session has reached its timebox limit or inactivity timeout. - - User has signed in on another device with single session per user enabled. - - Check the [User Sessions](/docs/guides/auth/sessions) docs for more information. - - Use this to clean up any local storage your application has associated with the user. - - \`TOKEN_REFRESHED\` - - Emitted each time a new access and refresh token are fetched for the signed in user. - - It's best practice and highly recommended to extract the access token (JWT) and store it in memory for further use in your application. - - Avoid frequent calls to \`supabase.auth.getSession()\` for the same purpose. - - There is a background process that keeps track of when the session should be refreshed so you will always receive valid tokens by listening to this event. - - The frequency of this event is related to the JWT expiry limit configured on your project. - - \`USER_UPDATED\` - - Emitted each time the \`supabase.auth.updateUser()\` method finishes successfully. Listen to it to update your application's UI based on new profile information. - - \`PASSWORD_RECOVERY\` - - Emitted instead of the \`SIGNED_IN\` event when the user lands on a page that includes a password recovery link in the URL. - - Use it to show a UI to the user where they can [reset their password](/docs/guides/auth/passwords#resetting-a-users-password-forgot-password).", - }, - "name": "@supabase/auth-js.GoTrueClient.onAuthStateChange", - "params": [Array], - "ret": [Object], - }, - "@supabase/auth-js.GoTrueClient.reauthenticate": [Object], - "@supabase/auth-js.GoTrueClient.refreshSession": [Object], - "@supabase/auth-js.GoTrueClient.registerPasskey": [Object], - "@supabase/auth-js.GoTrueClient.resend": [Object], - "@supabase/auth-js.GoTrueClient.resetPasswordForEmail": [Object], - "@supabase/auth-js.GoTrueClient.setSession": [Object], - "@supabase/auth-js.GoTrueClient.signInAnonymously": [Object], - "@supabase/auth-js.GoTrueClient.signInWithIdToken": [Object], - "@supabase/auth-js.GoTrueClient.signInWithOAuth": [Object], - "@supabase/auth-js.GoTrueClient.signInWithOtp": [Object], - "@supabase/auth-js.GoTrueClient.signInWithPasskey": [Object], - "@supabase/auth-js.GoTrueClient.signInWithPassword": [Object], - "@supabase/auth-js.GoTrueClient.signInWithSSO": [Object], - "@supabase/auth-js.GoTrueClient.signInWithWeb3": [Object], - "@supabase/auth-js.GoTrueClient.signOut": [Object], - "@supabase/auth-js.GoTrueClient.signUp": [Object], - "@supabase/auth-js.GoTrueClient.startAutoRefresh": [Object], - "@supabase/auth-js.GoTrueClient.stopAutoRefresh": [Object], - "@supabase/auth-js.GoTrueClient.unlinkIdentity": [Object], - "@supabase/auth-js.GoTrueClient.updateUser": [Object], - "@supabase/auth-js.GoTrueClient.verifyOtp": [Object], - "@supabase/auth-js.GoTrueMFAApi.challenge": [Object], - "@supabase/auth-js.GoTrueMFAApi.challengeAndVerify": [Object], - "@supabase/auth-js.GoTrueMFAApi.enroll": [Object], - "@supabase/auth-js.GoTrueMFAApi.getAuthenticatorAssuranceLevel": [Object], - "@supabase/auth-js.GoTrueMFAApi.listFactors": [Object], - "@supabase/auth-js.GoTrueMFAApi.unenroll": [Object], - "@supabase/auth-js.GoTrueMFAApi.verify": [Object], - "@supabase/auth-js.NavigatorLockAcquireTimeoutError.constructor": [Object], - "@supabase/auth-js.isAuthApiError": [Object], - "@supabase/auth-js.isAuthError": [Object], - "@supabase/auth-js.isAuthImplicitGrantRedirectError": [Object], - "@supabase/auth-js.isAuthPKCECodeVerifierMissingError": [Object], - "@supabase/auth-js.isAuthRefreshDiscardedError": [Object], - "@supabase/auth-js.isAuthRetryableFetchError": [Object], - "@supabase/auth-js.isAuthSessionMissingError": [Object], - "@supabase/auth-js.isAuthWeakPasswordError": [Object], - "@supabase/auth-js.navigatorLock": [Object], - "@supabase/auth-js.processLock": [Object], - "@supabase/functions-js.FunctionsClient.constructor": [Object], - "@supabase/functions-js.FunctionsClient.invoke": [Object], - "@supabase/functions-js.FunctionsClient.setAuth": [Object], - "@supabase/functions-js.FunctionsError.constructor": [Object], - "@supabase/functions-js.FunctionsError.toJSON": [Object], - "@supabase/functions-js.FunctionsFetchError.constructor": [Object], - "@supabase/functions-js.FunctionsFetchError.toJSON": [Object], - "@supabase/functions-js.FunctionsHttpError.constructor": [Object], - "@supabase/functions-js.FunctionsHttpError.toJSON": [Object], - "@supabase/functions-js.FunctionsRelayError.constructor": [Object], - "@supabase/functions-js.FunctionsRelayError.toJSON": [Object], - "@supabase/postgrest-js.PostgrestBuilder.constructor": [Object], - "@supabase/postgrest-js.PostgrestBuilder.overrideTypes": [Object], - "@supabase/postgrest-js.PostgrestBuilder.retry": [Object], - "@supabase/postgrest-js.PostgrestBuilder.returns": [Object], - "@supabase/postgrest-js.PostgrestBuilder.setHeader": [Object], - "@supabase/postgrest-js.PostgrestBuilder.stripNulls": [Object], - "@supabase/postgrest-js.PostgrestBuilder.then": [Object], - "@supabase/postgrest-js.PostgrestBuilder.throwOnError": [Object], - "@supabase/postgrest-js.PostgrestClient.constructor": [Object], - "@supabase/postgrest-js.PostgrestClient.from": [Object], - "@supabase/postgrest-js.PostgrestClient.rpc": [Object], - "@supabase/postgrest-js.PostgrestClient.schema": [Object], - "@supabase/postgrest-js.PostgrestError.constructor": [Object], - "@supabase/postgrest-js.PostgrestError.toJSON": [Object], - "@supabase/postgrest-js.PostgrestFilterBuilder.abortSignal": [Object], - "@supabase/postgrest-js.PostgrestFilterBuilder.constructor": [Object], - "@supabase/postgrest-js.PostgrestFilterBuilder.containedBy": [Object], - "@supabase/postgrest-js.PostgrestFilterBuilder.contains": [Object], - "@supabase/postgrest-js.PostgrestFilterBuilder.csv": [Object], - "@supabase/postgrest-js.PostgrestFilterBuilder.eq": [Object], - "@supabase/postgrest-js.PostgrestFilterBuilder.explain": [Object], - "@supabase/postgrest-js.PostgrestFilterBuilder.filter": [Object], - "@supabase/postgrest-js.PostgrestFilterBuilder.geojson": [Object], - "@supabase/postgrest-js.PostgrestFilterBuilder.gt": [Object], - "@supabase/postgrest-js.PostgrestFilterBuilder.gte": [Object], - "@supabase/postgrest-js.PostgrestFilterBuilder.ilike": [Object], - "@supabase/postgrest-js.PostgrestFilterBuilder.ilikeAllOf": [Object], - "@supabase/postgrest-js.PostgrestFilterBuilder.ilikeAnyOf": [Object], - "@supabase/postgrest-js.PostgrestFilterBuilder.in": [Object], - "@supabase/postgrest-js.PostgrestFilterBuilder.is": [Object], - "@supabase/postgrest-js.PostgrestFilterBuilder.isDistinct": [Object], - "@supabase/postgrest-js.PostgrestFilterBuilder.like": [Object], - "@supabase/postgrest-js.PostgrestFilterBuilder.likeAllOf": [Object], - "@supabase/postgrest-js.PostgrestFilterBuilder.likeAnyOf": [Object], - "@supabase/postgrest-js.PostgrestFilterBuilder.limit": [Object], - "@supabase/postgrest-js.PostgrestFilterBuilder.lt": [Object], - "@supabase/postgrest-js.PostgrestFilterBuilder.lte": [Object], - "@supabase/postgrest-js.PostgrestFilterBuilder.match": [Object], - "@supabase/postgrest-js.PostgrestFilterBuilder.maxAffected": [Object], - "@supabase/postgrest-js.PostgrestFilterBuilder.maybeSingle": [Object], - "@supabase/postgrest-js.PostgrestFilterBuilder.neq": [Object], - "@supabase/postgrest-js.PostgrestFilterBuilder.not": [Object], - "@supabase/postgrest-js.PostgrestFilterBuilder.notIn": [Object], - "@supabase/postgrest-js.PostgrestFilterBuilder.or": [Object], - "@supabase/postgrest-js.PostgrestFilterBuilder.order": [Object], - "@supabase/postgrest-js.PostgrestFilterBuilder.overlaps": [Object], - "@supabase/postgrest-js.PostgrestFilterBuilder.overrideTypes": [Object], - "@supabase/postgrest-js.PostgrestFilterBuilder.range": [Object], - "@supabase/postgrest-js.PostgrestFilterBuilder.rangeAdjacent": [Object], - "@supabase/postgrest-js.PostgrestFilterBuilder.rangeGt": [Object], - "@supabase/postgrest-js.PostgrestFilterBuilder.rangeGte": [Object], - "@supabase/postgrest-js.PostgrestFilterBuilder.rangeLt": [Object], - "@supabase/postgrest-js.PostgrestFilterBuilder.rangeLte": [Object], - "@supabase/postgrest-js.PostgrestFilterBuilder.regexIMatch": [Object], - "@supabase/postgrest-js.PostgrestFilterBuilder.regexMatch": [Object], - "@supabase/postgrest-js.PostgrestFilterBuilder.retry": [Object], - "@supabase/postgrest-js.PostgrestFilterBuilder.returns": [Object], - "@supabase/postgrest-js.PostgrestFilterBuilder.rollback": [Object], - "@supabase/postgrest-js.PostgrestFilterBuilder.select": [Object], - "@supabase/postgrest-js.PostgrestFilterBuilder.setHeader": [Object], - "@supabase/postgrest-js.PostgrestFilterBuilder.single": [Object], - "@supabase/postgrest-js.PostgrestFilterBuilder.stripNulls": [Object], - "@supabase/postgrest-js.PostgrestFilterBuilder.textSearch": [Object], - "@supabase/postgrest-js.PostgrestFilterBuilder.then": [Object], - "@supabase/postgrest-js.PostgrestFilterBuilder.throwOnError": [Object], - "@supabase/postgrest-js.PostgrestQueryBuilder.constructor": [Object], - "@supabase/postgrest-js.PostgrestQueryBuilder.delete": [Object], - "@supabase/postgrest-js.PostgrestQueryBuilder.insert": [Object], - "@supabase/postgrest-js.PostgrestQueryBuilder.select": [Object], - "@supabase/postgrest-js.PostgrestQueryBuilder.update": [Object], - "@supabase/postgrest-js.PostgrestQueryBuilder.upsert": [Object], - "@supabase/postgrest-js.PostgrestTransformBuilder.abortSignal": [Object], - "@supabase/postgrest-js.PostgrestTransformBuilder.constructor": [Object], - "@supabase/postgrest-js.PostgrestTransformBuilder.csv": [Object], - "@supabase/postgrest-js.PostgrestTransformBuilder.explain": [Object], - "@supabase/postgrest-js.PostgrestTransformBuilder.geojson": [Object], - "@supabase/postgrest-js.PostgrestTransformBuilder.limit": [Object], - "@supabase/postgrest-js.PostgrestTransformBuilder.maxAffected": [Object], - "@supabase/postgrest-js.PostgrestTransformBuilder.maybeSingle": [Object], - "@supabase/postgrest-js.PostgrestTransformBuilder.order": [Object], - "@supabase/postgrest-js.PostgrestTransformBuilder.overrideTypes": [Object], - "@supabase/postgrest-js.PostgrestTransformBuilder.range": [Object], - "@supabase/postgrest-js.PostgrestTransformBuilder.retry": [Object], - "@supabase/postgrest-js.PostgrestTransformBuilder.returns": [Object], - "@supabase/postgrest-js.PostgrestTransformBuilder.rollback": [Object], - "@supabase/postgrest-js.PostgrestTransformBuilder.select": [Object], - "@supabase/postgrest-js.PostgrestTransformBuilder.setHeader": [Object], - "@supabase/postgrest-js.PostgrestTransformBuilder.single": [Object], - "@supabase/postgrest-js.PostgrestTransformBuilder.stripNulls": [Object], - "@supabase/postgrest-js.PostgrestTransformBuilder.then": [Object], - "@supabase/postgrest-js.PostgrestTransformBuilder.throwOnError": [Object], - "@supabase/realtime-js.RealtimeChannel.constructor": [Object], - "@supabase/realtime-js.RealtimeChannel.copyBindings": [Object], - "@supabase/realtime-js.RealtimeChannel.httpSend": [Object], - "@supabase/realtime-js.RealtimeChannel.on": [Object], - "@supabase/realtime-js.RealtimeChannel.presenceState": [Object], - "@supabase/realtime-js.RealtimeChannel.send": [Object], - "@supabase/realtime-js.RealtimeChannel.subscribe": [Object], - "@supabase/realtime-js.RealtimeChannel.teardown": [Object], - "@supabase/realtime-js.RealtimeChannel.track": [Object], - "@supabase/realtime-js.RealtimeChannel.unsubscribe": [Object], - "@supabase/realtime-js.RealtimeChannel.untrack": [Object], - "@supabase/realtime-js.RealtimeChannel.updateJoinPayload": [Object], - "@supabase/realtime-js.RealtimeClient.channel": [Object], - "@supabase/realtime-js.RealtimeClient.connect": [Object], - "@supabase/realtime-js.RealtimeClient.connectionState": [Object], - "@supabase/realtime-js.RealtimeClient.constructor": [Object], - "@supabase/realtime-js.RealtimeClient.disconnect": [Object], - "@supabase/realtime-js.RealtimeClient.endpointURL": [Object], - "@supabase/realtime-js.RealtimeClient.getChannels": [Object], - "@supabase/realtime-js.RealtimeClient.isConnected": [Object], - "@supabase/realtime-js.RealtimeClient.isConnecting": [Object], - "@supabase/realtime-js.RealtimeClient.isDisconnecting": [Object], - "@supabase/realtime-js.RealtimeClient.log": [Object], - "@supabase/realtime-js.RealtimeClient.onHeartbeat": [Object], - "@supabase/realtime-js.RealtimeClient.push": [Object], - "@supabase/realtime-js.RealtimeClient.removeAllChannels": [Object], - "@supabase/realtime-js.RealtimeClient.removeChannel": [Object], - "@supabase/realtime-js.RealtimeClient.sendHeartbeat": [Object], - "@supabase/realtime-js.RealtimeClient.setAuth": [Object], - "@supabase/realtime-js.RealtimePresence.constructor": [Object], - "@supabase/realtime-js.WebSocketFactory.getWebSocketConstructor": [Object], - "@supabase/realtime-js.WebSocketFactory.isWebSocketSupported": [Object], - "@supabase/realtime-js.WebSocketLike.addEventListener": [Object], - "@supabase/realtime-js.WebSocketLike.close": [Object], - "@supabase/realtime-js.WebSocketLike.removeEventListener": [Object], - "@supabase/realtime-js.WebSocketLike.send": [Object], - "@supabase/realtime-js.WebSocketLikeConstructor.constructor": [Object], - "@supabase/storage-js.StorageApiError.constructor": [Object], - "@supabase/storage-js.StorageApiError.toJSON": [Object], - "@supabase/storage-js.StorageClient.constructor": [Object], - "@supabase/storage-js.StorageClient.createBucket": [Object], - "@supabase/storage-js.StorageClient.deleteBucket": [Object], - "@supabase/storage-js.StorageClient.emptyBucket": [Object], - "@supabase/storage-js.StorageClient.from": [Object], - "@supabase/storage-js.StorageClient.getBucket": [Object], - "@supabase/storage-js.StorageClient.listBuckets": [Object], - "@supabase/storage-js.StorageClient.setHeader": [Object], - "@supabase/storage-js.StorageClient.throwOnError": [Object], - "@supabase/storage-js.StorageClient.updateBucket": [Object], - "@supabase/storage-js.StorageError.constructor": [Object], - "@supabase/storage-js.StorageError.toJSON": [Object], - "@supabase/storage-js.StorageUnknownError.constructor": [Object], - "@supabase/storage-js.StorageUnknownError.toJSON": [Object], - "@supabase/storage-js.StorageVectorsApiError.constructor": [Object], - "@supabase/storage-js.StorageVectorsApiError.toJSON": [Object], - "@supabase/storage-js.StorageVectorsError.constructor": [Object], - "@supabase/storage-js.StorageVectorsError.toJSON": [Object], - "@supabase/storage-js.StorageVectorsUnknownError.constructor": [Object], - "@supabase/storage-js.StorageVectorsUnknownError.toJSON": [Object], - "@supabase/storage-js.isStorageError": [Object], - "@supabase/storage-js.isStorageVectorsError": [Object], - "@supabase/storage-js.packages/BlobDownloadBuilder.default.asStream": [Object], - "@supabase/storage-js.packages/BlobDownloadBuilder.default.catch": [Object], - "@supabase/storage-js.packages/BlobDownloadBuilder.default.constructor": [Object], - "@supabase/storage-js.packages/BlobDownloadBuilder.default.finally": [Object], - "@supabase/storage-js.packages/BlobDownloadBuilder.default.then": [Object], - "@supabase/storage-js.packages/StorageAnalyticsClient.default.constructor": [Object], - "@supabase/storage-js.packages/StorageAnalyticsClient.default.createBucket": [Object], - "@supabase/storage-js.packages/StorageAnalyticsClient.default.deleteBucket": [Object], - "@supabase/storage-js.packages/StorageAnalyticsClient.default.from": [Object], - "@supabase/storage-js.packages/StorageAnalyticsClient.default.listBuckets": [Object], - "@supabase/storage-js.packages/StorageAnalyticsClient.default.setHeader": [Object], - "@supabase/storage-js.packages/StorageAnalyticsClient.default.throwOnError": [Object], - "@supabase/storage-js.packages/StorageBucketApi.default.constructor": [Object], - "@supabase/storage-js.packages/StorageBucketApi.default.createBucket": [Object], - "@supabase/storage-js.packages/StorageBucketApi.default.deleteBucket": [Object], - "@supabase/storage-js.packages/StorageBucketApi.default.emptyBucket": [Object], - "@supabase/storage-js.packages/StorageBucketApi.default.getBucket": [Object], - "@supabase/storage-js.packages/StorageBucketApi.default.listBuckets": [Object], - "@supabase/storage-js.packages/StorageBucketApi.default.setHeader": [Object], - "@supabase/storage-js.packages/StorageBucketApi.default.throwOnError": [Object], - "@supabase/storage-js.packages/StorageBucketApi.default.updateBucket": [Object], - "@supabase/storage-js.packages/StorageFileApi.default.constructor": [Object], - "@supabase/storage-js.packages/StorageFileApi.default.copy": [Object], - "@supabase/storage-js.packages/StorageFileApi.default.createSignedUploadUrl": [Object], - "@supabase/storage-js.packages/StorageFileApi.default.createSignedUrl": [Object], - "@supabase/storage-js.packages/StorageFileApi.default.createSignedUrls": [Object], - "@supabase/storage-js.packages/StorageFileApi.default.download": [Object], - "@supabase/storage-js.packages/StorageFileApi.default.exists": [Object], - "@supabase/storage-js.packages/StorageFileApi.default.getPublicUrl": [Object], - "@supabase/storage-js.packages/StorageFileApi.default.info": [Object], - "@supabase/storage-js.packages/StorageFileApi.default.list": [Object], - "@supabase/storage-js.packages/StorageFileApi.default.listV2": [Object], - "@supabase/storage-js.packages/StorageFileApi.default.move": [Object], - "@supabase/storage-js.packages/StorageFileApi.default.remove": [Object], - "@supabase/storage-js.packages/StorageFileApi.default.setHeader": [Object], - "@supabase/storage-js.packages/StorageFileApi.default.throwOnError": [Object], - "@supabase/storage-js.packages/StorageFileApi.default.toBase64": [Object], - "@supabase/storage-js.packages/StorageFileApi.default.update": [Object], - "@supabase/storage-js.packages/StorageFileApi.default.upload": [Object], - "@supabase/storage-js.packages/StorageFileApi.default.uploadToSignedUrl": [Object], - "@supabase/storage-js.packages/StorageVectorsClient.StorageVectorsClient.constructor": [Object], - "@supabase/storage-js.packages/StorageVectorsClient.StorageVectorsClient.createBucket": [Object], - "@supabase/storage-js.packages/StorageVectorsClient.StorageVectorsClient.deleteBucket": [Object], - "@supabase/storage-js.packages/StorageVectorsClient.StorageVectorsClient.from": [Object], - "@supabase/storage-js.packages/StorageVectorsClient.StorageVectorsClient.getBucket": [Object], - "@supabase/storage-js.packages/StorageVectorsClient.StorageVectorsClient.listBuckets": [Object], - "@supabase/storage-js.packages/StorageVectorsClient.StorageVectorsClient.setHeader": [Object], - "@supabase/storage-js.packages/StorageVectorsClient.StorageVectorsClient.throwOnError": [Object], - "@supabase/storage-js.packages/StorageVectorsClient.VectorBucketScope": [Object], - "@supabase/storage-js.packages/StorageVectorsClient.VectorBucketScope.constructor": [Object], - "@supabase/storage-js.packages/StorageVectorsClient.VectorBucketScope.createIndex": [Object], - "@supabase/storage-js.packages/StorageVectorsClient.VectorBucketScope.deleteIndex": [Object], - "@supabase/storage-js.packages/StorageVectorsClient.VectorBucketScope.getIndex": [Object], - "@supabase/storage-js.packages/StorageVectorsClient.VectorBucketScope.listIndexes": [Object], - "@supabase/storage-js.packages/StorageVectorsClient.VectorBucketScope.setHeader": [Object], - "@supabase/storage-js.packages/StorageVectorsClient.VectorBucketScope.throwOnError": [Object], - "@supabase/storage-js.packages/StorageVectorsClient.VectorIndexScope.constructor": [Object], - "@supabase/storage-js.packages/StorageVectorsClient.VectorIndexScope.deleteVectors": [Object], - "@supabase/storage-js.packages/StorageVectorsClient.VectorIndexScope.getVectors": [Object], - "@supabase/storage-js.packages/StorageVectorsClient.VectorIndexScope.listVectors": [Object], - "@supabase/storage-js.packages/StorageVectorsClient.VectorIndexScope.putVectors": [Object], - "@supabase/storage-js.packages/StorageVectorsClient.VectorIndexScope.queryVectors": [Object], - "@supabase/storage-js.packages/StorageVectorsClient.VectorIndexScope.setHeader": [Object], - "@supabase/storage-js.packages/StorageVectorsClient.VectorIndexScope.throwOnError": [Object], - "@supabase/storage-js.packages/StreamDownloadBuilder.default.catch": [Object], - "@supabase/storage-js.packages/StreamDownloadBuilder.default.constructor": [Object], - "@supabase/storage-js.packages/StreamDownloadBuilder.default.finally": [Object], - "@supabase/storage-js.packages/StreamDownloadBuilder.default.then": [Object], - "@supabase/supabase-js.AuthApiError.constructor": [Object], - "@supabase/supabase-js.AuthApiError.toJSON": [Object], - "@supabase/supabase-js.AuthError.constructor": [Object], - "@supabase/supabase-js.AuthError.toJSON": [Object], - "@supabase/supabase-js.AuthImplicitGrantRedirectError.constructor": [Object], - "@supabase/supabase-js.AuthImplicitGrantRedirectError.toJSON": [Object], - "@supabase/supabase-js.AuthInvalidCredentialsError.constructor": [Object], - "@supabase/supabase-js.AuthInvalidCredentialsError.toJSON": [Object], - "@supabase/supabase-js.AuthInvalidJwtError.constructor": [Object], - "@supabase/supabase-js.AuthInvalidJwtError.toJSON": [Object], - "@supabase/supabase-js.AuthInvalidTokenResponseError.constructor": [Object], - "@supabase/supabase-js.AuthInvalidTokenResponseError.toJSON": [Object], - "@supabase/supabase-js.AuthOAuthServerApi.approveAuthorization": [Object], - "@supabase/supabase-js.AuthOAuthServerApi.denyAuthorization": [Object], - "@supabase/supabase-js.AuthOAuthServerApi.getAuthorizationDetails": [Object], - "@supabase/supabase-js.AuthOAuthServerApi.listGrants": [Object], - "@supabase/supabase-js.AuthOAuthServerApi.revokeGrant": [Object], - "@supabase/supabase-js.AuthPKCECodeVerifierMissingError.constructor": [Object], - "@supabase/supabase-js.AuthPKCECodeVerifierMissingError.toJSON": [Object], - "@supabase/supabase-js.AuthPKCEGrantCodeExchangeError.constructor": [Object], - "@supabase/supabase-js.AuthPKCEGrantCodeExchangeError.toJSON": [Object], - "@supabase/supabase-js.AuthPasskeyApi.delete": [Object], - "@supabase/supabase-js.AuthPasskeyApi.list": [Object], - "@supabase/supabase-js.AuthPasskeyApi.startAuthentication": [Object], - "@supabase/supabase-js.AuthPasskeyApi.startRegistration": [Object], - "@supabase/supabase-js.AuthPasskeyApi.update": [Object], - "@supabase/supabase-js.AuthPasskeyApi.verifyAuthentication": [Object], - "@supabase/supabase-js.AuthPasskeyApi.verifyRegistration": [Object], - "@supabase/supabase-js.AuthRefreshDiscardedError.constructor": [Object], - "@supabase/supabase-js.AuthRefreshDiscardedError.toJSON": [Object], - "@supabase/supabase-js.AuthRetryableFetchError.constructor": [Object], - "@supabase/supabase-js.AuthRetryableFetchError.toJSON": [Object], - "@supabase/supabase-js.AuthSessionMissingError.constructor": [Object], - "@supabase/supabase-js.AuthSessionMissingError.toJSON": [Object], - "@supabase/supabase-js.AuthUnknownError.constructor": [Object], - "@supabase/supabase-js.AuthUnknownError.toJSON": [Object], - "@supabase/supabase-js.AuthWeakPasswordError.constructor": [Object], - "@supabase/supabase-js.AuthWeakPasswordError.toJSON": [Object], - "@supabase/supabase-js.CustomAuthError.constructor": [Object], - "@supabase/supabase-js.CustomAuthError.toJSON": [Object], - "@supabase/supabase-js.FunctionsError.constructor": [Object], - "@supabase/supabase-js.FunctionsError.toJSON": [Object], - "@supabase/supabase-js.FunctionsFetchError.constructor": [Object], - "@supabase/supabase-js.FunctionsFetchError.toJSON": [Object], - "@supabase/supabase-js.FunctionsHttpError.constructor": [Object], - "@supabase/supabase-js.FunctionsHttpError.toJSON": [Object], - "@supabase/supabase-js.FunctionsRelayError.constructor": [Object], - "@supabase/supabase-js.FunctionsRelayError.toJSON": [Object], - "@supabase/supabase-js.GoTrueAdminApi.constructor": [Object], - "@supabase/supabase-js.GoTrueAdminApi.createUser": [Object], - "@supabase/supabase-js.GoTrueAdminApi.deleteUser": [Object], - "@supabase/supabase-js.GoTrueAdminApi.generateLink": [Object], - "@supabase/supabase-js.GoTrueAdminApi.getUserById": [Object], - "@supabase/supabase-js.GoTrueAdminApi.inviteUserByEmail": [Object], - "@supabase/supabase-js.GoTrueAdminApi.listUsers": [Object], - "@supabase/supabase-js.GoTrueAdminApi.signOut": [Object], - "@supabase/supabase-js.GoTrueAdminApi.updateUserById": [Object], - "@supabase/supabase-js.GoTrueAdminCustomProvidersApi.createProvider": [Object], - "@supabase/supabase-js.GoTrueAdminCustomProvidersApi.deleteProvider": [Object], - "@supabase/supabase-js.GoTrueAdminCustomProvidersApi.getProvider": [Object], - "@supabase/supabase-js.GoTrueAdminCustomProvidersApi.listProviders": [Object], - "@supabase/supabase-js.GoTrueAdminCustomProvidersApi.updateProvider": [Object], - "@supabase/supabase-js.GoTrueAdminMFAApi.deleteFactor": [Object], - "@supabase/supabase-js.GoTrueAdminMFAApi.listFactors": [Object], - "@supabase/supabase-js.GoTrueAdminOAuthApi.createClient": [Object], - "@supabase/supabase-js.GoTrueAdminOAuthApi.deleteClient": [Object], - "@supabase/supabase-js.GoTrueAdminOAuthApi.getClient": [Object], - "@supabase/supabase-js.GoTrueAdminOAuthApi.listClients": [Object], - "@supabase/supabase-js.GoTrueAdminOAuthApi.regenerateClientSecret": [Object], - "@supabase/supabase-js.GoTrueAdminOAuthApi.updateClient": [Object], - "@supabase/supabase-js.GoTrueAdminPasskeyApi.deletePasskey": [Object], - "@supabase/supabase-js.GoTrueAdminPasskeyApi.listPasskeys": [Object], - "@supabase/supabase-js.GoTrueClient._refreshSession": [Object], - "@supabase/supabase-js.GoTrueClient._setSession": [Object], - "@supabase/supabase-js.GoTrueClient._signOut": [Object], - "@supabase/supabase-js.GoTrueClient._updateUser": [Object], - "@supabase/supabase-js.GoTrueClient.constructor": [Object], - "@supabase/supabase-js.GoTrueClient.dispose": [Object], - "@supabase/supabase-js.GoTrueClient.exchangeCodeForSession": [Object], - "@supabase/supabase-js.GoTrueClient.getClaims": [Object], - "@supabase/supabase-js.GoTrueClient.getSession": [Object], - "@supabase/supabase-js.GoTrueClient.getUser": [Object], - "@supabase/supabase-js.GoTrueClient.getUserIdentities": [Object], - "@supabase/supabase-js.GoTrueClient.initialize": [Object], - "@supabase/supabase-js.GoTrueClient.isThrowOnErrorEnabled": [Object], - "@supabase/supabase-js.GoTrueClient.linkIdentity": [Object], - "@supabase/supabase-js.GoTrueClient.onAuthStateChange": [Object], - "@supabase/supabase-js.GoTrueClient.reauthenticate": [Object], - "@supabase/supabase-js.GoTrueClient.refreshSession": [Object], - "@supabase/supabase-js.GoTrueClient.registerPasskey": [Object], - "@supabase/supabase-js.GoTrueClient.resend": [Object], - "@supabase/supabase-js.GoTrueClient.resetPasswordForEmail": [Object], - "@supabase/supabase-js.GoTrueClient.setSession": [Object], - "@supabase/supabase-js.GoTrueClient.signInAnonymously": [Object], - "@supabase/supabase-js.GoTrueClient.signInWithIdToken": [Object], - "@supabase/supabase-js.GoTrueClient.signInWithOAuth": [Object], - "@supabase/supabase-js.GoTrueClient.signInWithOtp": [Object], - "@supabase/supabase-js.GoTrueClient.signInWithPasskey": [Object], - "@supabase/supabase-js.GoTrueClient.signInWithPassword": [Object], - "@supabase/supabase-js.GoTrueClient.signInWithSSO": [Object], - "@supabase/supabase-js.GoTrueClient.signInWithWeb3": [Object], - "@supabase/supabase-js.GoTrueClient.signOut": [Object], - "@supabase/supabase-js.GoTrueClient.signUp": [Object], - "@supabase/supabase-js.GoTrueClient.startAutoRefresh": [Object], - "@supabase/supabase-js.GoTrueClient.stopAutoRefresh": [Object], - "@supabase/supabase-js.GoTrueClient.unlinkIdentity": [Object], - "@supabase/supabase-js.GoTrueClient.updateUser": [Object], - "@supabase/supabase-js.GoTrueClient.verifyOtp": [Object], - "@supabase/supabase-js.GoTrueMFAApi.challenge": [Object], - "@supabase/supabase-js.GoTrueMFAApi.challengeAndVerify": [Object], - "@supabase/supabase-js.GoTrueMFAApi.enroll": [Object], - "@supabase/supabase-js.GoTrueMFAApi.getAuthenticatorAssuranceLevel": [Object], - "@supabase/supabase-js.GoTrueMFAApi.listFactors": [Object], - "@supabase/supabase-js.GoTrueMFAApi.unenroll": [Object], - "@supabase/supabase-js.GoTrueMFAApi.verify": [Object], - "@supabase/supabase-js.NavigatorLockAcquireTimeoutError.constructor": [Object], - "@supabase/supabase-js.PostgrestBuilder.constructor": [Object], - "@supabase/supabase-js.PostgrestBuilder.overrideTypes": [Object], - "@supabase/supabase-js.PostgrestBuilder.retry": [Object], - "@supabase/supabase-js.PostgrestBuilder.returns": [Object], - "@supabase/supabase-js.PostgrestBuilder.setHeader": [Object], - "@supabase/supabase-js.PostgrestBuilder.stripNulls": [Object], - "@supabase/supabase-js.PostgrestBuilder.then": [Object], - "@supabase/supabase-js.PostgrestBuilder.throwOnError": [Object], - "@supabase/supabase-js.PostgrestError.constructor": [Object], - "@supabase/supabase-js.PostgrestError.toJSON": [Object], - "@supabase/supabase-js.PostgrestFilterBuilder.abortSignal": [Object], - "@supabase/supabase-js.PostgrestFilterBuilder.constructor": [Object], - "@supabase/supabase-js.PostgrestFilterBuilder.containedBy": [Object], - "@supabase/supabase-js.PostgrestFilterBuilder.contains": [Object], - "@supabase/supabase-js.PostgrestFilterBuilder.csv": [Object], - "@supabase/supabase-js.PostgrestFilterBuilder.eq": [Object], - "@supabase/supabase-js.PostgrestFilterBuilder.explain": [Object], - "@supabase/supabase-js.PostgrestFilterBuilder.filter": [Object], - "@supabase/supabase-js.PostgrestFilterBuilder.geojson": [Object], - "@supabase/supabase-js.PostgrestFilterBuilder.gt": [Object], - "@supabase/supabase-js.PostgrestFilterBuilder.gte": [Object], - "@supabase/supabase-js.PostgrestFilterBuilder.ilike": [Object], - "@supabase/supabase-js.PostgrestFilterBuilder.ilikeAllOf": [Object], - "@supabase/supabase-js.PostgrestFilterBuilder.ilikeAnyOf": [Object], - "@supabase/supabase-js.PostgrestFilterBuilder.in": [Object], - "@supabase/supabase-js.PostgrestFilterBuilder.is": [Object], - "@supabase/supabase-js.PostgrestFilterBuilder.isDistinct": [Object], - "@supabase/supabase-js.PostgrestFilterBuilder.like": [Object], - "@supabase/supabase-js.PostgrestFilterBuilder.likeAllOf": [Object], - "@supabase/supabase-js.PostgrestFilterBuilder.likeAnyOf": [Object], - "@supabase/supabase-js.PostgrestFilterBuilder.limit": [Object], - "@supabase/supabase-js.PostgrestFilterBuilder.lt": [Object], - "@supabase/supabase-js.PostgrestFilterBuilder.lte": [Object], - "@supabase/supabase-js.PostgrestFilterBuilder.match": [Object], - "@supabase/supabase-js.PostgrestFilterBuilder.maxAffected": [Object], - "@supabase/supabase-js.PostgrestFilterBuilder.maybeSingle": [Object], - "@supabase/supabase-js.PostgrestFilterBuilder.neq": [Object], - "@supabase/supabase-js.PostgrestFilterBuilder.not": [Object], - "@supabase/supabase-js.PostgrestFilterBuilder.notIn": [Object], - "@supabase/supabase-js.PostgrestFilterBuilder.or": [Object], - "@supabase/supabase-js.PostgrestFilterBuilder.order": [Object], - "@supabase/supabase-js.PostgrestFilterBuilder.overlaps": [Object], - "@supabase/supabase-js.PostgrestFilterBuilder.overrideTypes": [Object], - "@supabase/supabase-js.PostgrestFilterBuilder.range": [Object], - "@supabase/supabase-js.PostgrestFilterBuilder.rangeAdjacent": [Object], - "@supabase/supabase-js.PostgrestFilterBuilder.rangeGt": [Object], - "@supabase/supabase-js.PostgrestFilterBuilder.rangeGte": [Object], - "@supabase/supabase-js.PostgrestFilterBuilder.rangeLt": [Object], - "@supabase/supabase-js.PostgrestFilterBuilder.rangeLte": [Object], - "@supabase/supabase-js.PostgrestFilterBuilder.regexIMatch": [Object], - "@supabase/supabase-js.PostgrestFilterBuilder.regexMatch": [Object], - "@supabase/supabase-js.PostgrestFilterBuilder.retry": [Object], - "@supabase/supabase-js.PostgrestFilterBuilder.returns": [Object], - "@supabase/supabase-js.PostgrestFilterBuilder.rollback": [Object], - "@supabase/supabase-js.PostgrestFilterBuilder.select": [Object], - "@supabase/supabase-js.PostgrestFilterBuilder.setHeader": [Object], - "@supabase/supabase-js.PostgrestFilterBuilder.single": [Object], - "@supabase/supabase-js.PostgrestFilterBuilder.stripNulls": [Object], - "@supabase/supabase-js.PostgrestFilterBuilder.textSearch": [Object], - "@supabase/supabase-js.PostgrestFilterBuilder.then": [Object], - "@supabase/supabase-js.PostgrestFilterBuilder.throwOnError": [Object], - "@supabase/supabase-js.PostgrestQueryBuilder.constructor": [Object], - "@supabase/supabase-js.PostgrestQueryBuilder.delete": [Object], - "@supabase/supabase-js.PostgrestQueryBuilder.insert": [Object], - "@supabase/supabase-js.PostgrestQueryBuilder.select": [Object], - "@supabase/supabase-js.PostgrestQueryBuilder.update": [Object], - "@supabase/supabase-js.PostgrestQueryBuilder.upsert": [Object], - "@supabase/supabase-js.PostgrestTransformBuilder.abortSignal": [Object], - "@supabase/supabase-js.PostgrestTransformBuilder.constructor": [Object], - "@supabase/supabase-js.PostgrestTransformBuilder.csv": [Object], - "@supabase/supabase-js.PostgrestTransformBuilder.explain": [Object], - "@supabase/supabase-js.PostgrestTransformBuilder.geojson": [Object], - "@supabase/supabase-js.PostgrestTransformBuilder.limit": [Object], - "@supabase/supabase-js.PostgrestTransformBuilder.maxAffected": [Object], - "@supabase/supabase-js.PostgrestTransformBuilder.maybeSingle": [Object], - "@supabase/supabase-js.PostgrestTransformBuilder.order": [Object], - "@supabase/supabase-js.PostgrestTransformBuilder.overrideTypes": [Object], - "@supabase/supabase-js.PostgrestTransformBuilder.range": [Object], - "@supabase/supabase-js.PostgrestTransformBuilder.retry": [Object], - "@supabase/supabase-js.PostgrestTransformBuilder.returns": [Object], - "@supabase/supabase-js.PostgrestTransformBuilder.rollback": [Object], - "@supabase/supabase-js.PostgrestTransformBuilder.select": [Object], - "@supabase/supabase-js.PostgrestTransformBuilder.setHeader": [Object], - "@supabase/supabase-js.PostgrestTransformBuilder.single": [Object], - "@supabase/supabase-js.PostgrestTransformBuilder.stripNulls": [Object], - "@supabase/supabase-js.PostgrestTransformBuilder.then": [Object], - "@supabase/supabase-js.PostgrestTransformBuilder.throwOnError": [Object], - "@supabase/supabase-js.RealtimeChannel.constructor": [Object], - "@supabase/supabase-js.RealtimeChannel.copyBindings": [Object], - "@supabase/supabase-js.RealtimeChannel.httpSend": [Object], - "@supabase/supabase-js.RealtimeChannel.on": [Object], - "@supabase/supabase-js.RealtimeChannel.presenceState": [Object], - "@supabase/supabase-js.RealtimeChannel.send": [Object], - "@supabase/supabase-js.RealtimeChannel.subscribe": [Object], - "@supabase/supabase-js.RealtimeChannel.teardown": [Object], - "@supabase/supabase-js.RealtimeChannel.track": [Object], - "@supabase/supabase-js.RealtimeChannel.unsubscribe": [Object], - "@supabase/supabase-js.RealtimeChannel.untrack": [Object], - "@supabase/supabase-js.RealtimeChannel.updateJoinPayload": [Object], - "@supabase/supabase-js.RealtimeClient.channel": [Object], - "@supabase/supabase-js.RealtimeClient.connect": [Object], - "@supabase/supabase-js.RealtimeClient.connectionState": [Object], - "@supabase/supabase-js.RealtimeClient.constructor": [Object], - "@supabase/supabase-js.RealtimeClient.disconnect": [Object], - "@supabase/supabase-js.RealtimeClient.endpointURL": [Object], - "@supabase/supabase-js.RealtimeClient.getChannels": [Object], - "@supabase/supabase-js.RealtimeClient.isConnected": [Object], - "@supabase/supabase-js.RealtimeClient.isConnecting": [Object], - "@supabase/supabase-js.RealtimeClient.isDisconnecting": [Object], - "@supabase/supabase-js.RealtimeClient.log": [Object], - "@supabase/supabase-js.RealtimeClient.onHeartbeat": [Object], - "@supabase/supabase-js.RealtimeClient.push": [Object], - "@supabase/supabase-js.RealtimeClient.removeAllChannels": [Object], - "@supabase/supabase-js.RealtimeClient.removeChannel": [Object], - "@supabase/supabase-js.RealtimeClient.sendHeartbeat": [Object], - "@supabase/supabase-js.RealtimeClient.setAuth": [Object], - "@supabase/supabase-js.RealtimePresence.constructor": [Object], - "@supabase/supabase-js.StorageApiError.constructor": [Object], - "@supabase/supabase-js.StorageApiError.toJSON": [Object], - "@supabase/supabase-js.SupabaseClient.channel": [Object], - "@supabase/supabase-js.SupabaseClient.constructor": [Object], - "@supabase/supabase-js.SupabaseClient.from": [Object], - "@supabase/supabase-js.SupabaseClient.getChannels": [Object], - "@supabase/supabase-js.SupabaseClient.removeAllChannels": [Object], - "@supabase/supabase-js.SupabaseClient.removeChannel": [Object], - "@supabase/supabase-js.SupabaseClient.rpc": [Object], - "@supabase/supabase-js.SupabaseClient.schema": [Object], - "@supabase/supabase-js.WebSocketFactory.getWebSocketConstructor": [Object], - "@supabase/supabase-js.WebSocketFactory.isWebSocketSupported": [Object], - "@supabase/supabase-js.WebSocketLike.addEventListener": [Object], - "@supabase/supabase-js.WebSocketLike.close": [Object], - "@supabase/supabase-js.WebSocketLike.removeEventListener": [Object], - "@supabase/supabase-js.WebSocketLike.send": [Object], - "@supabase/supabase-js.WebSocketLikeConstructor.constructor": [Object], - "@supabase/supabase-js.createClient": [Object], - "@supabase/supabase-js.isAuthApiError": [Object], - "@supabase/supabase-js.isAuthError": [Object], - "@supabase/supabase-js.isAuthImplicitGrantRedirectError": [Object], - "@supabase/supabase-js.isAuthPKCECodeVerifierMissingError": [Object], - "@supabase/supabase-js.isAuthRefreshDiscardedError": [Object], - "@supabase/supabase-js.isAuthRetryableFetchError": [Object], - "@supabase/supabase-js.isAuthSessionMissingError": [Object], - "@supabase/supabase-js.isAuthWeakPasswordError": [Object], - "@supabase/supabase-js.navigatorLock": [Object], - "@supabase/supabase-js.processLock": [Object], - }, - "variables": [Object], - }, -} -`; diff --git a/apps/docs/scripts/__snapshots__/build-reference-content.v2.json b/apps/docs/scripts/__snapshots__/build-reference-content.v2.json new file mode 100644 index 00000000000..f15c6ac0e19 --- /dev/null +++ b/apps/docs/scripts/__snapshots__/build-reference-content.v2.json @@ -0,0 +1,97936 @@ +{ + "bySlug": { + "introduction": { + "id": "introduction", + "title": "Introduction", + "slug": "introduction", + "type": "markdown" + }, + "installing": { + "id": "installing", + "title": "Installing", + "slug": "installing", + "type": "markdown" + }, + "initializing": { + "id": "initializing", + "title": "Initializing", + "slug": "initializing", + "type": "function" + }, + "typescript-support": { + "id": "typescript-support", + "title": "TypeScript support", + "slug": "typescript-support", + "type": "markdown" + }, + "database": { + "type": "category", + "title": "Database" + }, + "delete": { + "id": "delete", + "title": "delete", + "slug": "delete", + "product": "database", + "type": "function" + }, + "from": { + "id": "from", + "title": "from", + "slug": "from", + "product": "database", + "type": "function" + }, + "insert": { + "id": "insert", + "title": "insert", + "slug": "insert", + "product": "database", + "type": "function" + }, + "rpc": { + "id": "rpc", + "title": "rpc", + "slug": "rpc", + "product": "database", + "type": "function" + }, + "schema": { + "id": "schema", + "title": "schema", + "slug": "schema", + "product": "database", + "type": "function" + }, + "select": { + "id": "select", + "title": "select", + "slug": "select", + "product": "database", + "type": "function" + }, + "update": { + "id": "update", + "title": "update", + "slug": "update", + "product": "database", + "type": "function" + }, + "upsert": { + "id": "upsert", + "title": "upsert", + "slug": "upsert", + "product": "database", + "type": "function" + }, + "using-filters": { + "id": "using-filters", + "title": "Using Filters", + "slug": "using-filters", + "type": "function" + }, + "using-filters-containedby": { + "id": "using-filters-containedby", + "title": "containedBy", + "slug": "using-filters-containedby", + "product": "database", + "type": "function" + }, + "using-filters-contains": { + "id": "using-filters-contains", + "title": "contains", + "slug": "using-filters-contains", + "product": "database", + "type": "function" + }, + "using-filters-eq": { + "id": "using-filters-eq", + "title": "eq", + "slug": "using-filters-eq", + "product": "database", + "type": "function" + }, + "using-filters-filter": { + "id": "using-filters-filter", + "title": "filter", + "slug": "using-filters-filter", + "product": "database", + "type": "function" + }, + "using-filters-gt": { + "id": "using-filters-gt", + "title": "gt", + "slug": "using-filters-gt", + "product": "database", + "type": "function" + }, + "using-filters-gte": { + "id": "using-filters-gte", + "title": "gte", + "slug": "using-filters-gte", + "product": "database", + "type": "function" + }, + "using-filters-ilike": { + "id": "using-filters-ilike", + "title": "ilike", + "slug": "using-filters-ilike", + "product": "database", + "type": "function" + }, + "using-filters-ilikeallof": { + "id": "using-filters-ilikeallof", + "title": "ilikeAllOf", + "slug": "using-filters-ilikeallof", + "product": "database", + "type": "function" + }, + "using-filters-ilikeanyof": { + "id": "using-filters-ilikeanyof", + "title": "ilikeAnyOf", + "slug": "using-filters-ilikeanyof", + "product": "database", + "type": "function" + }, + "using-filters-in": { + "id": "using-filters-in", + "title": "in", + "slug": "using-filters-in", + "product": "database", + "type": "function" + }, + "using-filters-is": { + "id": "using-filters-is", + "title": "is", + "slug": "using-filters-is", + "product": "database", + "type": "function" + }, + "using-filters-like": { + "id": "using-filters-like", + "title": "like", + "slug": "using-filters-like", + "product": "database", + "type": "function" + }, + "using-filters-likeallof": { + "id": "using-filters-likeallof", + "title": "likeAllOf", + "slug": "using-filters-likeallof", + "product": "database", + "type": "function" + }, + "using-filters-likeanyof": { + "id": "using-filters-likeanyof", + "title": "likeAnyOf", + "slug": "using-filters-likeanyof", + "product": "database", + "type": "function" + }, + "using-filters-lt": { + "id": "using-filters-lt", + "title": "lt", + "slug": "using-filters-lt", + "product": "database", + "type": "function" + }, + "using-filters-lte": { + "id": "using-filters-lte", + "title": "lte", + "slug": "using-filters-lte", + "product": "database", + "type": "function" + }, + "using-filters-match": { + "id": "using-filters-match", + "title": "match", + "slug": "using-filters-match", + "product": "database", + "type": "function" + }, + "using-filters-neq": { + "id": "using-filters-neq", + "title": "neq", + "slug": "using-filters-neq", + "product": "database", + "type": "function" + }, + "using-filters-not": { + "id": "using-filters-not", + "title": "not", + "slug": "using-filters-not", + "product": "database", + "type": "function" + }, + "using-filters-or": { + "id": "using-filters-or", + "title": "or", + "slug": "using-filters-or", + "product": "database", + "type": "function" + }, + "using-filters-overlaps": { + "id": "using-filters-overlaps", + "title": "overlaps", + "slug": "using-filters-overlaps", + "product": "database", + "type": "function" + }, + "using-filters-rangeadjacent": { + "id": "using-filters-rangeadjacent", + "title": "rangeAdjacent", + "slug": "using-filters-rangeadjacent", + "product": "database", + "type": "function" + }, + "using-filters-rangegt": { + "id": "using-filters-rangegt", + "title": "rangeGt", + "slug": "using-filters-rangegt", + "product": "database", + "type": "function" + }, + "using-filters-rangegte": { + "id": "using-filters-rangegte", + "title": "rangeGte", + "slug": "using-filters-rangegte", + "product": "database", + "type": "function" + }, + "using-filters-rangelt": { + "id": "using-filters-rangelt", + "title": "rangeLt", + "slug": "using-filters-rangelt", + "product": "database", + "type": "function" + }, + "using-filters-rangelte": { + "id": "using-filters-rangelte", + "title": "rangeLte", + "slug": "using-filters-rangelte", + "product": "database", + "type": "function" + }, + "using-filters-textsearch": { + "id": "using-filters-textsearch", + "title": "textSearch", + "slug": "using-filters-textsearch", + "product": "database", + "type": "function" + }, + "using-modifiers": { + "id": "using-modifiers", + "title": "Using modifiers", + "slug": "using-modifiers", + "type": "function" + }, + "using-modifiers-abortsignal": { + "id": "using-modifiers-abortsignal", + "title": "abortSignal", + "slug": "using-modifiers-abortsignal", + "product": "database", + "type": "function" + }, + "using-modifiers-csv": { + "id": "using-modifiers-csv", + "title": "csv", + "slug": "using-modifiers-csv", + "product": "database", + "type": "function" + }, + "using-modifiers-explain": { + "id": "using-modifiers-explain", + "title": "explain", + "slug": "using-modifiers-explain", + "product": "database", + "type": "function" + }, + "using-modifiers-geojson": { + "id": "using-modifiers-geojson", + "title": "geojson", + "slug": "using-modifiers-geojson", + "product": "database", + "type": "function" + }, + "using-modifiers-limit": { + "id": "using-modifiers-limit", + "title": "limit", + "slug": "using-modifiers-limit", + "product": "database", + "type": "function" + }, + "using-modifiers-maxaffected": { + "id": "using-modifiers-maxaffected", + "title": "maxAffected", + "slug": "using-modifiers-maxaffected", + "product": "database", + "type": "function" + }, + "using-modifiers-maybesingle": { + "id": "using-modifiers-maybesingle", + "title": "maybeSingle", + "slug": "using-modifiers-maybesingle", + "product": "database", + "type": "function" + }, + "using-modifiers-order": { + "id": "using-modifiers-order", + "title": "order", + "slug": "using-modifiers-order", + "product": "database", + "type": "function" + }, + "using-modifiers-overridetypes": { + "id": "using-modifiers-overridetypes", + "title": "overrideTypes", + "slug": "using-modifiers-overridetypes", + "product": "database", + "type": "function" + }, + "using-modifiers-range": { + "id": "using-modifiers-range", + "title": "range", + "slug": "using-modifiers-range", + "product": "database", + "type": "function" + }, + "using-modifiers-retry": { + "id": "using-modifiers-retry", + "title": "retry", + "slug": "using-modifiers-retry", + "product": "database", + "type": "function" + }, + "using-modifiers-returns": { + "id": "using-modifiers-returns", + "title": "returns", + "slug": "using-modifiers-returns", + "product": "database", + "type": "function" + }, + "using-modifiers-rollback": { + "id": "using-modifiers-rollback", + "title": "rollback", + "slug": "using-modifiers-rollback", + "product": "database", + "type": "function" + }, + "using-modifiers-select": { + "id": "using-modifiers-select", + "title": "select", + "slug": "using-modifiers-select", + "product": "database", + "type": "function" + }, + "using-modifiers-setheader": { + "id": "using-modifiers-setheader", + "title": "setHeader", + "slug": "using-modifiers-setheader", + "product": "database", + "type": "function" + }, + "using-modifiers-single": { + "id": "using-modifiers-single", + "title": "single", + "slug": "using-modifiers-single", + "product": "database", + "type": "function" + }, + "using-modifiers-stripnulls": { + "id": "using-modifiers-stripnulls", + "title": "stripNulls", + "slug": "using-modifiers-stripnulls", + "product": "database", + "type": "function" + }, + "using-modifiers-throwonerror": { + "id": "using-modifiers-throwonerror", + "title": "throwOnError", + "slug": "using-modifiers-throwonerror", + "product": "database", + "type": "function" + }, + "auth": { + "id": "auth", + "title": "Overview", + "slug": "auth", + "type": "function" + }, + "auth-dispose": { + "id": "auth-dispose", + "title": "dispose", + "slug": "auth-dispose", + "product": "auth", + "type": "function" + }, + "auth-exchangecodeforsession": { + "id": "auth-exchangecodeforsession", + "title": "exchangeCodeForSession", + "slug": "auth-exchangecodeforsession", + "product": "auth", + "type": "function" + }, + "auth-getclaims": { + "id": "auth-getclaims", + "title": "getClaims", + "slug": "auth-getclaims", + "product": "auth", + "type": "function" + }, + "auth-getsession": { + "id": "auth-getsession", + "title": "getSession", + "slug": "auth-getsession", + "product": "auth", + "type": "function" + }, + "auth-getuser": { + "id": "auth-getuser", + "title": "getUser", + "slug": "auth-getuser", + "product": "auth", + "type": "function" + }, + "auth-getuseridentities": { + "id": "auth-getuseridentities", + "title": "getUserIdentities", + "slug": "auth-getuseridentities", + "product": "auth", + "type": "function" + }, + "auth-initialize": { + "id": "auth-initialize", + "title": "initialize", + "slug": "auth-initialize", + "product": "auth", + "type": "function" + }, + "auth-linkidentity": { + "id": "auth-linkidentity", + "title": "linkIdentity", + "slug": "auth-linkidentity", + "product": "auth", + "type": "function" + }, + "auth-onauthstatechange": { + "id": "auth-onauthstatechange", + "title": "onAuthStateChange", + "slug": "auth-onauthstatechange", + "product": "auth", + "type": "function" + }, + "auth-reauthenticate": { + "id": "auth-reauthenticate", + "title": "reauthenticate", + "slug": "auth-reauthenticate", + "product": "auth", + "type": "function" + }, + "auth-refreshsession": { + "id": "auth-refreshsession", + "title": "refreshSession", + "slug": "auth-refreshsession", + "product": "auth", + "type": "function" + }, + "auth-registerpasskey": { + "id": "auth-registerpasskey", + "title": "registerPasskey", + "slug": "auth-registerpasskey", + "product": "auth", + "type": "function" + }, + "auth-resend": { + "id": "auth-resend", + "title": "resend", + "slug": "auth-resend", + "product": "auth", + "type": "function" + }, + "auth-resetpasswordforemail": { + "id": "auth-resetpasswordforemail", + "title": "resetPasswordForEmail", + "slug": "auth-resetpasswordforemail", + "product": "auth", + "type": "function" + }, + "auth-setsession": { + "id": "auth-setsession", + "title": "setSession", + "slug": "auth-setsession", + "product": "auth", + "type": "function" + }, + "auth-signinanonymously": { + "id": "auth-signinanonymously", + "title": "signInAnonymously", + "slug": "auth-signinanonymously", + "product": "auth", + "type": "function" + }, + "auth-signinwithidtoken": { + "id": "auth-signinwithidtoken", + "title": "signInWithIdToken", + "slug": "auth-signinwithidtoken", + "product": "auth", + "type": "function" + }, + "auth-signinwithoauth": { + "id": "auth-signinwithoauth", + "title": "signInWithOAuth", + "slug": "auth-signinwithoauth", + "product": "auth", + "type": "function" + }, + "auth-signinwithotp": { + "id": "auth-signinwithotp", + "title": "signInWithOtp", + "slug": "auth-signinwithotp", + "product": "auth", + "type": "function" + }, + "auth-signinwithpasskey": { + "id": "auth-signinwithpasskey", + "title": "signInWithPasskey", + "slug": "auth-signinwithpasskey", + "product": "auth", + "type": "function" + }, + "auth-signinwithpassword": { + "id": "auth-signinwithpassword", + "title": "signInWithPassword", + "slug": "auth-signinwithpassword", + "product": "auth", + "type": "function" + }, + "auth-signinwithsso": { + "id": "auth-signinwithsso", + "title": "signInWithSSO", + "slug": "auth-signinwithsso", + "product": "auth", + "type": "function" + }, + "auth-signinwithweb3": { + "id": "auth-signinwithweb3", + "title": "signInWithWeb3", + "slug": "auth-signinwithweb3", + "product": "auth", + "type": "function" + }, + "auth-signout": { + "id": "auth-signout", + "title": "signOut", + "slug": "auth-signout", + "product": "auth", + "type": "function" + }, + "auth-signup": { + "id": "auth-signup", + "title": "signUp", + "slug": "auth-signup", + "product": "auth", + "type": "function" + }, + "auth-startautorefresh": { + "id": "auth-startautorefresh", + "title": "startAutoRefresh", + "slug": "auth-startautorefresh", + "product": "auth", + "type": "function" + }, + "auth-stopautorefresh": { + "id": "auth-stopautorefresh", + "title": "stopAutoRefresh", + "slug": "auth-stopautorefresh", + "product": "auth", + "type": "function" + }, + "auth-unlinkidentity": { + "id": "auth-unlinkidentity", + "title": "unlinkIdentity", + "slug": "auth-unlinkidentity", + "product": "auth", + "type": "function" + }, + "auth-updateuser": { + "id": "auth-updateuser", + "title": "updateUser", + "slug": "auth-updateuser", + "product": "auth", + "type": "function" + }, + "auth-verifyotp": { + "id": "auth-verifyotp", + "title": "verifyOtp", + "slug": "auth-verifyotp", + "product": "auth", + "type": "function" + }, + "auth-admin": { + "id": "auth-admin", + "title": "Overview", + "slug": "auth-admin", + "type": "function" + }, + "auth-admin-createprovider": { + "id": "auth-admin-createprovider", + "title": "createProvider", + "slug": "auth-admin-createprovider", + "product": "auth", + "type": "function" + }, + "auth-admin-createuser": { + "id": "auth-admin-createuser", + "title": "createUser", + "slug": "auth-admin-createuser", + "product": "auth", + "type": "function" + }, + "auth-admin-deletefactor": { + "id": "auth-admin-deletefactor", + "title": "deleteFactor", + "slug": "auth-admin-deletefactor", + "product": "auth", + "type": "function" + }, + "auth-admin-deleteprovider": { + "id": "auth-admin-deleteprovider", + "title": "deleteProvider", + "slug": "auth-admin-deleteprovider", + "product": "auth", + "type": "function" + }, + "auth-admin-deleteuser": { + "id": "auth-admin-deleteuser", + "title": "deleteUser", + "slug": "auth-admin-deleteuser", + "product": "auth", + "type": "function" + }, + "auth-admin-generatelink": { + "id": "auth-admin-generatelink", + "title": "generateLink", + "slug": "auth-admin-generatelink", + "product": "auth", + "type": "function" + }, + "auth-admin-getprovider": { + "id": "auth-admin-getprovider", + "title": "getProvider", + "slug": "auth-admin-getprovider", + "product": "auth", + "type": "function" + }, + "auth-admin-getuserbyid": { + "id": "auth-admin-getuserbyid", + "title": "getUserById", + "slug": "auth-admin-getuserbyid", + "product": "auth", + "type": "function" + }, + "auth-admin-inviteuserbyemail": { + "id": "auth-admin-inviteuserbyemail", + "title": "inviteUserByEmail", + "slug": "auth-admin-inviteuserbyemail", + "product": "auth", + "type": "function" + }, + "auth-admin-listfactors": { + "id": "auth-admin-listfactors", + "title": "listFactors", + "slug": "auth-admin-listfactors", + "product": "auth", + "type": "function" + }, + "auth-admin-listproviders": { + "id": "auth-admin-listproviders", + "title": "listProviders", + "slug": "auth-admin-listproviders", + "product": "auth", + "type": "function" + }, + "auth-admin-listusers": { + "id": "auth-admin-listusers", + "title": "listUsers", + "slug": "auth-admin-listusers", + "product": "auth", + "type": "function" + }, + "auth-admin-signout": { + "id": "auth-admin-signout", + "title": "signOut", + "slug": "auth-admin-signout", + "product": "auth", + "type": "function" + }, + "auth-admin-updateprovider": { + "id": "auth-admin-updateprovider", + "title": "updateProvider", + "slug": "auth-admin-updateprovider", + "product": "auth", + "type": "function" + }, + "auth-admin-updateuserbyid": { + "id": "auth-admin-updateuserbyid", + "title": "updateUserById", + "slug": "auth-admin-updateuserbyid", + "product": "auth", + "type": "function" + }, + "auth-mfa": { + "id": "auth-mfa", + "title": "Auth MFA", + "slug": "auth-mfa", + "type": "function" + }, + "auth-mfa-challenge": { + "id": "auth-mfa-challenge", + "title": "challenge", + "slug": "auth-mfa-challenge", + "product": "auth", + "type": "function" + }, + "auth-mfa-challengeandverify": { + "id": "auth-mfa-challengeandverify", + "title": "challengeAndVerify", + "slug": "auth-mfa-challengeandverify", + "product": "auth", + "type": "function" + }, + "auth-mfa-enroll": { + "id": "auth-mfa-enroll", + "title": "enroll", + "slug": "auth-mfa-enroll", + "product": "auth", + "type": "function" + }, + "auth-mfa-getauthenticatorassurancelevel": { + "id": "auth-mfa-getauthenticatorassurancelevel", + "title": "getAuthenticatorAssuranceLevel", + "slug": "auth-mfa-getauthenticatorassurancelevel", + "product": "auth", + "type": "function" + }, + "auth-mfa-listfactors": { + "id": "auth-mfa-listfactors", + "title": "listFactors", + "slug": "auth-mfa-listfactors", + "product": "auth", + "type": "function" + }, + "auth-mfa-unenroll": { + "id": "auth-mfa-unenroll", + "title": "unenroll", + "slug": "auth-mfa-unenroll", + "product": "auth", + "type": "function" + }, + "auth-mfa-verify": { + "id": "auth-mfa-verify", + "title": "verify", + "slug": "auth-mfa-verify", + "product": "auth", + "type": "function" + }, + "auth-passkey": { + "id": "auth-passkey", + "title": "Auth Passkey", + "slug": "auth-passkey", + "type": "function" + }, + "auth-passkey-delete": { + "id": "auth-passkey-delete", + "title": "delete", + "slug": "auth-passkey-delete", + "product": "auth", + "type": "function" + }, + "auth-passkey-list": { + "id": "auth-passkey-list", + "title": "list", + "slug": "auth-passkey-list", + "product": "auth", + "type": "function" + }, + "auth-passkey-startauthentication": { + "id": "auth-passkey-startauthentication", + "title": "startAuthentication", + "slug": "auth-passkey-startauthentication", + "product": "auth", + "type": "function" + }, + "auth-passkey-startregistration": { + "id": "auth-passkey-startregistration", + "title": "startRegistration", + "slug": "auth-passkey-startregistration", + "product": "auth", + "type": "function" + }, + "auth-passkey-update": { + "id": "auth-passkey-update", + "title": "update", + "slug": "auth-passkey-update", + "product": "auth", + "type": "function" + }, + "auth-passkey-verifyauthentication": { + "id": "auth-passkey-verifyauthentication", + "title": "verifyAuthentication", + "slug": "auth-passkey-verifyauthentication", + "product": "auth", + "type": "function" + }, + "auth-passkey-verifyregistration": { + "id": "auth-passkey-verifyregistration", + "title": "verifyRegistration", + "slug": "auth-passkey-verifyregistration", + "product": "auth", + "type": "function" + }, + "oauth-admin": { + "id": "oauth-admin", + "title": "OAuth Admin", + "slug": "oauth-admin", + "type": "function" + }, + "oauth-admin-createclient": { + "id": "oauth-admin-createclient", + "title": "createClient", + "slug": "oauth-admin-createclient", + "product": "auth", + "type": "function" + }, + "oauth-admin-deleteclient": { + "id": "oauth-admin-deleteclient", + "title": "deleteClient", + "slug": "oauth-admin-deleteclient", + "product": "auth", + "type": "function" + }, + "oauth-admin-getclient": { + "id": "oauth-admin-getclient", + "title": "getClient", + "slug": "oauth-admin-getclient", + "product": "auth", + "type": "function" + }, + "oauth-admin-listclients": { + "id": "oauth-admin-listclients", + "title": "listClients", + "slug": "oauth-admin-listclients", + "product": "auth", + "type": "function" + }, + "oauth-admin-regenerateclientsecret": { + "id": "oauth-admin-regenerateclientsecret", + "title": "regenerateClientSecret", + "slug": "oauth-admin-regenerateclientsecret", + "product": "auth", + "type": "function" + }, + "oauth-admin-updateclient": { + "id": "oauth-admin-updateclient", + "title": "updateClient", + "slug": "oauth-admin-updateclient", + "product": "auth", + "type": "function" + }, + "oauth-server": { + "id": "oauth-server", + "title": "OAuth Server", + "slug": "oauth-server", + "type": "function" + }, + "oauth-server-approveauthorization": { + "id": "oauth-server-approveauthorization", + "title": "approveAuthorization", + "slug": "oauth-server-approveauthorization", + "product": "auth", + "type": "function" + }, + "oauth-server-denyauthorization": { + "id": "oauth-server-denyauthorization", + "title": "denyAuthorization", + "slug": "oauth-server-denyauthorization", + "product": "auth", + "type": "function" + }, + "oauth-server-getauthorizationdetails": { + "id": "oauth-server-getauthorizationdetails", + "title": "getAuthorizationDetails", + "slug": "oauth-server-getauthorizationdetails", + "product": "auth", + "type": "function" + }, + "oauth-server-listgrants": { + "id": "oauth-server-listgrants", + "title": "listGrants", + "slug": "oauth-server-listgrants", + "product": "auth", + "type": "function" + }, + "oauth-server-revokegrant": { + "id": "oauth-server-revokegrant", + "title": "revokeGrant", + "slug": "oauth-server-revokegrant", + "product": "auth", + "type": "function" + }, + "passkey-admin": { + "id": "passkey-admin", + "title": "Passkey admin", + "slug": "passkey-admin", + "type": "function" + }, + "passkey-admin-deletepasskey": { + "id": "passkey-admin-deletepasskey", + "title": "deletePasskey", + "slug": "passkey-admin-deletepasskey", + "product": "auth", + "type": "function" + }, + "passkey-admin-listpasskeys": { + "id": "passkey-admin-listpasskeys", + "title": "listPasskeys", + "slug": "passkey-admin-listpasskeys", + "product": "auth", + "type": "function" + }, + "functions": { + "type": "category", + "title": "Edge Functions" + }, + "functions-corsheaders": { + "id": "functions-corsheaders", + "title": "corsHeaders", + "slug": "functions-corsheaders", + "product": "edge-functions", + "type": "function" + }, + "functions-invoke": { + "id": "functions-invoke", + "title": "invoke", + "slug": "functions-invoke", + "product": "edge-functions", + "type": "function" + }, + "functions-setauth": { + "id": "functions-setauth", + "title": "setAuth", + "slug": "functions-setauth", + "product": "edge-functions", + "type": "function" + }, + "realtime": { + "type": "category", + "title": "Realtime" + }, + "channel": { + "id": "channel", + "title": "channel", + "slug": "channel", + "product": "realtime", + "type": "function" + }, + "connect": { + "id": "connect", + "title": "connect", + "slug": "connect", + "product": "realtime", + "type": "function" + }, + "connectionstate": { + "id": "connectionstate", + "title": "connectionState", + "slug": "connectionstate", + "product": "realtime", + "type": "function" + }, + "disconnect": { + "id": "disconnect", + "title": "disconnect", + "slug": "disconnect", + "product": "realtime", + "type": "function" + }, + "endpointurl": { + "id": "endpointurl", + "title": "endpointURL", + "slug": "endpointurl", + "product": "realtime", + "type": "function" + }, + "getchannels": { + "id": "getchannels", + "title": "getChannels", + "slug": "getchannels", + "product": "realtime", + "type": "function" + }, + "getwebsocketconstructor": { + "id": "getwebsocketconstructor", + "title": "getWebSocketConstructor", + "slug": "getwebsocketconstructor", + "product": "realtime", + "type": "function" + }, + "httpsend": { + "id": "httpsend", + "title": "httpSend", + "slug": "httpsend", + "product": "realtime", + "type": "function" + }, + "isconnected": { + "id": "isconnected", + "title": "isConnected", + "slug": "isconnected", + "product": "realtime", + "type": "function" + }, + "isconnecting": { + "id": "isconnecting", + "title": "isConnecting", + "slug": "isconnecting", + "product": "realtime", + "type": "function" + }, + "isdisconnecting": { + "id": "isdisconnecting", + "title": "isDisconnecting", + "slug": "isdisconnecting", + "product": "realtime", + "type": "function" + }, + "iswebsocketsupported": { + "id": "iswebsocketsupported", + "title": "isWebSocketSupported", + "slug": "iswebsocketsupported", + "product": "realtime", + "type": "function" + }, + "log": { + "id": "log", + "title": "log", + "slug": "log", + "product": "realtime", + "type": "function" + }, + "on": { + "id": "on", + "title": "on", + "slug": "on", + "product": "realtime", + "type": "function" + }, + "onheartbeat": { + "id": "onheartbeat", + "title": "onHeartbeat", + "slug": "onheartbeat", + "product": "realtime", + "type": "function" + }, + "presencestate": { + "id": "presencestate", + "title": "presenceState", + "slug": "presencestate", + "product": "realtime", + "type": "function" + }, + "push": { + "id": "push", + "title": "push", + "slug": "push", + "product": "realtime", + "type": "function" + }, + "removeallchannels": { + "id": "removeallchannels", + "title": "removeAllChannels", + "slug": "removeallchannels", + "product": "realtime", + "type": "function" + }, + "removechannel": { + "id": "removechannel", + "title": "removeChannel", + "slug": "removechannel", + "product": "realtime", + "type": "function" + }, + "send": { + "id": "send", + "title": "send", + "slug": "send", + "product": "realtime", + "type": "function" + }, + "sendheartbeat": { + "id": "sendheartbeat", + "title": "sendHeartbeat", + "slug": "sendheartbeat", + "product": "realtime", + "type": "function" + }, + "setauth": { + "id": "setauth", + "title": "setAuth", + "slug": "setauth", + "product": "realtime", + "type": "function" + }, + "subscribe": { + "id": "subscribe", + "title": "subscribe", + "slug": "subscribe", + "product": "realtime", + "type": "function" + }, + "teardown": { + "id": "teardown", + "title": "teardown", + "slug": "teardown", + "product": "realtime", + "type": "function" + }, + "track": { + "id": "track", + "title": "track", + "slug": "track", + "product": "realtime", + "type": "function" + }, + "unsubscribe": { + "id": "unsubscribe", + "title": "unsubscribe", + "slug": "unsubscribe", + "product": "realtime", + "type": "function" + }, + "untrack": { + "id": "untrack", + "title": "untrack", + "slug": "untrack", + "product": "realtime", + "type": "function" + }, + "updatejoinpayload": { + "id": "updatejoinpayload", + "title": "updateJoinPayload", + "slug": "updatejoinpayload", + "product": "realtime", + "type": "function" + }, + "storage": { + "type": "category", + "title": "Storage" + }, + "analytics-buckets": { + "id": "analytics-buckets", + "title": "Analytics Buckets", + "slug": "analytics-buckets", + "type": "function" + }, + "analytics-buckets-createbucket": { + "id": "analytics-buckets-createbucket", + "title": "createBucket", + "slug": "analytics-buckets-createbucket", + "product": "storage", + "type": "function" + }, + "analytics-buckets-deletebucket": { + "id": "analytics-buckets-deletebucket", + "title": "deleteBucket", + "slug": "analytics-buckets-deletebucket", + "product": "storage", + "type": "function" + }, + "analytics-buckets-from": { + "id": "analytics-buckets-from", + "title": "from", + "slug": "analytics-buckets-from", + "product": "storage", + "type": "function" + }, + "analytics-buckets-listbuckets": { + "id": "analytics-buckets-listbuckets", + "title": "listBuckets", + "slug": "analytics-buckets-listbuckets", + "product": "storage", + "type": "function" + }, + "file-buckets": { + "id": "file-buckets", + "title": "File Buckets", + "slug": "file-buckets", + "type": "function" + }, + "file-buckets-copy": { + "id": "file-buckets-copy", + "title": "copy", + "slug": "file-buckets-copy", + "product": "storage", + "type": "function" + }, + "file-buckets-createbucket": { + "id": "file-buckets-createbucket", + "title": "createBucket", + "slug": "file-buckets-createbucket", + "product": "storage", + "type": "function" + }, + "file-buckets-createsigneduploadurl": { + "id": "file-buckets-createsigneduploadurl", + "title": "createSignedUploadUrl", + "slug": "file-buckets-createsigneduploadurl", + "product": "storage", + "type": "function" + }, + "file-buckets-createsignedurl": { + "id": "file-buckets-createsignedurl", + "title": "createSignedUrl", + "slug": "file-buckets-createsignedurl", + "product": "storage", + "type": "function" + }, + "file-buckets-createsignedurls": { + "id": "file-buckets-createsignedurls", + "title": "createSignedUrls", + "slug": "file-buckets-createsignedurls", + "product": "storage", + "type": "function" + }, + "file-buckets-deletebucket": { + "id": "file-buckets-deletebucket", + "title": "deleteBucket", + "slug": "file-buckets-deletebucket", + "product": "storage", + "type": "function" + }, + "file-buckets-download": { + "id": "file-buckets-download", + "title": "download", + "slug": "file-buckets-download", + "product": "storage", + "type": "function" + }, + "file-buckets-emptybucket": { + "id": "file-buckets-emptybucket", + "title": "emptyBucket", + "slug": "file-buckets-emptybucket", + "product": "storage", + "type": "function" + }, + "file-buckets-exists": { + "id": "file-buckets-exists", + "title": "exists", + "slug": "file-buckets-exists", + "product": "storage", + "type": "function" + }, + "file-buckets-from": { + "id": "file-buckets-from", + "title": "from", + "slug": "file-buckets-from", + "product": "storage", + "type": "function" + }, + "file-buckets-getbucket": { + "id": "file-buckets-getbucket", + "title": "getBucket", + "slug": "file-buckets-getbucket", + "product": "storage", + "type": "function" + }, + "file-buckets-getpublicurl": { + "id": "file-buckets-getpublicurl", + "title": "getPublicUrl", + "slug": "file-buckets-getpublicurl", + "product": "storage", + "type": "function" + }, + "file-buckets-info": { + "id": "file-buckets-info", + "title": "info", + "slug": "file-buckets-info", + "product": "storage", + "type": "function" + }, + "file-buckets-list": { + "id": "file-buckets-list", + "title": "list", + "slug": "file-buckets-list", + "product": "storage", + "type": "function" + }, + "file-buckets-listbuckets": { + "id": "file-buckets-listbuckets", + "title": "listBuckets", + "slug": "file-buckets-listbuckets", + "product": "storage", + "type": "function" + }, + "file-buckets-listv2": { + "id": "file-buckets-listv2", + "title": "listV2", + "slug": "file-buckets-listv2", + "product": "storage", + "type": "function" + }, + "file-buckets-move": { + "id": "file-buckets-move", + "title": "move", + "slug": "file-buckets-move", + "product": "storage", + "type": "function" + }, + "file-buckets-remove": { + "id": "file-buckets-remove", + "title": "remove", + "slug": "file-buckets-remove", + "product": "storage", + "type": "function" + }, + "file-buckets-update": { + "id": "file-buckets-update", + "title": "update", + "slug": "file-buckets-update", + "product": "storage", + "type": "function" + }, + "file-buckets-updatebucket": { + "id": "file-buckets-updatebucket", + "title": "updateBucket", + "slug": "file-buckets-updatebucket", + "product": "storage", + "type": "function" + }, + "file-buckets-upload": { + "id": "file-buckets-upload", + "title": "upload", + "slug": "file-buckets-upload", + "product": "storage", + "type": "function" + }, + "file-buckets-uploadtosignedurl": { + "id": "file-buckets-uploadtosignedurl", + "title": "uploadToSignedUrl", + "slug": "file-buckets-uploadtosignedurl", + "product": "storage", + "type": "function" + }, + "vector-buckets": { + "id": "vector-buckets", + "title": "Vector Buckets", + "slug": "vector-buckets", + "type": "function" + }, + "vector-buckets-createbucket": { + "id": "vector-buckets-createbucket", + "title": "createBucket", + "slug": "vector-buckets-createbucket", + "product": "storage", + "type": "function" + }, + "vector-buckets-createindex": { + "id": "vector-buckets-createindex", + "title": "createIndex", + "slug": "vector-buckets-createindex", + "product": "storage", + "type": "function" + }, + "vector-buckets-deletebucket": { + "id": "vector-buckets-deletebucket", + "title": "deleteBucket", + "slug": "vector-buckets-deletebucket", + "product": "storage", + "type": "function" + }, + "vector-buckets-deleteindex": { + "id": "vector-buckets-deleteindex", + "title": "deleteIndex", + "slug": "vector-buckets-deleteindex", + "product": "storage", + "type": "function" + }, + "vector-buckets-deletevectors": { + "id": "vector-buckets-deletevectors", + "title": "deleteVectors", + "slug": "vector-buckets-deletevectors", + "product": "storage", + "type": "function" + }, + "vector-buckets-from": { + "id": "vector-buckets-from", + "title": "from", + "slug": "vector-buckets-from", + "product": "storage", + "type": "function" + }, + "vector-buckets-getbucket": { + "id": "vector-buckets-getbucket", + "title": "getBucket", + "slug": "vector-buckets-getbucket", + "product": "storage", + "type": "function" + }, + "vector-buckets-getindex": { + "id": "vector-buckets-getindex", + "title": "getIndex", + "slug": "vector-buckets-getindex", + "product": "storage", + "type": "function" + }, + "vector-buckets-getvectors": { + "id": "vector-buckets-getvectors", + "title": "getVectors", + "slug": "vector-buckets-getvectors", + "product": "storage", + "type": "function" + }, + "vector-buckets-index": { + "id": "vector-buckets-index", + "title": "index", + "slug": "vector-buckets-index", + "product": "storage", + "type": "function" + }, + "vector-buckets-listbuckets": { + "id": "vector-buckets-listbuckets", + "title": "listBuckets", + "slug": "vector-buckets-listbuckets", + "product": "storage", + "type": "function" + }, + "vector-buckets-listindexes": { + "id": "vector-buckets-listindexes", + "title": "listIndexes", + "slug": "vector-buckets-listindexes", + "product": "storage", + "type": "function" + }, + "vector-buckets-listvectors": { + "id": "vector-buckets-listvectors", + "title": "listVectors", + "slug": "vector-buckets-listvectors", + "product": "storage", + "type": "function" + }, + "vector-buckets-putvectors": { + "id": "vector-buckets-putvectors", + "title": "putVectors", + "slug": "vector-buckets-putvectors", + "product": "storage", + "type": "function" + }, + "vector-buckets-queryvectors": { + "id": "vector-buckets-queryvectors", + "title": "queryVectors", + "slug": "vector-buckets-queryvectors", + "product": "storage", + "type": "function" + } + }, + "flat": [ + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]" + ], + "sections": [ + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + { + "type": "category", + "title": "Database", + "items": [ + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + { + "id": "using-filters", + "isFunc": false, + "title": "Using filters", + "slug": "using-filters", + "product": "database", + "type": "function", + "items": [ + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + { + "id": "using-modifiers", + "isFunc": false, + "title": "Using modifiers", + "slug": "using-modifiers", + "product": "database", + "type": "function", + "items": [ + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]" + ] + } + ] + }, + { + "type": "category", + "title": "Auth", + "items": [ + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + { + "id": "auth-admin", + "isFunc": false, + "title": "Auth Admin", + "slug": "auth-admin", + "product": "auth", + "type": "function", + "items": [ + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + { + "id": "auth-mfa", + "isFunc": false, + "title": "Auth MFA", + "slug": "auth-mfa", + "product": "auth", + "type": "function", + "items": [ + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + { + "id": "auth-passkey", + "isFunc": false, + "title": "Auth Passkey", + "slug": "auth-passkey", + "product": "auth", + "type": "function", + "items": [ + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + { + "id": "oauth-admin", + "isFunc": false, + "title": "OAuth Admin", + "slug": "oauth-admin", + "product": "auth", + "type": "function", + "items": [ + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + { + "id": "oauth-server", + "isFunc": false, + "title": "OAuth Server", + "slug": "oauth-server", + "product": "auth", + "type": "function", + "items": [ + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + { + "id": "passkey-admin", + "isFunc": false, + "title": "Passkey Admin", + "slug": "passkey-admin", + "product": "auth", + "type": "function", + "items": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + } + ] + }, + { + "type": "category", + "title": "Edge Functions", + "items": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + { + "type": "category", + "title": "Realtime", + "items": [ + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + { + "type": "category", + "title": "Storage", + "items": [ + { + "id": "analytics-buckets", + "isFunc": false, + "title": "Analytics Buckets", + "slug": "analytics-buckets", + "product": "storage", + "type": "function", + "items": [ + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + { + "id": "file-buckets", + "isFunc": false, + "title": "File Buckets", + "slug": "file-buckets", + "product": "storage", + "type": "function", + "items": [ + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + { + "id": "vector-buckets", + "isFunc": false, + "title": "Vector Buckets", + "slug": "vector-buckets", + "product": "storage", + "type": "function", + "items": [ + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]" + ] + } + ] + } + ], + "functionsList": [ + { + "id": "initializing", + "$ref": "@supabase/supabase-js.SupabaseClient.constructor" + }, + { + "id": "delete", + "$ref": "@supabase/postgrest-js.PostgrestQueryBuilder.delete" + }, + { + "id": "from", + "$ref": "@supabase/postgrest-js.PostgrestClient.from" + }, + { + "id": "insert", + "$ref": "@supabase/postgrest-js.PostgrestQueryBuilder.insert" + }, + { + "id": "rpc", + "$ref": "@supabase/postgrest-js.PostgrestClient.rpc" + }, + { + "id": "schema", + "$ref": "@supabase/postgrest-js.PostgrestClient.schema" + }, + { + "id": "select", + "$ref": "@supabase/postgrest-js.PostgrestQueryBuilder.select" + }, + { + "id": "update", + "$ref": "@supabase/postgrest-js.PostgrestQueryBuilder.update" + }, + { + "id": "upsert", + "$ref": "@supabase/postgrest-js.PostgrestQueryBuilder.upsert" + }, + { + "id": "using-filters", + "title": "Using Filters", + "description": "Filters allow you to only return rows that match certain conditions.\n\nFilters can be used on `select()`, `update()`, `upsert()`, and `delete()` queries.\n\nIf a Postgres function returns a table response, you can also apply filters.\n", + "examples": [ + { + "id": "applying-filters", + "name": "Applying Filters", + "description": "Filters must be applied after any of `select()`, `update()`, `upsert()`,\n`delete()`, and `rpc()` and before\n[modifiers](/docs/reference/javascript/using-modifiers).\n", + "code": "```ts\nconst { data, error } = await supabase\n .from('instruments')\n .select('name, section_id')\n .eq('name', 'violin') // Correct\n\nconst { data, error } = await supabase\n .from('instruments')\n .eq('name', 'violin') // Incorrect\n .select('name, section_id')\n```\n" + }, + { + "id": "chaining-filters", + "name": "Chaining", + "description": "Filters can be chained together to produce advanced queries. For example,\nto query cities with population between 1,000 and 10,000:\n\n```ts\nconst { data, error } = await supabase\n .from('cities')\n .select('name, country_id')\n .gte('population', 1000)\n .lt('population', 10000)\n```\n", + "code": "```ts\nconst { data, error } = await supabase\n .from('cities')\n .select('name, country_id')\n .gte('population', 1000)\n .lt('population', 10000)\n```\n" + }, + { + "id": "conditional-chaining", + "name": "Conditional Chaining", + "description": "Filters can be built up one step at a time and then executed. For example:\n\n```ts\nconst filterByName = null\nconst filterPopLow = 1000\nconst filterPopHigh = 10000\n\nlet query = supabase\n .from('cities')\n .select('name, country_id')\n\nif (filterByName) { query = query.eq('name', filterByName) }\nif (filterPopLow) { query = query.gte('population', filterPopLow) }\nif (filterPopHigh) { query = query.lt('population', filterPopHigh) }\n\nconst { data, error } = await query\n```\n", + "code": "```ts\nconst filterByName = null\nconst filterPopLow = 1000\nconst filterPopHigh = 10000\n\nlet query = supabase\n .from('cities')\n .select('name, country_id')\n\nif (filterByName) { query = query.eq('name', filterByName) }\nif (filterPopLow) { query = query.gte('population', filterPopLow) }\nif (filterPopHigh) { query = query.lt('population', filterPopHigh) }\n\nconst { data, error } = await query\n```\n" + }, + { + "id": "filter-by-value-within-json-column", + "name": "Filter by values within a JSON column", + "code": "```ts\nconst { data, error } = await supabase\n .from('users')\n .select()\n .eq('address->postcode', 90210)\n```\n", + "data": { + "sql": "```sql\ncreate table\n users (\n id int8 primary key,\n name text,\n address jsonb\n );\n\ninsert into\n users (id, name, address)\nvalues\n (1, 'Michael', '{ \"postcode\": 90210 }'),\n (2, 'Jane', null);\n```\n" + }, + "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"Michael\",\n \"address\": {\n \"postcode\": 90210\n }\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```\n" + }, + { + "id": "filter-referenced-tables", + "name": "Filter referenced tables", + "code": "```ts\nconst { data, error } = await supabase\n .from('orchestral_sections')\n .select(`\n name,\n instruments!inner (\n name\n )\n `)\n .eq('instruments.name', 'flute')\n```\n", + "data": { + "sql": "```sql\ncreate table\n orchestral_sections (id int8 primary key, name text);\ncreate table\n instruments (\n id int8 primary key,\n section_id int8 not null references orchestral_sections,\n name text\n );\n\ninsert into\n orchestral_sections (id, name)\nvalues\n (1, 'strings'),\n (2, 'woodwinds');\ninsert into\n instruments (id, section_id, name)\nvalues\n (1, 2, 'flute'),\n (2, 1, 'violin');\n```\n", + "response": "```json\n{\n \"data\": [\n {\n \"name\": \"woodwinds\",\n \"characters\": [\n {\n \"name\": \"flute\"\n }\n ]\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```\n" + }, + "description": "You can filter on referenced tables in your `select()` query using dot\nnotation.\n" + } + ] + }, + { + "id": "using-filters-containedby", + "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.containedBy" + }, + { + "id": "using-filters-contains", + "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.contains" + }, + { + "id": "using-filters-eq", + "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.eq" + }, + { + "id": "using-filters-filter", + "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.filter" + }, + { + "id": "using-filters-gt", + "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.gt" + }, + { + "id": "using-filters-gte", + "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.gte" + }, + { + "id": "using-filters-ilike", + "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.ilike" + }, + { + "id": "using-filters-ilikeallof", + "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.ilikeAllOf" + }, + { + "id": "using-filters-ilikeanyof", + "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.ilikeAnyOf" + }, + { + "id": "using-filters-in", + "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.in" + }, + { + "id": "using-filters-is", + "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.is" + }, + { + "id": "using-filters-like", + "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.like" + }, + { + "id": "using-filters-likeallof", + "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.likeAllOf" + }, + { + "id": "using-filters-likeanyof", + "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.likeAnyOf" + }, + { + "id": "using-filters-lt", + "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.lt" + }, + { + "id": "using-filters-lte", + "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.lte" + }, + { + "id": "using-filters-match", + "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.match" + }, + { + "id": "using-filters-neq", + "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.neq" + }, + { + "id": "using-filters-not", + "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.not" + }, + { + "id": "using-filters-or", + "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.or" + }, + { + "id": "using-filters-overlaps", + "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.overlaps" + }, + { + "id": "using-filters-rangeadjacent", + "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.rangeAdjacent" + }, + { + "id": "using-filters-rangegt", + "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.rangeGt" + }, + { + "id": "using-filters-rangegte", + "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.rangeGte" + }, + { + "id": "using-filters-rangelt", + "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.rangeLt" + }, + { + "id": "using-filters-rangelte", + "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.rangeLte" + }, + { + "id": "using-filters-textsearch", + "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.textSearch" + }, + { + "id": "using-modifiers", + "title": "Using modifiers", + "description": "Filters work on the row level—they allow you to return rows that only match certain conditions without changing the shape of the rows. Modifiers are everything that don't fit that definition—allowing you to change the format of the response (e.g., returning a CSV string).\n\nModifiers must be specified after filters. Some modifiers only apply for queries that return rows (e.g., `select()` or `rpc()` on a function that returns a table response)." + }, + { + "id": "using-modifiers-abortsignal", + "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.abortSignal" + }, + { + "id": "using-modifiers-csv", + "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.csv" + }, + { + "id": "using-modifiers-explain", + "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.explain" + }, + { + "id": "using-modifiers-geojson", + "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.geojson" + }, + { + "id": "using-modifiers-limit", + "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.limit" + }, + { + "id": "using-modifiers-maxaffected", + "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.maxAffected" + }, + { + "id": "using-modifiers-maybesingle", + "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.maybeSingle" + }, + { + "id": "using-modifiers-order", + "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.order" + }, + { + "id": "using-modifiers-overridetypes", + "$ref": "@supabase/postgrest-js.PostgrestBuilder.overrideTypes" + }, + { + "id": "using-modifiers-range", + "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.range" + }, + { + "id": "using-modifiers-retry", + "$ref": "@supabase/postgrest-js.PostgrestBuilder.retry" + }, + { + "id": "using-modifiers-returns", + "$ref": "@supabase/postgrest-js.PostgrestBuilder.returns" + }, + { + "id": "using-modifiers-rollback", + "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.rollback" + }, + { + "id": "using-modifiers-select", + "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.select" + }, + { + "id": "using-modifiers-setheader", + "$ref": "@supabase/postgrest-js.PostgrestBuilder.setHeader" + }, + { + "id": "using-modifiers-single", + "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.single" + }, + { + "id": "using-modifiers-stripnulls", + "$ref": "@supabase/postgrest-js.PostgrestBuilder.stripNulls" + }, + { + "id": "using-modifiers-throwonerror", + "$ref": "@supabase/postgrest-js.PostgrestBuilder.throwOnError" + }, + { + "id": "auth", + "title": "Overview", + "notes": "- The auth methods can be accessed via the `supabase.auth` namespace.\n- By default, the supabase client sets `persistSession` to true and attempts to store the session in local storage. When using the supabase client in an environment that doesn't support local storage, you might notice the following warning message being logged:\n\n > No storage option exists to persist the session, which may result in unexpected behavior when using auth. If you want to set `persistSession` to true, please provide a storage option or you may set `persistSession` to false to disable this warning.\n\n This warning message can be safely ignored if you're not using auth on the server-side. If you are using auth and you want to set `persistSession` to true, you will need to provide a custom storage implementation that follows [this interface](https://github.com/supabase/supabase-js/blob/master/packages/core/auth-js/src/lib/types.ts#L1053).\n- Any email links and one-time passwords (OTPs) sent have a default expiry of 24 hours. We have the following [rate limits](/docs/guides/platform/going-into-prod#auth-rate-limits) in place to guard against brute force attacks.\n- The expiry of an access token can be set in the \"JWT expiry limit\" field in [your project's auth settings](/dashboard/project/_/auth/providers). A refresh token never expires and can only be used once.\n", + "examples": [ + { + "id": "create-auth-client", + "name": "Create auth client", + "isSpotlight": true, + "code": "```js\nimport { createClient } from '@supabase/supabase-js'\n\nconst supabase = createClient(supabase_url, publishable_key)\n```\n" + }, + { + "id": "create-auth-client-server-side", + "name": "Create auth client (server-side)", + "isSpotlight": false, + "code": "```js\nimport { createClient } from '@supabase/supabase-js'\n\nconst supabase = createClient(supabase_url, publishable_key, {\n auth: {\n autoRefreshToken: false,\n persistSession: false,\n detectSessionInUrl: false\n }\n})\n```\n" + } + ] + }, + { + "id": "auth-dispose", + "$ref": "@supabase/auth-js.GoTrueClient.dispose" + }, + { + "id": "auth-exchangecodeforsession", + "$ref": "@supabase/auth-js.GoTrueClient.exchangeCodeForSession" + }, + { + "id": "auth-getclaims", + "$ref": "@supabase/auth-js.GoTrueClient.getClaims" + }, + { + "id": "auth-getsession", + "$ref": "@supabase/auth-js.GoTrueClient.getSession" + }, + { + "id": "auth-getuser", + "$ref": "@supabase/auth-js.GoTrueClient.getUser" + }, + { + "id": "auth-getuseridentities", + "$ref": "@supabase/auth-js.GoTrueClient.getUserIdentities" + }, + { + "id": "auth-initialize", + "$ref": "@supabase/auth-js.GoTrueClient.initialize" + }, + { + "id": "auth-linkidentity", + "$ref": "@supabase/auth-js.GoTrueClient.linkIdentity" + }, + { + "id": "auth-onauthstatechange", + "$ref": "@supabase/auth-js.GoTrueClient.onAuthStateChange" + }, + { + "id": "auth-reauthenticate", + "$ref": "@supabase/auth-js.GoTrueClient.reauthenticate" + }, + { + "id": "auth-refreshsession", + "$ref": "@supabase/auth-js.GoTrueClient.refreshSession" + }, + { + "id": "auth-registerpasskey", + "$ref": "@supabase/auth-js.GoTrueClient.registerPasskey" + }, + { + "id": "auth-resend", + "$ref": "@supabase/auth-js.GoTrueClient.resend" + }, + { + "id": "auth-resetpasswordforemail", + "$ref": "@supabase/auth-js.GoTrueClient.resetPasswordForEmail" + }, + { + "id": "auth-setsession", + "$ref": "@supabase/auth-js.GoTrueClient.setSession" + }, + { + "id": "auth-signinanonymously", + "$ref": "@supabase/auth-js.GoTrueClient.signInAnonymously" + }, + { + "id": "auth-signinwithidtoken", + "$ref": "@supabase/auth-js.GoTrueClient.signInWithIdToken" + }, + { + "id": "auth-signinwithoauth", + "$ref": "@supabase/auth-js.GoTrueClient.signInWithOAuth" + }, + { + "id": "auth-signinwithotp", + "$ref": "@supabase/auth-js.GoTrueClient.signInWithOtp" + }, + { + "id": "auth-signinwithpasskey", + "$ref": "@supabase/auth-js.GoTrueClient.signInWithPasskey" + }, + { + "id": "auth-signinwithpassword", + "$ref": "@supabase/auth-js.GoTrueClient.signInWithPassword" + }, + { + "id": "auth-signinwithsso", + "$ref": "@supabase/auth-js.GoTrueClient.signInWithSSO" + }, + { + "id": "auth-signinwithweb3", + "$ref": "@supabase/auth-js.GoTrueClient.signInWithWeb3" + }, + { + "id": "auth-signout", + "$ref": "@supabase/auth-js.GoTrueClient.signOut" + }, + { + "id": "auth-signup", + "$ref": "@supabase/auth-js.GoTrueClient.signUp" + }, + { + "id": "auth-startautorefresh", + "$ref": "@supabase/auth-js.GoTrueClient.startAutoRefresh" + }, + { + "id": "auth-stopautorefresh", + "$ref": "@supabase/auth-js.GoTrueClient.stopAutoRefresh" + }, + { + "id": "auth-unlinkidentity", + "$ref": "@supabase/auth-js.GoTrueClient.unlinkIdentity" + }, + { + "id": "auth-updateuser", + "$ref": "@supabase/auth-js.GoTrueClient.updateUser" + }, + { + "id": "auth-verifyotp", + "$ref": "@supabase/auth-js.GoTrueClient.verifyOtp" + }, + { + "id": "auth-admin", + "title": "Overview", + "notes": "- Any method under the `supabase.auth.admin` namespace requires a `secret` key.\n- These methods are considered admin methods and should be called on a trusted server. Never expose your `secret` key in the browser.\n", + "examples": [ + { + "id": "create-auth-admin-client", + "name": "Create server-side auth client", + "isSpotlight": true, + "code": "```js\nimport { createClient } from '@supabase/supabase-js'\n\nconst supabase = createClient(supabase_url, secret_key, {\n auth: {\n autoRefreshToken: false,\n persistSession: false\n }\n})\n\n// Access auth admin api\nconst adminAuthClient = supabase.auth.admin\n```\n" + } + ] + }, + { + "id": "auth-admin-createprovider", + "$ref": "@supabase/auth-js.GoTrueAdminCustomProvidersApi.createProvider" + }, + { + "id": "auth-admin-createuser", + "$ref": "@supabase/auth-js.GoTrueAdminApi.createUser" + }, + { + "id": "auth-admin-deletefactor", + "$ref": "@supabase/auth-js.GoTrueAdminMFAApi.deleteFactor" + }, + { + "id": "auth-admin-deleteprovider", + "$ref": "@supabase/auth-js.GoTrueAdminCustomProvidersApi.deleteProvider" + }, + { + "id": "auth-admin-deleteuser", + "$ref": "@supabase/auth-js.GoTrueAdminApi.deleteUser" + }, + { + "id": "auth-admin-generatelink", + "$ref": "@supabase/auth-js.GoTrueAdminApi.generateLink" + }, + { + "id": "auth-admin-getprovider", + "$ref": "@supabase/auth-js.GoTrueAdminCustomProvidersApi.getProvider" + }, + { + "id": "auth-admin-getuserbyid", + "$ref": "@supabase/auth-js.GoTrueAdminApi.getUserById" + }, + { + "id": "auth-admin-inviteuserbyemail", + "$ref": "@supabase/auth-js.GoTrueAdminApi.inviteUserByEmail" + }, + { + "id": "auth-admin-listfactors", + "$ref": "@supabase/auth-js.GoTrueAdminMFAApi.listFactors" + }, + { + "id": "auth-admin-listproviders", + "$ref": "@supabase/auth-js.GoTrueAdminCustomProvidersApi.listProviders" + }, + { + "id": "auth-admin-listusers", + "$ref": "@supabase/auth-js.GoTrueAdminApi.listUsers" + }, + { + "id": "auth-admin-signout", + "$ref": "@supabase/auth-js.GoTrueAdminApi.signOut" + }, + { + "id": "auth-admin-updateprovider", + "$ref": "@supabase/auth-js.GoTrueAdminCustomProvidersApi.updateProvider" + }, + { + "id": "auth-admin-updateuserbyid", + "$ref": "@supabase/auth-js.GoTrueAdminApi.updateUserById" + }, + { + "id": "auth-mfa", + "title": "Auth MFA", + "description": "This section contains methods commonly used for Multi-Factor Authentication (MFA) and are invoked behind the `supabase.auth.mfa` namespace.\n\nCurrently, there is support for time-based one-time password (TOTP) and phone verification code as the 2nd factor. Recovery codes are not supported but users can enroll multiple factors, with an upper limit of 10.\n\nHaving a 2nd factor for recovery frees the user of the burden of having to store their recovery codes somewhere. It also reduces the attack surface since multiple recovery codes are usually generated compared to just having 1 backup factor.\n\nLearn more about implementing MFA in your application [in the MFA guide](https://supabase.com/docs/guides/auth/auth-mfa#overview)." + }, + { + "id": "auth-mfa-challenge", + "$ref": "@supabase/auth-js.GoTrueMFAApi.challenge" + }, + { + "id": "auth-mfa-challengeandverify", + "$ref": "@supabase/auth-js.GoTrueMFAApi.challengeAndVerify" + }, + { + "id": "auth-mfa-enroll", + "$ref": "@supabase/auth-js.GoTrueMFAApi.enroll" + }, + { + "id": "auth-mfa-getauthenticatorassurancelevel", + "$ref": "@supabase/auth-js.GoTrueMFAApi.getAuthenticatorAssuranceLevel" + }, + { + "id": "auth-mfa-listfactors", + "$ref": "@supabase/auth-js.GoTrueMFAApi.listFactors" + }, + { + "id": "auth-mfa-unenroll", + "$ref": "@supabase/auth-js.GoTrueMFAApi.unenroll" + }, + { + "id": "auth-mfa-verify", + "$ref": "@supabase/auth-js.GoTrueMFAApi.verify" + }, + { + "id": "auth-passkey", + "title": "Auth Passkey", + "description": "This section contains methods for WebAuthn passkey registration, authentication, and management. Methods are invoked behind the `supabase.auth.passkey` namespace.\n\nPasskey support is an experimental feature. Enable it when creating the client:", + "code": "```js\nconst supabase = createClient(supabaseUrl, publishableKey, {\n auth: {\n experimental: { passkey: true },\n },\n})\n```" + }, + { + "id": "auth-passkey-delete", + "$ref": "@supabase/auth-js.AuthPasskeyApi.delete" + }, + { + "id": "auth-passkey-list", + "$ref": "@supabase/auth-js.AuthPasskeyApi.list" + }, + { + "id": "auth-passkey-startauthentication", + "$ref": "@supabase/auth-js.AuthPasskeyApi.startAuthentication" + }, + { + "id": "auth-passkey-startregistration", + "$ref": "@supabase/auth-js.AuthPasskeyApi.startRegistration" + }, + { + "id": "auth-passkey-update", + "$ref": "@supabase/auth-js.AuthPasskeyApi.update" + }, + { + "id": "auth-passkey-verifyauthentication", + "$ref": "@supabase/auth-js.AuthPasskeyApi.verifyAuthentication" + }, + { + "id": "auth-passkey-verifyregistration", + "$ref": "@supabase/auth-js.AuthPasskeyApi.verifyRegistration" + }, + { + "id": "oauth-admin", + "title": "OAuth Admin", + "description": "The OAuth Admin API allows you to manage OAuth clients programmatically. Only relevant when the OAuth 2.1 server is enabled in Supabase Auth. These functions should only be called on a server. Never expose your `secret` key in the browser." + }, + { + "id": "oauth-admin-createclient", + "$ref": "@supabase/auth-js.GoTrueAdminOAuthApi.createClient" + }, + { + "id": "oauth-admin-deleteclient", + "$ref": "@supabase/auth-js.GoTrueAdminOAuthApi.deleteClient" + }, + { + "id": "oauth-admin-getclient", + "$ref": "@supabase/auth-js.GoTrueAdminOAuthApi.getClient" + }, + { + "id": "oauth-admin-listclients", + "$ref": "@supabase/auth-js.GoTrueAdminOAuthApi.listClients" + }, + { + "id": "oauth-admin-regenerateclientsecret", + "$ref": "@supabase/auth-js.GoTrueAdminOAuthApi.regenerateClientSecret" + }, + { + "id": "oauth-admin-updateclient", + "$ref": "@supabase/auth-js.GoTrueAdminOAuthApi.updateClient" + }, + { + "id": "oauth-server", + "title": "OAuth Server", + "description": "The OAuth Server API allows you to build custom OAuth consent screens for your application. Only relevant when the OAuth 2.1 server is enabled in Supabase Auth." + }, + { + "id": "oauth-server-approveauthorization", + "$ref": "@supabase/auth-js.AuthOAuthServerApi.approveAuthorization" + }, + { + "id": "oauth-server-denyauthorization", + "$ref": "@supabase/auth-js.AuthOAuthServerApi.denyAuthorization" + }, + { + "id": "oauth-server-getauthorizationdetails", + "$ref": "@supabase/auth-js.AuthOAuthServerApi.getAuthorizationDetails" + }, + { + "id": "oauth-server-listgrants", + "$ref": "@supabase/auth-js.AuthOAuthServerApi.listGrants" + }, + { + "id": "oauth-server-revokegrant", + "$ref": "@supabase/auth-js.AuthOAuthServerApi.revokeGrant" + }, + { + "id": "passkey-admin", + "title": "Passkey admin", + "description": "Contains passkey administration methods. Requires a secret key." + }, + { + "id": "passkey-admin-deletepasskey", + "$ref": "@supabase/auth-js.GoTrueAdminPasskeyApi.deletePasskey" + }, + { + "id": "passkey-admin-listpasskeys", + "$ref": "@supabase/auth-js.GoTrueAdminPasskeyApi.listPasskeys" + }, + { + "id": "functions-corsheaders", + "$ref": "@supabase/supabase-js.cors.corsHeaders" + }, + { + "id": "functions-invoke", + "$ref": "@supabase/functions-js.FunctionsClient.invoke" + }, + { + "id": "functions-setauth", + "$ref": "@supabase/functions-js.FunctionsClient.setAuth" + }, + { + "id": "channel", + "$ref": "@supabase/realtime-js.RealtimeClient.channel" + }, + { + "id": "connect", + "$ref": "@supabase/realtime-js.RealtimeClient.connect" + }, + { + "id": "connectionstate", + "$ref": "@supabase/realtime-js.RealtimeClient.connectionState" + }, + { + "id": "disconnect", + "$ref": "@supabase/realtime-js.RealtimeClient.disconnect" + }, + { + "id": "endpointurl", + "$ref": "@supabase/realtime-js.RealtimeClient.endpointURL" + }, + { + "id": "getchannels", + "$ref": "@supabase/realtime-js.RealtimeClient.getChannels" + }, + { + "id": "getwebsocketconstructor", + "$ref": "@supabase/realtime-js.WebSocketFactory.getWebSocketConstructor" + }, + { + "id": "httpsend", + "$ref": "@supabase/realtime-js.RealtimeChannel.httpSend" + }, + { + "id": "isconnected", + "$ref": "@supabase/realtime-js.RealtimeClient.isConnected" + }, + { + "id": "isconnecting", + "$ref": "@supabase/realtime-js.RealtimeClient.isConnecting" + }, + { + "id": "isdisconnecting", + "$ref": "@supabase/realtime-js.RealtimeClient.isDisconnecting" + }, + { + "id": "iswebsocketsupported", + "$ref": "@supabase/realtime-js.WebSocketFactory.isWebSocketSupported" + }, + { + "id": "log", + "$ref": "@supabase/realtime-js.RealtimeClient.log" + }, + { + "id": "on", + "$ref": "@supabase/realtime-js.RealtimeChannel.on" + }, + { + "id": "onheartbeat", + "$ref": "@supabase/realtime-js.RealtimeClient.onHeartbeat" + }, + { + "id": "presencestate", + "$ref": "@supabase/realtime-js.RealtimeChannel.presenceState" + }, + { + "id": "push", + "$ref": "@supabase/realtime-js.RealtimeClient.push" + }, + { + "id": "removeallchannels", + "$ref": "@supabase/realtime-js.RealtimeClient.removeAllChannels" + }, + { + "id": "removechannel", + "$ref": "@supabase/realtime-js.RealtimeClient.removeChannel" + }, + { + "id": "send", + "$ref": "@supabase/realtime-js.RealtimeChannel.send" + }, + { + "id": "sendheartbeat", + "$ref": "@supabase/realtime-js.RealtimeClient.sendHeartbeat" + }, + { + "id": "setauth", + "$ref": "@supabase/realtime-js.RealtimeClient.setAuth" + }, + { + "id": "subscribe", + "$ref": "@supabase/realtime-js.RealtimeChannel.subscribe" + }, + { + "id": "teardown", + "$ref": "@supabase/realtime-js.RealtimeChannel.teardown" + }, + { + "id": "track", + "$ref": "@supabase/realtime-js.RealtimeChannel.track" + }, + { + "id": "unsubscribe", + "$ref": "@supabase/realtime-js.RealtimeChannel.unsubscribe" + }, + { + "id": "untrack", + "$ref": "@supabase/realtime-js.RealtimeChannel.untrack" + }, + { + "id": "updatejoinpayload", + "$ref": "@supabase/realtime-js.RealtimeChannel.updateJoinPayload" + }, + { + "id": "analytics-buckets", + "title": "Analytics Buckets", + "description": "This section contains methods for working with Analytics Buckets." + }, + { + "id": "analytics-buckets-createbucket", + "$ref": "@supabase/storage-js.packages/StorageAnalyticsClient.default.createBucket" + }, + { + "id": "analytics-buckets-deletebucket", + "$ref": "@supabase/storage-js.packages/StorageAnalyticsClient.default.deleteBucket" + }, + { + "id": "analytics-buckets-from", + "$ref": "@supabase/storage-js.packages/StorageAnalyticsClient.default.from" + }, + { + "id": "analytics-buckets-listbuckets", + "$ref": "@supabase/storage-js.packages/StorageAnalyticsClient.default.listBuckets" + }, + { + "id": "file-buckets", + "title": "File Buckets", + "description": "This section contains methods for working with File Buckets." + }, + { + "id": "file-buckets-copy", + "$ref": "@supabase/storage-js.packages/StorageFileApi.default.copy" + }, + { + "id": "file-buckets-createbucket", + "$ref": "@supabase/storage-js.StorageClient.createBucket" + }, + { + "id": "file-buckets-createsigneduploadurl", + "$ref": "@supabase/storage-js.packages/StorageFileApi.default.createSignedUploadUrl" + }, + { + "id": "file-buckets-createsignedurl", + "$ref": "@supabase/storage-js.packages/StorageFileApi.default.createSignedUrl" + }, + { + "id": "file-buckets-createsignedurls", + "$ref": "@supabase/storage-js.packages/StorageFileApi.default.createSignedUrls" + }, + { + "id": "file-buckets-deletebucket", + "$ref": "@supabase/storage-js.StorageClient.deleteBucket" + }, + { + "id": "file-buckets-download", + "$ref": "@supabase/storage-js.packages/StorageFileApi.default.download" + }, + { + "id": "file-buckets-emptybucket", + "$ref": "@supabase/storage-js.StorageClient.emptyBucket" + }, + { + "id": "file-buckets-exists", + "$ref": "@supabase/storage-js.packages/StorageFileApi.default.exists" + }, + { + "id": "file-buckets-from", + "$ref": "@supabase/storage-js.StorageClient.from" + }, + { + "id": "file-buckets-getbucket", + "$ref": "@supabase/storage-js.StorageClient.getBucket" + }, + { + "id": "file-buckets-getpublicurl", + "$ref": "@supabase/storage-js.packages/StorageFileApi.default.getPublicUrl" + }, + { + "id": "file-buckets-info", + "$ref": "@supabase/storage-js.packages/StorageFileApi.default.info" + }, + { + "id": "file-buckets-list", + "$ref": "@supabase/storage-js.packages/StorageFileApi.default.list" + }, + { + "id": "file-buckets-listbuckets", + "$ref": "@supabase/storage-js.StorageClient.listBuckets" + }, + { + "id": "file-buckets-listv2", + "$ref": "@supabase/storage-js.packages/StorageFileApi.default.listV2" + }, + { + "id": "file-buckets-move", + "$ref": "@supabase/storage-js.packages/StorageFileApi.default.move" + }, + { + "id": "file-buckets-remove", + "$ref": "@supabase/storage-js.packages/StorageFileApi.default.remove" + }, + { + "id": "file-buckets-update", + "$ref": "@supabase/storage-js.packages/StorageFileApi.default.update" + }, + { + "id": "file-buckets-updatebucket", + "$ref": "@supabase/storage-js.StorageClient.updateBucket" + }, + { + "id": "file-buckets-upload", + "$ref": "@supabase/storage-js.packages/StorageFileApi.default.upload" + }, + { + "id": "file-buckets-uploadtosignedurl", + "$ref": "@supabase/storage-js.packages/StorageFileApi.default.uploadToSignedUrl" + }, + { + "id": "vector-buckets", + "title": "Vector Buckets", + "description": "This section contains methods for working with Vector Buckets." + }, + { + "id": "vector-buckets-createbucket", + "$ref": "@supabase/storage-js.packages/StorageVectorsClient.StorageVectorsClient.createBucket" + }, + { + "id": "vector-buckets-createindex", + "$ref": "@supabase/storage-js.packages/StorageVectorsClient.VectorBucketScope.createIndex" + }, + { + "id": "vector-buckets-deletebucket", + "$ref": "@supabase/storage-js.packages/StorageVectorsClient.StorageVectorsClient.deleteBucket" + }, + { + "id": "vector-buckets-deleteindex", + "$ref": "@supabase/storage-js.packages/StorageVectorsClient.VectorBucketScope.deleteIndex" + }, + { + "id": "vector-buckets-deletevectors", + "$ref": "@supabase/storage-js.packages/StorageVectorsClient.VectorIndexScope.deleteVectors" + }, + { + "id": "vector-buckets-from", + "$ref": "@supabase/storage-js.packages/StorageVectorsClient.StorageVectorsClient.from" + }, + { + "id": "vector-buckets-getbucket", + "$ref": "@supabase/storage-js.packages/StorageVectorsClient.StorageVectorsClient.getBucket" + }, + { + "id": "vector-buckets-getindex", + "$ref": "@supabase/storage-js.packages/StorageVectorsClient.VectorBucketScope.getIndex" + }, + { + "id": "vector-buckets-getvectors", + "$ref": "@supabase/storage-js.packages/StorageVectorsClient.VectorIndexScope.getVectors" + }, + { + "id": "vector-buckets-index", + "$ref": "@supabase/storage-js.packages/StorageVectorsClient.VectorBucketScope" + }, + { + "id": "vector-buckets-listbuckets", + "$ref": "@supabase/storage-js.packages/StorageVectorsClient.StorageVectorsClient.listBuckets" + }, + { + "id": "vector-buckets-listindexes", + "$ref": "@supabase/storage-js.packages/StorageVectorsClient.VectorBucketScope.listIndexes" + }, + { + "id": "vector-buckets-listvectors", + "$ref": "@supabase/storage-js.packages/StorageVectorsClient.VectorIndexScope.listVectors" + }, + { + "id": "vector-buckets-putvectors", + "$ref": "@supabase/storage-js.packages/StorageVectorsClient.VectorIndexScope.putVectors" + }, + { + "id": "vector-buckets-queryvectors", + "$ref": "@supabase/storage-js.packages/StorageVectorsClient.VectorIndexScope.queryVectors" + } + ], + "typeSpec": { + "methods": { + "@supabase/functions-js.FunctionsClient.constructor": { + "name": "@supabase/functions-js.FunctionsClient.constructor", + "params": [ + { + "name": "url", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "type": { + "type": "object", + "properties": [ + { + "name": "customFetch", + "type": { + "type": "function", + "params": [ + { + "name": "input", + "type": { + "type": "union", + "subTypes": [ + { + "type": "nameOnly", + "name": "RequestInfo" + }, + { + "type": "nameOnly", + "name": "URL" + } + ] + } + }, + { + "name": "init", + "type": { + "type": "nameOnly", + "name": "RequestInit" + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "nameOnly", + "name": "Response" + } + } + }, + "comment": { + "shortText": "[MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch)" + } + }, + "isOptional": true + }, + { + "name": "headers", + "type": { + "type": "record", + "name": "Record", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "string" + } + }, + "isOptional": true + }, + { + "name": "region", + "type": { + "type": "nameOnly", + "name": "FunctionRegion" + }, + "isOptional": true + } + ] + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "FunctionsClient" + } + }, + "comment": { + "shortText": "Creates a new Functions client bound to an Edge Functions URL.", + "examples": [ + { + "id": "using-supabase-js-recommended", + "name": "Using supabase-js (recommended)", + "code": "```ts\nimport { createClient } from '@supabase/supabase-js'\n\nconst supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key')\nconst { data, error } = await supabase.functions.invoke('hello-world')\n```" + }, + { + "id": "standalone-import-for-bundle-sensitive-environments", + "name": "Standalone import for bundle-sensitive environments", + "code": "```ts\nimport { FunctionsClient, FunctionRegion } from '@supabase/functions-js'\n\nconst functions = new FunctionsClient('https://xyzcompany.supabase.co/functions/v1', {\n headers: { apikey: 'your-publishable-key' },\n region: FunctionRegion.UsEast1,\n})\n```" + } + ] + } + }, + "@supabase/functions-js.FunctionsClient.invoke": { + "name": "@supabase/functions-js.FunctionsClient.invoke", + "params": [ + { + "name": "functionName", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The name of the Function to invoke." + } + }, + { + "name": "options", + "type": { + "name": "FunctionInvokeOptions", + "type": "object", + "properties": [ + { + "name": "body", + "type": { + "type": "union", + "subTypes": [ + { + "type": "nameOnly", + "name": "File" + }, + { + "type": "nameOnly", + "name": "Blob" + }, + { + "type": "nameOnly", + "name": "ArrayBuffer" + }, + { + "type": "nameOnly", + "name": "FormData" + }, + { + "type": "nameOnly", + "name": "ReadableStream" + }, + { + "type": "record", + "name": "Record", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "any" + } + }, + { + "type": "intrinsic", + "name": "string" + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "The body of the request." + } + }, + { + "name": "headers", + "type": { + "type": "index signature", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "string" + } + }, + "isOptional": true, + "comment": { + "shortText": "Object representing the headers to send with the request." + } + }, + { + "name": "method", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "POST" + }, + { + "type": "literal", + "value": "GET" + }, + { + "type": "literal", + "value": "PUT" + }, + { + "type": "literal", + "value": "PATCH" + }, + { + "type": "literal", + "value": "DELETE" + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "The HTTP verb of the request" + } + }, + { + "name": "region", + "type": { + "type": "nameOnly", + "name": "FunctionRegion" + }, + "isOptional": true, + "comment": { + "shortText": "The Region to invoke the function in." + } + }, + { + "name": "signal", + "type": { + "type": "nameOnly", + "name": "AbortSignal" + }, + "isOptional": true, + "comment": { + "shortText": "The AbortSignal to use for the request." + } + }, + { + "name": "timeout", + "type": { + "type": "intrinsic", + "name": "number" + }, + "isOptional": true, + "comment": { + "shortText": "The timeout for the request in milliseconds.\nIf the function takes longer than this, the request will be aborted." + } + } + ] + }, + "comment": { + "shortText": "Options for invoking the Function." + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "FunctionsResponse", + "subTypes": [ + { + "type": "nameOnly", + "name": "FunctionsResponseSuccess" + }, + { + "type": "nameOnly", + "name": "FunctionsResponseFailure" + } + ] + } + } + }, + "comment": { + "shortText": "Invokes a function", + "text": "- Requires an Authorization header.\n- Invoke params generally match the [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) spec.\n- When you pass in a body to your function, we automatically attach the Content-Type header for `Blob`, `ArrayBuffer`, `File`, `FormData` and `String`. If it doesn't match any of these types we assume the payload is `json`, serialize it and attach the `Content-Type` header as `application/json`. You can override this behavior by passing in a `Content-Type` header of your own.\n- Responses are automatically parsed as `json`, `blob` and `form-data` depending on the `Content-Type` header sent by your function. Responses are parsed as `text` by default.", + "examples": [ + { + "id": "example-1", + "name": "Example 1", + "code": "```ts\nconst { data, error } = await functions.invoke('hello-world', {\n body: { name: 'Ada' },\n})\n```" + }, + { + "id": "basic-invocation", + "name": "Basic invocation", + "code": "```js\nconst { data, error } = await supabase.functions.invoke('hello', {\n body: { foo: 'bar' }\n})\n```" + }, + { + "id": "error-handling", + "name": "Error handling", + "code": "```js\nimport { FunctionsHttpError, FunctionsRelayError, FunctionsFetchError } from \"@supabase/supabase-js\";\n\nconst { data, error } = await supabase.functions.invoke('hello', {\n headers: {\n \"my-custom-header\": 'my-custom-header-value'\n },\n body: { foo: 'bar' }\n})\n\nif (error instanceof FunctionsHttpError) {\n const errorMessage = await error.context.json()\n console.error('Function returned an error', errorMessage)\n} else if (error instanceof FunctionsRelayError) {\n console.error('Relay error:', error)\n} else if (error instanceof FunctionsFetchError) {\n console.error('Fetch error:', error)\n}\n```", + "description": "A `FunctionsHttpError` error is returned if your function throws an error, `FunctionsRelayError` if the Supabase Relay has an error processing your function and `FunctionsFetchError` if there is a network error in calling your function. Log the full error object so fields like `name`, `context`, and any structured body aren't hidden." + }, + { + "id": "passing-custom-headers", + "name": "Passing custom headers", + "code": "```js\nconst { data, error } = await supabase.functions.invoke('hello', {\n headers: {\n \"my-custom-header\": 'my-custom-header-value'\n },\n body: { foo: 'bar' }\n})\n```", + "description": "You can pass custom headers to your function. Note: supabase-js automatically passes the `Authorization` header with the signed in user's JWT." + }, + { + "id": "calling-with-delete-http-verb", + "name": "Calling with DELETE HTTP verb", + "code": "```js\nconst { data, error } = await supabase.functions.invoke('hello', {\n headers: {\n \"my-custom-header\": 'my-custom-header-value'\n },\n body: { foo: 'bar' },\n method: 'DELETE'\n})\n```", + "description": "You can also set the HTTP verb to `DELETE` when calling your Edge Function." + }, + { + "id": "invoking-a-function-in-the-useast1-region", + "name": "Invoking a Function in the UsEast1 region", + "code": "```js\nimport { createClient, FunctionRegion } from '@supabase/supabase-js'\n\nconst { data, error } = await supabase.functions.invoke('hello', {\n body: { foo: 'bar' },\n region: FunctionRegion.UsEast1\n})\n```", + "description": "Here are the available regions:\n- `FunctionRegion.Any`\n- `FunctionRegion.ApNortheast1`\n- `FunctionRegion.ApNortheast2`\n- `FunctionRegion.ApSouth1`\n- `FunctionRegion.ApSoutheast1`\n- `FunctionRegion.ApSoutheast2`\n- `FunctionRegion.CaCentral1`\n- `FunctionRegion.EuCentral1`\n- `FunctionRegion.EuWest1`\n- `FunctionRegion.EuWest2`\n- `FunctionRegion.EuWest3`\n- `FunctionRegion.SaEast1`\n- `FunctionRegion.UsEast1`\n- `FunctionRegion.UsWest1`\n- `FunctionRegion.UsWest2`" + }, + { + "id": "calling-with-get-http-verb", + "name": "Calling with GET HTTP verb", + "code": "```js\nconst { data, error } = await supabase.functions.invoke('hello', {\n headers: {\n \"my-custom-header\": 'my-custom-header-value'\n },\n method: 'GET'\n})\n```", + "description": "You can also set the HTTP verb to `GET` when calling your Edge Function." + }, + { + "id": "standalone-client-invoke", + "name": "Standalone client invoke", + "code": "```ts\nconst { data, error } = await functions.invoke('hello-world', {\n body: { name: 'Ada' },\n})\n```" + } + ] + } + }, + "@supabase/functions-js.FunctionsClient.setAuth": { + "name": "@supabase/functions-js.FunctionsClient.setAuth", + "params": [ + { + "name": "token", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "the new jwt token sent in the authorisation header" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + }, + "comment": { + "shortText": "Updates the authorization header", + "examples": [ + { + "id": "setting-the-authorization-header", + "name": "Setting the authorization header", + "code": "```ts\nfunctions.setAuth(session.access_token)\n```" + } + ] + } + }, + "@supabase/functions-js.FunctionsError.constructor": { + "name": "@supabase/functions-js.FunctionsError.constructor", + "params": [ + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "context", + "type": { + "type": "intrinsic", + "name": "any" + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "FunctionsError" + } + } + }, + "@supabase/functions-js.FunctionsError.toJSON": { + "name": "@supabase/functions-js.FunctionsError.toJSON", + "params": [], + "ret": { + "type": { + "type": "object", + "properties": [ + { + "name": "context", + "type": { + "type": "intrinsic", + "name": "any" + } + }, + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + } + } + }, + "@supabase/functions-js.FunctionsFetchError.constructor": { + "name": "@supabase/functions-js.FunctionsFetchError.constructor", + "params": [ + { + "name": "context", + "type": { + "type": "intrinsic", + "name": "any" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "FunctionsFetchError" + } + } + }, + "@supabase/functions-js.FunctionsFetchError.toJSON": { + "name": "@supabase/functions-js.FunctionsFetchError.toJSON", + "params": [], + "ret": { + "type": { + "type": "object", + "properties": [ + { + "name": "context", + "type": { + "type": "intrinsic", + "name": "any" + } + }, + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + } + } + }, + "@supabase/functions-js.FunctionsHttpError.constructor": { + "name": "@supabase/functions-js.FunctionsHttpError.constructor", + "params": [ + { + "name": "context", + "type": { + "type": "intrinsic", + "name": "any" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "FunctionsHttpError" + } + } + }, + "@supabase/functions-js.FunctionsHttpError.toJSON": { + "name": "@supabase/functions-js.FunctionsHttpError.toJSON", + "params": [], + "ret": { + "type": { + "type": "object", + "properties": [ + { + "name": "context", + "type": { + "type": "intrinsic", + "name": "any" + } + }, + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + } + } + }, + "@supabase/functions-js.FunctionsRelayError.constructor": { + "name": "@supabase/functions-js.FunctionsRelayError.constructor", + "params": [ + { + "name": "context", + "type": { + "type": "intrinsic", + "name": "any" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "FunctionsRelayError" + } + } + }, + "@supabase/functions-js.FunctionsRelayError.toJSON": { + "name": "@supabase/functions-js.FunctionsRelayError.toJSON", + "params": [], + "ret": { + "type": { + "type": "object", + "properties": [ + { + "name": "context", + "type": { + "type": "intrinsic", + "name": "any" + } + }, + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + } + } + }, + "@supabase/auth-js.AuthApiError.constructor": { + "name": "@supabase/auth-js.AuthApiError.constructor", + "params": [ + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "status", + "type": { + "type": "intrinsic", + "name": "number" + } + }, + { + "name": "code", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "intrinsic", + "name": "string" + } + ] + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "AuthApiError" + } + } + }, + "@supabase/auth-js.AuthApiError.toJSON": { + "name": "@supabase/auth-js.AuthApiError.toJSON", + "params": [], + "ret": { + "type": { + "type": "object", + "properties": [ + { + "name": "code", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + null, + { + "type": "nameOnly", + "name": "ErrorCode" + } + ] + } + }, + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "intrinsic", + "name": "number" + } + ] + } + } + ] + } + } + }, + "@supabase/auth-js.AuthError.constructor": { + "name": "@supabase/auth-js.AuthError.constructor", + "params": [ + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "status", + "type": { + "type": "intrinsic", + "name": "number" + }, + "isOptional": true + }, + { + "name": "code", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + }, + "@supabase/auth-js.AuthError.toJSON": { + "name": "@supabase/auth-js.AuthError.toJSON", + "params": [], + "ret": { + "type": { + "type": "object", + "properties": [ + { + "name": "code", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + null, + { + "type": "nameOnly", + "name": "ErrorCode" + } + ] + } + }, + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "intrinsic", + "name": "number" + } + ] + } + } + ] + } + } + }, + "@supabase/auth-js.AuthImplicitGrantRedirectError.constructor": { + "name": "@supabase/auth-js.AuthImplicitGrantRedirectError.constructor", + "params": [ + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "details", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "object", + "properties": [ + { + "name": "code", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "error", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + } + ] + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "AuthImplicitGrantRedirectError" + } + } + }, + "@supabase/auth-js.AuthImplicitGrantRedirectError.toJSON": { + "name": "@supabase/auth-js.AuthImplicitGrantRedirectError.toJSON", + "params": [], + "ret": { + "type": { + "type": "object", + "properties": [ + { + "name": "code", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + null, + { + "type": "nameOnly", + "name": "ErrorCode" + } + ] + } + }, + { + "name": "details", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "object", + "properties": [ + { + "name": "code", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "error", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + } + ] + } + }, + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "intrinsic", + "name": "number" + } + ] + } + } + ] + } + } + }, + "@supabase/auth-js.AuthInvalidCredentialsError.constructor": { + "name": "@supabase/auth-js.AuthInvalidCredentialsError.constructor", + "params": [ + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "AuthInvalidCredentialsError" + } + } + }, + "@supabase/auth-js.AuthInvalidCredentialsError.toJSON": { + "name": "@supabase/auth-js.AuthInvalidCredentialsError.toJSON", + "params": [], + "ret": { + "type": { + "type": "object", + "properties": [ + { + "name": "code", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + null, + { + "type": "nameOnly", + "name": "ErrorCode" + } + ] + } + }, + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "intrinsic", + "name": "number" + } + ] + } + } + ] + } + } + }, + "@supabase/auth-js.AuthInvalidJwtError.constructor": { + "name": "@supabase/auth-js.AuthInvalidJwtError.constructor", + "params": [ + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "AuthInvalidJwtError" + } + } + }, + "@supabase/auth-js.AuthInvalidJwtError.toJSON": { + "name": "@supabase/auth-js.AuthInvalidJwtError.toJSON", + "params": [], + "ret": { + "type": { + "type": "object", + "properties": [ + { + "name": "code", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + null, + { + "type": "nameOnly", + "name": "ErrorCode" + } + ] + } + }, + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "intrinsic", + "name": "number" + } + ] + } + } + ] + } + } + }, + "@supabase/auth-js.AuthInvalidTokenResponseError.constructor": { + "name": "@supabase/auth-js.AuthInvalidTokenResponseError.constructor", + "params": [], + "ret": { + "type": { + "type": "nameOnly", + "name": "AuthInvalidTokenResponseError" + } + } + }, + "@supabase/auth-js.AuthInvalidTokenResponseError.toJSON": { + "name": "@supabase/auth-js.AuthInvalidTokenResponseError.toJSON", + "params": [], + "ret": { + "type": { + "type": "object", + "properties": [ + { + "name": "code", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + null, + { + "type": "nameOnly", + "name": "ErrorCode" + } + ] + } + }, + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "intrinsic", + "name": "number" + } + ] + } + } + ] + } + } + }, + "@supabase/auth-js.AuthPKCECodeVerifierMissingError.constructor": { + "name": "@supabase/auth-js.AuthPKCECodeVerifierMissingError.constructor", + "params": [], + "ret": { + "type": { + "type": "nameOnly", + "name": "AuthPKCECodeVerifierMissingError" + } + } + }, + "@supabase/auth-js.AuthPKCECodeVerifierMissingError.toJSON": { + "name": "@supabase/auth-js.AuthPKCECodeVerifierMissingError.toJSON", + "params": [], + "ret": { + "type": { + "type": "object", + "properties": [ + { + "name": "code", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + null, + { + "type": "nameOnly", + "name": "ErrorCode" + } + ] + } + }, + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "intrinsic", + "name": "number" + } + ] + } + } + ] + } + } + }, + "@supabase/auth-js.AuthPKCEGrantCodeExchangeError.constructor": { + "name": "@supabase/auth-js.AuthPKCEGrantCodeExchangeError.constructor", + "params": [ + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "details", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "object", + "properties": [ + { + "name": "code", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "error", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + } + ] + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "AuthPKCEGrantCodeExchangeError" + } + } + }, + "@supabase/auth-js.AuthPKCEGrantCodeExchangeError.toJSON": { + "name": "@supabase/auth-js.AuthPKCEGrantCodeExchangeError.toJSON", + "params": [], + "ret": { + "type": { + "type": "object", + "properties": [ + { + "name": "code", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + null, + { + "type": "nameOnly", + "name": "ErrorCode" + } + ] + } + }, + { + "name": "details", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "object", + "properties": [ + { + "name": "code", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "error", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + } + ] + } + }, + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "intrinsic", + "name": "number" + } + ] + } + } + ] + } + } + }, + "@supabase/auth-js.AuthRefreshDiscardedError.constructor": { + "name": "@supabase/auth-js.AuthRefreshDiscardedError.constructor", + "params": [ + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "AuthRefreshDiscardedError" + } + } + }, + "@supabase/auth-js.AuthRefreshDiscardedError.toJSON": { + "name": "@supabase/auth-js.AuthRefreshDiscardedError.toJSON", + "params": [], + "ret": { + "type": { + "type": "object", + "properties": [ + { + "name": "code", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + null, + { + "type": "nameOnly", + "name": "ErrorCode" + } + ] + } + }, + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "intrinsic", + "name": "number" + } + ] + } + } + ] + } + } + }, + "@supabase/auth-js.AuthRetryableFetchError.constructor": { + "name": "@supabase/auth-js.AuthRetryableFetchError.constructor", + "params": [ + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "status", + "type": { + "type": "intrinsic", + "name": "number" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "AuthRetryableFetchError" + } + } + }, + "@supabase/auth-js.AuthRetryableFetchError.toJSON": { + "name": "@supabase/auth-js.AuthRetryableFetchError.toJSON", + "params": [], + "ret": { + "type": { + "type": "object", + "properties": [ + { + "name": "code", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + null, + { + "type": "nameOnly", + "name": "ErrorCode" + } + ] + } + }, + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "intrinsic", + "name": "number" + } + ] + } + } + ] + } + } + }, + "@supabase/auth-js.AuthSessionMissingError.constructor": { + "name": "@supabase/auth-js.AuthSessionMissingError.constructor", + "params": [], + "ret": { + "type": { + "type": "nameOnly", + "name": "AuthSessionMissingError" + } + } + }, + "@supabase/auth-js.AuthSessionMissingError.toJSON": { + "name": "@supabase/auth-js.AuthSessionMissingError.toJSON", + "params": [], + "ret": { + "type": { + "type": "object", + "properties": [ + { + "name": "code", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + null, + { + "type": "nameOnly", + "name": "ErrorCode" + } + ] + } + }, + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "intrinsic", + "name": "number" + } + ] + } + } + ] + } + } + }, + "@supabase/auth-js.AuthUnknownError.constructor": { + "name": "@supabase/auth-js.AuthUnknownError.constructor", + "params": [ + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "originalError", + "type": { + "type": "intrinsic", + "name": "unknown" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "AuthUnknownError" + } + } + }, + "@supabase/auth-js.AuthUnknownError.toJSON": { + "name": "@supabase/auth-js.AuthUnknownError.toJSON", + "params": [], + "ret": { + "type": { + "type": "object", + "properties": [ + { + "name": "code", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + null, + { + "type": "nameOnly", + "name": "ErrorCode" + } + ] + } + }, + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "intrinsic", + "name": "number" + } + ] + } + } + ] + } + } + }, + "@supabase/auth-js.AuthWeakPasswordError.constructor": { + "name": "@supabase/auth-js.AuthWeakPasswordError.constructor", + "params": [ + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "status", + "type": { + "type": "intrinsic", + "name": "number" + } + }, + { + "name": "reasons", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "length" + }, + { + "type": "literal", + "value": "characters" + }, + { + "type": "literal", + "value": "pwned" + } + ] + } + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "AuthWeakPasswordError" + } + } + }, + "@supabase/auth-js.AuthWeakPasswordError.toJSON": { + "name": "@supabase/auth-js.AuthWeakPasswordError.toJSON", + "params": [], + "ret": { + "type": { + "type": "object", + "properties": [ + { + "name": "code", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + null, + { + "type": "nameOnly", + "name": "ErrorCode" + } + ] + } + }, + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "reasons", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "length" + }, + { + "type": "literal", + "value": "characters" + }, + { + "type": "literal", + "value": "pwned" + } + ] + } + } + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "intrinsic", + "name": "number" + } + ] + } + } + ] + } + } + }, + "@supabase/auth-js.CustomAuthError.constructor": { + "name": "@supabase/auth-js.CustomAuthError.constructor", + "params": [ + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "status", + "type": { + "type": "intrinsic", + "name": "number" + } + }, + { + "name": "code", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "intrinsic", + "name": "string" + } + ] + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "CustomAuthError" + } + } + }, + "@supabase/auth-js.CustomAuthError.toJSON": { + "name": "@supabase/auth-js.CustomAuthError.toJSON", + "params": [], + "ret": { + "type": { + "type": "object", + "properties": [ + { + "name": "code", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + null, + { + "type": "nameOnly", + "name": "ErrorCode" + } + ] + } + }, + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "intrinsic", + "name": "number" + } + ] + } + } + ] + } + } + }, + "@supabase/auth-js.GoTrueAdminApi.constructor": { + "name": "@supabase/auth-js.GoTrueAdminApi.constructor", + "params": [ + { + "type": { + "type": "object", + "properties": [ + { + "name": "experimental", + "type": { + "name": "ExperimentalFeatureFlags", + "type": "object", + "properties": [ + { + "name": "passkey", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "Enables passkey support:\n - `auth.signInWithPasskey()`, `auth.registerPasskey()`\n - `auth.passkey.*`\n - `auth.admin.passkey.*`\n\nDefaults to `false`. Calling any passkey method while this flag is\ndisabled throws a descriptive error at call time." + } + } + ] + }, + "isOptional": true + }, + { + "name": "fetch", + "type": { + "type": "function", + "params": [ + { + "name": "input", + "type": { + "type": "union", + "subTypes": [ + { + "type": "nameOnly", + "name": "URL" + }, + { + "type": "nameOnly", + "name": "RequestInfo" + } + ] + } + }, + { + "name": "init", + "type": { + "type": "nameOnly", + "name": "RequestInit" + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "nameOnly", + "name": "Response" + } + } + }, + "comment": { + "shortText": "[MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch)" + } + }, + "isOptional": true + }, + { + "name": "headers", + "type": { + "type": "index signature", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "string" + } + }, + "isOptional": true + }, + { + "name": "url", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "GoTrueAdminApi" + } + }, + "comment": { + "shortText": "Creates an admin API client that can be used to manage users and OAuth clients.", + "examples": [ + { + "id": "using-supabase-js-recommended", + "name": "Using supabase-js (recommended)", + "code": "```ts\nimport { createClient } from '@supabase/supabase-js'\n\nconst supabase = createClient('https://xyzcompany.supabase.co', 'your-secret-key')\nconst { data, error } = await supabase.auth.admin.listUsers()\n```" + }, + { + "id": "standalone-import-for-bundle-sensitive-environments", + "name": "Standalone import for bundle-sensitive environments", + "code": "```ts\nimport { GoTrueAdminApi } from '@supabase/auth-js'\n\nconst admin = new GoTrueAdminApi({\n url: 'https://xyzcompany.supabase.co/auth/v1',\n headers: { Authorization: `Bearer ${process.env.SUPABASE_SECRET_KEY}` },\n})\n```" + } + ] + } + }, + "@supabase/auth-js.GoTrueAdminApi.createUser": { + "name": "@supabase/auth-js.GoTrueAdminApi.createUser", + "params": [ + { + "name": "attributes", + "type": { + "type": "object", + "name": "AdminUserAttributes", + "properties": [ + { + "name": "app_metadata", + "type": { + "type": "intrinsic", + "name": "object" + }, + "isOptional": true, + "comment": { + "shortText": "A custom data object to store the user's application specific metadata. This maps to the `auth.users.app_metadata` column.\n\nOnly a service role can modify.\n\nThe `app_metadata` should be a JSON object that includes app-specific info, such as identity providers, roles, and other\naccess control information." + } + }, + { + "name": "ban_duration", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Determines how long a user is banned for.\n\nThe format for the ban duration follows a strict sequence of decimal numbers with a unit suffix.\nValid time units are \"ns\", \"us\" (or \"µs\"), \"ms\", \"s\", \"m\", \"h\".\n\nFor example, some possible durations include: '300ms', '2h45m'.\n\nSetting the ban duration to 'none' lifts the ban on the user." + } + }, + { + "name": "current_password", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "The user's current password\n\nThis is only ever present when the user is resetting\ntheir password and GOTRUE_SECURITY_UPDATE_PASSWORD_REQUIRE_CURRENT_PASSWORD is true." + } + }, + { + "name": "email", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "The user's email." + } + }, + { + "name": "email_confirm", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "Sets the user's email as confirmed when true, or unconfirmed when false.\n\nOnly a service role can modify." + } + }, + { + "name": "id", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "The `id` for the user.\n\nAllows you to overwrite the default `id` set for the user." + } + }, + { + "name": "nonce", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "The nonce sent for reauthentication if the user's password is to be updated.\n\nCall reauthenticate() to obtain the nonce first." + } + }, + { + "name": "password", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "The user's password." + } + }, + { + "name": "password_hash", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "The `password_hash` for the user's password.\n\nAllows you to specify a password hash for the user. This is useful for migrating a user's password hash from another service.\n\nSupports bcrypt, scrypt (firebase), and argon2 password hashes." + } + }, + { + "name": "phone", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "The user's phone." + } + }, + { + "name": "phone_confirm", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "Sets the user's phone as confirmed when true, or unconfirmed when false.\n\nOnly a service role can modify." + } + }, + { + "name": "role", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "The `role` claim set in the user's access token JWT.\n\nWhen a user signs up, this role is set to `authenticated` by default. You should only modify the `role` if you need to provision several levels of admin access that have different permissions on individual columns in your database.\n\nSetting this role to `service_role` is not recommended as it grants the user admin privileges." + } + }, + { + "name": "user_metadata", + "type": { + "type": "intrinsic", + "name": "object" + }, + "isOptional": true, + "comment": { + "shortText": "A custom data object to store the user's metadata. This maps to the `auth.users.raw_user_meta_data` column.\n\n\nThe `user_metadata` should be a JSON object that includes user-specific info, such as their first and last name.\n\nNote: When using the GoTrueAdminApi and wanting to modify a user's metadata,\nthis attribute is used instead of UserAttributes data." + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "UserResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "user", + "type": { + "type": "object", + "name": "User", + "properties": [ + { + "name": "action_link", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "banned_until", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "confirmed_at", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "created_at", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "deleted_at", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "email", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "totp" + }, + { + "type": "literal", + "value": "phone" + }, + { + "type": "literal", + "value": "webauthn" + } + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "totp" + }, + { + "type": "literal", + "value": "phone" + }, + { + "type": "literal", + "value": "webauthn" + } + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "id", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "any" + } + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "last_sign_in_at", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "provider", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "updated_at", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "user_id", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "is_anonymous", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "is_sso_user", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "new_email", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "new_phone", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "phone", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "role", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "updated_at", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + } + } + ] + } + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "user", + "type": { + "type": "literal", + "value": null + } + } + ] + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Creates a new user.\nThis function should only be called on a server. Never expose your `service_role` key in the browser.", + "text": "- To confirm the user's email address or phone number, set `email_confirm` or `phone_confirm` to true. Both arguments default to false.\n- `createUser()` will not send a confirmation email to the user. You can use [`inviteUserByEmail()`](/docs/reference/javascript/auth-admin-inviteuserbyemail) if you want to send them an email invite instead.\n- If you are sure that the created user's email or phone number is legitimate and verified, you can set the `email_confirm` or `phone_confirm` param to `true`.", + "examples": [ + { + "id": "with-custom-user-metadata", + "name": "With custom user metadata", + "code": "```js\nconst { data, error } = await supabase.auth.admin.createUser({\n email: 'user@email.com',\n password: 'password',\n user_metadata: { name: 'Yoda' }\n})\n```", + "response": "```json\n{\n data: {\n user: {\n id: '1',\n aud: 'authenticated',\n role: 'authenticated',\n email: 'example@email.com',\n email_confirmed_at: '2024-01-01T00:00:00Z',\n phone: '',\n confirmation_sent_at: '2024-01-01T00:00:00Z',\n confirmed_at: '2024-01-01T00:00:00Z',\n last_sign_in_at: '2024-01-01T00:00:00Z',\n app_metadata: {},\n user_metadata: {},\n identities: [\n {\n \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n \"id\": \"1\",\n \"user_id\": \"1\",\n \"identity_data\": {\n \"email\": \"example@email.com\",\n \"email_verified\": true,\n \"phone_verified\": false,\n \"sub\": \"1\"\n },\n \"provider\": \"email\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"email@example.com\"\n },\n ],\n created_at: '2024-01-01T00:00:00Z',\n updated_at: '2024-01-01T00:00:00Z',\n is_anonymous: false,\n }\n }\n error: null\n}\n```" + }, + { + "id": "auto-confirm-the-user-s-email", + "name": "Auto-confirm the user's email", + "code": "```js\nconst { data, error } = await supabase.auth.admin.createUser({\n email: 'user@email.com',\n email_confirm: true\n})\n```" + }, + { + "id": "auto-confirm-the-user-s-phone-number", + "name": "Auto-confirm the user's phone number", + "code": "```js\nconst { data, error } = await supabase.auth.admin.createUser({\n phone: '1234567890',\n phone_confirm: true\n})\n```" + } + ] + } + }, + "@supabase/auth-js.GoTrueAdminApi.deleteUser": { + "name": "@supabase/auth-js.GoTrueAdminApi.deleteUser", + "params": [ + { + "name": "id", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The user id you want to remove." + } + }, + { + "name": "shouldSoftDelete", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "comment": { + "shortText": "If true, then the user will be soft-deleted from the auth schema. Soft deletion allows user identification from the hashed user ID but is not reversible.\nDefaults to false for backward compatibility.\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser." + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "UserResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "user", + "type": { + "type": "object", + "name": "User", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "user", + "type": "[Circular]" + } + ] + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Delete a user. Requires a `service_role` key.", + "text": "- The `deleteUser()` method requires the user's ID, which maps to the `auth.users.id` column.", + "examples": [ + { + "id": "removes-a-user", + "name": "Removes a user", + "code": "```js\nconst { data, error } = await supabase.auth.admin.deleteUser(\n '715ed5db-f090-4b8c-a067-640ecee36aa0'\n)\n```", + "response": "```json\n{\n \"data\": {\n \"user\": {}\n },\n \"error\": null\n}\n```" + } + ] + } + }, + "@supabase/auth-js.GoTrueAdminApi.generateLink": { + "name": "@supabase/auth-js.GoTrueAdminApi.generateLink", + "params": [ + { + "name": "params", + "type": { + "type": "union", + "name": "GenerateLinkParams", + "subTypes": [ + { + "name": "GenerateSignupLinkParams", + "type": "object", + "properties": [ + { + "name": "email", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "options", + "isOptional": true + }, + { + "name": "password", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "type", + "type": { + "type": "literal", + "value": "signup" + } + } + ] + }, + { + "name": "GenerateInviteOrMagiclinkParams", + "type": "object", + "properties": [ + { + "name": "email", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The user's email" + } + }, + { + "name": "options", + "isOptional": true + }, + { + "name": "type", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "invite" + }, + { + "type": "literal", + "value": "magiclink" + } + ] + } + } + ] + }, + { + "name": "GenerateRecoveryLinkParams", + "type": "object", + "properties": [ + { + "name": "email", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The user's email" + } + }, + { + "name": "options", + "isOptional": true + }, + { + "name": "type", + "type": { + "type": "literal", + "value": "recovery" + } + } + ] + }, + { + "name": "GenerateEmailChangeLinkParams", + "type": "object", + "properties": [ + { + "name": "email", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The user's email" + } + }, + { + "name": "newEmail", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The user's new email. Only required if type is 'email_change_current' or 'email_change_new'." + } + }, + { + "name": "options", + "isOptional": true + }, + { + "name": "type", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "email_change_current" + }, + { + "type": "literal", + "value": "email_change_new" + } + ] + } + } + ] + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "GenerateLinkResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "properties", + "type": { + "name": "GenerateLinkProperties", + "type": "object", + "properties": [ + { + "name": "action_link", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The email link to send to the user.\nThe action_link follows the following format: auth/v1/verify?type={verification_type}&token={hashed_token}&redirect_to={redirect_to}" + } + }, + { + "name": "email_otp", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The raw email OTP.\nYou should send this in the email if you want your users to verify using an OTP instead of the action link." + } + }, + { + "name": "hashed_token", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The hashed token appended to the action link." + } + }, + { + "name": "redirect_to", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The URL appended to the action link." + } + }, + { + "name": "verification_type", + "type": { + "type": "union", + "name": "GenerateLinkType", + "subTypes": [ + { + "type": "literal", + "value": "signup" + }, + { + "type": "literal", + "value": "invite" + }, + { + "type": "literal", + "value": "magiclink" + }, + { + "type": "literal", + "value": "recovery" + }, + { + "type": "literal", + "value": "email_change_current" + }, + { + "type": "literal", + "value": "email_change_new" + } + ] + }, + "comment": { + "shortText": "The verification type that the email link is associated to." + } + } + ] + } + }, + { + "name": "user", + "type": { + "type": "object", + "name": "User", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "properties", + "type": "[Circular]" + }, + { + "name": "user", + "type": "[Circular]" + } + ] + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Generates email links and OTPs to be sent via a custom email provider.", + "text": "- The following types can be passed into `generateLink()`: `signup`, `magiclink`, `invite`, `recovery`, `email_change_current`, `email_change_new`, `phone_change`.\n- `generateLink()` only generates the email link for `email_change_email` if the **Secure email change** is enabled in your project's [email auth provider settings](/dashboard/project/_/auth/providers).\n- `generateLink()` handles the creation of the user for `signup`, `invite` and `magiclink`.", + "examples": [ + { + "id": "generate-a-signup-link", + "name": "Generate a signup link", + "code": "```js\nconst { data, error } = await supabase.auth.admin.generateLink({\n type: 'signup',\n email: 'email@example.com',\n password: 'secret'\n})\n```", + "response": "```json\n{\n \"data\": {\n \"properties\": {\n \"action_link\": \"\",\n \"email_otp\": \"999999\",\n \"hashed_token\": \"\",\n \"verification_type\": \"signup\"\n },\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"email@example.com\",\n \"phone\": \"\",\n \"confirmation_sent_at\": \"2024-01-01T00:00:00Z\",\n \"app_metadata\": {\n \"provider\": \"email\",\n \"providers\": [\n \"email\"\n ]\n },\n \"user_metadata\": {},\n \"identities\": [\n {\n \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n \"identity_data\": {\n \"email\": \"email@example.com\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"provider\": \"email\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"email@example.com\"\n }\n ],\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"is_anonymous\": false\n }\n },\n \"error\": null\n}\n```" + }, + { + "id": "generate-an-invite-link", + "name": "Generate an invite link", + "code": "```js\nconst { data, error } = await supabase.auth.admin.generateLink({\n type: 'invite',\n email: 'email@example.com'\n})\n```" + }, + { + "id": "generate-a-magic-link", + "name": "Generate a magic link", + "code": "```js\nconst { data, error } = await supabase.auth.admin.generateLink({\n type: 'magiclink',\n email: 'email@example.com'\n})\n```" + }, + { + "id": "generate-a-recovery-link", + "name": "Generate a recovery link", + "code": "```js\nconst { data, error } = await supabase.auth.admin.generateLink({\n type: 'recovery',\n email: 'email@example.com'\n})\n```" + }, + { + "id": "generate-links-to-change-current-email-address", + "name": "Generate links to change current email address", + "code": "```js\n// generate an email change link to be sent to the current email address\nconst { data, error } = await supabase.auth.admin.generateLink({\n type: 'email_change_current',\n email: 'current.email@example.com',\n newEmail: 'new.email@example.com'\n})\n\n// generate an email change link to be sent to the new email address\nconst { data, error } = await supabase.auth.admin.generateLink({\n type: 'email_change_new',\n email: 'current.email@example.com',\n newEmail: 'new.email@example.com'\n})\n```" + } + ] + } + }, + "@supabase/auth-js.GoTrueAdminApi.getUserById": { + "name": "@supabase/auth-js.GoTrueAdminApi.getUserById", + "params": [ + { + "name": "uid", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The user's unique identifier\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser." + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "UserResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "user", + "type": { + "type": "object", + "name": "User", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "user", + "type": "[Circular]" + } + ] + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Get user by id.", + "text": "- Fetches the user object from the database based on the user's id.\n- The `getUserById()` method requires the user's id which maps to the `auth.users.id` column.", + "examples": [ + { + "id": "fetch-the-user-object-using-the-access-token-jwt", + "name": "Fetch the user object using the access_token jwt", + "code": "```js\nconst { data, error } = await supabase.auth.admin.getUserById(1)\n```", + "response": "```json\n{\n data: {\n user: {\n id: '1',\n aud: 'authenticated',\n role: 'authenticated',\n email: 'example@email.com',\n email_confirmed_at: '2024-01-01T00:00:00Z',\n phone: '',\n confirmation_sent_at: '2024-01-01T00:00:00Z',\n confirmed_at: '2024-01-01T00:00:00Z',\n last_sign_in_at: '2024-01-01T00:00:00Z',\n app_metadata: {},\n user_metadata: {},\n identities: [\n {\n \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n \"id\": \"1\",\n \"user_id\": \"1\",\n \"identity_data\": {\n \"email\": \"example@email.com\",\n \"email_verified\": true,\n \"phone_verified\": false,\n \"sub\": \"1\"\n },\n \"provider\": \"email\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"email@example.com\"\n },\n ],\n created_at: '2024-01-01T00:00:00Z',\n updated_at: '2024-01-01T00:00:00Z',\n is_anonymous: false,\n }\n }\n error: null\n}\n```" + } + ] + } + }, + "@supabase/auth-js.GoTrueAdminApi.inviteUserByEmail": { + "name": "@supabase/auth-js.GoTrueAdminApi.inviteUserByEmail", + "params": [ + { + "name": "email", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The email address of the user." + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "intrinsic", + "name": "object" + }, + "isOptional": true, + "comment": { + "shortText": "A custom data object to store additional metadata about the user. This maps to the `auth.users.user_metadata` column." + } + }, + { + "name": "redirectTo", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "The URL which will be appended to the email link sent to the user's email address. Once clicked the user will end up on this URL." + } + } + ] + }, + "comment": { + "shortText": "Additional options to be included when inviting." + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "UserResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "user", + "type": { + "type": "object", + "name": "User", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "user", + "type": "[Circular]" + } + ] + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Sends an invite link to an email address.", + "text": "- Sends an invite link to the user's email address.\n- The `inviteUserByEmail()` method is typically used by administrators to invite users to join the application.\n- Note that PKCE is not supported when using `inviteUserByEmail`. This is because the browser initiating the invite is often different from the browser accepting the invite which makes it difficult to provide the security guarantees required of the PKCE flow.", + "examples": [ + { + "id": "invite-a-user", + "name": "Invite a user", + "code": "```js\nconst { data, error } = await supabase.auth.admin.inviteUserByEmail('email@example.com')\n```", + "response": "```json\n{\n \"data\": {\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"example@email.com\",\n \"invited_at\": \"2024-01-01T00:00:00Z\",\n \"phone\": \"\",\n \"confirmation_sent_at\": \"2024-01-01T00:00:00Z\",\n \"app_metadata\": {\n \"provider\": \"email\",\n \"providers\": [\n \"email\"\n ]\n },\n \"user_metadata\": {},\n \"identities\": [\n {\n \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n \"identity_data\": {\n \"email\": \"example@email.com\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"provider\": \"email\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"example@email.com\"\n }\n ],\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"is_anonymous\": false\n }\n },\n \"error\": null\n}\n```" + } + ] + } + }, + "@supabase/auth-js.GoTrueAdminApi.listUsers": { + "name": "@supabase/auth-js.GoTrueAdminApi.listUsers", + "params": [ + { + "name": "params", + "type": { + "name": "PageParams", + "type": "object", + "properties": [ + { + "name": "page", + "type": { + "type": "intrinsic", + "name": "number" + }, + "isOptional": true, + "comment": { + "shortText": "The page number" + } + }, + { + "name": "perPage", + "type": { + "type": "intrinsic", + "name": "number" + }, + "isOptional": true, + "comment": { + "shortText": "Number of items returned per page" + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "An object which supports `page` and `perPage` as numbers, to alter the paginated results." + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data" + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "users" + } + ] + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Get a list of users.\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser.", + "text": "- Defaults to return 50 users per page.", + "examples": [ + { + "id": "get-a-page-of-users", + "name": "Get a page of users", + "code": "```js\nconst { data: { users }, error } = await supabase.auth.admin.listUsers()\n```" + }, + { + "id": "paginated-list-of-users", + "name": "Paginated list of users", + "code": "```js\nconst { data: { users }, error } = await supabase.auth.admin.listUsers({\n page: 1,\n perPage: 1000\n})\n```" + } + ] + } + }, + "@supabase/auth-js.GoTrueAdminApi.signOut": { + "name": "@supabase/auth-js.GoTrueAdminApi.signOut", + "params": [ + { + "name": "jwt", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "A valid, logged-in JWT." + } + }, + { + "name": "scope", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "global" + }, + { + "type": "literal", + "value": "local" + }, + { + "type": "literal", + "value": "others" + } + ] + }, + "comment": { + "shortText": "The logout sope." + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "literal", + "value": null + } + }, + { + "name": "error", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "nameOnly", + "name": "AuthError" + } + ] + } + } + ] + } + } + }, + "comment": { + "shortText": "Removes a logged-in session." + } + }, + "@supabase/auth-js.GoTrueAdminApi.updateUserById": { + "name": "@supabase/auth-js.GoTrueAdminApi.updateUserById", + "params": [ + { + "name": "uid", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The user's unique identifier" + } + }, + { + "name": "attributes", + "type": { + "type": "object", + "name": "AdminUserAttributes", + "properties": [ + { + "name": "app_metadata", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "A custom data object to store the user's application specific metadata. This maps to the `auth.users.app_metadata` column.\n\nOnly a service role can modify.\n\nThe `app_metadata` should be a JSON object that includes app-specific info, such as identity providers, roles, and other\naccess control information." + } + }, + { + "name": "ban_duration", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Determines how long a user is banned for.\n\nThe format for the ban duration follows a strict sequence of decimal numbers with a unit suffix.\nValid time units are \"ns\", \"us\" (or \"µs\"), \"ms\", \"s\", \"m\", \"h\".\n\nFor example, some possible durations include: '300ms', '2h45m'.\n\nSetting the ban duration to 'none' lifts the ban on the user." + } + }, + { + "name": "current_password", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The user's current password\n\nThis is only ever present when the user is resetting\ntheir password and GOTRUE_SECURITY_UPDATE_PASSWORD_REQUIRE_CURRENT_PASSWORD is true." + } + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The user's email." + } + }, + { + "name": "email_confirm", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Sets the user's email as confirmed when true, or unconfirmed when false.\n\nOnly a service role can modify." + } + }, + { + "name": "id", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The `id` for the user.\n\nAllows you to overwrite the default `id` set for the user." + } + }, + { + "name": "nonce", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The nonce sent for reauthentication if the user's password is to be updated.\n\nCall reauthenticate() to obtain the nonce first." + } + }, + { + "name": "password", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The user's password." + } + }, + { + "name": "password_hash", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The `password_hash` for the user's password.\n\nAllows you to specify a password hash for the user. This is useful for migrating a user's password hash from another service.\n\nSupports bcrypt, scrypt (firebase), and argon2 password hashes." + } + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The user's phone." + } + }, + { + "name": "phone_confirm", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Sets the user's phone as confirmed when true, or unconfirmed when false.\n\nOnly a service role can modify." + } + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The `role` claim set in the user's access token JWT.\n\nWhen a user signs up, this role is set to `authenticated` by default. You should only modify the `role` if you need to provision several levels of admin access that have different permissions on individual columns in your database.\n\nSetting this role to `service_role` is not recommended as it grants the user admin privileges." + } + }, + { + "name": "user_metadata", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "A custom data object to store the user's metadata. This maps to the `auth.users.raw_user_meta_data` column.\n\n\nThe `user_metadata` should be a JSON object that includes user-specific info, such as their first and last name.\n\nNote: When using the GoTrueAdminApi and wanting to modify a user's metadata,\nthis attribute is used instead of UserAttributes data." + } + } + ] + }, + "comment": { + "shortText": "The data you want to update.\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser." + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "UserResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "user", + "type": { + "type": "object", + "name": "User", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "user", + "type": "[Circular]" + } + ] + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Updates the user data. Changes are applied directly without confirmation flows.", + "text": "**Important:** This is a server-side operation and does **not** trigger client-side\n`onAuthStateChange` listeners. The admin API has no connection to client state.\n\nTo sync changes to the client after calling this method:\n1. On the client, call `supabase.auth.refreshSession()` to fetch the updated user data\n2. This will trigger the `TOKEN_REFRESHED` event and notify all listeners", + "examples": [ + { + "id": "example-1", + "name": "Example 1", + "code": "```typescript\n// Server-side (Edge Function)\nconst { data, error } = await supabase.auth.admin.updateUserById(\n userId,\n { user_metadata: { preferences: { theme: 'dark' } } }\n)\n\n// Client-side (to sync the changes)\nconst { data, error } = await supabase.auth.refreshSession()\n// onAuthStateChange listeners will now be notified with updated user\n```" + }, + { + "id": "updates-a-user-s-email", + "name": "Updates a user's email", + "code": "```js\nconst { data: user, error } = await supabase.auth.admin.updateUserById(\n '11111111-1111-1111-1111-111111111111',\n { email: 'new@email.com' }\n)\n```", + "response": "```json\n{\n \"data\": {\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"new@email.com\",\n \"email_confirmed_at\": \"2024-01-01T00:00:00Z\",\n \"phone\": \"\",\n \"confirmed_at\": \"2024-01-01T00:00:00Z\",\n \"recovery_sent_at\": \"2024-01-01T00:00:00Z\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"app_metadata\": {\n \"provider\": \"email\",\n \"providers\": [\n \"email\"\n ]\n },\n \"user_metadata\": {\n \"email\": \"example@email.com\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"identities\": [\n {\n \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n \"identity_data\": {\n \"email\": \"example@email.com\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"provider\": \"email\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"example@email.com\"\n }\n ],\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"is_anonymous\": false\n }\n },\n \"error\": null\n}\n```" + }, + { + "id": "updates-a-user-s-password", + "name": "Updates a user's password", + "code": "```js\nconst { data: user, error } = await supabase.auth.admin.updateUserById(\n '6aa5d0d4-2a9f-4483-b6c8-0cf4c6c98ac4',\n { password: 'new_password' }\n)\n```" + }, + { + "id": "updates-a-user-s-metadata", + "name": "Updates a user's metadata", + "code": "```js\nconst { data: user, error } = await supabase.auth.admin.updateUserById(\n '6aa5d0d4-2a9f-4483-b6c8-0cf4c6c98ac4',\n { user_metadata: { hello: 'world' } }\n)\n```" + }, + { + "id": "updates-a-user-s-app-metadata", + "name": "Updates a user's app_metadata", + "code": "```js\nconst { data: user, error } = await supabase.auth.admin.updateUserById(\n '6aa5d0d4-2a9f-4483-b6c8-0cf4c6c98ac4',\n { app_metadata: { plan: 'trial' } }\n)\n```" + }, + { + "id": "confirms-a-user-s-email-address", + "name": "Confirms a user's email address", + "code": "```js\nconst { data: user, error } = await supabase.auth.admin.updateUserById(\n '6aa5d0d4-2a9f-4483-b6c8-0cf4c6c98ac4',\n { email_confirm: true }\n)\n```" + }, + { + "id": "confirms-a-user-s-phone-number", + "name": "Confirms a user's phone number", + "code": "```js\nconst { data: user, error } = await supabase.auth.admin.updateUserById(\n '6aa5d0d4-2a9f-4483-b6c8-0cf4c6c98ac4',\n { phone_confirm: true }\n)\n```" + }, + { + "id": "ban-a-user-for-100-years", + "name": "Ban a user for 100 years", + "code": "```js\nconst { data: user, error } = await supabase.auth.admin.updateUserById(\n '6aa5d0d4-2a9f-4483-b6c8-0cf4c6c98ac4',\n { ban_duration: '876000h' }\n)\n```" + } + ] + } + }, + "@supabase/auth-js.GoTrueClient.constructor": { + "name": "@supabase/auth-js.GoTrueClient.constructor", + "params": [ + { + "name": "options", + "type": { + "name": "GoTrueClientOptions", + "type": "object", + "properties": [ + { + "name": "autoRefreshToken", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "debug", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "boolean" + }, + { + "type": "function", + "params": [ + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "args", + "type": { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "any" + } + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + } + } + ] + }, + "isOptional": true + }, + { + "name": "detectSessionInUrl", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "boolean" + }, + { + "type": "function", + "params": [ + { + "name": "url", + "type": { + "type": "nameOnly", + "name": "URL" + } + }, + { + "name": "params", + "type": { + "type": "index signature", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "string" + } + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "boolean" + } + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Set to \"true\" if you want to automatically detect OAuth grants in the URL and sign in the user.\nSet to \"false\" to disable automatic detection.\nSet to a function to provide custom logic for determining if a URL contains a Supabase auth callback.\nThe function receives the current URL and parsed parameters, and should return true if the URL\nshould be processed as a Supabase auth callback, or false to ignore it.\n\nThis is useful when your app uses other OAuth providers (e.g., Facebook Login) that also return\naccess_token in the URL fragment, which would otherwise be incorrectly intercepted by Supabase Auth.", + "examples": [ + { + "id": "example-1", + "name": "Example 1", + "code": "```ts\ndetectSessionInUrl: (url, params) => {\n // Ignore Facebook OAuth redirects\n if (url.pathname === '/facebook/redirect') return false\n // Use default detection for other URLs\n return Boolean(params.access_token || params.error_description)\n}\n```" + } + ] + } + }, + { + "name": "experimental", + "type": { + "name": "ExperimentalFeatureFlags", + "type": "object", + "properties": [ + { + "name": "passkey", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Enables passkey support:\n - `auth.signInWithPasskey()`, `auth.registerPasskey()`\n - `auth.passkey.*`\n - `auth.admin.passkey.*`\n\nDefaults to `false`. Calling any passkey method while this flag is\ndisabled throws a descriptive error at call time." + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Opt-in flags for experimental features. These APIs may change without\nnotice and are disabled by default.", + "tags": [ + { + "tag": "experimental", + "text": "" + } + ] + } + }, + { + "name": "fetch", + "type": { + "type": "nameOnly", + "name": "Fetch" + }, + "isOptional": true + }, + { + "name": "flowType", + "type": { + "type": "union", + "name": "AuthFlowType", + "subTypes": [ + { + "type": "literal", + "value": "implicit" + }, + { + "type": "literal", + "value": "pkce" + }, + null + ] + }, + "isOptional": true + }, + { + "name": "hasCustomAuthorizationHeader", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "Set to \"true\" if there is a custom authorization header set globally.", + "tags": [ + { + "tag": "experimental", + "text": "" + } + ] + } + }, + { + "name": "headers", + "type": { + "type": "index signature", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "string" + } + }, + "isOptional": true + }, + { + "name": "lock", + "type": { + "name": "LockFunc", + "type": "function", + "params": [ + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Name of the lock to be acquired." + } + }, + { + "name": "acquireTimeout", + "type": { + "type": "intrinsic", + "name": "number" + }, + "comment": { + "shortText": "If negative, no timeout should occur. If positive it\n should throw an Error with an `isAcquireTimeout`\n property set to true if the operation fails to be\n acquired after this much time (ms)." + } + }, + { + "name": "fn", + "type": { + "type": "function", + "params": [], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "nameOnly", + "name": "R" + } + } + } + }, + "comment": { + "shortText": "The operation to execute when the lock is acquired." + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "nameOnly", + "name": "R" + } + } + } + }, + "isOptional": true, + "comment": { + "shortText": "Provide your own locking mechanism based on the environment. By default\nthe client coordinates refreshes itself (single-flight via\n`refreshingDeferred` + commit guard) and relies on the GoTrue server to\nresolve cross-tab refresh races. Passing a custom lock opts into a\nlegacy path that wraps every auth operation in your supplied lock — this\npath is preserved for backwards compatibility (typically React Native\n`processLock` or Node multi-process setups)." + } + }, + { + "name": "lockAcquireTimeout", + "type": { + "type": "intrinsic", + "name": "number" + }, + "isOptional": true, + "comment": { + "shortText": "The maximum time in milliseconds to wait for acquiring the custom lock\nsupplied via the `lock` option. Only consulted when a custom `lock` is\npassed — the default lockless path doesn't use this timeout." + } + }, + { + "name": "persistSession", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "skipAutoInitialize", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "If true, skips automatic initialization in constructor. Useful for SSR\ncontexts where initialization timing must be controlled to prevent race\nconditions with HTTP response generation." + } + }, + { + "name": "storage", + "type": { + "type": "nameOnly", + "name": "SupportedStorage" + }, + "isOptional": true + }, + { + "name": "storageKey", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "throwOnError", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "If there is an error with the query, throwOnError will reject the promise by\nthrowing the error instead of returning it as part of a successful response." + } + }, + { + "name": "url", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "userStorage", + "type": { + "type": "nameOnly", + "name": "SupportedStorage" + }, + "isOptional": true, + "comment": { + "shortText": "Stores the user object in a separate storage location from the rest of the session data. When non-null, `storage` will only store a JSON object containing the access and refresh token and some adjacent metadata, while `userStorage` will only contain the user object under the key `storageKey + '-user'`.\n\nWhen this option is set and cookie storage is used, `getSession()` and other functions that load a session from the cookie store might not return back a user. It's very important to always use `getUser()` to fetch a user object in those scenarios.", + "tags": [ + { + "tag": "experimental", + "text": "" + } + ] + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "GoTrueClient" + } + }, + "comment": { + "shortText": "Create a new client for use in the browser.", + "examples": [ + { + "id": "using-supabase-js-recommended", + "name": "Using supabase-js (recommended)", + "code": "```ts\nimport { createClient } from '@supabase/supabase-js'\n\nconst supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key')\nconst { data, error } = await supabase.auth.getUser()\n```" + }, + { + "id": "standalone-import-for-bundle-sensitive-environments", + "name": "Standalone import for bundle-sensitive environments", + "code": "```ts\nimport { GoTrueClient } from '@supabase/auth-js'\n\nconst auth = new GoTrueClient({\n url: 'https://xyzcompany.supabase.co/auth/v1',\n headers: { apikey: 'your-publishable-key' },\n storageKey: 'supabase-auth',\n})\n```" + } + ] + } + }, + "@supabase/auth-js.GoTrueClient.dispose": { + "name": "@supabase/auth-js.GoTrueClient.dispose", + "params": [], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "intrinsic", + "name": "void" + } + } + }, + "comment": { + "shortText": "Tears down the client's background work: stops the auto-refresh interval,\nremoves the `visibilitychange` listener, closes the cross-tab\n`BroadcastChannel`, and clears registered `onAuthStateChange` subscribers.\n\nCall this from cleanup hooks when the client is being replaced before\nits JS realm is destroyed. React Strict Mode and HMR are the common\ncases. Any in-flight `fetch` calls continue to completion and may still\nwrite to storage; dispose doesn't abort them or erase storage.\n\nLifecycle caveat: because in-flight refreshes are not aborted, a\ndisposed instance can still persist a rotated session to storage after\n`dispose()` returns. A subsequent `createClient` against the same\n`storageKey` will pick up that session on its next read. If you need\nstrict isolation between client lifecycles, await any pending auth\noperation before calling `dispose()` (or change the `storageKey` for\nthe replacement client).\n\nSafe to call repeatedly.", + "examples": [ + { + "id": "cleanup-on-react-unmount", + "name": "Cleanup on React unmount", + "code": "```ts\nuseEffect(() => {\n const client = createClient(...)\n return () => { client.auth.dispose() }\n}, [])\n```" + } + ] + } + }, + "@supabase/auth-js.GoTrueClient.exchangeCodeForSession": { + "name": "@supabase/auth-js.GoTrueClient.exchangeCodeForSession", + "params": [ + { + "name": "authCode", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthTokenResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "session", + "type": { + "type": "object", + "name": "Session", + "properties": [ + { + "name": "access_token", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The access token jwt. It is recommended to set the JWT_EXPIRY to a shorter expiry value." + } + }, + { + "name": "expires_at", + "type": { + "type": "intrinsic", + "name": "number" + }, + "isOptional": true, + "comment": { + "shortText": "A timestamp of when the token will expire. Returned when a login is confirmed." + } + }, + { + "name": "expires_in", + "type": { + "type": "intrinsic", + "name": "number" + }, + "comment": { + "shortText": "The number of seconds until the token expires (since it was issued). Returned when a login is confirmed." + } + }, + { + "name": "provider_refresh_token", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "intrinsic", + "name": "string" + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider refresh token. If present, this can be used to refresh the provider_token via the oauth provider's API.\nNot all oauth providers return a provider refresh token. If the provider_refresh_token is missing, please refer to the oauth provider's documentation for information on how to obtain the provider refresh token." + } + }, + { + "name": "provider_token", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "intrinsic", + "name": "string" + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider token. If present, this can be used to make external API requests to the oauth provider used." + } + }, + { + "name": "refresh_token", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "A one-time used refresh token that never expires." + } + }, + { + "name": "token_type", + "type": { + "type": "literal", + "value": "bearer" + } + }, + { + "name": "user", + "type": { + "type": "object", + "name": "User", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + "comment": { + "shortText": "When using a separate user storage, accessing properties of this object will throw an error." + } + } + ] + } + }, + { + "name": "user", + "type": { + "type": "object", + "name": "User", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "session", + "type": "[Circular]" + }, + { + "name": "user", + "type": "[Circular]" + } + ] + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Log in an existing user by exchanging an Auth Code issued during the PKCE flow.", + "text": "- Used when `flowType` is set to `pkce` in client options.", + "examples": [ + { + "id": "exchange-auth-code", + "name": "Exchange Auth Code", + "code": "```js\nsupabase.auth.exchangeCodeForSession('34e770dd-9ff9-416c-87fa-43b31d7ef225')\n```", + "response": "```json\n{\n \"data\": {\n session: {\n access_token: '',\n token_type: 'bearer',\n expires_in: 3600,\n expires_at: 1700000000,\n refresh_token: '',\n user: {\n id: '11111111-1111-1111-1111-111111111111',\n aud: 'authenticated',\n role: 'authenticated',\n email: 'example@email.com'\n email_confirmed_at: '2024-01-01T00:00:00Z',\n phone: '',\n confirmation_sent_at: '2024-01-01T00:00:00Z',\n confirmed_at: '2024-01-01T00:00:00Z',\n last_sign_in_at: '2024-01-01T00:00:00Z',\n app_metadata: {\n \"provider\": \"email\",\n \"providers\": [\n \"email\",\n \"\"\n ]\n },\n user_metadata: {\n email: 'email@email.com',\n email_verified: true,\n full_name: 'User Name',\n iss: '',\n name: 'User Name',\n phone_verified: false,\n provider_id: '',\n sub: ''\n },\n identities: [\n {\n \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n \"identity_data\": {\n \"email\": \"example@email.com\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"provider\": \"email\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"email@example.com\"\n },\n {\n \"identity_id\": \"33333333-3333-3333-3333-333333333333\",\n \"id\": \"\",\n \"user_id\": \"\",\n \"identity_data\": {\n \"email\": \"example@email.com\",\n \"email_verified\": true,\n \"full_name\": \"User Name\",\n \"iss\": \"\",\n \"name\": \"User Name\",\n \"phone_verified\": false,\n \"provider_id\": \"\",\n \"sub\": \"\"\n },\n \"provider\": \"\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"example@email.com\"\n }\n ],\n created_at: '2024-01-01T00:00:00Z',\n updated_at: '2024-01-01T00:00:00Z',\n is_anonymous: false\n },\n provider_token: '',\n provider_refresh_token: ''\n },\n user: {\n id: '11111111-1111-1111-1111-111111111111',\n aud: 'authenticated',\n role: 'authenticated',\n email: 'example@email.com',\n email_confirmed_at: '2024-01-01T00:00:00Z',\n phone: '',\n confirmation_sent_at: '2024-01-01T00:00:00Z',\n confirmed_at: '2024-01-01T00:00:00Z',\n last_sign_in_at: '2024-01-01T00:00:00Z',\n app_metadata: {\n provider: 'email',\n providers: [\n \"email\",\n \"\"\n ]\n },\n user_metadata: {\n email: 'email@email.com',\n email_verified: true,\n full_name: 'User Name',\n iss: '',\n name: 'User Name',\n phone_verified: false,\n provider_id: '',\n sub: ''\n },\n identities: [\n {\n \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n \"identity_data\": {\n \"email\": \"example@email.com\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"provider\": \"email\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"email@example.com\"\n },\n {\n \"identity_id\": \"33333333-3333-3333-3333-333333333333\",\n \"id\": \"\",\n \"user_id\": \"\",\n \"identity_data\": {\n \"email\": \"example@email.com\",\n \"email_verified\": true,\n \"full_name\": \"User Name\",\n \"iss\": \"\",\n \"name\": \"User Name\",\n \"phone_verified\": false,\n \"provider_id\": \"\",\n \"sub\": \"\"\n },\n \"provider\": \"\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"example@email.com\"\n }\n ],\n created_at: '2024-01-01T00:00:00Z',\n updated_at: '2024-01-01T00:00:00Z',\n is_anonymous: false\n },\n redirectType: null\n },\n \"error\": null\n}\n```" + } + ] + } + }, + "@supabase/auth-js.GoTrueClient.getClaims": { + "name": "@supabase/auth-js.GoTrueClient.getClaims", + "params": [ + { + "name": "jwt", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "An optional specific JWT you wish to verify, not the one you\n can obtain from #getSession." + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "allowExpired", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "If set to `true` the `exp` claim will not be validated against the current time." + } + }, + { + "name": "jwks", + "type": { + "type": "object", + "properties": [ + { + "name": "keys", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "JWK", + "properties": [ + { + "name": "alg", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "key_ops", + "type": { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + } + }, + { + "name": "kid", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "kty", + "type": { + "type": "union", + "subTypes": [ + null, + { + "type": "literal", + "value": "RSA" + }, + { + "type": "literal", + "value": "EC" + }, + { + "type": "literal", + "value": "oct" + } + ] + } + } + ] + } + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "If set, this JSON Web Key Set is going to have precedence over the cached value available on the server." + } + }, + { + "name": "keys", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "JWK", + "properties": [ + { + "name": "alg", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "key_ops", + "type": { + "type": "array", + "elemType": "[Circular]" + } + }, + { + "name": "kid", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "kty", + "type": { + "type": "union", + "subTypes": [ + null, + "[Circular]", + "[Circular]", + "[Circular]" + ] + } + } + ] + } + }, + "isOptional": true, + "comment": { + "shortText": "" + } + } + ] + }, + "comment": { + "shortText": "Various additional options that allow you to customize the\n behavior of this method." + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "claims", + "type": { + "type": "object", + "name": "JwtPayload", + "properties": [ + { + "name": "aal", + "type": { + "type": "union", + "name": "AuthenticatorAssuranceLevels", + "subTypes": [ + { + "type": "literal", + "value": "aal1" + }, + { + "type": "literal", + "value": "aal2" + }, + null + ] + } + }, + { + "name": "amr", + "type": { + "type": "union", + "subTypes": [ + { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + }, + { + "type": "array", + "elemType": { + "type": "object", + "name": "AMREntry", + "properties": [ + { + "name": "method", + "type": { + "type": "union", + "name": "AMRMethod", + "subTypes": [ + { + "type": "nameOnly", + "name": "['number']" + }, + null + ] + }, + "comment": { + "shortText": "Authentication method name." + } + }, + { + "name": "timestamp", + "type": { + "type": "intrinsic", + "name": "number" + }, + "comment": { + "shortText": "Timestamp when the method was successfully used. Represents number of\nseconds since 1st January 1970 (UNIX epoch) in UTC." + } + } + ] + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Authentication Method References.\nSupports both RFC-8176 compliant format (string[]) and detailed format (AMREntry[]).\n- String format: ['password', 'otp'] - RFC-8176 compliant\n- Object format: [{ method: 'password', timestamp: 1234567890 }] - includes timestamps" + } + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + }, + "isOptional": true + }, + { + "name": "aud", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "string" + }, + { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + } + ] + } + }, + { + "name": "email", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "exp", + "type": { + "type": "intrinsic", + "name": "number" + } + }, + { + "name": "iat", + "type": { + "type": "intrinsic", + "name": "number" + } + }, + { + "name": "is_anonymous", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "iss", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "jti", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "nbf", + "type": { + "type": "intrinsic", + "name": "number" + }, + "isOptional": true + }, + { + "name": "phone", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "ref", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "role", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "session_id", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "sub", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + }, + "isOptional": true + } + ] + } + }, + { + "name": "header", + "type": { + "name": "JwtHeader", + "type": "object", + "properties": [ + { + "name": "alg", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "RS256" + }, + { + "type": "literal", + "value": "ES256" + }, + { + "type": "literal", + "value": "HS256" + }, + null + ] + } + }, + { + "name": "kid", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "typ", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + } + }, + { + "name": "signature", + "type": { + "type": "nameOnly", + "name": "Uint8Array" + } + } + ] + } + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "literal", + "value": null + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "literal", + "value": null + } + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Extracts the JWT claims present in the access token by first verifying the\nJWT against the server's JSON Web Key Set endpoint\n`/.well-known/jwks.json` which is often cached, resulting in significantly\nfaster responses. Prefer this method over #getUser which always\nsends a request to the Auth server for each JWT.\n\nIf the project is not using an asymmetric JWT signing key (like ECC or\nRSA) it always sends a request to the Auth server (similar to #getUser) to verify the JWT.", + "text": "- Parses the user's [access token](/docs/guides/auth/sessions#access-token-jwt-claims) as a [JSON Web Token (JWT)](/docs/guides/auth/jwts) and returns its components if valid and not expired.\n- If your project is using asymmetric JWT signing keys, then the verification is done locally usually without a network request using the [WebCrypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API).\n- A network request is sent to your project's JWT signing key discovery endpoint `https://project-id.supabase.co/auth/v1/.well-known/jwks.json`, which is cached locally. If your environment is ephemeral, such as a Lambda function that is destroyed after every request, a network request will be sent for each new invocation. Supabase provides a network-edge cache providing fast responses for these situations.\n- If the user's access token is about to expire when calling this function, the user's session will first be refreshed before validating the JWT.\n- If your project is using a symmetric secret to sign the JWT, it always sends a request similar to `getUser()` to validate the JWT at the server before returning the decoded token. This is also used if the WebCrypto API is not available in the environment. Make sure you polyfill it in such situations.\n- The returned claims can be customized per project using the [Custom Access Token Hook](/docs/guides/auth/auth-hooks/custom-access-token-hook).", + "examples": [ + { + "id": "get-jwt-claims-header-and-signature", + "name": "Get JWT claims, header and signature", + "code": "```js\nconst { data, error } = await supabase.auth.getClaims()\n```", + "response": "```json\n{\n \"data\": {\n \"claims\": {\n \"aal\": \"aal1\",\n \"amr\": [{\n \"method\": \"email\",\n \"timestamp\": 1715766000\n }],\n \"app_metadata\": {},\n \"aud\": \"authenticated\",\n \"email\": \"example@email.com\",\n \"exp\": 1715769600,\n \"iat\": 1715766000,\n \"is_anonymous\": false,\n \"iss\": \"https://project-id.supabase.co/auth/v1\",\n \"phone\": \"+13334445555\",\n \"role\": \"authenticated\",\n \"session_id\": \"11111111-1111-1111-1111-111111111111\",\n \"sub\": \"11111111-1111-1111-1111-111111111111\",\n \"user_metadata\": {}\n },\n \"header\": {\n \"alg\": \"RS256\",\n \"typ\": \"JWT\",\n \"kid\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"signature\": [/** Uint8Array */],\n },\n \"error\": null\n}\n```" + } + ] + } + }, + "@supabase/auth-js.GoTrueClient.getSession": { + "name": "@supabase/auth-js.GoTrueClient.getSession", + "params": [], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "session", + "type": { + "type": "object", + "name": "Session", + "properties": [ + { + "name": "access_token", + "type": "[Circular]", + "comment": { + "shortText": "The access token jwt. It is recommended to set the JWT_EXPIRY to a shorter expiry value." + } + }, + { + "name": "expires_at", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "A timestamp of when the token will expire. Returned when a login is confirmed." + } + }, + { + "name": "expires_in", + "type": "[Circular]", + "comment": { + "shortText": "The number of seconds until the token expires (since it was issued). Returned when a login is confirmed." + } + }, + { + "name": "provider_refresh_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider refresh token. If present, this can be used to refresh the provider_token via the oauth provider's API.\nNot all oauth providers return a provider refresh token. If the provider_refresh_token is missing, please refer to the oauth provider's documentation for information on how to obtain the provider refresh token." + } + }, + { + "name": "provider_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider token. If present, this can be used to make external API requests to the oauth provider used." + } + }, + { + "name": "refresh_token", + "type": "[Circular]", + "comment": { + "shortText": "A one-time used refresh token that never expires." + } + }, + { + "name": "token_type", + "type": "[Circular]" + }, + { + "name": "user", + "type": { + "type": "object", + "name": "User", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + "comment": { + "shortText": "When using a separate user storage, accessing properties of this object will throw an error." + } + } + ] + } + } + ] + } + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "session", + "type": { + "type": "literal", + "value": null + } + } + ] + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "session", + "type": { + "type": "literal", + "value": null + } + } + ] + } + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Returns the session, refreshing it if necessary.\n\nThe session returned can be null if the session is not detected which can happen in the event a user is not signed-in or has logged out.\n\n**IMPORTANT:** This method loads values directly from the storage attached\nto the client. If that storage is based on request cookies for example,\nthe values in it may not be authentic and therefore it's strongly advised\nagainst using this method and its results in such circumstances. A warning\nwill be emitted if this is detected. Use #getUser() instead.", + "text": "- Since the introduction of [asymmetric JWT signing keys](/docs/guides/auth/signing-keys), this method is considered low-level and we encourage you to use `getClaims()` or `getUser()` instead.\n- Retrieves the current [user session](/docs/guides/auth/sessions) from the storage medium (local storage, cookies).\n- The session contains an access token (signed JWT), a refresh token and the user object.\n- If the session's access token is expired or is about to expire, this method will use the refresh token to refresh the session.\n- When using in a browser, or you've called `startAutoRefresh()` in your environment (React Native, etc.) this function always returns a valid access token without refreshing the session itself, as this is done in the background. This function returns very fast.\n- **IMPORTANT SECURITY NOTICE:** If using an insecure storage medium, such as cookies or request headers, the user object returned by this function **must not be trusted**. Always verify the JWT using `getClaims()` or your own JWT verification library to securely establish the user's identity and access. You can also use `getUser()` to fetch the user object directly from the Auth server for this purpose.\n- Cross-tab refresh races are handled by the GoTrue server (the rotated token from the first tab is returned to subsequent tabs via the parent-of-active mechanism), so no client-side serialization is needed.", + "examples": [ + { + "id": "get-the-session-data", + "name": "Get the session data", + "code": "```js\nconst { data, error } = await supabase.auth.getSession()\n```", + "response": "```json\n{\n \"data\": {\n \"session\": {\n \"access_token\": \"\",\n \"token_type\": \"bearer\",\n \"expires_in\": 3600,\n \"expires_at\": 1700000000,\n \"refresh_token\": \"\",\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"example@email.com\",\n \"email_confirmed_at\": \"2024-01-01T00:00:00Z\",\n \"phone\": \"\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"app_metadata\": {\n \"provider\": \"email\",\n \"providers\": [\n \"email\"\n ]\n },\n \"user_metadata\": {\n \"email\": \"example@email.com\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"identities\": [\n {\n \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n \"identity_data\": {\n \"email\": \"example@email.com\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"provider\": \"email\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"example@email.com\"\n }\n ],\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"is_anonymous\": false\n }\n }\n },\n \"error\": null\n}\n```" + } + ] + } + }, + "@supabase/auth-js.GoTrueClient.getUser": { + "name": "@supabase/auth-js.GoTrueClient.getUser", + "params": [ + { + "name": "jwt", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Takes in an optional access token JWT. If no JWT is provided, the JWT from the current session is used." + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "UserResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "user", + "type": { + "type": "object", + "name": "User", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "user", + "type": "[Circular]" + } + ] + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Gets the current user details if there is an existing session. This method\nperforms a network request to the Supabase Auth server, so the returned\nvalue is authentic and can be used to base authorization rules on.", + "text": "- This method fetches the user object from the database instead of local session.\n- This method is useful for checking if the user is authorized because it validates the user's access token JWT on the server.\n- Should always be used when checking for user authorization on the server. On the client, you can instead use `getSession().session.user` for faster results. `getSession` is insecure on the server.", + "examples": [ + { + "id": "get-the-logged-in-user-with-the-current-existing-session", + "name": "Get the logged in user with the current existing session", + "code": "```js\nconst { data: { user } } = await supabase.auth.getUser()\n```", + "response": "```json\n{\n \"data\": {\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"example@email.com\",\n \"email_confirmed_at\": \"2024-01-01T00:00:00Z\",\n \"phone\": \"\",\n \"confirmed_at\": \"2024-01-01T00:00:00Z\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"app_metadata\": {\n \"provider\": \"email\",\n \"providers\": [\n \"email\"\n ]\n },\n \"user_metadata\": {\n \"email\": \"example@email.com\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"identities\": [\n {\n \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n \"identity_data\": {\n \"email\": \"example@email.com\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"provider\": \"email\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"example@email.com\"\n }\n ],\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"is_anonymous\": false\n }\n },\n \"error\": null\n}\n```" + }, + { + "id": "get-the-logged-in-user-with-a-custom-access-token-jwt", + "name": "Get the logged in user with a custom access token jwt", + "code": "```js\nconst { data: { user } } = await supabase.auth.getUser(jwt)\n```" + } + ] + } + }, + "@supabase/auth-js.GoTrueClient.getUserIdentities": { + "name": "@supabase/auth-js.GoTrueClient.getUserIdentities", + "params": [], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + } + } + ] + } + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "literal", + "value": null + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Gets all the identities linked to a user.", + "text": "- The user needs to be signed in to call `getUserIdentities()`.", + "examples": [ + { + "id": "returns-a-list-of-identities-linked-to-the-user", + "name": "Returns a list of identities linked to the user", + "code": "```js\nconst { data, error } = await supabase.auth.getUserIdentities()\n```", + "response": "```json\n{\n \"data\": {\n \"identities\": [\n {\n \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n \"id\": \"2024-01-01T00:00:00Z\",\n \"user_id\": \"2024-01-01T00:00:00Z\",\n \"identity_data\": {\n \"email\": \"example@email.com\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"provider\": \"email\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"example@email.com\"\n }\n ]\n },\n \"error\": null\n}\n```" + } + ] + } + }, + "@supabase/auth-js.GoTrueClient.initialize": { + "name": "@supabase/auth-js.GoTrueClient.initialize", + "params": [], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "name": "InitializeResult", + "type": "object", + "properties": [ + { + "name": "error", + "type": { + "type": "union", + "subTypes": [ + { + "type": "nameOnly", + "name": "AuthError" + }, + { + "type": "literal", + "value": null + } + ] + } + } + ] + } + } + }, + "comment": { + "shortText": "Initialize the auth client by loading the session from storage or\ndetecting it from the URL after an OAuth, magic-link, or password-recovery\nredirect.\n\n**Most callers do not need to invoke this directly.** The client calls it\nautomatically during construction, and to react to sign-in events (including\npost-redirect events) you should subscribe to `onAuthStateChange` rather\nthan awaiting `initialize()`.\n\nYou only need to call it manually when you have opted out of the automatic\ncall by passing `skipAutoInitialize: true` — for example, in an SSR context\nwhere you need to control initialization timing. In that case, awaiting\n`initialize()` returns the resolved session result (or any error encountered\nwhile detecting it from the URL)." + } + }, + "@supabase/auth-js.GoTrueClient.isThrowOnErrorEnabled": { + "name": "@supabase/auth-js.GoTrueClient.isThrowOnErrorEnabled", + "params": [], + "ret": { + "type": { + "type": "intrinsic", + "name": "boolean" + } + }, + "comment": { + "shortText": "Returns whether error throwing mode is enabled for this client." + } + }, + "@supabase/auth-js.GoTrueClient.linkIdentity": { + "name": "@supabase/auth-js.GoTrueClient.linkIdentity", + "params": [ + { + "name": "credentials", + "type": { + "name": "SignInWithOAuthCredentials", + "type": "object", + "properties": [ + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "queryParams", + "type": { + "type": "index signature", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "string" + } + }, + "isOptional": true, + "comment": { + "shortText": "An object of query params" + } + }, + { + "name": "redirectTo", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "A URL to send the user to after they are confirmed." + } + }, + { + "name": "scopes", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "A space-separated list of scopes granted to the OAuth application." + } + }, + { + "name": "skipBrowserRedirect", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "If set to true does not immediately redirect the current browser context to visit the OAuth authorization page for the provider." + } + } + ] + }, + "isOptional": true + }, + { + "name": "provider", + "type": { + "type": "union", + "name": "Provider", + "subTypes": [ + { + "type": "literal", + "value": "apple" + }, + { + "type": "literal", + "value": "azure" + }, + { + "type": "literal", + "value": "bitbucket" + }, + { + "type": "literal", + "value": "discord" + }, + { + "type": "literal", + "value": "facebook" + }, + { + "type": "literal", + "value": "figma" + }, + { + "type": "literal", + "value": "github" + }, + { + "type": "literal", + "value": "gitlab" + }, + { + "type": "literal", + "value": "google" + }, + { + "type": "literal", + "value": "kakao" + }, + { + "type": "literal", + "value": "keycloak" + }, + { + "type": "literal", + "value": "linkedin" + }, + { + "type": "literal", + "value": "linkedin_oidc" + }, + { + "type": "literal", + "value": "notion" + }, + { + "type": "literal", + "value": "slack" + }, + { + "type": "literal", + "value": "slack_oidc" + }, + { + "type": "literal", + "value": "spotify" + }, + { + "type": "literal", + "value": "twitch" + }, + { + "type": "literal", + "value": "twitter" + }, + { + "type": "literal", + "value": "x" + }, + { + "type": "literal", + "value": "workos" + }, + { + "type": "literal", + "value": "zoom" + }, + { + "type": "literal", + "value": "fly" + }, + null + ] + }, + "comment": { + "shortText": "One of the providers supported by GoTrue." + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "OAuthResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "provider", + "type": { + "type": "union", + "name": "Provider", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + null + ] + } + }, + { + "name": "url", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + } + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "provider", + "type": { + "type": "union", + "name": "Provider", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + null + ] + } + }, + { + "name": "url", + "type": { + "type": "literal", + "value": null + } + } + ] + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Links an oauth identity to an existing user.\nThis method supports the PKCE flow.", + "text": "- The **Enable Manual Linking** option must be enabled from your [project's authentication settings](/dashboard/project/_/auth/providers).\n- The user needs to be signed in to call `linkIdentity()`.\n- If the candidate identity is already linked to the existing user or another user, `linkIdentity()` will fail.\n- If `linkIdentity` is run in the browser, the user is automatically redirected to the returned URL. On the server, you should handle the redirect.", + "examples": [ + { + "id": "link-an-identity-to-a-user", + "name": "Link an identity to a user", + "code": "```js\nconst { data, error } = await supabase.auth.linkIdentity({\n provider: 'github'\n})\n```", + "response": "```json\n{\n data: {\n provider: 'github',\n url: \n },\n error: null\n}\n```" + } + ] + }, + "altSignatures": [ + { + "params": [ + { + "name": "credentials", + "type": { + "name": "SignInWithIdTokenCredentials", + "type": "object", + "properties": [ + { + "name": "access_token", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "If the ID token contains an `at_hash` claim, then the hash of this value is compared to the value in the ID token." + } + }, + { + "name": "nonce", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "If the ID token contains a `nonce` claim, then the hash of this value is compared to the value in the ID token." + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "captchaToken", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Verification token received when the user completes the captcha on the site." + } + } + ] + }, + "isOptional": true + }, + { + "name": "provider", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "google" + }, + { + "type": "literal", + "value": "apple" + }, + { + "type": "literal", + "value": "azure" + }, + { + "type": "literal", + "value": "facebook" + }, + { + "type": "literal", + "value": "kakao" + }, + null, + null + ] + }, + "comment": { + "shortText": "Provider name or OIDC `iss` value identifying which provider should be used to verify the provided token. Supported names: `google`, `apple`, `azure`, `facebook`, `kakao`. Use the `custom:` prefix for custom OIDC providers (e.g. `custom:my-oidc-provider`)." + } + }, + { + "name": "token", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "OIDC ID token issued by the specified provider. The `iss` claim in the ID token must match the supplied provider. Some ID tokens contain an `at_hash` which require that you provide an `access_token` value to be accepted properly. If the token contains a `nonce` claim you must supply the nonce used to obtain the ID token." + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthTokenResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "session", + "type": { + "type": "object", + "name": "Session", + "properties": [ + { + "name": "access_token", + "type": "[Circular]", + "comment": { + "shortText": "The access token jwt. It is recommended to set the JWT_EXPIRY to a shorter expiry value." + } + }, + { + "name": "expires_at", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "A timestamp of when the token will expire. Returned when a login is confirmed." + } + }, + { + "name": "expires_in", + "type": "[Circular]", + "comment": { + "shortText": "The number of seconds until the token expires (since it was issued). Returned when a login is confirmed." + } + }, + { + "name": "provider_refresh_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider refresh token. If present, this can be used to refresh the provider_token via the oauth provider's API.\nNot all oauth providers return a provider refresh token. If the provider_refresh_token is missing, please refer to the oauth provider's documentation for information on how to obtain the provider refresh token." + } + }, + { + "name": "provider_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider token. If present, this can be used to make external API requests to the oauth provider used." + } + }, + { + "name": "refresh_token", + "type": "[Circular]", + "comment": { + "shortText": "A one-time used refresh token that never expires." + } + }, + { + "name": "token_type", + "type": "[Circular]" + }, + { + "name": "user", + "type": { + "type": "object", + "name": "User", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + "comment": { + "shortText": "When using a separate user storage, accessing properties of this object will throw an error." + } + } + ] + } + }, + { + "name": "user", + "type": { + "type": "object", + "name": "User", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "session", + "type": "[Circular]" + }, + { + "name": "user", + "type": "[Circular]" + } + ] + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + } + ] + } + } + } + } + ] + }, + "@supabase/auth-js.GoTrueClient.onAuthStateChange": { + "name": "@supabase/auth-js.GoTrueClient.onAuthStateChange", + "params": [ + { + "name": "callback", + "type": { + "type": "function", + "params": [ + { + "name": "event", + "type": { + "type": "union", + "name": "AuthChangeEvent", + "subTypes": [ + { + "type": "literal", + "value": "INITIAL_SESSION" + }, + { + "type": "literal", + "value": "PASSWORD_RECOVERY" + }, + { + "type": "literal", + "value": "SIGNED_IN" + }, + { + "type": "literal", + "value": "SIGNED_OUT" + }, + { + "type": "literal", + "value": "TOKEN_REFRESHED" + }, + { + "type": "literal", + "value": "USER_UPDATED" + }, + { + "type": "literal", + "value": "MFA_CHALLENGE_VERIFIED", + "name": "AuthChangeEventMFA" + } + ] + } + }, + { + "name": "session", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "object", + "name": "Session", + "properties": [ + { + "name": "access_token", + "type": "[Circular]", + "comment": { + "shortText": "The access token jwt. It is recommended to set the JWT_EXPIRY to a shorter expiry value." + } + }, + { + "name": "expires_at", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "A timestamp of when the token will expire. Returned when a login is confirmed." + } + }, + { + "name": "expires_in", + "type": "[Circular]", + "comment": { + "shortText": "The number of seconds until the token expires (since it was issued). Returned when a login is confirmed." + } + }, + { + "name": "provider_refresh_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider refresh token. If present, this can be used to refresh the provider_token via the oauth provider's API.\nNot all oauth providers return a provider refresh token. If the provider_refresh_token is missing, please refer to the oauth provider's documentation for information on how to obtain the provider refresh token." + } + }, + { + "name": "provider_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider token. If present, this can be used to make external API requests to the oauth provider used." + } + }, + { + "name": "refresh_token", + "type": "[Circular]", + "comment": { + "shortText": "A one-time used refresh token that never expires." + } + }, + { + "name": "token_type", + "type": "[Circular]" + }, + { + "name": "user", + "type": { + "type": "object", + "name": "User", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + "comment": { + "shortText": "When using a separate user storage, accessing properties of this object will throw an error." + } + } + ] + } + ] + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + } + }, + "comment": { + "shortText": "A callback function to be invoked when an auth event happens." + } + } + ], + "ret": { + "type": { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "subscription", + "type": { + "type": "object", + "name": "Subscription", + "properties": [ + { + "name": "callback", + "type": { + "type": "function", + "params": [ + { + "name": "event", + "type": { + "type": "union", + "name": "AuthChangeEvent", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]" + ] + } + }, + { + "name": "session", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "object", + "name": "Session", + "properties": [ + { + "name": "access_token", + "type": "[Circular]", + "comment": { + "shortText": "The access token jwt. It is recommended to set the JWT_EXPIRY to a shorter expiry value." + } + }, + { + "name": "expires_at", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "A timestamp of when the token will expire. Returned when a login is confirmed." + } + }, + { + "name": "expires_in", + "type": "[Circular]", + "comment": { + "shortText": "The number of seconds until the token expires (since it was issued). Returned when a login is confirmed." + } + }, + { + "name": "provider_refresh_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider refresh token. If present, this can be used to refresh the provider_token via the oauth provider's API.\nNot all oauth providers return a provider refresh token. If the provider_refresh_token is missing, please refer to the oauth provider's documentation for information on how to obtain the provider refresh token." + } + }, + { + "name": "provider_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider token. If present, this can be used to make external API requests to the oauth provider used." + } + }, + { + "name": "refresh_token", + "type": "[Circular]", + "comment": { + "shortText": "A one-time used refresh token that never expires." + } + }, + { + "name": "token_type", + "type": "[Circular]" + }, + { + "name": "user", + "type": { + "type": "object", + "name": "User", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + "comment": { + "shortText": "When using a separate user storage, accessing properties of this object will throw an error." + } + } + ] + } + ] + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + } + }, + "comment": { + "shortText": "The function to call every time there is an event. eg: (eventName) => {}" + } + }, + { + "name": "id", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "string" + }, + { + "type": "intrinsic", + "name": "symbol" + } + ] + }, + "comment": { + "shortText": "A unique identifier for this subscription, set by the client.\nThis is an internal identifier used for managing callbacks and should not be\nrelied upon by application code. Use the unsubscribe() method to remove listeners." + } + }, + { + "name": "unsubscribe", + "type": { + "type": "function", + "params": [], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + } + }, + "comment": { + "shortText": "Call this to remove the listener." + } + } + ] + } + } + ] + } + } + ] + } + }, + "comment": { + "shortText": "Receive a notification every time an auth event happens.\nSafe to use without an async function as callback.", + "text": "- Subscribes to important events occurring on the user's session.\n- Use on the frontend/client. It is less useful on the server.\n- Events are emitted across tabs to keep your application's UI up-to-date. Some events can fire very frequently, based on the number of tabs open. Use a quick and efficient callback function, and defer or debounce as many operations as you can to be performed outside of the callback.\n- Callbacks can be `async` and can safely call other Supabase auth methods (`getUser`, `setSession`, etc.) from inside the callback.\n- Keep callbacks quick. Events are awaited in order, so a slow callback delays subsequent events to subscribers in this tab.\n- Emitted events:\n - `INITIAL_SESSION`\n - Emitted right after the Supabase client is constructed and the initial session from storage is loaded.\n - `SIGNED_IN`\n - Emitted each time a user session is confirmed or re-established, including on user sign in and when refocusing a tab.\n - Avoid making assumptions as to when this event is fired, this may occur even when the user is already signed in. Instead, check the user object attached to the event to see if a new user has signed in and update your application's UI.\n - This event can fire very frequently depending on the number of tabs open in your application.\n - `SIGNED_OUT`\n - Emitted when the user signs out. This can be after:\n - A call to `supabase.auth.signOut()`.\n - After the user's session has expired for any reason:\n - User has signed out on another device.\n - The session has reached its timebox limit or inactivity timeout.\n - User has signed in on another device with single session per user enabled.\n - Check the [User Sessions](/docs/guides/auth/sessions) docs for more information.\n - Use this to clean up any local storage your application has associated with the user.\n - `TOKEN_REFRESHED`\n - Emitted each time a new access and refresh token are fetched for the signed in user.\n - It's best practice and highly recommended to extract the access token (JWT) and store it in memory for further use in your application.\n - Avoid frequent calls to `supabase.auth.getSession()` for the same purpose.\n - There is a background process that keeps track of when the session should be refreshed so you will always receive valid tokens by listening to this event.\n - The frequency of this event is related to the JWT expiry limit configured on your project.\n - `USER_UPDATED`\n - Emitted each time the `supabase.auth.updateUser()` method finishes successfully. Listen to it to update your application's UI based on new profile information.\n - `PASSWORD_RECOVERY`\n - Emitted instead of the `SIGNED_IN` event when the user lands on a page that includes a password recovery link in the URL.\n - Use it to show a UI to the user where they can [reset their password](/docs/guides/auth/passwords#resetting-a-users-password-forgot-password).", + "examples": [ + { + "id": "listen-to-auth-changes", + "name": "Listen to auth changes", + "code": "```js\nconst { data } = supabase.auth.onAuthStateChange((event, session) => {\n console.log(event, session)\n\n if (event === 'INITIAL_SESSION') {\n // handle initial session\n } else if (event === 'SIGNED_IN') {\n // handle sign in event\n } else if (event === 'SIGNED_OUT') {\n // handle sign out event\n } else if (event === 'PASSWORD_RECOVERY') {\n // handle password recovery event\n } else if (event === 'TOKEN_REFRESHED') {\n // handle token refreshed event\n } else if (event === 'USER_UPDATED') {\n // handle user updated event\n }\n})\n\n// call unsubscribe to remove the callback\ndata.subscription.unsubscribe()\n```" + }, + { + "id": "listen-to-sign-out", + "name": "Listen to sign out", + "code": "```js\nsupabase.auth.onAuthStateChange((event, session) => {\n if (event === 'SIGNED_OUT') {\n console.log('SIGNED_OUT', session)\n\n // clear local and session storage\n [\n window.localStorage,\n window.sessionStorage,\n ].forEach((storage) => {\n Object.entries(storage)\n .forEach(([key]) => {\n storage.removeItem(key)\n })\n })\n }\n})\n```", + "description": "Make sure you clear out any local data, such as local and session storage, after the client library has detected the user's sign out." + }, + { + "id": "store-oauth-provider-tokens-on-sign-in", + "name": "Store OAuth provider tokens on sign in", + "code": "```js\n// Register this immediately after calling createClient!\n// Because signInWithOAuth causes a redirect, you need to fetch the\n// provider tokens from the callback.\nsupabase.auth.onAuthStateChange((event, session) => {\n if (session && session.provider_token) {\n window.localStorage.setItem('oauth_provider_token', session.provider_token)\n }\n\n if (session && session.provider_refresh_token) {\n window.localStorage.setItem('oauth_provider_refresh_token', session.provider_refresh_token)\n }\n\n if (event === 'SIGNED_OUT') {\n window.localStorage.removeItem('oauth_provider_token')\n window.localStorage.removeItem('oauth_provider_refresh_token')\n }\n})\n```", + "description": "When using [OAuth (Social Login)](/docs/guides/auth/social-login) you sometimes wish to get access to the provider's access token and refresh token, in order to call provider APIs in the name of the user.\n\nFor example, if you are using [Sign in with Google](/docs/guides/auth/social-login/auth-google) you may want to use the provider token to call Google APIs on behalf of the user. Supabase Auth does not keep track of the provider access and refresh token, but does return them for you once, immediately after sign in. You can use the `onAuthStateChange` method to listen for the presence of the provider tokens and store them in local storage. You can further send them to your server's APIs for use on the backend.\n\nFinally, make sure you remove them from local storage on the `SIGNED_OUT` event. If the OAuth provider supports token revocation, make sure you call those APIs either from the frontend or schedule them to be called on the backend." + }, + { + "id": "use-react-context-for-the-user-s-session", + "name": "Use React Context for the User's session", + "code": "```js\nconst SessionContext = React.createContext(null)\n\nfunction main() {\n const [session, setSession] = React.useState(null)\n\n React.useEffect(() => {\n const {data: { subscription }} = supabase.auth.onAuthStateChange(\n (event, session) => {\n if (event === 'SIGNED_OUT') {\n setSession(null)\n } else if (session) {\n setSession(session)\n }\n })\n\n return () => {\n subscription.unsubscribe()\n }\n }, [])\n\n return (\n \n \n \n )\n}\n```", + "description": "Instead of relying on `supabase.auth.getSession()` within your React components, you can use a [React Context](https://react.dev/reference/react/createContext) to store the latest session information from the `onAuthStateChange` callback and access it that way." + }, + { + "id": "listen-to-password-recovery-events", + "name": "Listen to password recovery events", + "code": "```js\nsupabase.auth.onAuthStateChange((event, session) => {\n if (event === 'PASSWORD_RECOVERY') {\n console.log('PASSWORD_RECOVERY', session)\n // show screen to update user's password\n showPasswordResetScreen(true)\n }\n})\n```" + }, + { + "id": "listen-to-sign-in", + "name": "Listen to sign in", + "code": "```js\nsupabase.auth.onAuthStateChange((event, session) => {\n if (event === 'SIGNED_IN') console.log('SIGNED_IN', session)\n})\n```" + }, + { + "id": "listen-to-token-refresh", + "name": "Listen to token refresh", + "code": "```js\nsupabase.auth.onAuthStateChange((event, session) => {\n if (event === 'TOKEN_REFRESHED') console.log('TOKEN_REFRESHED', session)\n})\n```" + }, + { + "id": "listen-to-user-updates", + "name": "Listen to user updates", + "code": "```js\nsupabase.auth.onAuthStateChange((event, session) => {\n if (event === 'USER_UPDATED') console.log('USER_UPDATED', session)\n})\n```" + } + ] + }, + "altSignatures": [ + { + "params": [ + { + "name": "callback", + "type": { + "type": "function", + "params": [ + { + "name": "event", + "type": { + "type": "union", + "name": "AuthChangeEvent", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]" + ] + } + }, + { + "name": "session", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "object", + "name": "Session", + "properties": [ + { + "name": "access_token", + "type": "[Circular]", + "comment": { + "shortText": "The access token jwt. It is recommended to set the JWT_EXPIRY to a shorter expiry value." + } + }, + { + "name": "expires_at", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "A timestamp of when the token will expire. Returned when a login is confirmed." + } + }, + { + "name": "expires_in", + "type": "[Circular]", + "comment": { + "shortText": "The number of seconds until the token expires (since it was issued). Returned when a login is confirmed." + } + }, + { + "name": "provider_refresh_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider refresh token. If present, this can be used to refresh the provider_token via the oauth provider's API.\nNot all oauth providers return a provider refresh token. If the provider_refresh_token is missing, please refer to the oauth provider's documentation for information on how to obtain the provider refresh token." + } + }, + { + "name": "provider_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider token. If present, this can be used to make external API requests to the oauth provider used." + } + }, + { + "name": "refresh_token", + "type": "[Circular]", + "comment": { + "shortText": "A one-time used refresh token that never expires." + } + }, + { + "name": "token_type", + "type": "[Circular]" + }, + { + "name": "user", + "type": { + "type": "object", + "name": "User", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + "comment": { + "shortText": "When using a separate user storage, accessing properties of this object will throw an error." + } + } + ] + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "intrinsic", + "name": "void" + } + } + } + }, + "comment": { + "shortText": "A callback function to be invoked when an auth event happens." + } + } + ], + "ret": { + "type": { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "subscription", + "type": { + "type": "object", + "name": "Subscription", + "properties": [ + { + "name": "callback", + "type": { + "type": "function", + "params": [ + { + "name": "event", + "type": { + "type": "union", + "name": "AuthChangeEvent", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]" + ] + } + }, + { + "name": "session", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + { + "type": "object", + "name": "Session", + "properties": [ + { + "name": "access_token", + "type": "[Circular]", + "comment": { + "shortText": "The access token jwt. It is recommended to set the JWT_EXPIRY to a shorter expiry value." + } + }, + { + "name": "expires_at", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "A timestamp of when the token will expire. Returned when a login is confirmed." + } + }, + { + "name": "expires_in", + "type": "[Circular]", + "comment": { + "shortText": "The number of seconds until the token expires (since it was issued). Returned when a login is confirmed." + } + }, + { + "name": "provider_refresh_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider refresh token. If present, this can be used to refresh the provider_token via the oauth provider's API.\nNot all oauth providers return a provider refresh token. If the provider_refresh_token is missing, please refer to the oauth provider's documentation for information on how to obtain the provider refresh token." + } + }, + { + "name": "provider_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider token. If present, this can be used to make external API requests to the oauth provider used." + } + }, + { + "name": "refresh_token", + "type": "[Circular]", + "comment": { + "shortText": "A one-time used refresh token that never expires." + } + }, + { + "name": "token_type", + "type": "[Circular]" + }, + { + "name": "user", + "type": { + "type": "object", + "name": "User", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + "comment": { + "shortText": "When using a separate user storage, accessing properties of this object will throw an error." + } + } + ] + } + ] + } + } + ], + "ret": { + "type": "[Circular]" + } + }, + "comment": { + "shortText": "The function to call every time there is an event. eg: (eventName) => {}" + } + }, + { + "name": "id", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "A unique identifier for this subscription, set by the client.\nThis is an internal identifier used for managing callbacks and should not be\nrelied upon by application code. Use the unsubscribe() method to remove listeners." + } + }, + { + "name": "unsubscribe", + "type": { + "type": "function", + "params": [], + "ret": { + "type": "[Circular]" + } + }, + "comment": { + "shortText": "Call this to remove the listener." + } + } + ] + } + } + ] + } + } + ] + } + } + } + ] + }, + "@supabase/auth-js.GoTrueClient.reauthenticate": { + "name": "@supabase/auth-js.GoTrueClient.reauthenticate", + "params": [], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "session", + "type": { + "type": "union", + "subTypes": [ + { + "type": "object", + "name": "Session", + "properties": [ + { + "name": "access_token", + "type": "[Circular]", + "comment": { + "shortText": "The access token jwt. It is recommended to set the JWT_EXPIRY to a shorter expiry value." + } + }, + { + "name": "expires_at", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "A timestamp of when the token will expire. Returned when a login is confirmed." + } + }, + { + "name": "expires_in", + "type": "[Circular]", + "comment": { + "shortText": "The number of seconds until the token expires (since it was issued). Returned when a login is confirmed." + } + }, + { + "name": "provider_refresh_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider refresh token. If present, this can be used to refresh the provider_token via the oauth provider's API.\nNot all oauth providers return a provider refresh token. If the provider_refresh_token is missing, please refer to the oauth provider's documentation for information on how to obtain the provider refresh token." + } + }, + { + "name": "provider_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider token. If present, this can be used to make external API requests to the oauth provider used." + } + }, + { + "name": "refresh_token", + "type": "[Circular]", + "comment": { + "shortText": "A one-time used refresh token that never expires." + } + }, + { + "name": "token_type", + "type": "[Circular]" + }, + { + "name": "user", + "type": { + "type": "object", + "name": "User", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + "comment": { + "shortText": "When using a separate user storage, accessing properties of this object will throw an error." + } + } + ] + }, + { + "type": "literal", + "value": null + } + ] + } + }, + { + "name": "user", + "type": { + "type": "union", + "subTypes": [ + { + "type": "object", + "name": "User", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + { + "type": "literal", + "value": null + } + ] + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "session", + "type": "[Circular]" + }, + { + "name": "user", + "type": "[Circular]" + } + ] + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Sends a reauthentication OTP to the user's email or phone number.\nRequires the user to be signed-in.", + "text": "- This method is used together with `updateUser()` when a user's password needs to be updated.\n- If you require your user to reauthenticate before updating their password, you need to enable the **Secure password change** option in your [project's email provider settings](/dashboard/project/_/auth/providers).\n- A user is only require to reauthenticate before updating their password if **Secure password change** is enabled and the user **hasn't recently signed in**. A user is deemed recently signed in if the session was created in the last 24 hours.\n- This method will send a nonce to the user's email. If the user doesn't have a confirmed email address, the method will send the nonce to the user's confirmed phone number instead.\n- After receiving the OTP, include it as the `nonce` in your `updateUser()` call to finalize the password change.", + "examples": [ + { + "id": "send-reauthentication-nonce", + "name": "Send reauthentication nonce", + "code": "```js\nconst { error } = await supabase.auth.reauthenticate()\n```", + "description": "Sends a reauthentication nonce to the user's email or phone number." + } + ] + } + }, + "@supabase/auth-js.GoTrueClient.refreshSession": { + "name": "@supabase/auth-js.GoTrueClient.refreshSession", + "params": [ + { + "name": "currentSession", + "type": { + "type": "object", + "properties": [ + { + "name": "refresh_token", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "The current session. If passed in, it must contain a refresh token." + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "session", + "type": { + "type": "union", + "subTypes": [ + { + "type": "object", + "name": "Session", + "properties": [ + { + "name": "access_token", + "type": "[Circular]", + "comment": { + "shortText": "The access token jwt. It is recommended to set the JWT_EXPIRY to a shorter expiry value." + } + }, + { + "name": "expires_at", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "A timestamp of when the token will expire. Returned when a login is confirmed." + } + }, + { + "name": "expires_in", + "type": "[Circular]", + "comment": { + "shortText": "The number of seconds until the token expires (since it was issued). Returned when a login is confirmed." + } + }, + { + "name": "provider_refresh_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider refresh token. If present, this can be used to refresh the provider_token via the oauth provider's API.\nNot all oauth providers return a provider refresh token. If the provider_refresh_token is missing, please refer to the oauth provider's documentation for information on how to obtain the provider refresh token." + } + }, + { + "name": "provider_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider token. If present, this can be used to make external API requests to the oauth provider used." + } + }, + { + "name": "refresh_token", + "type": "[Circular]", + "comment": { + "shortText": "A one-time used refresh token that never expires." + } + }, + { + "name": "token_type", + "type": "[Circular]" + }, + { + "name": "user", + "type": { + "type": "object", + "name": "User", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + "comment": { + "shortText": "When using a separate user storage, accessing properties of this object will throw an error." + } + } + ] + }, + "[Circular]" + ] + } + }, + { + "name": "user", + "type": { + "type": "union", + "subTypes": [ + { + "type": "object", + "name": "User", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + "[Circular]" + ] + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "session", + "type": "[Circular]" + }, + { + "name": "user", + "type": "[Circular]" + } + ] + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Returns a new session, regardless of expiry status.\nTakes in an optional current session. If not passed in, then refreshSession() will attempt to retrieve it from getSession().\nIf the current session's refresh token is invalid, an error will be thrown.", + "text": "- This method will refresh and return a new session whether the current one is expired or not.", + "examples": [ + { + "id": "refresh-session-using-the-current-session", + "name": "Refresh session using the current session", + "code": "```js\nconst { data, error } = await supabase.auth.refreshSession()\nconst { session, user } = data\n```", + "response": "```json\n{\n \"data\": {\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"example@email.com\",\n \"email_confirmed_at\": \"2024-01-01T00:00:00Z\",\n \"phone\": \"\",\n \"confirmed_at\": \"2024-01-01T00:00:00Z\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"app_metadata\": {\n \"provider\": \"email\",\n \"providers\": [\n \"email\"\n ]\n },\n \"user_metadata\": {\n \"email\": \"example@email.com\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"identities\": [\n {\n \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n \"identity_data\": {\n \"email\": \"example@email.com\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"provider\": \"email\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"example@email.com\"\n }\n ],\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"is_anonymous\": false\n },\n \"session\": {\n \"access_token\": \"\",\n \"token_type\": \"bearer\",\n \"expires_in\": 3600,\n \"expires_at\": 1700000000,\n \"refresh_token\": \"\",\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"example@email.com\",\n \"email_confirmed_at\": \"2024-01-01T00:00:00Z\",\n \"phone\": \"\",\n \"confirmed_at\": \"2024-01-01T00:00:00Z\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"app_metadata\": {\n \"provider\": \"email\",\n \"providers\": [\n \"email\"\n ]\n },\n \"user_metadata\": {\n \"email\": \"example@email.com\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"identities\": [\n {\n \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n \"identity_data\": {\n \"email\": \"example@email.com\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"provider\": \"email\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"example@email.com\"\n }\n ],\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"is_anonymous\": false\n }\n }\n },\n \"error\": null\n}\n```" + }, + { + "id": "refresh-session-using-a-refresh-token", + "name": "Refresh session using a refresh token", + "code": "```js\nconst { data, error } = await supabase.auth.refreshSession({ refresh_token })\nconst { session, user } = data\n```" + } + ] + } + }, + "@supabase/auth-js.GoTrueClient.registerPasskey": { + "name": "@supabase/auth-js.GoTrueClient.registerPasskey", + "params": [ + { + "name": "credentials", + "type": { + "name": "RegisterPasskeyCredentials", + "type": "object", + "properties": [ + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "signal", + "type": { + "type": "nameOnly", + "name": "AbortSignal" + }, + "isOptional": true + } + ] + }, + "isOptional": true + } + ] + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthPasskeyRegistrationVerifyResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "name": "PasskeyMetadata", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "friendly_name", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "id", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + } + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "literal", + "value": null + } + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Register a passkey for the current authenticated user. Handles the full WebAuthn ceremony:\n1. Fetches registration challenge from server\n2. Prompts user via navigator.credentials.create()\n3. Verifies credential with server\n\nRequires an active session. Requires `auth.experimental.passkey: true`." + } + }, + "@supabase/auth-js.GoTrueClient.resend": { + "name": "@supabase/auth-js.GoTrueClient.resend", + "params": [ + { + "name": "credentials", + "type": { + "type": "union", + "name": "ResendParams", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "email", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "captchaToken", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Verification token received when the user completes the captcha on the site." + } + }, + { + "name": "emailRedirectTo", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "A URL to send the user to after they have signed-in." + } + } + ] + }, + "isOptional": true + }, + { + "name": "type", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "signup" + }, + { + "type": "literal", + "value": "email_change" + } + ] + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "captchaToken", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Verification token received when the user completes the captcha on the site." + } + } + ] + }, + "isOptional": true + }, + { + "name": "phone", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "type", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "sms" + }, + { + "type": "literal", + "value": "phone_change" + } + ] + } + } + ] + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthOtpResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "messageId", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "string" + }, + { + "type": "literal", + "value": null + } + ] + }, + "isOptional": true + }, + { + "name": "session", + "type": { + "type": "literal", + "value": null + } + }, + { + "name": "user", + "type": { + "type": "literal", + "value": null + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "messageId", + "type": "[Circular]" + }, + { + "name": "session", + "type": "[Circular]" + }, + { + "name": "user", + "type": "[Circular]" + } + ] + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Resends an existing signup confirmation email, email change email, SMS OTP or phone change OTP.", + "text": "- Resends a signup confirmation, email change or phone change email to the user.\n- Passwordless sign-ins can be resent by calling the `signInWithOtp()` method again.\n- Password recovery emails can be resent by calling the `resetPasswordForEmail()` method again.\n- This method will only resend an email or phone OTP to the user if there was an initial signup, email change or phone change request being made(note: For existing users signing in with OTP, you should use `signInWithOtp()` again to resend the OTP).\n- You can specify a redirect url when you resend an email link using the `emailRedirectTo` option.", + "examples": [ + { + "id": "resend-an-email-signup-confirmation", + "name": "Resend an email signup confirmation", + "code": "```js\nconst { error } = await supabase.auth.resend({\n type: 'signup',\n email: 'email@example.com',\n options: {\n emailRedirectTo: 'https://example.com/welcome'\n }\n})\n```", + "description": "Resends the email signup confirmation to the user" + }, + { + "id": "resend-a-phone-signup-confirmation", + "name": "Resend a phone signup confirmation", + "code": "```js\nconst { error } = await supabase.auth.resend({\n type: 'sms',\n phone: '1234567890'\n})\n```", + "description": "Resends the phone signup confirmation email to the user" + }, + { + "id": "resend-email-change-email", + "name": "Resend email change email", + "code": "```js\nconst { error } = await supabase.auth.resend({\n type: 'email_change',\n email: 'email@example.com'\n})\n```", + "description": "Resends the email change email to the user" + }, + { + "id": "resend-phone-change-otp", + "name": "Resend phone change OTP", + "code": "```js\nconst { error } = await supabase.auth.resend({\n type: 'phone_change',\n phone: '1234567890'\n})\n```", + "description": "Resends the phone change OTP to the user" + } + ] + } + }, + "@supabase/auth-js.GoTrueClient.resetPasswordForEmail": { + "name": "@supabase/auth-js.GoTrueClient.resetPasswordForEmail", + "params": [ + { + "name": "email", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The email address of the user." + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "captchaToken", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Verification token received when the user completes the captcha on the site." + } + }, + { + "name": "redirectTo", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "The URL to send the user to after they click the password reset link." + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data" + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "literal", + "value": null + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Sends a password reset request to an email address. This method supports the PKCE flow.", + "text": "- The password reset flow consist of 2 broad steps: (i) Allow the user to login via the password reset link; (ii) Update the user's password.\n- The `resetPasswordForEmail()` only sends a password reset link to the user's email.\nTo update the user's password, see [`updateUser()`](/docs/reference/javascript/auth-updateuser).\n- A `PASSWORD_RECOVERY` event will be emitted when the password recovery link is clicked.\nYou can use [`onAuthStateChange()`](/docs/reference/javascript/auth-onauthstatechange) to listen and invoke a callback function on these events.\n- When the user clicks the reset link in the email they are redirected back to your application.\nYou can configure the URL that the user is redirected to with the `redirectTo` parameter.\nSee [redirect URLs and wildcards](/docs/guides/auth/redirect-urls#use-wildcards-in-redirect-urls) to add additional redirect URLs to your project.\n- After the user has been redirected successfully, prompt them for a new password and call `updateUser()`:\n```js\nconst { data, error } = await supabase.auth.updateUser({\n password: new_password\n})\n```", + "examples": [ + { + "id": "reset-password", + "name": "Reset password", + "code": "```js\nconst { data, error } = await supabase.auth.resetPasswordForEmail(email, {\n redirectTo: 'https://example.com/update-password',\n})\n```", + "response": "```json\n{\n data: {}\n error: null\n}\n```" + }, + { + "id": "reset-password-react", + "name": "Reset password (React)", + "code": "```js\n/**\n * Step 1: Send the user an email to get a password reset token.\n * This email contains a link which sends the user back to your application.\n */\nconst { data, error } = await supabase.auth\n .resetPasswordForEmail('user@email.com')\n\n/**\n * Step 2: Once the user is redirected back to your application,\n * ask the user to reset their password.\n */\n useEffect(() => {\n supabase.auth.onAuthStateChange(async (event, session) => {\n if (event == \"PASSWORD_RECOVERY\") {\n const newPassword = prompt(\"What would you like your new password to be?\");\n const { data, error } = await supabase.auth\n .updateUser({ password: newPassword })\n\n if (data) alert(\"Password updated successfully!\")\n if (error) alert(\"There was an error updating your password.\")\n }\n })\n }, [])\n```" + } + ] + } + }, + "@supabase/auth-js.GoTrueClient.setSession": { + "name": "@supabase/auth-js.GoTrueClient.setSession", + "params": [ + { + "name": "currentSession", + "type": { + "type": "object", + "properties": [ + { + "name": "access_token", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "refresh_token", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + }, + "comment": { + "shortText": "The current session that minimally contains an access token and refresh token." + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "session", + "type": { + "type": "union", + "subTypes": [ + { + "type": "object", + "name": "Session", + "properties": [ + { + "name": "access_token", + "type": "[Circular]", + "comment": { + "shortText": "The access token jwt. It is recommended to set the JWT_EXPIRY to a shorter expiry value." + } + }, + { + "name": "expires_at", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "A timestamp of when the token will expire. Returned when a login is confirmed." + } + }, + { + "name": "expires_in", + "type": "[Circular]", + "comment": { + "shortText": "The number of seconds until the token expires (since it was issued). Returned when a login is confirmed." + } + }, + { + "name": "provider_refresh_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider refresh token. If present, this can be used to refresh the provider_token via the oauth provider's API.\nNot all oauth providers return a provider refresh token. If the provider_refresh_token is missing, please refer to the oauth provider's documentation for information on how to obtain the provider refresh token." + } + }, + { + "name": "provider_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider token. If present, this can be used to make external API requests to the oauth provider used." + } + }, + { + "name": "refresh_token", + "type": "[Circular]", + "comment": { + "shortText": "A one-time used refresh token that never expires." + } + }, + { + "name": "token_type", + "type": "[Circular]" + }, + { + "name": "user", + "type": { + "type": "object", + "name": "User", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + "comment": { + "shortText": "When using a separate user storage, accessing properties of this object will throw an error." + } + } + ] + }, + "[Circular]" + ] + } + }, + { + "name": "user", + "type": { + "type": "union", + "subTypes": [ + { + "type": "object", + "name": "User", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + "[Circular]" + ] + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "session", + "type": "[Circular]" + }, + { + "name": "user", + "type": "[Circular]" + } + ] + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Sets the session data from the current session. If the current session is expired, setSession will take care of refreshing it to obtain a new session.\nIf the refresh token or access token in the current session is invalid, an error will be thrown.", + "text": "- This method sets the session using an `access_token` and `refresh_token`.\n- If successful, a `SIGNED_IN` event is emitted.", + "examples": [ + { + "id": "set-the-session", + "name": "Set the session", + "code": "```js\n const { data, error } = await supabase.auth.setSession({\n access_token,\n refresh_token\n })\n```", + "description": "Sets the session data from an access_token and refresh_token, then returns an auth response or error.", + "response": "```json\n{\n \"data\": {\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"example@email.com\",\n \"email_confirmed_at\": \"2024-01-01T00:00:00Z\",\n \"phone\": \"\",\n \"confirmed_at\": \"2024-01-01T00:00:00Z\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"app_metadata\": {\n \"provider\": \"email\",\n \"providers\": [\n \"email\"\n ]\n },\n \"user_metadata\": {\n \"email\": \"example@email.com\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"identities\": [\n {\n \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n \"identity_data\": {\n \"email\": \"example@email.com\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"provider\": \"email\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"example@email.com\"\n }\n ],\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"is_anonymous\": false\n },\n \"session\": {\n \"access_token\": \"\",\n \"refresh_token\": \"\",\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"example@email.com\",\n \"email_confirmed_at\": \"2024-01-01T00:00:00Z\",\n \"phone\": \"\",\n \"confirmed_at\": \"2024-01-01T00:00:00Z\",\n \"last_sign_in_at\": \"11111111-1111-1111-1111-111111111111\",\n \"app_metadata\": {\n \"provider\": \"email\",\n \"providers\": [\n \"email\"\n ]\n },\n \"user_metadata\": {\n \"email\": \"example@email.com\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"identities\": [\n {\n \"identity_id\": \"2024-01-01T00:00:00Z\",\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n \"identity_data\": {\n \"email\": \"example@email.com\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"provider\": \"email\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"example@email.com\"\n }\n ],\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"is_anonymous\": false\n },\n \"token_type\": \"bearer\",\n \"expires_in\": 3500,\n \"expires_at\": 1700000000\n }\n },\n \"error\": null\n}\n```" + } + ] + } + }, + "@supabase/auth-js.GoTrueClient.signInAnonymously": { + "name": "@supabase/auth-js.GoTrueClient.signInAnonymously", + "params": [ + { + "name": "credentials", + "type": { + "name": "SignInAnonymouslyCredentials", + "type": "object", + "properties": [ + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "captchaToken", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Verification token received when the user completes the captcha on the site." + } + }, + { + "name": "data", + "type": { + "type": "intrinsic", + "name": "object" + }, + "isOptional": true, + "comment": { + "shortText": "A custom data object to store the user's metadata. This maps to the `auth.users.raw_user_meta_data` column.\n\nThe `data` should be a JSON object that includes user-specific info, such as their first and last name." + } + } + ] + }, + "isOptional": true + } + ] + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "session", + "type": { + "type": "union", + "subTypes": [ + { + "type": "object", + "name": "Session", + "properties": [ + { + "name": "access_token", + "type": "[Circular]", + "comment": { + "shortText": "The access token jwt. It is recommended to set the JWT_EXPIRY to a shorter expiry value." + } + }, + { + "name": "expires_at", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "A timestamp of when the token will expire. Returned when a login is confirmed." + } + }, + { + "name": "expires_in", + "type": "[Circular]", + "comment": { + "shortText": "The number of seconds until the token expires (since it was issued). Returned when a login is confirmed." + } + }, + { + "name": "provider_refresh_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider refresh token. If present, this can be used to refresh the provider_token via the oauth provider's API.\nNot all oauth providers return a provider refresh token. If the provider_refresh_token is missing, please refer to the oauth provider's documentation for information on how to obtain the provider refresh token." + } + }, + { + "name": "provider_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider token. If present, this can be used to make external API requests to the oauth provider used." + } + }, + { + "name": "refresh_token", + "type": "[Circular]", + "comment": { + "shortText": "A one-time used refresh token that never expires." + } + }, + { + "name": "token_type", + "type": "[Circular]" + }, + { + "name": "user", + "type": { + "type": "object", + "name": "User", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + "comment": { + "shortText": "When using a separate user storage, accessing properties of this object will throw an error." + } + } + ] + }, + "[Circular]" + ] + } + }, + { + "name": "user", + "type": { + "type": "union", + "subTypes": [ + { + "type": "object", + "name": "User", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + "[Circular]" + ] + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "session", + "type": "[Circular]" + }, + { + "name": "user", + "type": "[Circular]" + } + ] + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Creates a new anonymous user.", + "text": "- Returns an anonymous user\n- It is recommended to set up captcha for anonymous sign-ins to prevent abuse. You can pass in the captcha token in the `options` param.", + "examples": [ + { + "id": "create-an-anonymous-user", + "name": "Create an anonymous user", + "code": "```js\nconst { data, error } = await supabase.auth.signInAnonymously({\n options: {\n captchaToken\n }\n});\n```", + "response": "```json\n{\n \"data\": {\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"\",\n \"phone\": \"\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"app_metadata\": {},\n \"user_metadata\": {},\n \"identities\": [],\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"is_anonymous\": true\n },\n \"session\": {\n \"access_token\": \"\",\n \"token_type\": \"bearer\",\n \"expires_in\": 3600,\n \"expires_at\": 1700000000,\n \"refresh_token\": \"\",\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"\",\n \"phone\": \"\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"app_metadata\": {},\n \"user_metadata\": {},\n \"identities\": [],\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"is_anonymous\": true\n }\n }\n },\n \"error\": null\n}\n```" + }, + { + "id": "create-an-anonymous-user-with-custom-user-metadata", + "name": "Create an anonymous user with custom user metadata", + "code": "```js\nconst { data, error } = await supabase.auth.signInAnonymously({\n options: {\n data\n }\n})\n```" + } + ] + } + }, + "@supabase/auth-js.GoTrueClient.signInWithIdToken": { + "name": "@supabase/auth-js.GoTrueClient.signInWithIdToken", + "params": [ + { + "name": "credentials", + "type": { + "name": "SignInWithIdTokenCredentials", + "type": "object", + "properties": [ + { + "name": "access_token", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "If the ID token contains an `at_hash` claim, then the hash of this value is compared to the value in the ID token." + } + }, + { + "name": "nonce", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "If the ID token contains a `nonce` claim, then the hash of this value is compared to the value in the ID token." + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "captchaToken", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Verification token received when the user completes the captcha on the site." + } + } + ] + }, + "isOptional": true + }, + { + "name": "provider", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + null, + null + ] + }, + "comment": { + "shortText": "Provider name or OIDC `iss` value identifying which provider should be used to verify the provided token. Supported names: `google`, `apple`, `azure`, `facebook`, `kakao`. Use the `custom:` prefix for custom OIDC providers (e.g. `custom:my-oidc-provider`)." + } + }, + { + "name": "token", + "type": "[Circular]", + "comment": { + "shortText": "OIDC ID token issued by the specified provider. The `iss` claim in the ID token must match the supplied provider. Some ID tokens contain an `at_hash` which require that you provide an `access_token` value to be accepted properly. If the token contains a `nonce` claim you must supply the nonce used to obtain the ID token." + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthTokenResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "session", + "type": { + "type": "object", + "name": "Session", + "properties": [ + { + "name": "access_token", + "type": "[Circular]", + "comment": { + "shortText": "The access token jwt. It is recommended to set the JWT_EXPIRY to a shorter expiry value." + } + }, + { + "name": "expires_at", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "A timestamp of when the token will expire. Returned when a login is confirmed." + } + }, + { + "name": "expires_in", + "type": "[Circular]", + "comment": { + "shortText": "The number of seconds until the token expires (since it was issued). Returned when a login is confirmed." + } + }, + { + "name": "provider_refresh_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider refresh token. If present, this can be used to refresh the provider_token via the oauth provider's API.\nNot all oauth providers return a provider refresh token. If the provider_refresh_token is missing, please refer to the oauth provider's documentation for information on how to obtain the provider refresh token." + } + }, + { + "name": "provider_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider token. If present, this can be used to make external API requests to the oauth provider used." + } + }, + { + "name": "refresh_token", + "type": "[Circular]", + "comment": { + "shortText": "A one-time used refresh token that never expires." + } + }, + { + "name": "token_type", + "type": "[Circular]" + }, + { + "name": "user", + "type": { + "type": "object", + "name": "User", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + "comment": { + "shortText": "When using a separate user storage, accessing properties of this object will throw an error." + } + } + ] + } + }, + { + "name": "user", + "type": { + "type": "object", + "name": "User", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "session", + "type": "[Circular]" + }, + { + "name": "user", + "type": "[Circular]" + } + ] + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Allows signing in with an OIDC ID token. The authentication provider used\nshould be enabled and configured.", + "text": "- Use an ID token to sign in.\n- Especially useful when implementing sign in using native platform dialogs in mobile or desktop apps using Sign in with Apple or Sign in with Google on iOS and Android.\n- You can also use Google's [One Tap](https://developers.google.com/identity/gsi/web/guides/display-google-one-tap) and [Automatic sign-in](https://developers.google.com/identity/gsi/web/guides/automatic-sign-in-sign-out) via this API.", + "examples": [ + { + "id": "sign-in-using-id-token", + "name": "Sign In using ID Token", + "code": "```js\nconst { data, error } = await supabase.auth.signInWithIdToken({\n provider: 'google',\n token: 'your-id-token'\n})\n```", + "response": "```json\n{\n \"data\": {\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"app_metadata\": {\n ...\n },\n \"user_metadata\": {\n ...\n },\n \"identities\": [\n {\n \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n \"provider\": \"google\",\n }\n ],\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n },\n \"session\": {\n \"access_token\": \"\",\n \"token_type\": \"bearer\",\n \"expires_in\": 3600,\n \"expires_at\": 1700000000,\n \"refresh_token\": \"\",\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"app_metadata\": {\n ...\n },\n \"user_metadata\": {\n ...\n },\n \"identities\": [\n {\n \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n \"provider\": \"google\",\n }\n ],\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n }\n }\n },\n \"error\": null\n}\n```" + } + ] + } + }, + "@supabase/auth-js.GoTrueClient.signInWithOAuth": { + "name": "@supabase/auth-js.GoTrueClient.signInWithOAuth", + "params": [ + { + "name": "credentials", + "type": { + "name": "SignInWithOAuthCredentials", + "type": "object", + "properties": [ + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "queryParams", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "An object of query params" + } + }, + { + "name": "redirectTo", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "A URL to send the user to after they are confirmed." + } + }, + { + "name": "scopes", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "A space-separated list of scopes granted to the OAuth application." + } + }, + { + "name": "skipBrowserRedirect", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "If set to true does not immediately redirect the current browser context to visit the OAuth authorization page for the provider." + } + } + ] + }, + "isOptional": true + }, + { + "name": "provider", + "type": { + "type": "union", + "name": "Provider", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + null + ] + }, + "comment": { + "shortText": "One of the providers supported by GoTrue." + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "OAuthResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "provider", + "type": { + "type": "union", + "name": "Provider", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + null + ] + } + }, + { + "name": "url", + "type": "[Circular]" + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "provider", + "type": { + "type": "union", + "name": "Provider", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + null + ] + } + }, + { + "name": "url", + "type": "[Circular]" + } + ] + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Log in an existing user via a third-party provider.\nThis method supports the PKCE flow.", + "text": "- This method is used for signing in using [Social Login (OAuth) providers](/docs/guides/auth#configure-third-party-providers).\n- It works by redirecting your application to the provider's authorization screen, before bringing back the user to your app.", + "examples": [ + { + "id": "sign-in-using-a-third-party-provider", + "name": "Sign in using a third-party provider", + "code": "```js\nconst { data, error } = await supabase.auth.signInWithOAuth({\n provider: 'github'\n})\n```", + "response": "```json\n{\n data: {\n provider: 'github',\n url: \n },\n error: null\n}\n```" + }, + { + "id": "sign-in-using-a-third-party-provider-with-redirect", + "name": "Sign in using a third-party provider with redirect", + "code": "```js\nconst { data, error } = await supabase.auth.signInWithOAuth({\n provider: 'github',\n options: {\n redirectTo: 'https://example.com/welcome'\n }\n})\n```", + "description": "- When the OAuth provider successfully authenticates the user, they are redirected to the URL specified in the `redirectTo` parameter. This parameter defaults to the [`SITE_URL`](/docs/guides/auth/redirect-urls#use-wildcards-in-redirect-urls). It does not redirect the user immediately after invoking this method.\n- See [redirect URLs and wildcards](/docs/guides/auth/redirect-urls#use-wildcards-in-redirect-urls) to add additional redirect URLs to your project." + }, + { + "id": "sign-in-with-scopes-and-access-provider-tokens", + "name": "Sign in with scopes and access provider tokens", + "code": "```js\n// Register this immediately after calling createClient!\n// Because signInWithOAuth causes a redirect, you need to fetch the\n// provider tokens from the callback.\nsupabase.auth.onAuthStateChange((event, session) => {\n if (session && session.provider_token) {\n window.localStorage.setItem('oauth_provider_token', session.provider_token)\n }\n\n if (session && session.provider_refresh_token) {\n window.localStorage.setItem('oauth_provider_refresh_token', session.provider_refresh_token)\n }\n\n if (event === 'SIGNED_OUT') {\n window.localStorage.removeItem('oauth_provider_token')\n window.localStorage.removeItem('oauth_provider_refresh_token')\n }\n})\n\n// Call this on your Sign in with GitHub button to initiate OAuth\n// with GitHub with the requested elevated scopes.\nawait supabase.auth.signInWithOAuth({\n provider: 'github',\n options: {\n scopes: 'repo gist notifications'\n }\n})\n```", + "description": "If you need additional access from an OAuth provider, in order to access provider specific APIs in the name of the user, you can do this by passing in the scopes the user should authorize for your application. Note that the `scopes` option takes in **a space-separated list** of scopes.\n\nBecause OAuth sign-in often includes redirects, you should register an `onAuthStateChange` callback immediately after you create the Supabase client. This callback will listen for the presence of `provider_token` and `provider_refresh_token` properties on the `session` object and store them in local storage. The client library will emit these values **only once** immediately after the user signs in. You can then access them by looking them up in local storage, or send them to your backend servers for further processing.\n\nFinally, make sure you remove them from local storage on the `SIGNED_OUT` event. If the OAuth provider supports token revocation, make sure you call those APIs either from the frontend or schedule them to be called on the backend." + } + ] + } + }, + "@supabase/auth-js.GoTrueClient.signInWithOtp": { + "name": "@supabase/auth-js.GoTrueClient.signInWithOtp", + "params": [ + { + "name": "credentials", + "type": { + "type": "union", + "name": "SignInWithPasswordlessCredentials", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "email", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The user's email address." + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "captchaToken", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Verification token received when the user completes the captcha on the site." + } + }, + { + "name": "data", + "type": { + "type": "intrinsic", + "name": "object" + }, + "isOptional": true, + "comment": { + "shortText": "A custom data object to store the user's metadata. This maps to the `auth.users.raw_user_meta_data` column.\n\nThe `data` should be a JSON object that includes user-specific info, such as their first and last name." + } + }, + { + "name": "emailRedirectTo", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "The redirect url embedded in the email link" + } + }, + { + "name": "shouldCreateUser", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "If set to false, this method will not create a new user. Defaults to true." + } + } + ] + }, + "isOptional": true + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "captchaToken", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Verification token received when the user completes the captcha on the site." + } + }, + { + "name": "channel", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "sms" + }, + { + "type": "literal", + "value": "whatsapp" + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Messaging channel to use (e.g. whatsapp or sms)" + } + }, + { + "name": "data", + "type": { + "type": "intrinsic", + "name": "object" + }, + "isOptional": true, + "comment": { + "shortText": "A custom data object to store the user's metadata. This maps to the `auth.users.raw_user_meta_data` column.\n\nThe `data` should be a JSON object that includes user-specific info, such as their first and last name." + } + }, + { + "name": "shouldCreateUser", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "If set to false, this method will not create a new user. Defaults to true." + } + } + ] + }, + "isOptional": true + }, + { + "name": "phone", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The user's phone number." + } + } + ] + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthOtpResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "messageId", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true + }, + { + "name": "session", + "type": "[Circular]" + }, + { + "name": "user", + "type": "[Circular]" + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "messageId", + "type": "[Circular]" + }, + { + "name": "session", + "type": "[Circular]" + }, + { + "name": "user", + "type": "[Circular]" + } + ] + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Log in a user using magiclink or a one-time password (OTP).\n\nIf the `{{ .ConfirmationURL }}` variable is specified in the email template, a magiclink will be sent.\nIf the `{{ .Token }}` variable is specified in the email template, an OTP will be sent.\nIf you're using phone sign-ins, only an OTP will be sent. You won't be able to send a magiclink for phone sign-ins.\n\nBe aware that you may get back an error message that will not distinguish\nbetween the cases where the account does not exist or, that the account\ncan only be accessed via social login.\n\nDo note that you will need to configure a Whatsapp sender on Twilio\nif you are using phone sign in with the 'whatsapp' channel. The whatsapp\nchannel is not supported on other providers\nat this time.\nThis method supports PKCE when an email is passed.", + "text": "- Requires either an email or phone number.\n- This method is used for passwordless sign-ins where a OTP is sent to the user's email or phone number.\n- If the user doesn't exist, `signInWithOtp()` will signup the user instead. To restrict this behavior, you can set `shouldCreateUser` in `SignInWithPasswordlessCredentials.options` to `false`.\n- If you're using an email, you can configure whether you want the user to receive a magiclink or a OTP.\n- If you're using phone, you can configure whether you want the user to receive a OTP.\n- The magic link's destination URL is determined by the [`SITE_URL`](/docs/guides/auth/redirect-urls#use-wildcards-in-redirect-urls).\n- See [redirect URLs and wildcards](/docs/guides/auth/redirect-urls#use-wildcards-in-redirect-urls) to add additional redirect URLs to your project.\n- Magic links and OTPs share the same implementation. To send users a one-time code instead of a magic link, [modify the magic link email template](/dashboard/project/_/auth/templates) to include `{{ .Token }}` instead of `{{ .ConfirmationURL }}`.\n- See our [Twilio Phone Auth Guide](/docs/guides/auth/phone-login?showSMSProvider=Twilio) for details about configuring WhatsApp sign in.", + "examples": [ + { + "id": "sign-in-with-email", + "name": "Sign in with email", + "code": "```js\nconst { data, error } = await supabase.auth.signInWithOtp({\n email: 'example@email.com',\n options: {\n emailRedirectTo: 'https://example.com/welcome'\n }\n})\n```", + "description": "The user will be sent an email which contains either a magiclink or a OTP or both. By default, a given user can only request a OTP once every 60 seconds.", + "response": "```json\n{\n \"data\": {\n \"user\": null,\n \"session\": null\n },\n \"error\": null\n}\n```" + }, + { + "id": "sign-in-with-sms-otp", + "name": "Sign in with SMS OTP", + "code": "```js\nconst { data, error } = await supabase.auth.signInWithOtp({\n phone: '+13334445555',\n})\n```", + "description": "The user will be sent a SMS which contains a OTP. By default, a given user can only request a OTP once every 60 seconds." + }, + { + "id": "sign-in-with-whatsapp-otp", + "name": "Sign in with WhatsApp OTP", + "code": "```js\nconst { data, error } = await supabase.auth.signInWithOtp({\n phone: '+13334445555',\n options: {\n channel:'whatsapp',\n }\n})\n```", + "description": "The user will be sent a WhatsApp message which contains a OTP. By default, a given user can only request a OTP once every 60 seconds. Note that a user will need to have a valid WhatsApp account that is linked to Twilio in order to use this feature." + } + ] + } + }, + "@supabase/auth-js.GoTrueClient.signInWithPasskey": { + "name": "@supabase/auth-js.GoTrueClient.signInWithPasskey", + "params": [ + { + "name": "credentials", + "type": { + "name": "SignInWithPasskeyCredentials", + "type": "object", + "properties": [ + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "captchaToken", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "signal", + "type": { + "type": "nameOnly", + "name": "AbortSignal" + }, + "isOptional": true + } + ] + }, + "isOptional": true + } + ] + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthPasskeyAuthenticationVerifyResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "session", + "type": { + "type": "union", + "subTypes": [ + { + "type": "object", + "name": "Session", + "properties": [ + { + "name": "access_token", + "type": "[Circular]", + "comment": { + "shortText": "The access token jwt. It is recommended to set the JWT_EXPIRY to a shorter expiry value." + } + }, + { + "name": "expires_at", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "A timestamp of when the token will expire. Returned when a login is confirmed." + } + }, + { + "name": "expires_in", + "type": "[Circular]", + "comment": { + "shortText": "The number of seconds until the token expires (since it was issued). Returned when a login is confirmed." + } + }, + { + "name": "provider_refresh_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider refresh token. If present, this can be used to refresh the provider_token via the oauth provider's API.\nNot all oauth providers return a provider refresh token. If the provider_refresh_token is missing, please refer to the oauth provider's documentation for information on how to obtain the provider refresh token." + } + }, + { + "name": "provider_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider token. If present, this can be used to make external API requests to the oauth provider used." + } + }, + { + "name": "refresh_token", + "type": "[Circular]", + "comment": { + "shortText": "A one-time used refresh token that never expires." + } + }, + { + "name": "token_type", + "type": "[Circular]" + }, + { + "name": "user", + "type": { + "type": "object", + "name": "User", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + "comment": { + "shortText": "When using a separate user storage, accessing properties of this object will throw an error." + } + } + ] + }, + { + "type": "literal", + "value": null + } + ] + } + }, + { + "name": "user", + "type": { + "type": "union", + "subTypes": [ + { + "type": "object", + "name": "User", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + { + "type": "literal", + "value": null + } + ] + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Sign in with a passkey. Handles the full WebAuthn ceremony:\n1. Fetches authentication challenge from server\n2. Prompts user via navigator.credentials.get()\n3. Verifies credential with server and creates session\n\nRequires `auth.experimental.passkey: true`." + } + }, + "@supabase/auth-js.GoTrueClient.signInWithPassword": { + "name": "@supabase/auth-js.GoTrueClient.signInWithPassword", + "params": [ + { + "name": "credentials", + "type": { + "type": "nameOnly", + "name": "SignInWithPasswordCredentials" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthTokenResponsePassword", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "session", + "type": { + "type": "object", + "name": "Session", + "properties": [ + { + "name": "access_token", + "type": "[Circular]", + "comment": { + "shortText": "The access token jwt. It is recommended to set the JWT_EXPIRY to a shorter expiry value." + } + }, + { + "name": "expires_at", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "A timestamp of when the token will expire. Returned when a login is confirmed." + } + }, + { + "name": "expires_in", + "type": "[Circular]", + "comment": { + "shortText": "The number of seconds until the token expires (since it was issued). Returned when a login is confirmed." + } + }, + { + "name": "provider_refresh_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider refresh token. If present, this can be used to refresh the provider_token via the oauth provider's API.\nNot all oauth providers return a provider refresh token. If the provider_refresh_token is missing, please refer to the oauth provider's documentation for information on how to obtain the provider refresh token." + } + }, + { + "name": "provider_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider token. If present, this can be used to make external API requests to the oauth provider used." + } + }, + { + "name": "refresh_token", + "type": "[Circular]", + "comment": { + "shortText": "A one-time used refresh token that never expires." + } + }, + { + "name": "token_type", + "type": "[Circular]" + }, + { + "name": "user", + "type": { + "type": "object", + "name": "User", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + "comment": { + "shortText": "When using a separate user storage, accessing properties of this object will throw an error." + } + } + ] + } + }, + { + "name": "user", + "type": { + "type": "object", + "name": "User", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + } + }, + { + "name": "weakPassword", + "type": { + "name": "WeakPassword", + "type": "object", + "properties": [ + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "reasons", + "type": { + "type": "array", + "elemType": { + "type": "nameOnly", + "name": "WeakPasswordReasons" + } + } + } + ] + }, + "isOptional": true + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "session", + "type": "[Circular]" + }, + { + "name": "user", + "type": "[Circular]" + }, + { + "name": "weakPassword", + "type": "[Circular]" + } + ] + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Log in an existing user with an email and password or phone and password.\n\nBe aware that you may get back an error message that will not distinguish\nbetween the cases where the account does not exist or that the\nemail/phone and password combination is wrong or that the account can only\nbe accessed via social login.", + "text": "- Requires either an email and password or a phone number and password.", + "examples": [ + { + "id": "sign-in-with-email-and-password", + "name": "Sign in with email and password", + "code": "```js\nconst { data, error } = await supabase.auth.signInWithPassword({\n email: 'example@email.com',\n password: 'example-password',\n})\n```", + "response": "```json\n{\n \"data\": {\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"example@email.com\",\n \"email_confirmed_at\": \"2024-01-01T00:00:00Z\",\n \"phone\": \"\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"app_metadata\": {\n \"provider\": \"email\",\n \"providers\": [\n \"email\"\n ]\n },\n \"user_metadata\": {},\n \"identities\": [\n {\n \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n \"identity_data\": {\n \"email\": \"example@email.com\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"provider\": \"email\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"example@email.com\"\n }\n ],\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\"\n },\n \"session\": {\n \"access_token\": \"\",\n \"token_type\": \"bearer\",\n \"expires_in\": 3600,\n \"expires_at\": 1700000000,\n \"refresh_token\": \"\",\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"example@email.com\",\n \"email_confirmed_at\": \"2024-01-01T00:00:00Z\",\n \"phone\": \"\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"app_metadata\": {\n \"provider\": \"email\",\n \"providers\": [\n \"email\"\n ]\n },\n \"user_metadata\": {},\n \"identities\": [\n {\n \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n \"identity_data\": {\n \"email\": \"example@email.com\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"provider\": \"email\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"example@email.com\"\n }\n ],\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\"\n }\n }\n },\n \"error\": null\n}\n```" + }, + { + "id": "sign-in-with-phone-and-password", + "name": "Sign in with phone and password", + "code": "```js\nconst { data, error } = await supabase.auth.signInWithPassword({\n phone: '+13334445555',\n password: 'some-password',\n})\n```" + }, + { + "id": "handling-errors", + "name": "Handling errors", + "code": "```js\nconst { data, error } = await supabase.auth.signInWithPassword({\n email: 'example@email.com',\n password: 'example-password',\n})\nif (error) {\n console.error(error)\n return\n}\n```", + "description": "Log the full `error` object so fields like `code`, `status`, and `name` aren't hidden. The `error.code` (e.g. `'invalid_credentials'`, `'email_not_confirmed'`) is often more useful for branching than `error.message`, and the full object surfaces both." + } + ] + } + }, + "@supabase/auth-js.GoTrueClient.signInWithSSO": { + "name": "@supabase/auth-js.GoTrueClient.signInWithSSO", + "params": [ + { + "name": "params", + "type": { + "type": "union", + "name": "SignInWithSSO", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "captchaToken", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Verification token received when the user completes the captcha on the site." + } + }, + { + "name": "redirectTo", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "A URL to send the user to after they have signed-in." + } + }, + { + "name": "skipBrowserRedirect", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "If set to true, the redirect will not happen on the client side.\nThis parameter is used when you wish to handle the redirect yourself.\nDefaults to false." + } + } + ] + }, + "isOptional": true + }, + { + "name": "providerId", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "UUID of the SSO provider to invoke single-sign on to." + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "domain", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Domain name of the organization for which to invoke single-sign on." + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "captchaToken", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Verification token received when the user completes the captcha on the site." + } + }, + { + "name": "redirectTo", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "A URL to send the user to after they have signed-in." + } + }, + { + "name": "skipBrowserRedirect", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "If set to true, the redirect will not happen on the client side.\nThis parameter is used when you wish to handle the redirect yourself.\nDefaults to false." + } + } + ] + }, + "isOptional": true + } + ] + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "SSOResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "url", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "URL to open in a browser which will complete the sign-in flow by\ntaking the user to the identity provider's authentication flow.\n\nOn browsers you can set the URL to `window.location.href` to take\nthe user to the authentication flow." + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Attempts a single-sign on using an enterprise Identity Provider. A\nsuccessful SSO attempt will redirect the current page to the identity\nprovider authorization page. The redirect URL is implementation and SSO\nprotocol specific.\n\nYou can use it by providing a SSO domain. Typically you can extract this\ndomain by asking users for their email address. If this domain is\nregistered on the Auth instance the redirect will use that organization's\ncurrently active SSO Identity Provider for the login.\n\nIf you have built an organization-specific login page, you can use the\norganization's SSO Identity Provider UUID directly instead.", + "text": "- Before you can call this method you need to [establish a connection](/docs/guides/auth/sso/auth-sso-saml#managing-saml-20-connections) to an identity provider. Use the [CLI commands](/docs/reference/cli/supabase-sso) to do this.\n- If you've associated an email domain to the identity provider, you can use the `domain` property to start a sign-in flow.\n- In case you need to use a different way to start the authentication flow with an identity provider, you can use the `providerId` property. For example:\n - Mapping specific user email addresses with an identity provider.\n - Using different hints to identity the identity provider to be used by the user, like a company-specific page, IP address or other tracking information.", + "examples": [ + { + "id": "sign-in-with-email-domain", + "name": "Sign in with email domain", + "code": "```js\n // You can extract the user's email domain and use it to trigger the\n // authentication flow with the correct identity provider.\n\n const { data, error } = await supabase.auth.signInWithSSO({\n domain: 'company.com'\n })\n\n if (data?.url) {\n // redirect the user to the identity provider's authentication flow\n window.location.href = data.url\n }\n```" + }, + { + "id": "sign-in-with-provider-uuid", + "name": "Sign in with provider UUID", + "code": "```js\n // Useful when you need to map a user's sign in request according\n // to different rules that can't use email domains.\n\n const { data, error } = await supabase.auth.signInWithSSO({\n providerId: '21648a9d-8d5a-4555-a9d1-d6375dc14e92'\n })\n\n if (data?.url) {\n // redirect the user to the identity provider's authentication flow\n window.location.href = data.url\n }\n```" + } + ] + } + }, + "@supabase/auth-js.GoTrueClient.signInWithWeb3": { + "name": "@supabase/auth-js.GoTrueClient.signInWithWeb3", + "params": [ + { + "name": "credentials", + "type": { + "type": "union", + "name": "Web3Credentials", + "subTypes": [ + { + "type": "union", + "name": "SolanaWeb3Credentials", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "chain", + "type": { + "type": "literal", + "value": "solana" + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "captchaToken", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Verification token received when the user completes the captcha on the site." + } + }, + { + "name": "signInWithSolana", + "type": { + "type": "nameOnly", + "name": "Partial" + }, + "isOptional": true + }, + { + "name": "url", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "URL to use with the wallet interface. Some wallets do not allow signing a message for URLs different from the current page." + } + } + ] + }, + "isOptional": true + }, + { + "name": "statement", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Optional statement to include in the Sign in with Solana message. Must not include new line characters. Most wallets like Phantom **require specifying a statement!**" + } + }, + { + "name": "wallet", + "type": { + "name": "SolanaWallet", + "type": "object", + "properties": [ + { + "name": "publicKey", + "type": { + "type": "union", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "toBase58", + "type": { + "type": "function", + "params": [], + "ret": { + "type": { + "type": "intrinsic", + "name": "string" + } + } + } + } + ] + }, + { + "type": "literal", + "value": null + } + ] + }, + "isOptional": true + }, + { + "name": "signIn", + "type": { + "type": "function", + "params": [ + { + "name": "inputs", + "type": { + "type": "array", + "elemType": { + "type": "nameOnly", + "name": "SolanaSignInInput" + } + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + { + "type": "nameOnly", + "name": "SolanaSignInOutput" + }, + { + "type": "array", + "elemType": { + "type": "nameOnly", + "name": "SolanaSignInOutput" + } + } + ] + } + } + } + }, + "isOptional": true + }, + { + "name": "signMessage", + "type": { + "type": "function", + "params": [ + { + "name": "message", + "type": { + "type": "nameOnly", + "name": "Uint8Array" + } + }, + { + "name": "encoding", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "utf8" + }, + { + "type": "intrinsic", + "name": "string" + } + ] + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "union", + "subTypes": [ + { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "nameOnly", + "name": "Uint8Array" + } + }, + { + "type": "intrinsic", + "name": "undefined" + } + ] + } + } + }, + "isOptional": true + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Wallet interface to use. If not specified will default to `window.solana`." + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "chain", + "type": { + "type": "literal", + "value": "solana" + } + }, + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Sign in with Solana compatible message. Must include `Issued At`, `URI` and `Version`." + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "captchaToken", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Verification token received when the user completes the captcha on the site." + } + } + ] + }, + "isOptional": true + }, + { + "name": "signature", + "type": { + "type": "nameOnly", + "name": "Uint8Array" + }, + "comment": { + "shortText": "Ed25519 signature of the message." + } + } + ] + } + ] + }, + { + "type": "union", + "name": "EthereumWeb3Credentials", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "chain", + "type": { + "type": "literal", + "value": "ethereum" + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "captchaToken", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Verification token received when the user completes the captcha on the site." + } + }, + { + "name": "signInWithEthereum", + "type": { + "type": "nameOnly", + "name": "Partial" + }, + "isOptional": true + }, + { + "name": "url", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "URL to use with the wallet interface. Some wallets do not allow signing a message for URLs different from the current page." + } + } + ] + }, + "isOptional": true + }, + { + "name": "statement", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Optional statement to include in the Sign in with Ethereum message. Must not include new line characters. Most wallets like Phantom **require specifying a statement!**" + } + }, + { + "name": "wallet", + "type": { + "type": "nameOnly", + "name": "EthereumWallet" + }, + "isOptional": true, + "comment": { + "shortText": "Wallet interface to use. If not specified will default to `window.ethereum`." + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "chain", + "type": { + "type": "literal", + "value": "ethereum" + } + }, + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Sign in with Ethereum compatible message. Must include `Issued At`, `URI` and `Version`." + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "captchaToken", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Verification token received when the user completes the captcha on the site." + } + } + ] + }, + "isOptional": true + }, + { + "name": "signature", + "type": { + "type": "nameOnly", + "name": "Hex" + }, + "comment": { + "shortText": "Ethereum curve (secp256k1) signature of the message." + } + } + ] + } + ] + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "session", + "type": { + "type": "object", + "name": "Session", + "properties": [ + { + "name": "access_token", + "type": "[Circular]", + "comment": { + "shortText": "The access token jwt. It is recommended to set the JWT_EXPIRY to a shorter expiry value." + } + }, + { + "name": "expires_at", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "A timestamp of when the token will expire. Returned when a login is confirmed." + } + }, + { + "name": "expires_in", + "type": "[Circular]", + "comment": { + "shortText": "The number of seconds until the token expires (since it was issued). Returned when a login is confirmed." + } + }, + { + "name": "provider_refresh_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider refresh token. If present, this can be used to refresh the provider_token via the oauth provider's API.\nNot all oauth providers return a provider refresh token. If the provider_refresh_token is missing, please refer to the oauth provider's documentation for information on how to obtain the provider refresh token." + } + }, + { + "name": "provider_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider token. If present, this can be used to make external API requests to the oauth provider used." + } + }, + { + "name": "refresh_token", + "type": "[Circular]", + "comment": { + "shortText": "A one-time used refresh token that never expires." + } + }, + { + "name": "token_type", + "type": "[Circular]" + }, + { + "name": "user", + "type": { + "type": "object", + "name": "User", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + "comment": { + "shortText": "When using a separate user storage, accessing properties of this object will throw an error." + } + } + ] + } + }, + { + "name": "user", + "type": { + "type": "object", + "name": "User", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + } + } + ] + } + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "session", + "type": { + "type": "literal", + "value": null + } + }, + { + "name": "user", + "type": { + "type": "literal", + "value": null + } + } + ] + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Signs in a user by verifying a message signed by the user's private key.\nSupports Ethereum (via Sign-In-With-Ethereum) & Solana (Sign-In-With-Solana) standards,\nboth of which derive from the EIP-4361 standard\nWith slight variation on Solana's side.", + "text": "- Uses a Web3 (Ethereum, Solana) wallet to sign a user in.\n- Read up on the [potential for abuse](/docs/guides/auth/auth-web3#potential-for-abuse) before using it.", + "examples": [ + { + "id": "sign-in-with-solana-or-ethereum-window-api", + "name": "Sign in with Solana or Ethereum (Window API)", + "code": "```js\n // uses window.ethereum for the wallet\n const { data, error } = await supabase.auth.signInWithWeb3({\n chain: 'ethereum',\n statement: 'I accept the Terms of Service at https://example.com/tos'\n })\n\n // uses window.solana for the wallet\n const { data, error } = await supabase.auth.signInWithWeb3({\n chain: 'solana',\n statement: 'I accept the Terms of Service at https://example.com/tos'\n })\n```" + }, + { + "id": "sign-in-with-ethereum-message-and-signature", + "name": "Sign in with Ethereum (Message and Signature)", + "code": "```js\n const { data, error } = await supabase.auth.signInWithWeb3({\n chain: 'ethereum',\n message: '',\n signature: '',\n })\n```" + }, + { + "id": "sign-in-with-solana-brave", + "name": "Sign in with Solana (Brave)", + "code": "```js\n const { data, error } = await supabase.auth.signInWithWeb3({\n chain: 'solana',\n statement: 'I accept the Terms of Service at https://example.com/tos',\n wallet: window.braveSolana\n })\n```" + }, + { + "id": "sign-in-with-solana-wallet-adapter", + "name": "Sign in with Solana (Wallet Adapter)", + "code": "```jsx\n function SignInButton() {\n const wallet = useWallet()\n\n return (\n <>\n {wallet.connected ? (\n {\n supabase.auth.signInWithWeb3({\n chain: 'solana',\n statement: 'I accept the Terms of Service at https://example.com/tos',\n wallet,\n })\n }}\n >\n Sign in with Solana\n \n ) : (\n \n )}\n \n )\n}\n\nfunction App() {\n const endpoint = clusterApiUrl('devnet')\n const wallets = useMemo(() => [], [])\n\n return (\n \n \n \n \n \n \n \n )\n}\n```" + } + ] + } + }, + "@supabase/auth-js.GoTrueClient.signOut": { + "name": "@supabase/auth-js.GoTrueClient.signOut", + "params": [ + { + "name": "options", + "type": { + "name": "SignOut", + "type": "object", + "properties": [ + { + "name": "scope", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "global" + }, + { + "type": "literal", + "value": "local" + }, + { + "type": "literal", + "value": "others" + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Determines which sessions should be\nlogged out. Global means all\nsessions by this account. Local\nmeans only this session. Others\nmeans all other sessions except the\ncurrent one. When using others,\nthere is no sign-out event fired on\nthe current session!" + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "object", + "properties": [ + { + "name": "error", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "nameOnly", + "name": "AuthError" + } + ] + } + } + ] + } + } + }, + "comment": { + "shortText": "Inside a browser context, `signOut()` will remove the logged in user from the browser session and log them out - removing all items from localstorage and then trigger a `\"SIGNED_OUT\"` event.\n\nFor server-side management, you can revoke all refresh tokens for a user by passing a user's JWT through to `auth.api.signOut(JWT: string)`.\nThere is no way to revoke a user's access token jwt until it expires. It is recommended to set a shorter expiry on the jwt for this reason.\n\nIf using `others` scope, no `SIGNED_OUT` event is fired!\n\n**Warning:** the default `scope` is `'global'`. This signs the user out of\n**every device they are currently signed in on**, not just the current\ntab/session. If you only want to sign the user out of the current session\n(the behavior most other auth libraries default to), pass\n`{ scope: 'local' }` explicitly.", + "text": "- In order to use the `signOut()` method, the user needs to be signed in first.\n- By default, `signOut()` uses the **global** scope, which signs out the user\n on every device they are signed in on (not just the current one). Pass\n `{ scope: 'local' }` to only sign out the current session. This is\n usually what apps want on a \"Sign out\" button, especially when users\n sign in from multiple devices and do not expect signing out of one to\n terminate the others.\n- Since Supabase Auth uses JWTs for authentication, the access token JWT will be valid until it's expired. When the user signs out, Supabase revokes the refresh token and deletes the JWT from the client-side. This does not revoke the JWT and it will still be valid until it expires.", + "examples": [ + { + "id": "sign-out-of-every-device-global-default", + "name": "Sign out of every device (global – default)", + "code": "```js\nconst { error } = await supabase.auth.signOut()\n```" + }, + { + "id": "sign-out-only-the-current-session-recommended-for-most-apps", + "name": "Sign out only the current session (recommended for most apps)", + "code": "```js\nconst { error } = await supabase.auth.signOut({ scope: 'local' })\n```" + }, + { + "id": "sign-out-of-all-other-sessions-keep-the-current-one", + "name": "Sign out of all other sessions, keep the current one", + "code": "```js\nconst { error } = await supabase.auth.signOut({ scope: 'others' })\n```" + } + ] + } + }, + "@supabase/auth-js.GoTrueClient.signUp": { + "name": "@supabase/auth-js.GoTrueClient.signUp", + "params": [ + { + "name": "credentials", + "type": { + "type": "nameOnly", + "name": "SignUpWithPasswordCredentials" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "session", + "type": { + "type": "union", + "subTypes": [ + { + "type": "object", + "name": "Session", + "properties": [ + { + "name": "access_token", + "type": "[Circular]", + "comment": { + "shortText": "The access token jwt. It is recommended to set the JWT_EXPIRY to a shorter expiry value." + } + }, + { + "name": "expires_at", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "A timestamp of when the token will expire. Returned when a login is confirmed." + } + }, + { + "name": "expires_in", + "type": "[Circular]", + "comment": { + "shortText": "The number of seconds until the token expires (since it was issued). Returned when a login is confirmed." + } + }, + { + "name": "provider_refresh_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider refresh token. If present, this can be used to refresh the provider_token via the oauth provider's API.\nNot all oauth providers return a provider refresh token. If the provider_refresh_token is missing, please refer to the oauth provider's documentation for information on how to obtain the provider refresh token." + } + }, + { + "name": "provider_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider token. If present, this can be used to make external API requests to the oauth provider used." + } + }, + { + "name": "refresh_token", + "type": "[Circular]", + "comment": { + "shortText": "A one-time used refresh token that never expires." + } + }, + { + "name": "token_type", + "type": "[Circular]" + }, + { + "name": "user", + "type": { + "type": "object", + "name": "User", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + "comment": { + "shortText": "When using a separate user storage, accessing properties of this object will throw an error." + } + } + ] + }, + "[Circular]" + ] + } + }, + { + "name": "user", + "type": { + "type": "union", + "subTypes": [ + { + "type": "object", + "name": "User", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + "[Circular]" + ] + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "session", + "type": "[Circular]" + }, + { + "name": "user", + "type": "[Circular]" + } + ] + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Creates a new user.\n\nBe aware that if a user account exists in the system you may get back an\nerror message that attempts to hide this information from the user.\nThis method has support for PKCE via email signups. The PKCE flow cannot be used when autoconfirm is enabled.", + "text": "- By default, the user needs to verify their email address before logging in. To turn this off, disable **Confirm email** in [your project](/dashboard/project/_/auth/providers).\n- **Confirm email** determines if users need to confirm their email address after signing up.\n - If **Confirm email** is enabled, a `user` is returned but `session` is null.\n - If **Confirm email** is disabled, both a `user` and a `session` are returned.\n- When the user confirms their email address, they are redirected to the [`SITE_URL`](/docs/guides/auth/redirect-urls#use-wildcards-in-redirect-urls) by default. You can modify your `SITE_URL` or add additional redirect URLs in [your project](/dashboard/project/_/auth/url-configuration).\n- If signUp() is called for an existing confirmed user:\n - When both **Confirm email** and **Confirm phone** (even when phone provider is disabled) are enabled in [your project](/dashboard/project/_/auth/providers), an obfuscated/fake user object is returned.\n - When either **Confirm email** or **Confirm phone** (even when phone provider is disabled) is disabled, the error message, `User already registered` is returned.\n- To fetch the currently logged-in user, refer to [`getUser()`](/docs/reference/javascript/auth-getuser).", + "examples": [ + { + "id": "sign-up-with-an-email-and-password", + "name": "Sign up with an email and password", + "code": "```js\nconst { data, error } = await supabase.auth.signUp({\n email: 'example@email.com',\n password: 'example-password',\n})\n```", + "response": "```json\n// Some fields may be null if \"confirm email\" is enabled.\n{\n \"data\": {\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"example@email.com\",\n \"email_confirmed_at\": \"2024-01-01T00:00:00Z\",\n \"phone\": \"\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"app_metadata\": {\n \"provider\": \"email\",\n \"providers\": [\n \"email\"\n ]\n },\n \"user_metadata\": {},\n \"identities\": [\n {\n \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n \"identity_data\": {\n \"email\": \"example@email.com\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"provider\": \"email\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"example@email.com\"\n }\n ],\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\"\n },\n \"session\": {\n \"access_token\": \"\",\n \"token_type\": \"bearer\",\n \"expires_in\": 3600,\n \"expires_at\": 1700000000,\n \"refresh_token\": \"\",\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"example@email.com\",\n \"email_confirmed_at\": \"2024-01-01T00:00:00Z\",\n \"phone\": \"\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"app_metadata\": {\n \"provider\": \"email\",\n \"providers\": [\n \"email\"\n ]\n },\n \"user_metadata\": {},\n \"identities\": [\n {\n \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n \"identity_data\": {\n \"email\": \"example@email.com\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"provider\": \"email\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"example@email.com\"\n }\n ],\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\"\n }\n }\n },\n \"error\": null\n}\n```" + }, + { + "id": "sign-up-with-a-phone-number-and-password-sms", + "name": "Sign up with a phone number and password (SMS)", + "code": "```js\nconst { data, error } = await supabase.auth.signUp({\n phone: '123456789',\n password: 'example-password',\n options: {\n channel: 'sms'\n }\n})\n```" + }, + { + "id": "sign-up-with-a-phone-number-and-password-whatsapp", + "name": "Sign up with a phone number and password (whatsapp)", + "code": "```js\nconst { data, error } = await supabase.auth.signUp({\n phone: '123456789',\n password: 'example-password',\n options: {\n channel: 'whatsapp'\n }\n})\n```", + "description": "The user will be sent a WhatsApp message which contains a OTP. By default, a given user can only request a OTP once every 60 seconds. Note that a user will need to have a valid WhatsApp account that is linked to Twilio in order to use this feature." + }, + { + "id": "sign-up-with-additional-user-metadata", + "name": "Sign up with additional user metadata", + "code": "```js\nconst { data, error } = await supabase.auth.signUp(\n {\n email: 'example@email.com',\n password: 'example-password',\n options: {\n data: {\n first_name: 'John',\n age: 27,\n }\n }\n }\n)\n```" + }, + { + "id": "sign-up-with-a-redirect-url", + "name": "Sign up with a redirect URL", + "code": "```js\nconst { data, error } = await supabase.auth.signUp(\n {\n email: 'example@email.com',\n password: 'example-password',\n options: {\n emailRedirectTo: 'https://example.com/welcome'\n }\n }\n)\n```", + "description": "- See [redirect URLs and wildcards](/docs/guides/auth/redirect-urls#use-wildcards-in-redirect-urls) to add additional redirect URLs to your project." + } + ] + } + }, + "@supabase/auth-js.GoTrueClient.startAutoRefresh": { + "name": "@supabase/auth-js.GoTrueClient.startAutoRefresh", + "params": [], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "intrinsic", + "name": "void" + } + } + }, + "comment": { + "shortText": "Starts an auto-refresh process in the background. The session is checked\nevery few seconds. Close to the time of expiration a process is started to\nrefresh the session. If refreshing fails it will be retried for as long as\nnecessary.\n\nIf you set the GoTrueClientOptions#autoRefreshToken you don't need\nto call this function, it will be called for you.\n\nOn browsers the refresh process works only when the tab/window is in the\nforeground to conserve resources as well as prevent race conditions and\nflooding auth with requests. If you call this method any managed\nvisibility change callback will be removed and you must manage visibility\nchanges on your own.\n\nOn non-browser platforms the refresh process works *continuously* in the\nbackground, which may not be desirable. You should hook into your\nplatform's foreground indication mechanism and call these methods\nappropriately to conserve resources.\n\n#stopAutoRefresh", + "text": "- Only useful in non-browser environments such as React Native or Electron.\n- The Supabase Auth library automatically starts and stops proactively refreshing the session when a tab is focused or not.\n- On non-browser platforms, such as mobile or desktop apps built with web technologies, the library is not able to effectively determine whether the application is _focused_ or not.\n- To give this hint to the application, you should be calling this method when the app is in focus and calling `supabase.auth.stopAutoRefresh()` when it's out of focus.", + "examples": [ + { + "id": "start-and-stop-auto-refresh-in-react-native", + "name": "Start and stop auto refresh in React Native", + "code": "```js\nimport { AppState } from 'react-native'\n\n// make sure you register this only once!\nAppState.addEventListener('change', (state) => {\n if (state === 'active') {\n supabase.auth.startAutoRefresh()\n } else {\n supabase.auth.stopAutoRefresh()\n }\n})\n```" + } + ] + } + }, + "@supabase/auth-js.GoTrueClient.stopAutoRefresh": { + "name": "@supabase/auth-js.GoTrueClient.stopAutoRefresh", + "params": [], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "intrinsic", + "name": "void" + } + } + }, + "comment": { + "shortText": "Stops an active auto refresh process running in the background (if any).\n\nIf you call this method any managed visibility change callback will be\nremoved and you must manage visibility changes on your own.\n\nSee #startAutoRefresh for more details.", + "text": "- Only useful in non-browser environments such as React Native or Electron.\n- The Supabase Auth library automatically starts and stops proactively refreshing the session when a tab is focused or not.\n- On non-browser platforms, such as mobile or desktop apps built with web technologies, the library is not able to effectively determine whether the application is _focused_ or not.\n- When your application goes in the background or out of focus, call this method to stop the proactive refreshing of the session.", + "examples": [ + { + "id": "start-and-stop-auto-refresh-in-react-native", + "name": "Start and stop auto refresh in React Native", + "code": "```js\nimport { AppState } from 'react-native'\n\n// make sure you register this only once!\nAppState.addEventListener('change', (state) => {\n if (state === 'active') {\n supabase.auth.startAutoRefresh()\n } else {\n supabase.auth.stopAutoRefresh()\n }\n})\n```" + } + ] + } + }, + "@supabase/auth-js.GoTrueClient.unlinkIdentity": { + "name": "@supabase/auth-js.GoTrueClient.unlinkIdentity", + "params": [ + { + "name": "identity", + "type": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data" + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "literal", + "value": null + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Unlinks an identity from a user by deleting it. The user will no longer be able to sign in with that identity once it's unlinked.", + "text": "- The **Enable Manual Linking** option must be enabled from your [project's authentication settings](/dashboard/project/_/auth/providers).\n- The user needs to be signed in to call `unlinkIdentity()`.\n- The user must have at least 2 identities in order to unlink an identity.\n- The identity to be unlinked must belong to the user.", + "examples": [ + { + "id": "unlink-an-identity", + "name": "Unlink an identity", + "code": "```js\n// retrieve all identities linked to a user\nconst identities = await supabase.auth.getUserIdentities()\n\n// find the google identity\nconst googleIdentity = identities.find(\n identity => identity.provider === 'google'\n)\n\n// unlink the google identity\nconst { error } = await supabase.auth.unlinkIdentity(googleIdentity)\n```" + } + ] + } + }, + "@supabase/auth-js.GoTrueClient.updateUser": { + "name": "@supabase/auth-js.GoTrueClient.updateUser", + "params": [ + { + "name": "attributes", + "type": { + "type": "object", + "name": "UserAttributes", + "properties": [ + { + "name": "current_password", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "The user's current password\n\nThis is only ever present when the user is resetting\ntheir password and GOTRUE_SECURITY_UPDATE_PASSWORD_REQUIRE_CURRENT_PASSWORD is true." + } + }, + { + "name": "data", + "type": { + "type": "intrinsic", + "name": "object" + }, + "isOptional": true, + "comment": { + "shortText": "A custom data object to store the user's metadata. This maps to the `auth.users.raw_user_meta_data` column.\n\nThe `data` should be a JSON object that includes user-specific info, such as their first and last name." + } + }, + { + "name": "email", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "The user's email." + } + }, + { + "name": "nonce", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "The nonce sent for reauthentication if the user's password is to be updated.\n\nCall reauthenticate() to obtain the nonce first." + } + }, + { + "name": "password", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "The user's password." + } + }, + { + "name": "phone", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "The user's phone." + } + } + ] + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "emailRedirectTo", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "UserResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "user", + "type": { + "type": "object", + "name": "User", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "user", + "type": "[Circular]" + } + ] + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Updates user data for a logged in user.", + "text": "- In order to use the `updateUser()` method, the user needs to be signed in first.\n- By default, email updates sends a confirmation link to both the user's current and new email.\nTo only send a confirmation link to the user's new email, disable **Secure email change** in your project's [email auth provider settings](/dashboard/project/_/auth/providers).", + "examples": [ + { + "id": "update-the-email-for-an-authenticated-user", + "name": "Update the email for an authenticated user", + "code": "```js\nconst { data, error } = await supabase.auth.updateUser({\n email: 'new@email.com'\n})\n```", + "description": "Sends a \"Confirm Email Change\" email to the new address. If **Secure Email Change** is enabled (default), confirmation is also required from the **old email** before the change is applied. To skip dual confirmation and apply the change after only the new email is verified, disable **Secure Email Change** in the [Email Auth Provider settings](/dashboard/project/_/auth/providers?provider=Email).", + "response": "```json\n{\n \"data\": {\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"example@email.com\",\n \"email_confirmed_at\": \"2024-01-01T00:00:00Z\",\n \"phone\": \"\",\n \"confirmed_at\": \"2024-01-01T00:00:00Z\",\n \"new_email\": \"new@email.com\",\n \"email_change_sent_at\": \"2024-01-01T00:00:00Z\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"app_metadata\": {\n \"provider\": \"email\",\n \"providers\": [\n \"email\"\n ]\n },\n \"user_metadata\": {\n \"email\": \"example@email.com\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"identities\": [\n {\n \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n \"identity_data\": {\n \"email\": \"example@email.com\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"provider\": \"email\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"example@email.com\"\n }\n ],\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"is_anonymous\": false\n }\n },\n \"error\": null\n}\n```" + }, + { + "id": "update-the-phone-number-for-an-authenticated-user", + "name": "Update the phone number for an authenticated user", + "code": "```js\nconst { data, error } = await supabase.auth.updateUser({\n phone: '123456789'\n})\n```", + "description": "Sends a one-time password (OTP) to the new phone number." + }, + { + "id": "update-the-password-for-an-authenticated-user", + "name": "Update the password for an authenticated user", + "code": "```js\nconst { data, error } = await supabase.auth.updateUser({\n password: 'new password'\n})\n```" + }, + { + "id": "update-the-user-s-metadata", + "name": "Update the user's metadata", + "code": "```js\nconst { data, error } = await supabase.auth.updateUser({\n data: { hello: 'world' }\n})\n```", + "description": "Updates the user's custom metadata.\n\n**Note**: The `data` field maps to the `auth.users.raw_user_meta_data` column in your Supabase database. When calling `getUser()`, the data will be available as `user.user_metadata`." + }, + { + "id": "update-the-user-s-password-with-a-nonce", + "name": "Update the user's password with a nonce", + "code": "```js\nconst { data, error } = await supabase.auth.updateUser({\n password: 'new password',\n nonce: '123456'\n})\n```", + "description": "If **Secure password change** is enabled in your [project's email provider settings](/dashboard/project/_/auth/providers), updating the user's password would require a nonce if the user **hasn't recently signed in**. The nonce is sent to the user's email or phone number. A user is deemed recently signed in if the session was created in the last 24 hours." + } + ] + } + }, + "@supabase/auth-js.GoTrueClient.verifyOtp": { + "name": "@supabase/auth-js.GoTrueClient.verifyOtp", + "params": [ + { + "name": "params", + "type": { + "type": "union", + "name": "VerifyOtpParams", + "subTypes": [ + { + "type": "object", + "name": "VerifyMobileOtpParams", + "properties": [ + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "captchaToken", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Verification token received when the user completes the captcha on the site." + } + }, + { + "name": "redirectTo", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "A URL to send the user to after they are confirmed." + } + } + ] + }, + "isOptional": true + }, + { + "name": "phone", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The user's phone number." + } + }, + { + "name": "token", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The otp sent to the user's phone number." + } + }, + { + "name": "type", + "type": { + "type": "union", + "name": "MobileOtpType", + "subTypes": [ + { + "type": "literal", + "value": "sms" + }, + { + "type": "literal", + "value": "phone_change" + }, + null + ] + }, + "comment": { + "shortText": "The user's verification type." + } + } + ] + }, + { + "type": "object", + "name": "VerifyEmailOtpParams", + "properties": [ + { + "name": "email", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The user's email address." + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "captchaToken", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Verification token received when the user completes the captcha on the site." + } + }, + { + "name": "redirectTo", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "A URL to send the user to after they are confirmed." + } + } + ] + }, + "isOptional": true + }, + { + "name": "token", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The otp sent to the user's email address." + } + }, + { + "name": "type", + "type": { + "type": "union", + "name": "EmailOtpType", + "subTypes": [ + { + "type": "literal", + "value": "signup" + }, + { + "type": "literal", + "value": "invite" + }, + { + "type": "literal", + "value": "magiclink" + }, + { + "type": "literal", + "value": "recovery" + }, + { + "type": "literal", + "value": "email_change" + }, + { + "type": "literal", + "value": "email" + }, + null + ] + }, + "comment": { + "shortText": "The user's verification type." + } + } + ] + }, + { + "type": "object", + "name": "VerifyTokenHashParams", + "properties": [ + { + "name": "token_hash", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The token hash used in an email link" + } + }, + { + "name": "type", + "type": { + "type": "union", + "name": "EmailOtpType", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + null + ] + }, + "comment": { + "shortText": "The user's verification type." + } + } + ] + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "session", + "type": { + "type": "union", + "subTypes": [ + { + "type": "object", + "name": "Session", + "properties": [ + { + "name": "access_token", + "type": "[Circular]", + "comment": { + "shortText": "The access token jwt. It is recommended to set the JWT_EXPIRY to a shorter expiry value." + } + }, + { + "name": "expires_at", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "A timestamp of when the token will expire. Returned when a login is confirmed." + } + }, + { + "name": "expires_in", + "type": "[Circular]", + "comment": { + "shortText": "The number of seconds until the token expires (since it was issued). Returned when a login is confirmed." + } + }, + { + "name": "provider_refresh_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider refresh token. If present, this can be used to refresh the provider_token via the oauth provider's API.\nNot all oauth providers return a provider refresh token. If the provider_refresh_token is missing, please refer to the oauth provider's documentation for information on how to obtain the provider refresh token." + } + }, + { + "name": "provider_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider token. If present, this can be used to make external API requests to the oauth provider used." + } + }, + { + "name": "refresh_token", + "type": "[Circular]", + "comment": { + "shortText": "A one-time used refresh token that never expires." + } + }, + { + "name": "token_type", + "type": "[Circular]" + }, + { + "name": "user", + "type": { + "type": "object", + "name": "User", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + "comment": { + "shortText": "When using a separate user storage, accessing properties of this object will throw an error." + } + } + ] + }, + "[Circular]" + ] + } + }, + { + "name": "user", + "type": { + "type": "union", + "subTypes": [ + { + "type": "object", + "name": "User", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + "[Circular]" + ] + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "session", + "type": "[Circular]" + }, + { + "name": "user", + "type": "[Circular]" + } + ] + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Log in a user given a User supplied OTP or TokenHash received through mobile or email.", + "text": "- The `verifyOtp` method takes in different verification types.\n- If a phone number is used, the type can either be:\n 1. `sms` – Used when verifying a one-time password (OTP) sent via SMS during sign-up or sign-in.\n 2. `phone_change` – Used when verifying an OTP sent to a new phone number during a phone number update process.\n- If an email address is used, the type can be one of the following (note: `signup` and `magiclink` types are deprecated):\n 1. `email` – Used when verifying an OTP sent to the user's email during sign-up or sign-in.\n 2. `recovery` – Used when verifying an OTP sent for account recovery, typically after a password reset request.\n 3. `invite` – Used when verifying an OTP sent as part of an invitation to join a project or organization.\n 4. `email_change` – Used when verifying an OTP sent to a new email address during an email update process.\n- The verification type used should be determined based on the corresponding auth method called before `verifyOtp` to sign up / sign-in a user.\n- The `TokenHash` is contained in the [email templates](/docs/guides/auth/auth-email-templates) and can be used to sign in. You may wish to use the hash for the PKCE flow for Server Side Auth. Read [the Password-based Auth guide](/docs/guides/auth/passwords) for more details.", + "examples": [ + { + "id": "verify-signup-one-time-password-otp", + "name": "Verify Signup One-Time Password (OTP)", + "code": "```js\nconst { data, error } = await supabase.auth.verifyOtp({ email, token, type: 'email'})\n```", + "response": "```json\n{\n \"data\": {\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"example@email.com\",\n \"email_confirmed_at\": \"2024-01-01T00:00:00Z\",\n \"phone\": \"\",\n \"confirmed_at\": \"2024-01-01T00:00:00Z\",\n \"recovery_sent_at\": \"2024-01-01T00:00:00Z\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"app_metadata\": {\n \"provider\": \"email\",\n \"providers\": [\n \"email\"\n ]\n },\n \"user_metadata\": {\n \"email\": \"example@email.com\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"identities\": [\n {\n \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n \"identity_data\": {\n \"email\": \"example@email.com\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"provider\": \"email\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"example@email.com\"\n }\n ],\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"is_anonymous\": false\n },\n \"session\": {\n \"access_token\": \"\",\n \"token_type\": \"bearer\",\n \"expires_in\": 3600,\n \"expires_at\": 1700000000,\n \"refresh_token\": \"\",\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"example@email.com\",\n \"email_confirmed_at\": \"2024-01-01T00:00:00Z\",\n \"phone\": \"\",\n \"confirmed_at\": \"2024-01-01T00:00:00Z\",\n \"recovery_sent_at\": \"2024-01-01T00:00:00Z\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"app_metadata\": {\n \"provider\": \"email\",\n \"providers\": [\n \"email\"\n ]\n },\n \"user_metadata\": {\n \"email\": \"example@email.com\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"identities\": [\n {\n \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n \"identity_data\": {\n \"email\": \"example@email.com\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"provider\": \"email\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"example@email.com\"\n }\n ],\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"is_anonymous\": false\n }\n }\n },\n \"error\": null\n}\n```" + }, + { + "id": "verify-sms-one-time-password-otp", + "name": "Verify SMS One-Time Password (OTP)", + "code": "```js\nconst { data, error } = await supabase.auth.verifyOtp({ phone, token, type: 'sms'})\n```" + }, + { + "id": "verify-email-auth-token-hash", + "name": "Verify Email Auth (Token Hash)", + "code": "```js\nconst { data, error } = await supabase.auth.verifyOtp({ token_hash: tokenHash, type: 'email'})\n```" + } + ] + } + }, + "@supabase/auth-js.NavigatorLockAcquireTimeoutError.constructor": { + "name": "@supabase/auth-js.NavigatorLockAcquireTimeoutError.constructor", + "params": [ + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "NavigatorLockAcquireTimeoutError" + } + } + }, + "@supabase/auth-js.AuthOAuthServerApi.approveAuthorization": { + "name": "@supabase/auth-js.AuthOAuthServerApi.approveAuthorization", + "params": [ + { + "name": "authorizationId", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The authorization ID to approve" + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "skipBrowserRedirect", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "If false (default), automatically redirects the browser to the OAuth client. If true, returns the redirect_url without automatic redirect (useful for custom handling)." + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Optional parameters" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthOAuthConsentResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "name": "OAuthRedirect", + "type": "object", + "properties": [ + { + "name": "redirect_url", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Complete redirect URL with authorization code and state parameters (e.g., \"https://app.com/callback?code=xxx&state=yyy\")" + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Approves an OAuth authorization request.\nOnly relevant when the OAuth 2.1 server is enabled in Supabase Auth.\n\nAfter approval, the user's consent is stored and an authorization code is generated.\nThe response contains a complete redirect URL with the authorization code and state." + } + }, + "@supabase/auth-js.AuthOAuthServerApi.denyAuthorization": { + "name": "@supabase/auth-js.AuthOAuthServerApi.denyAuthorization", + "params": [ + { + "name": "authorizationId", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The authorization ID to deny" + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "skipBrowserRedirect", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "If false (default), automatically redirects the browser to the OAuth client. If true, returns the redirect_url without automatic redirect (useful for custom handling)." + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Optional parameters" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthOAuthConsentResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "name": "OAuthRedirect", + "type": "object", + "properties": [ + { + "name": "redirect_url", + "type": "[Circular]", + "comment": { + "shortText": "Complete redirect URL with authorization code and state parameters (e.g., \"https://app.com/callback?code=xxx&state=yyy\")" + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Denies an OAuth authorization request.\nOnly relevant when the OAuth 2.1 server is enabled in Supabase Auth.\n\nAfter denial, the response contains a redirect URL with an OAuth error\n(access_denied) to inform the OAuth client that the user rejected the request." + } + }, + "@supabase/auth-js.AuthOAuthServerApi.getAuthorizationDetails": { + "name": "@supabase/auth-js.AuthOAuthServerApi.getAuthorizationDetails", + "params": [ + { + "name": "authorizationId", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The authorization ID from the authorization request" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthOAuthAuthorizationDetailsResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "union", + "subTypes": [ + { + "name": "OAuthAuthorizationDetails", + "type": "object", + "properties": [ + { + "name": "authorization_id", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The authorization ID used to approve or deny the request" + } + }, + { + "name": "client", + "type": { + "name": "OAuthAuthorizationClient", + "type": "object", + "properties": [ + { + "name": "id", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Unique identifier for the OAuth client (UUID)" + } + }, + { + "name": "logo_uri", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "URI of the OAuth client's logo" + } + }, + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Human-readable name of the OAuth client" + } + }, + { + "name": "uri", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "URI of the OAuth client's website" + } + } + ] + }, + "comment": { + "shortText": "OAuth client requesting authorization" + } + }, + { + "name": "redirect_uri", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The OAuth client's registered redirect URI (base URI without query parameters)" + } + }, + { + "name": "scope", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Space-separated list of requested scopes (e.g., \"openid profile email\")" + } + }, + { + "name": "user", + "type": { + "type": "object", + "properties": [ + { + "name": "email", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "User email" + } + }, + { + "name": "id", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "User ID (UUID)" + } + } + ] + }, + "comment": { + "shortText": "User object associated with the authorization" + } + } + ] + }, + { + "name": "OAuthRedirect", + "type": "object", + "properties": [ + { + "name": "redirect_url", + "type": "[Circular]", + "comment": { + "shortText": "Complete redirect URL with authorization code and state parameters (e.g., \"https://app.com/callback?code=xxx&state=yyy\")" + } + } + ] + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Retrieves details about an OAuth authorization request.\nUsed to display consent information to the user.\nOnly relevant when the OAuth 2.1 server is enabled in Supabase Auth.\n\nThis method returns one of two response types:\n- `OAuthAuthorizationDetails`: User needs to consent - show consent page with client info\n- `OAuthRedirect`: User already consented - redirect immediately to the OAuth client\n\nUse type narrowing to distinguish between the responses:\n```typescript\nif ('authorization_id' in data) {\n // Show consent page\n} else {\n // Redirect to data.redirect_url\n}\n```" + } + }, + "@supabase/auth-js.AuthOAuthServerApi.listGrants": { + "name": "@supabase/auth-js.AuthOAuthServerApi.listGrants", + "params": [], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthOAuthGrantsResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "array", + "elemType": { + "name": "OAuthGrant", + "type": "object", + "properties": [ + { + "name": "client", + "type": { + "name": "OAuthAuthorizationClient", + "type": "object", + "properties": [ + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "Unique identifier for the OAuth client (UUID)" + } + }, + { + "name": "logo_uri", + "type": "[Circular]", + "comment": { + "shortText": "URI of the OAuth client's logo" + } + }, + { + "name": "name", + "type": "[Circular]", + "comment": { + "shortText": "Human-readable name of the OAuth client" + } + }, + { + "name": "uri", + "type": "[Circular]", + "comment": { + "shortText": "URI of the OAuth client's website" + } + } + ] + }, + "comment": { + "shortText": "OAuth client information" + } + }, + { + "name": "granted_at", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Timestamp when the grant was created (ISO 8601 date-time)" + } + }, + { + "name": "scopes", + "type": { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + }, + "comment": { + "shortText": "Array of scopes granted to this client" + } + } + ] + } + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Lists all OAuth grants that the authenticated user has authorized.\nOnly relevant when the OAuth 2.1 server is enabled in Supabase Auth." + } + }, + "@supabase/auth-js.AuthOAuthServerApi.revokeGrant": { + "name": "@supabase/auth-js.AuthOAuthServerApi.revokeGrant", + "params": [ + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "clientId", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The OAuth client identifier (UUID) to revoke access for" + } + } + ] + }, + "comment": { + "shortText": "Revocation options" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthOAuthRevokeGrantResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data" + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Revokes a user's OAuth grant for a specific client.\nOnly relevant when the OAuth 2.1 server is enabled in Supabase Auth.\n\nRevocation marks consent as revoked, deletes active sessions for that OAuth client,\nand invalidates associated refresh tokens." + } + }, + "@supabase/auth-js.AuthPasskeyApi.delete": { + "name": "@supabase/auth-js.AuthPasskeyApi.delete", + "params": [ + { + "name": "params", + "type": { + "name": "PasskeyDeleteParams", + "type": "object", + "properties": [ + { + "name": "passkeyId", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "UUID of the passkey to delete" + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthPasskeyDeleteResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "literal", + "value": null + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Deletes a passkey for the currently signed-in user." + } + }, + "@supabase/auth-js.AuthPasskeyApi.list": { + "name": "@supabase/auth-js.AuthPasskeyApi.list", + "params": [], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthPasskeyListResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "array", + "elemType": { + "name": "PasskeyListItem", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "friendly_name", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "id", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "last_used_at", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + } + ] + } + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Lists all passkeys registered for the currently signed-in user." + } + }, + "@supabase/auth-js.AuthPasskeyApi.startAuthentication": { + "name": "@supabase/auth-js.AuthPasskeyApi.startAuthentication", + "params": [ + { + "name": "params", + "type": { + "name": "StartPasskeyAuthenticationParams", + "type": "object", + "properties": [ + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "captchaToken", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + } + ] + }, + "isOptional": true + } + ] + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthPasskeyAuthenticationOptionsResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "name": "PasskeyAuthenticationOptionsResponse", + "type": "object", + "properties": [ + { + "name": "challenge_id", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "expires_at", + "type": { + "type": "intrinsic", + "name": "number" + } + }, + { + "name": "options", + "type": { + "type": "nameOnly", + "name": "ServerCredentialRequestOptions" + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Starts the passkey authentication ceremony. Fetches an authentication\nchallenge and credential request options from the server. Used as the\nfirst step of a two-step sign-in flow when the caller wants to handle\n`navigator.credentials.get()` themselves." + } + }, + "@supabase/auth-js.AuthPasskeyApi.startRegistration": { + "name": "@supabase/auth-js.AuthPasskeyApi.startRegistration", + "params": [], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthPasskeyRegistrationOptionsResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "name": "PasskeyRegistrationOptionsResponse", + "type": "object", + "properties": [ + { + "name": "challenge_id", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "expires_at", + "type": { + "type": "intrinsic", + "name": "number" + } + }, + { + "name": "options", + "type": { + "type": "nameOnly", + "name": "ServerCredentialCreationOptions" + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Starts the passkey registration ceremony. Fetches a registration challenge\nand credential creation options from the server. Used as the first step of\na two-step registration flow when the caller wants to handle\n`navigator.credentials.create()` themselves." + } + }, + "@supabase/auth-js.AuthPasskeyApi.update": { + "name": "@supabase/auth-js.AuthPasskeyApi.update", + "params": [ + { + "name": "params", + "type": { + "name": "PasskeyUpdateParams", + "type": "object", + "properties": [ + { + "name": "friendlyName", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "New friendly name (max 120 chars)" + } + }, + { + "name": "passkeyId", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "UUID of the passkey to update" + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthPasskeyUpdateResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "name": "PasskeyListItem", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "last_used_at", + "type": "[Circular]", + "isOptional": true + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Updates a passkey's friendly name." + } + }, + "@supabase/auth-js.AuthPasskeyApi.verifyAuthentication": { + "name": "@supabase/auth-js.AuthPasskeyApi.verifyAuthentication", + "params": [ + { + "name": "params", + "type": { + "name": "VerifyPasskeyAuthenticationParams", + "type": "object", + "properties": [ + { + "name": "challengeId", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Challenge ID from startAuthentication" + } + }, + { + "name": "credential", + "type": { + "type": "nameOnly", + "name": "ServerCredentialResponse" + }, + "comment": { + "shortText": "Serialized credential from navigator.credentials.get()" + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthPasskeyAuthenticationVerifyResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "session", + "type": { + "type": "union", + "subTypes": [ + { + "type": "object", + "name": "Session", + "properties": [ + { + "name": "access_token", + "type": "[Circular]", + "comment": { + "shortText": "The access token jwt. It is recommended to set the JWT_EXPIRY to a shorter expiry value." + } + }, + { + "name": "expires_at", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "A timestamp of when the token will expire. Returned when a login is confirmed." + } + }, + { + "name": "expires_in", + "type": "[Circular]", + "comment": { + "shortText": "The number of seconds until the token expires (since it was issued). Returned when a login is confirmed." + } + }, + { + "name": "provider_refresh_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider refresh token. If present, this can be used to refresh the provider_token via the oauth provider's API.\nNot all oauth providers return a provider refresh token. If the provider_refresh_token is missing, please refer to the oauth provider's documentation for information on how to obtain the provider refresh token." + } + }, + { + "name": "provider_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider token. If present, this can be used to make external API requests to the oauth provider used." + } + }, + { + "name": "refresh_token", + "type": "[Circular]", + "comment": { + "shortText": "A one-time used refresh token that never expires." + } + }, + { + "name": "token_type", + "type": "[Circular]" + }, + { + "name": "user", + "type": { + "type": "object", + "name": "User", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + "comment": { + "shortText": "When using a separate user storage, accessing properties of this object will throw an error." + } + } + ] + }, + "[Circular]" + ] + } + }, + { + "name": "user", + "type": { + "type": "union", + "subTypes": [ + { + "type": "object", + "name": "User", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + "[Circular]" + ] + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Verifies a passkey authentication credential against a previously issued\nchallenge. Used as the second step of a two-step sign-in flow." + } + }, + "@supabase/auth-js.AuthPasskeyApi.verifyRegistration": { + "name": "@supabase/auth-js.AuthPasskeyApi.verifyRegistration", + "params": [ + { + "name": "params", + "type": { + "name": "VerifyPasskeyRegistrationParams", + "type": "object", + "properties": [ + { + "name": "challengeId", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Challenge ID from startRegistration" + } + }, + { + "name": "credential", + "type": { + "type": "nameOnly", + "name": "ServerCredentialResponse" + }, + "comment": { + "shortText": "Serialized credential from navigator.credentials.create()" + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthPasskeyRegistrationVerifyResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "name": "PasskeyMetadata", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Verifies a passkey registration credential against a previously issued\nchallenge. Used as the second step of a two-step registration flow." + } + }, + "@supabase/auth-js.GoTrueAdminCustomProvidersApi.createProvider": { + "name": "@supabase/auth-js.GoTrueAdminCustomProvidersApi.createProvider", + "params": [ + { + "name": "params", + "type": { + "name": "CreateCustomProviderParams", + "type": "object", + "properties": [ + { + "name": "acceptable_client_ids", + "type": { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + }, + "isOptional": true, + "comment": { + "shortText": "Additional client IDs accepted during token validation" + } + }, + { + "name": "attribute_mapping", + "type": { + "type": "record", + "name": "Record", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "any" + } + }, + "isOptional": true, + "comment": { + "shortText": "Mapping of provider attributes to Supabase user attributes" + } + }, + { + "name": "authorization_params", + "type": { + "type": "record", + "name": "Record", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "string" + } + }, + "isOptional": true, + "comment": { + "shortText": "Additional parameters sent with the authorization request" + } + }, + { + "name": "authorization_url", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "OAuth2 authorization URL" + } + }, + { + "name": "client_id", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "OAuth client ID" + } + }, + { + "name": "client_secret", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "OAuth client secret (write-only, not returned in responses)" + } + }, + { + "name": "discovery_url", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "OIDC discovery URL" + } + }, + { + "name": "email_optional", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "Whether email is optional for this provider" + } + }, + { + "name": "enabled", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "Whether the provider is enabled" + } + }, + { + "name": "identifier", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Provider identifier (e.g. `custom:mycompany`)" + } + }, + { + "name": "issuer", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "OIDC issuer URL" + } + }, + { + "name": "jwks_uri", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "JWKS URI for token verification" + } + }, + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Human-readable name" + } + }, + { + "name": "pkce_enabled", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "Whether PKCE is enabled" + } + }, + { + "name": "provider_type", + "type": { + "type": "union", + "name": "CustomProviderType", + "subTypes": [ + { + "type": "literal", + "value": "oauth2" + }, + { + "type": "literal", + "value": "oidc" + } + ] + }, + "comment": { + "shortText": "Provider type" + } + }, + { + "name": "scopes", + "type": { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + }, + "isOptional": true, + "comment": { + "shortText": "OAuth scopes requested during authorization" + } + }, + { + "name": "skip_nonce_check", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "Whether to skip nonce check (OIDC)" + } + }, + { + "name": "token_url", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "OAuth2 token URL" + } + }, + { + "name": "userinfo_url", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "OAuth2 userinfo URL" + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "CustomProviderResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "name": "CustomOAuthProvider", + "type": "object", + "properties": [ + { + "name": "acceptable_client_ids", + "type": { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + }, + "isOptional": true, + "comment": { + "shortText": "Additional client IDs accepted during token validation" + } + }, + { + "name": "attribute_mapping", + "type": { + "type": "record", + "name": "Record", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "any" + } + }, + "isOptional": true, + "comment": { + "shortText": "Mapping of provider attributes to Supabase user attributes" + } + }, + { + "name": "authorization_params", + "type": { + "type": "record", + "name": "Record", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "string" + } + }, + "isOptional": true, + "comment": { + "shortText": "Additional parameters sent with the authorization request" + } + }, + { + "name": "authorization_url", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "OAuth2 authorization URL" + } + }, + { + "name": "client_id", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "OAuth client ID" + } + }, + { + "name": "created_at", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Timestamp when the provider was created" + } + }, + { + "name": "discovery_document", + "type": { + "type": "union", + "subTypes": [ + { + "name": "OIDCDiscoveryDocument", + "type": "object", + "properties": [ + { + "name": "authorization_endpoint", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "URL of the authorization endpoint" + } + }, + { + "name": "issuer", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The issuer identifier" + } + }, + { + "name": "jwks_uri", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "URL of the JSON Web Key Set" + } + }, + { + "name": "revocation_endpoint", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "URL of the revocation endpoint" + } + }, + { + "name": "supported_id_token_signing_algs", + "type": { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + }, + "isOptional": true, + "comment": { + "shortText": "List of supported ID token signing algorithms" + } + }, + { + "name": "supported_response_types", + "type": { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + }, + "isOptional": true, + "comment": { + "shortText": "List of supported response types" + } + }, + { + "name": "supported_scopes", + "type": { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + }, + "isOptional": true, + "comment": { + "shortText": "List of supported scopes" + } + }, + { + "name": "supported_subject_types", + "type": { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + }, + "isOptional": true, + "comment": { + "shortText": "List of supported subject types" + } + }, + { + "name": "token_endpoint", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "URL of the token endpoint" + } + }, + { + "name": "userinfo_endpoint", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "URL of the userinfo endpoint" + } + } + ] + }, + { + "type": "literal", + "value": null + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "OIDC discovery document (OIDC providers only)" + } + }, + { + "name": "discovery_url", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "OIDC discovery URL" + } + }, + { + "name": "email_optional", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "Whether email is optional for this provider" + } + }, + { + "name": "enabled", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "Whether the provider is enabled" + } + }, + { + "name": "id", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Unique identifier (UUID)" + } + }, + { + "name": "identifier", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Provider identifier (e.g. `custom:mycompany`)" + } + }, + { + "name": "issuer", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "OIDC issuer URL" + } + }, + { + "name": "jwks_uri", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "JWKS URI for token verification" + } + }, + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Human-readable name" + } + }, + { + "name": "pkce_enabled", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "Whether PKCE is enabled" + } + }, + { + "name": "provider_type", + "type": { + "type": "union", + "name": "CustomProviderType", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Provider type" + } + }, + { + "name": "scopes", + "type": { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + }, + "isOptional": true, + "comment": { + "shortText": "OAuth scopes requested during authorization" + } + }, + { + "name": "skip_nonce_check", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "Whether to skip nonce check (OIDC)" + } + }, + { + "name": "token_url", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "OAuth2 token URL" + } + }, + { + "name": "updated_at", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Timestamp when the provider was last updated" + } + }, + { + "name": "userinfo_url", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "OAuth2 userinfo URL" + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Creates a new custom OIDC/OAuth provider.\n\nFor OIDC providers, the server fetches and validates the OpenID Connect discovery document\nfrom the issuer's well-known endpoint (or the provided `discovery_url`) at creation time.\nThis may return a validation error (`error_code: \"validation_failed\"`) if the discovery\ndocument is unreachable, not valid JSON, missing required fields, or if the issuer\nin the document does not match the expected issuer.\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser." + } + }, + "@supabase/auth-js.GoTrueAdminCustomProvidersApi.deleteProvider": { + "name": "@supabase/auth-js.GoTrueAdminCustomProvidersApi.deleteProvider", + "params": [ + { + "name": "identifier", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "literal", + "value": null + } + }, + { + "name": "error", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "nameOnly", + "name": "AuthError" + } + ] + } + } + ] + } + } + }, + "comment": { + "shortText": "Deletes a custom provider.\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser." + } + }, + "@supabase/auth-js.GoTrueAdminCustomProvidersApi.getProvider": { + "name": "@supabase/auth-js.GoTrueAdminCustomProvidersApi.getProvider", + "params": [ + { + "name": "identifier", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "CustomProviderResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "name": "CustomOAuthProvider", + "type": "object", + "properties": [ + { + "name": "acceptable_client_ids", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "Additional client IDs accepted during token validation" + } + }, + { + "name": "attribute_mapping", + "type": { + "type": "record", + "name": "Record", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "Mapping of provider attributes to Supabase user attributes" + } + }, + { + "name": "authorization_params", + "type": { + "type": "record", + "name": "Record", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "Additional parameters sent with the authorization request" + } + }, + { + "name": "authorization_url", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "OAuth2 authorization URL" + } + }, + { + "name": "client_id", + "type": "[Circular]", + "comment": { + "shortText": "OAuth client ID" + } + }, + { + "name": "created_at", + "type": "[Circular]", + "comment": { + "shortText": "Timestamp when the provider was created" + } + }, + { + "name": "discovery_document", + "type": { + "type": "union", + "subTypes": [ + { + "name": "OIDCDiscoveryDocument", + "type": "object", + "properties": [ + { + "name": "authorization_endpoint", + "type": "[Circular]", + "comment": { + "shortText": "URL of the authorization endpoint" + } + }, + { + "name": "issuer", + "type": "[Circular]", + "comment": { + "shortText": "The issuer identifier" + } + }, + { + "name": "jwks_uri", + "type": "[Circular]", + "comment": { + "shortText": "URL of the JSON Web Key Set" + } + }, + { + "name": "revocation_endpoint", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "URL of the revocation endpoint" + } + }, + { + "name": "supported_id_token_signing_algs", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "List of supported ID token signing algorithms" + } + }, + { + "name": "supported_response_types", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "List of supported response types" + } + }, + { + "name": "supported_scopes", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "List of supported scopes" + } + }, + { + "name": "supported_subject_types", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "List of supported subject types" + } + }, + { + "name": "token_endpoint", + "type": "[Circular]", + "comment": { + "shortText": "URL of the token endpoint" + } + }, + { + "name": "userinfo_endpoint", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "URL of the userinfo endpoint" + } + } + ] + }, + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "OIDC discovery document (OIDC providers only)" + } + }, + { + "name": "discovery_url", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "OIDC discovery URL" + } + }, + { + "name": "email_optional", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Whether email is optional for this provider" + } + }, + { + "name": "enabled", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Whether the provider is enabled" + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "Unique identifier (UUID)" + } + }, + { + "name": "identifier", + "type": "[Circular]", + "comment": { + "shortText": "Provider identifier (e.g. `custom:mycompany`)" + } + }, + { + "name": "issuer", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "OIDC issuer URL" + } + }, + { + "name": "jwks_uri", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "JWKS URI for token verification" + } + }, + { + "name": "name", + "type": "[Circular]", + "comment": { + "shortText": "Human-readable name" + } + }, + { + "name": "pkce_enabled", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Whether PKCE is enabled" + } + }, + { + "name": "provider_type", + "type": { + "type": "union", + "name": "CustomProviderType", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Provider type" + } + }, + { + "name": "scopes", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "OAuth scopes requested during authorization" + } + }, + { + "name": "skip_nonce_check", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Whether to skip nonce check (OIDC)" + } + }, + { + "name": "token_url", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "OAuth2 token URL" + } + }, + { + "name": "updated_at", + "type": "[Circular]", + "comment": { + "shortText": "Timestamp when the provider was last updated" + } + }, + { + "name": "userinfo_url", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "OAuth2 userinfo URL" + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Gets details of a specific custom provider by identifier.\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser." + } + }, + "@supabase/auth-js.GoTrueAdminCustomProvidersApi.listProviders": { + "name": "@supabase/auth-js.GoTrueAdminCustomProvidersApi.listProviders", + "params": [ + { + "name": "params", + "type": { + "name": "ListCustomProvidersParams", + "type": "object", + "properties": [ + { + "name": "type", + "type": { + "type": "union", + "name": "CustomProviderType", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "Filter by provider type" + } + } + ] + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "CustomProviderListResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "providers", + "type": { + "type": "array", + "elemType": { + "name": "CustomOAuthProvider", + "type": "object", + "properties": [ + { + "name": "acceptable_client_ids", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "Additional client IDs accepted during token validation" + } + }, + { + "name": "attribute_mapping", + "type": { + "type": "record", + "name": "Record", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "Mapping of provider attributes to Supabase user attributes" + } + }, + { + "name": "authorization_params", + "type": { + "type": "record", + "name": "Record", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "Additional parameters sent with the authorization request" + } + }, + { + "name": "authorization_url", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "OAuth2 authorization URL" + } + }, + { + "name": "client_id", + "type": "[Circular]", + "comment": { + "shortText": "OAuth client ID" + } + }, + { + "name": "created_at", + "type": "[Circular]", + "comment": { + "shortText": "Timestamp when the provider was created" + } + }, + { + "name": "discovery_document", + "type": { + "type": "union", + "subTypes": [ + { + "name": "OIDCDiscoveryDocument", + "type": "object", + "properties": [ + { + "name": "authorization_endpoint", + "type": "[Circular]", + "comment": { + "shortText": "URL of the authorization endpoint" + } + }, + { + "name": "issuer", + "type": "[Circular]", + "comment": { + "shortText": "The issuer identifier" + } + }, + { + "name": "jwks_uri", + "type": "[Circular]", + "comment": { + "shortText": "URL of the JSON Web Key Set" + } + }, + { + "name": "revocation_endpoint", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "URL of the revocation endpoint" + } + }, + { + "name": "supported_id_token_signing_algs", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "List of supported ID token signing algorithms" + } + }, + { + "name": "supported_response_types", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "List of supported response types" + } + }, + { + "name": "supported_scopes", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "List of supported scopes" + } + }, + { + "name": "supported_subject_types", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "List of supported subject types" + } + }, + { + "name": "token_endpoint", + "type": "[Circular]", + "comment": { + "shortText": "URL of the token endpoint" + } + }, + { + "name": "userinfo_endpoint", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "URL of the userinfo endpoint" + } + } + ] + }, + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "OIDC discovery document (OIDC providers only)" + } + }, + { + "name": "discovery_url", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "OIDC discovery URL" + } + }, + { + "name": "email_optional", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Whether email is optional for this provider" + } + }, + { + "name": "enabled", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Whether the provider is enabled" + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "Unique identifier (UUID)" + } + }, + { + "name": "identifier", + "type": "[Circular]", + "comment": { + "shortText": "Provider identifier (e.g. `custom:mycompany`)" + } + }, + { + "name": "issuer", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "OIDC issuer URL" + } + }, + { + "name": "jwks_uri", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "JWKS URI for token verification" + } + }, + { + "name": "name", + "type": "[Circular]", + "comment": { + "shortText": "Human-readable name" + } + }, + { + "name": "pkce_enabled", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Whether PKCE is enabled" + } + }, + { + "name": "provider_type", + "type": { + "type": "union", + "name": "CustomProviderType", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Provider type" + } + }, + { + "name": "scopes", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "OAuth scopes requested during authorization" + } + }, + { + "name": "skip_nonce_check", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Whether to skip nonce check (OIDC)" + } + }, + { + "name": "token_url", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "OAuth2 token URL" + } + }, + { + "name": "updated_at", + "type": "[Circular]", + "comment": { + "shortText": "Timestamp when the provider was last updated" + } + }, + { + "name": "userinfo_url", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "OAuth2 userinfo URL" + } + } + ] + } + } + } + ] + } + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "providers" + } + ] + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Lists all custom providers with optional type filter.\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser." + } + }, + "@supabase/auth-js.GoTrueAdminCustomProvidersApi.updateProvider": { + "name": "@supabase/auth-js.GoTrueAdminCustomProvidersApi.updateProvider", + "params": [ + { + "name": "identifier", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "params", + "type": { + "name": "UpdateCustomProviderParams", + "type": "object", + "properties": [ + { + "name": "acceptable_client_ids", + "type": { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + }, + "isOptional": true, + "comment": { + "shortText": "Additional client IDs accepted during token validation" + } + }, + { + "name": "attribute_mapping", + "type": { + "type": "record", + "name": "Record", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "any" + } + }, + "isOptional": true, + "comment": { + "shortText": "Mapping of provider attributes to Supabase user attributes" + } + }, + { + "name": "authorization_params", + "type": { + "type": "record", + "name": "Record", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "string" + } + }, + "isOptional": true, + "comment": { + "shortText": "Additional parameters sent with the authorization request" + } + }, + { + "name": "authorization_url", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "OAuth2 authorization URL" + } + }, + { + "name": "client_id", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "OAuth client ID" + } + }, + { + "name": "client_secret", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "OAuth client secret (write-only, not returned in responses)" + } + }, + { + "name": "discovery_url", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "OIDC discovery URL" + } + }, + { + "name": "email_optional", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "Whether email is optional for this provider" + } + }, + { + "name": "enabled", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "Whether the provider is enabled" + } + }, + { + "name": "issuer", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "OIDC issuer URL" + } + }, + { + "name": "jwks_uri", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "JWKS URI for token verification" + } + }, + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Human-readable name" + } + }, + { + "name": "pkce_enabled", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "Whether PKCE is enabled" + } + }, + { + "name": "scopes", + "type": { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + }, + "isOptional": true, + "comment": { + "shortText": "OAuth scopes requested during authorization" + } + }, + { + "name": "skip_nonce_check", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "Whether to skip nonce check (OIDC)" + } + }, + { + "name": "token_url", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "OAuth2 token URL" + } + }, + { + "name": "userinfo_url", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "OAuth2 userinfo URL" + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "CustomProviderResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "name": "CustomOAuthProvider", + "type": "object", + "properties": [ + { + "name": "acceptable_client_ids", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "Additional client IDs accepted during token validation" + } + }, + { + "name": "attribute_mapping", + "type": { + "type": "record", + "name": "Record", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "Mapping of provider attributes to Supabase user attributes" + } + }, + { + "name": "authorization_params", + "type": { + "type": "record", + "name": "Record", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "Additional parameters sent with the authorization request" + } + }, + { + "name": "authorization_url", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "OAuth2 authorization URL" + } + }, + { + "name": "client_id", + "type": "[Circular]", + "comment": { + "shortText": "OAuth client ID" + } + }, + { + "name": "created_at", + "type": "[Circular]", + "comment": { + "shortText": "Timestamp when the provider was created" + } + }, + { + "name": "discovery_document", + "type": { + "type": "union", + "subTypes": [ + { + "name": "OIDCDiscoveryDocument", + "type": "object", + "properties": [ + { + "name": "authorization_endpoint", + "type": "[Circular]", + "comment": { + "shortText": "URL of the authorization endpoint" + } + }, + { + "name": "issuer", + "type": "[Circular]", + "comment": { + "shortText": "The issuer identifier" + } + }, + { + "name": "jwks_uri", + "type": "[Circular]", + "comment": { + "shortText": "URL of the JSON Web Key Set" + } + }, + { + "name": "revocation_endpoint", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "URL of the revocation endpoint" + } + }, + { + "name": "supported_id_token_signing_algs", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "List of supported ID token signing algorithms" + } + }, + { + "name": "supported_response_types", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "List of supported response types" + } + }, + { + "name": "supported_scopes", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "List of supported scopes" + } + }, + { + "name": "supported_subject_types", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "List of supported subject types" + } + }, + { + "name": "token_endpoint", + "type": "[Circular]", + "comment": { + "shortText": "URL of the token endpoint" + } + }, + { + "name": "userinfo_endpoint", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "URL of the userinfo endpoint" + } + } + ] + }, + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "OIDC discovery document (OIDC providers only)" + } + }, + { + "name": "discovery_url", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "OIDC discovery URL" + } + }, + { + "name": "email_optional", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Whether email is optional for this provider" + } + }, + { + "name": "enabled", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Whether the provider is enabled" + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "Unique identifier (UUID)" + } + }, + { + "name": "identifier", + "type": "[Circular]", + "comment": { + "shortText": "Provider identifier (e.g. `custom:mycompany`)" + } + }, + { + "name": "issuer", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "OIDC issuer URL" + } + }, + { + "name": "jwks_uri", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "JWKS URI for token verification" + } + }, + { + "name": "name", + "type": "[Circular]", + "comment": { + "shortText": "Human-readable name" + } + }, + { + "name": "pkce_enabled", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Whether PKCE is enabled" + } + }, + { + "name": "provider_type", + "type": { + "type": "union", + "name": "CustomProviderType", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Provider type" + } + }, + { + "name": "scopes", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "OAuth scopes requested during authorization" + } + }, + { + "name": "skip_nonce_check", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Whether to skip nonce check (OIDC)" + } + }, + { + "name": "token_url", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "OAuth2 token URL" + } + }, + { + "name": "updated_at", + "type": "[Circular]", + "comment": { + "shortText": "Timestamp when the provider was last updated" + } + }, + { + "name": "userinfo_url", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "OAuth2 userinfo URL" + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Updates an existing custom provider.\n\nWhen `issuer` or `discovery_url` is changed on an OIDC provider, the server re-fetches and\nvalidates the discovery document before persisting. This may return a validation error\n(`error_code: \"validation_failed\"`) if the discovery document is unreachable, invalid, or\nthe issuer does not match.\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser." + } + }, + "@supabase/auth-js.GoTrueAdminMFAApi.deleteFactor": { + "name": "@supabase/auth-js.GoTrueAdminMFAApi.deleteFactor", + "params": [ + { + "name": "params", + "type": { + "name": "AuthMFAAdminDeleteFactorParams", + "type": "object", + "properties": [ + { + "name": "id", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "ID of the MFA factor to delete." + } + }, + { + "name": "userId", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "ID of the user whose factor is being deleted." + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthMFAAdminDeleteFactorResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "id", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "ID of the factor that was successfully deleted." + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Deletes a factor on a user. This will log the user out of all active\nsessions if the deleted factor was verified.", + "examples": [ + { + "id": "delete-a-factor-for-a-user", + "name": "Delete a factor for a user", + "code": "```js\nconst { data, error } = await supabase.auth.admin.mfa.deleteFactor({\n id: '34e770dd-9ff9-416c-87fa-43b31d7ef225',\n userId: 'a89baba7-b1b7-440f-b4bb-91026967f66b',\n})\n```", + "response": "```json\n{\n data: {\n id: '34e770dd-9ff9-416c-87fa-43b31d7ef225'\n },\n error: null\n}\n```" + } + ] + } + }, + "@supabase/auth-js.GoTrueAdminMFAApi.listFactors": { + "name": "@supabase/auth-js.GoTrueAdminMFAApi.listFactors", + "params": [ + { + "name": "params", + "type": { + "name": "AuthMFAAdminListFactorsParams", + "type": "object", + "properties": [ + { + "name": "userId", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "ID of the user." + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthMFAAdminListFactorsResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "nameOnly", + "name": "Type" + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "nameOnly", + "name": "Status" + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + }, + "comment": { + "shortText": "All factors attached to the user." + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Lists all factors associated to a user.", + "examples": [ + { + "id": "list-all-factors-for-a-user", + "name": "List all factors for a user", + "code": "```js\nconst { data, error } = await supabase.auth.admin.mfa.listFactors()\n```", + "response": "```json\n{\n data: {\n factors: Factor[\n {\n id: '',\n friendly_name: 'Auth App Factor',\n factor_type: 'totp',\n status: 'verified',\n created_at: '2024-01-01T00:00:00Z',\n updated_at: '2024-01-01T00:00:00Z'\n }\n ]\n },\n error: null\n}\n```" + } + ] + } + }, + "@supabase/auth-js.GoTrueAdminOAuthApi.createClient": { + "name": "@supabase/auth-js.GoTrueAdminOAuthApi.createClient", + "params": [ + { + "name": "params", + "type": { + "name": "CreateOAuthClientParams", + "type": "object", + "properties": [ + { + "name": "client_name", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Human-readable name of the OAuth client" + } + }, + { + "name": "client_uri", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "URI of the OAuth client" + } + }, + { + "name": "grant_types", + "type": { + "type": "array", + "elemType": { + "type": "union", + "name": "OAuthClientGrantType", + "subTypes": [ + { + "type": "literal", + "value": "authorization_code" + }, + { + "type": "literal", + "value": "refresh_token" + }, + null + ] + } + }, + "isOptional": true, + "comment": { + "shortText": "Array of allowed grant types (optional, defaults to authorization_code and refresh_token)" + } + }, + { + "name": "redirect_uris", + "type": { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + }, + "comment": { + "shortText": "Array of allowed redirect URIs" + } + }, + { + "name": "response_types", + "type": { + "type": "array", + "elemType": { + "type": "literal", + "value": "code", + "name": "OAuthClientResponseType" + } + }, + "isOptional": true, + "comment": { + "shortText": "Array of allowed response types (optional, defaults to code)" + } + }, + { + "name": "scope", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Scope of the OAuth client" + } + }, + { + "name": "token_endpoint_auth_method", + "type": { + "type": "union", + "name": "OAuthClientTokenEndpointAuthMethod", + "subTypes": [ + { + "type": "literal", + "value": "none" + }, + { + "type": "literal", + "value": "client_secret_basic" + }, + { + "type": "literal", + "value": "client_secret_post" + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Token endpoint authentication method (defaults to server default if not specified)" + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "OAuthClientResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "name": "OAuthClient", + "type": "object", + "properties": [ + { + "name": "client_id", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Unique identifier for the OAuth client" + } + }, + { + "name": "client_name", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Human-readable name of the OAuth client" + } + }, + { + "name": "client_secret", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Client secret (only returned on registration and regeneration)" + } + }, + { + "name": "client_type", + "type": { + "type": "union", + "name": "OAuthClientType", + "subTypes": [ + { + "type": "literal", + "value": "public" + }, + { + "type": "literal", + "value": "confidential" + } + ] + }, + "comment": { + "shortText": "Type of OAuth client" + } + }, + { + "name": "client_uri", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "URI of the OAuth client" + } + }, + { + "name": "created_at", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Timestamp when the client was created" + } + }, + { + "name": "grant_types", + "type": { + "type": "array", + "elemType": { + "type": "union", + "name": "OAuthClientGrantType", + "subTypes": [ + "[Circular]", + "[Circular]", + null + ] + } + }, + "comment": { + "shortText": "Array of allowed grant types" + } + }, + { + "name": "logo_uri", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "URI of the OAuth client's logo" + } + }, + { + "name": "redirect_uris", + "type": { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + }, + "comment": { + "shortText": "Array of allowed redirect URIs" + } + }, + { + "name": "registration_type", + "type": { + "type": "union", + "name": "OAuthClientRegistrationType", + "subTypes": [ + { + "type": "literal", + "value": "dynamic" + }, + { + "type": "literal", + "value": "manual" + } + ] + }, + "comment": { + "shortText": "Registration type of the client" + } + }, + { + "name": "response_types", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "comment": { + "shortText": "Array of allowed response types" + } + }, + { + "name": "scope", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Scope of the OAuth client" + } + }, + { + "name": "token_endpoint_auth_method", + "type": { + "type": "union", + "name": "OAuthClientTokenEndpointAuthMethod", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Token endpoint authentication method" + } + }, + { + "name": "updated_at", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Timestamp when the client was last updated" + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Creates a new OAuth client.\nOnly relevant when the OAuth 2.1 server is enabled in Supabase Auth.\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser." + } + }, + "@supabase/auth-js.GoTrueAdminOAuthApi.deleteClient": { + "name": "@supabase/auth-js.GoTrueAdminOAuthApi.deleteClient", + "params": [ + { + "name": "clientId", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "literal", + "value": null + } + }, + { + "name": "error", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "nameOnly", + "name": "AuthError" + } + ] + } + } + ] + } + } + }, + "comment": { + "shortText": "Deletes an OAuth client.\nOnly relevant when the OAuth 2.1 server is enabled in Supabase Auth.\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser." + } + }, + "@supabase/auth-js.GoTrueAdminOAuthApi.getClient": { + "name": "@supabase/auth-js.GoTrueAdminOAuthApi.getClient", + "params": [ + { + "name": "clientId", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "OAuthClientResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "name": "OAuthClient", + "type": "object", + "properties": [ + { + "name": "client_id", + "type": "[Circular]", + "comment": { + "shortText": "Unique identifier for the OAuth client" + } + }, + { + "name": "client_name", + "type": "[Circular]", + "comment": { + "shortText": "Human-readable name of the OAuth client" + } + }, + { + "name": "client_secret", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Client secret (only returned on registration and regeneration)" + } + }, + { + "name": "client_type", + "type": { + "type": "union", + "name": "OAuthClientType", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of OAuth client" + } + }, + { + "name": "client_uri", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "URI of the OAuth client" + } + }, + { + "name": "created_at", + "type": "[Circular]", + "comment": { + "shortText": "Timestamp when the client was created" + } + }, + { + "name": "grant_types", + "type": { + "type": "array", + "elemType": { + "type": "union", + "name": "OAuthClientGrantType", + "subTypes": [ + "[Circular]", + "[Circular]", + null + ] + } + }, + "comment": { + "shortText": "Array of allowed grant types" + } + }, + { + "name": "logo_uri", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "URI of the OAuth client's logo" + } + }, + { + "name": "redirect_uris", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "comment": { + "shortText": "Array of allowed redirect URIs" + } + }, + { + "name": "registration_type", + "type": { + "type": "union", + "name": "OAuthClientRegistrationType", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Registration type of the client" + } + }, + { + "name": "response_types", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "comment": { + "shortText": "Array of allowed response types" + } + }, + { + "name": "scope", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Scope of the OAuth client" + } + }, + { + "name": "token_endpoint_auth_method", + "type": { + "type": "union", + "name": "OAuthClientTokenEndpointAuthMethod", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Token endpoint authentication method" + } + }, + { + "name": "updated_at", + "type": "[Circular]", + "comment": { + "shortText": "Timestamp when the client was last updated" + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Gets details of a specific OAuth client.\nOnly relevant when the OAuth 2.1 server is enabled in Supabase Auth.\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser." + } + }, + "@supabase/auth-js.GoTrueAdminOAuthApi.listClients": { + "name": "@supabase/auth-js.GoTrueAdminOAuthApi.listClients", + "params": [ + { + "name": "params", + "type": { + "name": "PageParams", + "type": "object", + "properties": [ + { + "name": "page", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The page number" + } + }, + { + "name": "perPage", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Number of items returned per page" + } + } + ] + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "OAuthClientListResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data" + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "clients" + } + ] + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Lists all OAuth clients with optional pagination.\nOnly relevant when the OAuth 2.1 server is enabled in Supabase Auth.\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser." + } + }, + "@supabase/auth-js.GoTrueAdminOAuthApi.regenerateClientSecret": { + "name": "@supabase/auth-js.GoTrueAdminOAuthApi.regenerateClientSecret", + "params": [ + { + "name": "clientId", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "OAuthClientResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "name": "OAuthClient", + "type": "object", + "properties": [ + { + "name": "client_id", + "type": "[Circular]", + "comment": { + "shortText": "Unique identifier for the OAuth client" + } + }, + { + "name": "client_name", + "type": "[Circular]", + "comment": { + "shortText": "Human-readable name of the OAuth client" + } + }, + { + "name": "client_secret", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Client secret (only returned on registration and regeneration)" + } + }, + { + "name": "client_type", + "type": { + "type": "union", + "name": "OAuthClientType", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of OAuth client" + } + }, + { + "name": "client_uri", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "URI of the OAuth client" + } + }, + { + "name": "created_at", + "type": "[Circular]", + "comment": { + "shortText": "Timestamp when the client was created" + } + }, + { + "name": "grant_types", + "type": { + "type": "array", + "elemType": { + "type": "union", + "name": "OAuthClientGrantType", + "subTypes": [ + "[Circular]", + "[Circular]", + null + ] + } + }, + "comment": { + "shortText": "Array of allowed grant types" + } + }, + { + "name": "logo_uri", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "URI of the OAuth client's logo" + } + }, + { + "name": "redirect_uris", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "comment": { + "shortText": "Array of allowed redirect URIs" + } + }, + { + "name": "registration_type", + "type": { + "type": "union", + "name": "OAuthClientRegistrationType", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Registration type of the client" + } + }, + { + "name": "response_types", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "comment": { + "shortText": "Array of allowed response types" + } + }, + { + "name": "scope", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Scope of the OAuth client" + } + }, + { + "name": "token_endpoint_auth_method", + "type": { + "type": "union", + "name": "OAuthClientTokenEndpointAuthMethod", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Token endpoint authentication method" + } + }, + { + "name": "updated_at", + "type": "[Circular]", + "comment": { + "shortText": "Timestamp when the client was last updated" + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Regenerates the secret for an OAuth client.\nOnly relevant when the OAuth 2.1 server is enabled in Supabase Auth.\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser." + } + }, + "@supabase/auth-js.GoTrueAdminOAuthApi.updateClient": { + "name": "@supabase/auth-js.GoTrueAdminOAuthApi.updateClient", + "params": [ + { + "name": "clientId", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "params", + "type": { + "name": "UpdateOAuthClientParams", + "type": "object", + "properties": [ + { + "name": "client_name", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Human-readable name of the OAuth client" + } + }, + { + "name": "client_uri", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "URI of the OAuth client" + } + }, + { + "name": "grant_types", + "type": { + "type": "array", + "elemType": { + "type": "union", + "name": "OAuthClientGrantType", + "subTypes": [ + "[Circular]", + "[Circular]", + null + ] + } + }, + "isOptional": true, + "comment": { + "shortText": "Array of allowed grant types" + } + }, + { + "name": "logo_uri", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "URI of the OAuth client's logo" + } + }, + { + "name": "redirect_uris", + "type": { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + }, + "isOptional": true, + "comment": { + "shortText": "Array of allowed redirect URIs" + } + }, + { + "name": "token_endpoint_auth_method", + "type": { + "type": "union", + "name": "OAuthClientTokenEndpointAuthMethod", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "Token endpoint authentication method" + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "OAuthClientResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "name": "OAuthClient", + "type": "object", + "properties": [ + { + "name": "client_id", + "type": "[Circular]", + "comment": { + "shortText": "Unique identifier for the OAuth client" + } + }, + { + "name": "client_name", + "type": "[Circular]", + "comment": { + "shortText": "Human-readable name of the OAuth client" + } + }, + { + "name": "client_secret", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Client secret (only returned on registration and regeneration)" + } + }, + { + "name": "client_type", + "type": { + "type": "union", + "name": "OAuthClientType", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of OAuth client" + } + }, + { + "name": "client_uri", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "URI of the OAuth client" + } + }, + { + "name": "created_at", + "type": "[Circular]", + "comment": { + "shortText": "Timestamp when the client was created" + } + }, + { + "name": "grant_types", + "type": { + "type": "array", + "elemType": { + "type": "union", + "name": "OAuthClientGrantType", + "subTypes": [ + "[Circular]", + "[Circular]", + null + ] + } + }, + "comment": { + "shortText": "Array of allowed grant types" + } + }, + { + "name": "logo_uri", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "URI of the OAuth client's logo" + } + }, + { + "name": "redirect_uris", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "comment": { + "shortText": "Array of allowed redirect URIs" + } + }, + { + "name": "registration_type", + "type": { + "type": "union", + "name": "OAuthClientRegistrationType", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Registration type of the client" + } + }, + { + "name": "response_types", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "comment": { + "shortText": "Array of allowed response types" + } + }, + { + "name": "scope", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Scope of the OAuth client" + } + }, + { + "name": "token_endpoint_auth_method", + "type": { + "type": "union", + "name": "OAuthClientTokenEndpointAuthMethod", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Token endpoint authentication method" + } + }, + { + "name": "updated_at", + "type": "[Circular]", + "comment": { + "shortText": "Timestamp when the client was last updated" + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Updates an existing OAuth client.\nOnly relevant when the OAuth 2.1 server is enabled in Supabase Auth.\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser." + } + }, + "@supabase/auth-js.GoTrueAdminPasskeyApi.deletePasskey": { + "name": "@supabase/auth-js.GoTrueAdminPasskeyApi.deletePasskey", + "params": [ + { + "name": "params", + "type": { + "name": "AuthPasskeyAdminDeleteParams", + "type": "object", + "properties": [ + { + "name": "passkeyId", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "userId", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthPasskeyDeleteResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Deletes a specific passkey for a specific user.\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser." + } + }, + "@supabase/auth-js.GoTrueAdminPasskeyApi.listPasskeys": { + "name": "@supabase/auth-js.GoTrueAdminPasskeyApi.listPasskeys", + "params": [ + { + "name": "params", + "type": { + "name": "AuthPasskeyAdminListParams", + "type": "object", + "properties": [ + { + "name": "userId", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthPasskeyListResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "array", + "elemType": { + "name": "PasskeyListItem", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "last_used_at", + "type": "[Circular]", + "isOptional": true + } + ] + } + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Lists all passkeys registered for a specific user.\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser." + } + }, + "@supabase/auth-js.GoTrueMFAApi.challenge": { + "name": "@supabase/auth-js.GoTrueMFAApi.challenge", + "params": [ + { + "name": "params", + "type": { + "type": "nameOnly", + "name": "MFAChallengeParamsBase" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "literal", + "value": null + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "nameOnly", + "name": "AuthMFAChallengeResponseBase" + } + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Prepares a challenge used to verify that a user has access to a MFA\nfactor.", + "text": "- An [enrolled factor](/docs/reference/javascript/auth-mfa-enroll) is required before creating a challenge.\n- To verify a challenge, see [`mfa.verify()`](/docs/reference/javascript/auth-mfa-verify).\n- A phone factor sends a code to the user upon challenge. The channel defaults to `sms` unless otherwise specified.", + "examples": [ + { + "id": "create-a-challenge-for-a-factor", + "name": "Create a challenge for a factor", + "code": "```js\nconst { data, error } = await supabase.auth.mfa.challenge({\n factorId: '34e770dd-9ff9-416c-87fa-43b31d7ef225'\n})\n```", + "response": "```json\n{\n data: {\n id: '',\n type: 'totp',\n expires_at: 1700000000\n },\n error: null\n}\n```" + }, + { + "id": "create-a-challenge-for-a-phone-factor", + "name": "Create a challenge for a phone factor", + "code": "```js\nconst { data, error } = await supabase.auth.mfa.challenge({\n factorId: '34e770dd-9ff9-416c-87fa-43b31d7ef225',\n})\n```", + "response": "```json\n{\n data: {\n id: '',\n type: 'phone',\n expires_at: 1700000000\n },\n error: null\n}\n```" + }, + { + "id": "create-a-challenge-for-a-phone-factor-whatsapp", + "name": "Create a challenge for a phone factor (WhatsApp)", + "code": "```js\nconst { data, error } = await supabase.auth.mfa.challenge({\n factorId: '34e770dd-9ff9-416c-87fa-43b31d7ef225',\n channel: 'whatsapp',\n})\n```", + "response": "```json\n{\n data: {\n id: '',\n expires_at: 1700000000\n },\n error: null\n}\n```" + } + ] + }, + "altSignatures": [ + { + "params": [ + { + "name": "params", + "type": { + "type": "nameOnly", + "name": "MFAChallengePhoneParams" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "literal", + "value": null + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "nameOnly", + "name": "AuthMFAChallengeResponseBase" + } + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + } + } + ] + } + ] + } + } + } + }, + { + "params": [ + { + "name": "params", + "type": { + "type": "nameOnly", + "name": "MFAChallengeWebauthnParams" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "literal", + "value": null + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data" + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + } + } + ] + } + ] + } + } + } + }, + { + "params": [ + { + "name": "params", + "type": { + "type": "union", + "name": "MFAChallengeParams", + "subTypes": [ + { + "type": "nameOnly", + "name": "MFAChallengeTOTPParams" + }, + { + "type": "nameOnly", + "name": "MFAChallengePhoneParams" + }, + { + "type": "nameOnly", + "name": "MFAChallengeWebauthnParams" + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthMFAChallengeResponse", + "subTypes": [ + { + "type": "union", + "name": "AuthMFAChallengeTOTPResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data" + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + }, + { + "type": "union", + "name": "AuthMFAChallengePhoneResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data" + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + }, + { + "type": "union", + "name": "AuthMFAChallengeWebauthnResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data" + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + ] + } + } + } + } + ] + }, + "@supabase/auth-js.GoTrueMFAApi.challengeAndVerify": { + "name": "@supabase/auth-js.GoTrueMFAApi.challengeAndVerify", + "params": [ + { + "name": "params", + "type": { + "type": "nameOnly", + "name": "MFAChallengeAndVerifyTOTPParams" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthMFAVerifyResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "name": "AuthMFAVerifyResponseData", + "type": "object", + "properties": [ + { + "name": "access_token", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "New access token (JWT) after successful verification." + } + }, + { + "name": "expires_in", + "type": { + "type": "intrinsic", + "name": "number" + }, + "comment": { + "shortText": "Number of seconds in which the access token will expire." + } + }, + { + "name": "refresh_token", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Refresh token you can use to obtain new access tokens when expired." + } + }, + { + "name": "token_type", + "type": { + "type": "literal", + "value": "bearer" + }, + "comment": { + "shortText": "Type of token, always `bearer`." + } + }, + { + "name": "user", + "type": { + "type": "object", + "name": "User", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + "comment": { + "shortText": "Updated user profile." + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Helper method which creates a challenge and immediately uses the given code to verify against it thereafter. The verification code is\nprovided by the user by entering a code seen in their authenticator app.", + "text": "- Intended for use with only TOTP factors.\n- An [enrolled factor](/docs/reference/javascript/auth-mfa-enroll) is required before invoking `challengeAndVerify()`.\n- Executes [`mfa.challenge()`](/docs/reference/javascript/auth-mfa-challenge) and [`mfa.verify()`](/docs/reference/javascript/auth-mfa-verify) in a single step.", + "examples": [ + { + "id": "create-and-verify-a-challenge-for-a-factor", + "name": "Create and verify a challenge for a factor", + "code": "```js\nconst { data, error } = await supabase.auth.mfa.challengeAndVerify({\n factorId: '34e770dd-9ff9-416c-87fa-43b31d7ef225',\n code: '123456'\n})\n```", + "response": "```json\n{\n data: {\n access_token: '',\n token_type: 'Bearer',\n expires_in: 3600,\n refresh_token: '',\n user: {\n id: '11111111-1111-1111-1111-111111111111',\n aud: 'authenticated',\n role: 'authenticated',\n email: 'example@email.com',\n email_confirmed_at: '2024-01-01T00:00:00Z',\n phone: '',\n confirmation_sent_at: '2024-01-01T00:00:00Z',\n confirmed_at: '2024-01-01T00:00:00Z',\n last_sign_in_at: '2024-01-01T00:00:00Z',\n app_metadata: {\n provider: 'email',\n providers: [\n \"email\",\n ]\n },\n user_metadata: {},\n identities: [\n {\n \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n \"identity_data\": {\n \"email\": \"example@email.com\",\n \"email_verified\": true,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"provider\": \"email\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"email@example.com\"\n },\n ],\n created_at: '2024-01-01T00:00:00Z',\n updated_at: '2024-01-01T00:00:00Z',\n is_anonymous: false,\n factors: [\n \"id\": '',\n \"friendly_name\": 'Important Auth App',\n \"factor_type\": 'totp',\n \"status\": 'verified',\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\"\n ]\n }\n }\n error: null\n}\n```" + } + ] + } + }, + "@supabase/auth-js.GoTrueMFAApi.enroll": { + "name": "@supabase/auth-js.GoTrueMFAApi.enroll", + "params": [ + { + "name": "params", + "type": { + "type": "nameOnly", + "name": "MFAEnrollTOTPParams" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthMFAEnrollTOTPResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data" + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Starts the enrollment process for a new Multi-Factor Authentication (MFA)\nfactor. This method creates a new `unverified` factor.\nTo verify a factor, present the QR code or secret to the user and ask them to add it to their\nauthenticator app.\nThe user has to enter the code from their authenticator app to verify it.\n\nUpon verifying a factor, all other sessions are logged out and the current session's authenticator level is promoted to `aal2`.", + "text": "- Use `totp` or `phone` as the `factorType` and use the returned `id` to create a challenge.\n- To create a challenge, see [`mfa.challenge()`](/docs/reference/javascript/auth-mfa-challenge).\n- To verify a challenge, see [`mfa.verify()`](/docs/reference/javascript/auth-mfa-verify).\n- To create and verify a TOTP challenge in a single step, see [`mfa.challengeAndVerify()`](/docs/reference/javascript/auth-mfa-challengeandverify).\n- To generate a QR code for the `totp` secret in Next.js, you can do the following:\n```html\n{data.totp.uri}\n```\n- The `challenge` and `verify` steps are separated when using Phone factors as the user will need time to receive and input the code obtained from the SMS in challenge.", + "examples": [ + { + "id": "enroll-a-time-based-one-time-password-totp-factor", + "name": "Enroll a time-based, one-time password (TOTP) factor", + "code": "```js\nconst { data, error } = await supabase.auth.mfa.enroll({\n factorType: 'totp',\n friendlyName: 'your_friendly_name'\n})\n\n// Use the id to create a challenge.\n// The challenge can be verified by entering the code generated from the authenticator app.\n// The code will be generated upon scanning the qr_code or entering the secret into the authenticator app.\nconst { id, type, totp: { qr_code, secret, uri }, friendly_name } = data\nconst challenge = await supabase.auth.mfa.challenge({ factorId: id });\n```", + "response": "```json\n{\n data: {\n id: '',\n type: 'totp'\n totp: {\n qr_code: '',\n secret: '',\n uri: '',\n }\n friendly_name?: 'Important app'\n },\n error: null\n}\n```" + }, + { + "id": "enroll-a-phone-factor", + "name": "Enroll a Phone Factor", + "code": "```js\nconst { data, error } = await supabase.auth.mfa.enroll({\n factorType: 'phone',\n friendlyName: 'your_friendly_name',\n phone: '+12345678',\n})\n\n// Use the id to create a challenge and send an SMS with a code to the user.\nconst { id, type, friendly_name, phone } = data\n\nconst challenge = await supabase.auth.mfa.challenge({ factorId: id });\n```", + "response": "```json\n{\n data: {\n id: '',\n type: 'phone',\n friendly_name?: 'Important app',\n phone: '+5787123456'\n },\n error: null\n}\n```" + } + ] + }, + "altSignatures": [ + { + "params": [ + { + "name": "params", + "type": { + "type": "nameOnly", + "name": "MFAEnrollPhoneParams" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthMFAEnrollPhoneResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data" + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + } + }, + { + "params": [ + { + "name": "params", + "type": { + "type": "nameOnly", + "name": "MFAEnrollParamsBase" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthMFAEnrollWebauthnResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data" + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + } + }, + { + "params": [ + { + "name": "params", + "type": { + "type": "union", + "name": "MFAEnrollParams", + "subTypes": [ + { + "type": "nameOnly", + "name": "MFAEnrollTOTPParams" + }, + { + "type": "nameOnly", + "name": "MFAEnrollPhoneParams" + }, + { + "type": "nameOnly", + "name": "MFAEnrollWebauthnParams" + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthMFAEnrollResponse", + "subTypes": [ + { + "type": "union", + "name": "AuthMFAEnrollTOTPResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data" + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + }, + { + "type": "union", + "name": "AuthMFAEnrollPhoneResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data" + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + }, + { + "type": "union", + "name": "AuthMFAEnrollWebauthnResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data" + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + ] + } + } + } + } + ] + }, + "@supabase/auth-js.GoTrueMFAApi.getAuthenticatorAssuranceLevel": { + "name": "@supabase/auth-js.GoTrueMFAApi.getAuthenticatorAssuranceLevel", + "params": [ + { + "name": "jwt", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Takes in an optional access token JWT. If no JWT is provided, the JWT from the current session is used." + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthMFAGetAuthenticatorAssuranceLevelResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "currentAuthenticationMethods", + "type": { + "type": "union", + "subTypes": [ + { + "type": "array", + "elemType": { + "type": "object", + "name": "AMREntry", + "properties": [ + { + "name": "method", + "type": { + "type": "union", + "name": "AMRMethod", + "subTypes": [ + { + "type": "nameOnly", + "name": "['number']" + }, + null + ] + }, + "comment": { + "shortText": "Authentication method name." + } + }, + { + "name": "timestamp", + "type": "[Circular]", + "comment": { + "shortText": "Timestamp when the method was successfully used. Represents number of\nseconds since 1st January 1970 (UNIX epoch) in UTC." + } + } + ] + } + }, + { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + } + ] + }, + "comment": { + "shortText": "A list of all authentication methods attached to this session. Use\nthe information here to detect the last time a user verified a\nfactor, for example if implementing a step-up scenario.\n\nSupports both RFC-8176 compliant format (string[]) and detailed format (AMREntry[]).\n- String format: ['password', 'otp'] - RFC-8176 compliant\n- Object format: [{ method: 'password', timestamp: 1234567890 }] - includes timestamps" + } + }, + { + "name": "currentLevel", + "type": { + "type": "union", + "subTypes": [ + { + "type": "union", + "name": "AuthenticatorAssuranceLevels", + "subTypes": [ + "[Circular]", + "[Circular]", + null + ] + }, + { + "type": "literal", + "value": null + } + ] + }, + "comment": { + "shortText": "Current AAL level of the session." + } + }, + { + "name": "nextLevel", + "type": { + "type": "union", + "subTypes": [ + { + "type": "union", + "name": "AuthenticatorAssuranceLevels", + "subTypes": [ + "[Circular]", + "[Circular]", + null + ] + }, + { + "type": "literal", + "value": null + } + ] + }, + "comment": { + "shortText": "Next possible AAL level for the session. If the next level is higher\nthan the current one, the user should go through MFA." + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Returns the Authenticator Assurance Level (AAL) for the active session.\n\n- `aal1` (or `null`) means that the user's identity has been verified only\nwith a conventional login (email+password, OTP, magic link, social login,\netc.).\n- `aal2` means that the user's identity has been verified both with a conventional login and at least one MFA factor.\n\nWhen called without a JWT parameter, this method is fairly quick (microseconds)\nand rarely uses the network. When a JWT is provided (useful in server-side\nenvironments like Edge Functions where no session is stored), this method\nwill make a network request to validate the user and fetch their MFA factors.", + "text": "- Authenticator Assurance Level (AAL) is the measure of the strength of an authentication mechanism.\n- In Supabase, having an AAL of `aal1` refers to having the 1st factor of authentication such as an email and password or OAuth sign-in while `aal2` refers to the 2nd factor of authentication such as a time-based, one-time-password (TOTP) or Phone factor.\n- If the user has a verified factor, the `nextLevel` field will return `aal2`, else, it will return `aal1`.\n- An optional `jwt` parameter can be passed to check the AAL level of a specific JWT instead of the current session.", + "examples": [ + { + "id": "get-the-aal-details-of-a-session", + "name": "Get the AAL details of a session", + "code": "```js\nconst { data, error } = await supabase.auth.mfa.getAuthenticatorAssuranceLevel()\nconst { currentLevel, nextLevel, currentAuthenticationMethods } = data\n```", + "response": "```json\n{\n data: {\n currentLevel: 'aal1',\n nextLevel: 'aal2',\n currentAuthenticationMethods: [\n {\n method: 'password',\n timestamp: 1700000000\n }\n ]\n }\n error: null\n}\n```" + }, + { + "id": "get-the-aal-details-for-a-specific-jwt", + "name": "Get the AAL details for a specific JWT", + "code": "```js\nconst { data, error } = await supabase.auth.mfa.getAuthenticatorAssuranceLevel(jwt)\n```" + } + ] + } + }, + "@supabase/auth-js.GoTrueMFAApi.listFactors": { + "name": "@supabase/auth-js.GoTrueMFAApi.listFactors", + "params": [], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthMFAListFactorsResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data" + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Returns the list of MFA factors enabled for this user." + } + }, + "@supabase/auth-js.GoTrueMFAApi.unenroll": { + "name": "@supabase/auth-js.GoTrueMFAApi.unenroll", + "params": [ + { + "name": "params", + "type": { + "name": "MFAUnenrollParams", + "type": "object", + "properties": [ + { + "name": "factorId", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "ID of the factor being unenrolled." + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthMFAUnenrollResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "id", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "ID of the factor that was successfully unenrolled." + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Unenroll removes a MFA factor.\nA user has to have an `aal2` authenticator level in order to unenroll a `verified` factor.", + "examples": [ + { + "id": "unenroll-a-factor", + "name": "Unenroll a factor", + "code": "```js\nconst { data, error } = await supabase.auth.mfa.unenroll({\n factorId: '34e770dd-9ff9-416c-87fa-43b31d7ef225',\n})\n```", + "response": "```json\n{\n data: {\n id: ''\n },\n error: null\n}\n```" + } + ] + } + }, + "@supabase/auth-js.GoTrueMFAApi.verify": { + "name": "@supabase/auth-js.GoTrueMFAApi.verify", + "params": [ + { + "name": "params", + "type": { + "type": "nameOnly", + "name": "MFAVerifyTOTPParams" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthMFAVerifyResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "name": "AuthMFAVerifyResponseData", + "type": "object", + "properties": [ + { + "name": "access_token", + "type": "[Circular]", + "comment": { + "shortText": "New access token (JWT) after successful verification." + } + }, + { + "name": "expires_in", + "type": "[Circular]", + "comment": { + "shortText": "Number of seconds in which the access token will expire." + } + }, + { + "name": "refresh_token", + "type": "[Circular]", + "comment": { + "shortText": "Refresh token you can use to obtain new access tokens when expired." + } + }, + { + "name": "token_type", + "type": "[Circular]", + "comment": { + "shortText": "Type of token, always `bearer`." + } + }, + { + "name": "user", + "type": { + "type": "object", + "name": "User", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + "comment": { + "shortText": "Updated user profile." + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Verifies a code against a challenge. The verification code is\nprovided by the user by entering a code seen in their authenticator app.", + "text": "- To verify a challenge, please [create a challenge](/docs/reference/javascript/auth-mfa-challenge) first.", + "examples": [ + { + "id": "verify-a-challenge-for-a-factor", + "name": "Verify a challenge for a factor", + "code": "```js\nconst { data, error } = await supabase.auth.mfa.verify({\n factorId: '34e770dd-9ff9-416c-87fa-43b31d7ef225',\n challengeId: '4034ae6f-a8ce-4fb5-8ee5-69a5863a7c15',\n code: '123456'\n})\n```", + "response": "```json\n{\n data: {\n access_token: '',\n token_type: 'Bearer',\n expires_in: 3600,\n refresh_token: '',\n user: {\n id: '11111111-1111-1111-1111-111111111111',\n aud: 'authenticated',\n role: 'authenticated',\n email: 'example@email.com',\n email_confirmed_at: '2024-01-01T00:00:00Z',\n phone: '',\n confirmation_sent_at: '2024-01-01T00:00:00Z',\n confirmed_at: '2024-01-01T00:00:00Z',\n last_sign_in_at: '2024-01-01T00:00:00Z',\n app_metadata: {\n provider: 'email',\n providers: [\n \"email\",\n ]\n },\n user_metadata: {},\n identities: [\n {\n \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n \"identity_data\": {\n \"email\": \"example@email.com\",\n \"email_verified\": true,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"provider\": \"email\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"email@example.com\"\n },\n ],\n created_at: '2024-01-01T00:00:00Z',\n updated_at: '2024-01-01T00:00:00Z',\n is_anonymous: false,\n factors: [\n \"id\": '',\n \"friendly_name\": 'Important Auth App',\n \"factor_type\": 'totp',\n \"status\": 'verified',\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\"\n ]\n }\n }\n error: null\n}\n```" + } + ] + }, + "altSignatures": [ + { + "params": [ + { + "name": "params", + "type": { + "type": "nameOnly", + "name": "MFAVerifyPhoneParams" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthMFAVerifyResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "name": "AuthMFAVerifyResponseData", + "type": "object", + "properties": [ + { + "name": "access_token", + "type": "[Circular]", + "comment": { + "shortText": "New access token (JWT) after successful verification." + } + }, + { + "name": "expires_in", + "type": "[Circular]", + "comment": { + "shortText": "Number of seconds in which the access token will expire." + } + }, + { + "name": "refresh_token", + "type": "[Circular]", + "comment": { + "shortText": "Refresh token you can use to obtain new access tokens when expired." + } + }, + { + "name": "token_type", + "type": "[Circular]", + "comment": { + "shortText": "Type of token, always `bearer`." + } + }, + { + "name": "user", + "type": { + "type": "object", + "name": "User", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + "comment": { + "shortText": "Updated user profile." + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + } + }, + { + "params": [ + { + "name": "params", + "type": { + "type": "nameOnly", + "name": "MFAVerifyWebauthnParams" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthMFAVerifyResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "name": "AuthMFAVerifyResponseData", + "type": "object", + "properties": [ + { + "name": "access_token", + "type": "[Circular]", + "comment": { + "shortText": "New access token (JWT) after successful verification." + } + }, + { + "name": "expires_in", + "type": "[Circular]", + "comment": { + "shortText": "Number of seconds in which the access token will expire." + } + }, + { + "name": "refresh_token", + "type": "[Circular]", + "comment": { + "shortText": "Refresh token you can use to obtain new access tokens when expired." + } + }, + { + "name": "token_type", + "type": "[Circular]", + "comment": { + "shortText": "Type of token, always `bearer`." + } + }, + { + "name": "user", + "type": { + "type": "object", + "name": "User", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + "comment": { + "shortText": "Updated user profile." + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + } + }, + { + "params": [ + { + "name": "params", + "type": { + "type": "union", + "name": "MFAVerifyParams", + "subTypes": [ + { + "type": "nameOnly", + "name": "MFAVerifyTOTPParams" + }, + { + "type": "nameOnly", + "name": "MFAVerifyPhoneParams" + }, + { + "type": "nameOnly", + "name": "MFAVerifyWebauthnParams" + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthMFAVerifyResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "name": "AuthMFAVerifyResponseData", + "type": "object", + "properties": [ + { + "name": "access_token", + "type": "[Circular]", + "comment": { + "shortText": "New access token (JWT) after successful verification." + } + }, + { + "name": "expires_in", + "type": "[Circular]", + "comment": { + "shortText": "Number of seconds in which the access token will expire." + } + }, + { + "name": "refresh_token", + "type": "[Circular]", + "comment": { + "shortText": "Refresh token you can use to obtain new access tokens when expired." + } + }, + { + "name": "token_type", + "type": "[Circular]", + "comment": { + "shortText": "Type of token, always `bearer`." + } + }, + { + "name": "user", + "type": { + "type": "object", + "name": "User", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + "comment": { + "shortText": "Updated user profile." + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + } + } + ] + }, + "@supabase/auth-js.isAuthApiError": { + "name": "@supabase/auth-js.isAuthApiError", + "params": [ + { + "name": "error", + "type": { + "type": "intrinsic", + "name": "unknown" + } + } + ] + }, + "@supabase/auth-js.isAuthError": { + "name": "@supabase/auth-js.isAuthError", + "params": [ + { + "name": "error", + "type": { + "type": "intrinsic", + "name": "unknown" + } + } + ] + }, + "@supabase/auth-js.isAuthImplicitGrantRedirectError": { + "name": "@supabase/auth-js.isAuthImplicitGrantRedirectError", + "params": [ + { + "name": "error", + "type": { + "type": "intrinsic", + "name": "any" + } + } + ] + }, + "@supabase/auth-js.isAuthPKCECodeVerifierMissingError": { + "name": "@supabase/auth-js.isAuthPKCECodeVerifierMissingError", + "params": [ + { + "name": "error", + "type": { + "type": "intrinsic", + "name": "unknown" + } + } + ] + }, + "@supabase/auth-js.isAuthRefreshDiscardedError": { + "name": "@supabase/auth-js.isAuthRefreshDiscardedError", + "params": [ + { + "name": "error", + "type": { + "type": "intrinsic", + "name": "unknown" + } + } + ] + }, + "@supabase/auth-js.isAuthRetryableFetchError": { + "name": "@supabase/auth-js.isAuthRetryableFetchError", + "params": [ + { + "name": "error", + "type": { + "type": "intrinsic", + "name": "unknown" + } + } + ] + }, + "@supabase/auth-js.isAuthSessionMissingError": { + "name": "@supabase/auth-js.isAuthSessionMissingError", + "params": [ + { + "name": "error", + "type": { + "type": "intrinsic", + "name": "any" + } + } + ] + }, + "@supabase/auth-js.isAuthWeakPasswordError": { + "name": "@supabase/auth-js.isAuthWeakPasswordError", + "params": [ + { + "name": "error", + "type": { + "type": "intrinsic", + "name": "unknown" + } + } + ] + }, + "@supabase/auth-js.navigatorLock": { + "name": "@supabase/auth-js.navigatorLock", + "params": [ + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Name of the lock to be acquired." + } + }, + { + "name": "acquireTimeout", + "type": { + "type": "intrinsic", + "name": "number" + }, + "comment": { + "shortText": "If negative, no timeout. If 0 an error is thrown if\n the lock can't be acquired without waiting. If positive, the lock acquire\n will time out after so many milliseconds. An error is\n a timeout if it has `isAcquireTimeout` set to true." + } + }, + { + "name": "fn", + "type": { + "type": "function", + "params": [], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "nameOnly", + "name": "R" + } + } + } + }, + "comment": { + "shortText": "The operation to run once the lock is acquired." + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "nameOnly", + "name": "R" + } + } + }, + "comment": { + "shortText": "Implements a global exclusive lock using the Navigator LockManager API. It\nis available on all browsers released after 2022-03-15 with Safari being the\nlast one to release support. If the API is not available, this function will\nthrow. Make sure you check availablility before configuring GoTrueClient.\n\nYou can turn on debugging by setting the `supabase.gotrue-js.locks.debug`\nlocal storage item to `true`.\n\nInternals:\n\nSince the LockManager API does not preserve stack traces for the async\nfunction passed in the `request` method, a trick is used where acquiring the\nlock releases a previously started promise to run the operation in the `fn`\nfunction. The lock waits for that promise to finish (with or without error),\nwhile the function will finally wait for the result anyway." + } + }, + "@supabase/auth-js.processLock": { + "name": "@supabase/auth-js.processLock", + "params": [ + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Name of the lock to be acquired." + } + }, + { + "name": "acquireTimeout", + "type": { + "type": "intrinsic", + "name": "number" + }, + "comment": { + "shortText": "If negative, no timeout. If 0 an error is thrown if\n the lock can't be acquired without waiting. If positive, the lock acquire\n will time out after so many milliseconds. An error is\n a timeout if it has `isAcquireTimeout` set to true." + } + }, + { + "name": "fn", + "type": { + "type": "function", + "params": [], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "nameOnly", + "name": "R" + } + } + } + }, + "comment": { + "shortText": "The operation to run once the lock is acquired." + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "nameOnly", + "name": "R" + } + } + }, + "comment": { + "shortText": "Implements a global exclusive lock that works only in the current process.\nUseful for environments like React Native or other non-browser\nsingle-process (i.e. no concept of \"tabs\") environments.\n\nUse #navigatorLock in browser environments.", + "examples": [ + { + "id": "example-1", + "name": "Example 1", + "code": "```ts\nawait processLock('migrate', 5000, async () => {\n await runMigration()\n})\n```" + } + ] + } + }, + "@supabase/postgrest-js.PostgrestBuilder.constructor": { + "name": "@supabase/postgrest-js.PostgrestBuilder.constructor", + "params": [ + { + "name": "builder", + "type": { + "type": "object", + "properties": [ + { + "name": "body", + "type": { + "type": "intrinsic", + "name": "unknown" + }, + "isOptional": true + }, + { + "name": "fetch", + "type": { + "type": "function", + "params": [ + { + "name": "input", + "type": { + "type": "union", + "subTypes": [ + { + "type": "nameOnly", + "name": "URL" + }, + { + "type": "nameOnly", + "name": "RequestInfo" + } + ] + } + }, + { + "name": "init", + "type": { + "type": "nameOnly", + "name": "RequestInit" + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "nameOnly", + "name": "Response" + } + } + }, + "comment": { + "shortText": "[MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch)" + } + }, + "isOptional": true + }, + { + "name": "headers", + "type": { + "type": "nameOnly", + "name": "HeadersInit" + } + }, + { + "name": "isMaybeSingle", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "method", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "GET" + }, + { + "type": "literal", + "value": "HEAD" + }, + { + "type": "literal", + "value": "POST" + }, + { + "type": "literal", + "value": "PATCH" + }, + { + "type": "literal", + "value": "DELETE" + } + ] + } + }, + { + "name": "retry", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "schema", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "shouldStripNulls", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "shouldThrowOnError", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "signal", + "type": { + "type": "nameOnly", + "name": "AbortSignal" + }, + "isOptional": true + }, + { + "name": "url", + "type": { + "type": "nameOnly", + "name": "URL" + } + }, + { + "name": "urlLengthLimit", + "type": { + "type": "intrinsic", + "name": "number" + }, + "isOptional": true + } + ] + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestBuilder" + } + }, + "comment": { + "shortText": "Creates a builder configured for a specific PostgREST request.", + "examples": [ + { + "id": "using-supabase-js-recommended", + "name": "Using supabase-js (recommended)", + "code": "```ts\nimport { createClient } from '@supabase/supabase-js'\n\nconst supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key')\nconst { data, error } = await supabase.from('users').select('*')\n```" + }, + { + "id": "standalone-import-for-bundle-sensitive-environments", + "name": "Standalone import for bundle-sensitive environments", + "code": "```ts\nimport { PostgrestQueryBuilder } from '@supabase/postgrest-js'\n\nconst builder = new PostgrestQueryBuilder(\n new URL('https://xyzcompany.supabase.co/rest/v1/users'),\n { headers: new Headers({ apikey: 'your-publishable-key' }) }\n)\n```" + } + ] + } + }, + "@supabase/postgrest-js.PostgrestBuilder.overrideTypes": { + "name": "@supabase/postgrest-js.PostgrestBuilder.overrideTypes", + "params": [], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestBuilder" + } + }, + "comment": { + "shortText": "Override the type of the returned `data` field in the response.", + "examples": [ + { + "id": "example-1", + "name": "Example 1", + "code": "```typescript\n// Merge with existing types (default behavior)\nconst query = supabase\n .from('users')\n .select()\n .overrideTypes<{ custom_field: string }>()\n\n// Replace existing types completely\nconst replaceQuery = supabase\n .from('users')\n .select()\n .overrideTypes<{ id: number; name: string }, { merge: false }>()\n```" + }, + { + "id": "complete-override-type-of-successful-response", + "name": "Complete Override type of successful response", + "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .overrideTypes, { merge: false }>()\n```", + "response": "```ts\nlet x: typeof data // MyType[]\n```" + }, + { + "id": "complete-override-type-of-object-response", + "name": "Complete Override type of object response", + "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .maybeSingle()\n .overrideTypes()\n```", + "response": "```ts\nlet x: typeof data // MyType | null\n```" + }, + { + "id": "partial-override-type-of-successful-response", + "name": "Partial Override type of successful response", + "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .overrideTypes>()\n```", + "response": "```ts\nlet x: typeof data // Array\n```" + }, + { + "id": "partial-override-type-of-object-response", + "name": "Partial Override type of object response", + "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .maybeSingle()\n .overrideTypes<{ status: \"A\" | \"B\" }>()\n```", + "response": "```ts\nlet x: typeof data // CountryRowProperties & { status: \"A\" | \"B\" } | null\n```" + }, + { + "id": "merge-vs-replace-existing-types", + "name": "Merge vs replace existing types", + "code": "```typescript\n// Merge with existing types (default behavior)\nconst query = supabase\n .from('users')\n .select()\n .overrideTypes<{ custom_field: string }>()\n\n// Replace existing types completely\nconst replaceQuery = supabase\n .from('users')\n .select()\n .overrideTypes<{ id: number; name: string }, { merge: false }>()\n```" + } + ] + } + }, + "@supabase/postgrest-js.PostgrestBuilder.retry": { + "name": "@supabase/postgrest-js.PostgrestBuilder.retry", + "params": [ + { + "name": "enabled", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "comment": { + "shortText": "Whether to enable retries for this request" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "", + "examples": [ + { + "id": "example-1", + "name": "Example 1", + "code": "```ts\n// Disable retries for a specific query\nconst { data, error } = await supabase\n .from('users')\n .select()\n .retry(false)\n```" + } + ] + } + }, + "@supabase/postgrest-js.PostgrestBuilder.returns": { + "name": "@supabase/postgrest-js.PostgrestBuilder.returns", + "params": [], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestBuilder" + } + }, + "comment": { + "shortText": "Override the type of the returned `data`." + } + }, + "@supabase/postgrest-js.PostgrestBuilder.setHeader": { + "name": "@supabase/postgrest-js.PostgrestBuilder.setHeader", + "params": [ + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "HTTP header name" + } + }, + { + "name": "value", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "HTTP header value" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Set an HTTP header on this single PostgREST request, overriding any header\nwith the same name set on the client.\n\nThis is an advanced escape hatch for one-off needs (passing a custom\n`Authorization` for a single query, attaching a tracing header, etc.).\nMost callers do not need it: configure client-wide headers via the\n`headers` option when constructing the client, and authentication via\nSupabase Auth." + } + }, + "@supabase/postgrest-js.PostgrestBuilder.stripNulls": { + "name": "@supabase/postgrest-js.PostgrestBuilder.stripNulls", + "params": [], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Strip null values from the response data. Properties with `null` values\nwill be omitted from the returned JSON objects.\n\nRequires PostgREST 11.2.0+.\n\nhttps://docs.postgrest.org/en/stable/references/api/resource_representation.html#stripped-nulls", + "examples": [ + { + "id": "with-select", + "name": "With `select()`", + "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .stripNulls()\n```", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text, bio text);\n\ninsert into\n characters (id, name, bio)\nvalues\n (1, 'Luke', null),\n (2, 'Leia', 'Princess of Alderaan');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"Luke\"\n },\n {\n \"id\": 2,\n \"name\": \"Leia\",\n \"bio\": \"Princess of Alderaan\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + } + ] + } + }, + "@supabase/postgrest-js.PostgrestBuilder.then": { + "name": "@supabase/postgrest-js.PostgrestBuilder.then", + "params": [ + { + "name": "onfulfilled", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "function", + "params": [ + { + "name": "value" + } + ], + "ret": { + "type": { + "type": "union", + "subTypes": [ + { + "type": "nameOnly", + "name": "TResult1" + }, + { + "type": "nameOnly", + "name": "PromiseLike" + } + ] + } + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "The callback to execute when the Promise is resolved." + } + }, + { + "name": "onrejected", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "function", + "params": [ + { + "name": "reason", + "type": { + "type": "intrinsic", + "name": "any" + } + } + ], + "ret": { + "type": { + "type": "union", + "subTypes": [ + { + "type": "nameOnly", + "name": "TResult2" + }, + { + "type": "nameOnly", + "name": "PromiseLike" + } + ] + } + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "The callback to execute when the Promise is rejected." + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "PromiseLike" + } + }, + "comment": { + "shortText": "Attaches callbacks for the resolution and/or rejection of the Promise." + } + }, + "@supabase/postgrest-js.PostgrestBuilder.throwOnError": { + "name": "@supabase/postgrest-js.PostgrestBuilder.throwOnError", + "params": [], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestBuilder" + } + }, + "comment": { + "shortText": "If there's an error with the query, throwOnError will reject the promise by\nthrowing the error instead of returning it as part of a successful response.\n\nhttps://github.com/supabase/supabase-js/issues/92" + } + }, + "@supabase/postgrest-js.PostgrestClient.constructor": { + "name": "@supabase/postgrest-js.PostgrestClient.constructor", + "params": [ + { + "name": "url", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "URL of the PostgREST endpoint" + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "fetch", + "type": { + "type": "function", + "params": [ + { + "name": "input", + "type": { + "type": "union", + "subTypes": [ + { + "type": "nameOnly", + "name": "URL" + }, + { + "type": "nameOnly", + "name": "RequestInfo" + } + ] + } + }, + { + "name": "init", + "type": { + "type": "nameOnly", + "name": "RequestInit" + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "nameOnly", + "name": "Response" + } + } + }, + "comment": { + "shortText": "[MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch)" + } + }, + "isOptional": true, + "comment": { + "shortText": "Custom fetch" + } + }, + { + "name": "headers", + "type": { + "type": "nameOnly", + "name": "HeadersInit" + }, + "isOptional": true, + "comment": { + "shortText": "Custom headers" + } + }, + { + "name": "retry", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "Enable or disable automatic retries for transient errors.\n When enabled, idempotent requests (GET, HEAD, OPTIONS) that fail with network\n errors or HTTP 503/520 responses will be automatically retried up to 3 times\n with exponential backoff (1s, 2s, 4s). Defaults to `true`." + } + }, + { + "name": "schema", + "type": { + "type": "nameOnly", + "name": "@supabase/postgrest-js.default.SchemaName" + }, + "isOptional": true, + "comment": { + "shortText": "Postgres schema to switch to" + } + }, + { + "name": "timeout", + "type": { + "type": "intrinsic", + "name": "number" + }, + "isOptional": true, + "comment": { + "shortText": "Optional timeout in milliseconds for all requests. When set, requests will automatically abort after this duration to prevent indefinite hangs." + } + }, + { + "name": "urlLengthLimit", + "type": { + "type": "intrinsic", + "name": "number" + }, + "isOptional": true, + "comment": { + "shortText": "Maximum URL length in characters before warnings/errors are triggered. Defaults to 8000." + } + } + ] + }, + "comment": { + "shortText": "Named parameters" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestClient" + } + }, + "comment": { + "shortText": "Creates a PostgREST client.", + "text": "- A `timeout` option (in milliseconds) can be set to automatically abort requests that take too long.\n- A `urlLengthLimit` option (default: 8000) can be set to control when URL length warnings are included in error messages for aborted requests.", + "examples": [ + { + "id": "using-supabase-js-recommended", + "name": "Using supabase-js (recommended)", + "code": "```ts\nimport { createClient } from '@supabase/supabase-js'\n\nconst supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key')\nconst { data, error } = await supabase.from('profiles').select('*')\n```" + }, + { + "id": "standalone-import-for-bundle-sensitive-environments", + "name": "Standalone import for bundle-sensitive environments", + "code": "```ts\nimport { PostgrestClient } from '@supabase/postgrest-js'\n\nconst postgrest = new PostgrestClient('https://xyzcompany.supabase.co/rest/v1', {\n headers: { apikey: 'your-publishable-key' },\n schema: 'public',\n timeout: 30000, // 30 second timeout\n})\n```" + } + ] + } + }, + "@supabase/postgrest-js.PostgrestClient.from": { + "name": "@supabase/postgrest-js.PostgrestClient.from", + "params": [ + { + "name": "relation", + "type": { + "type": "nameOnly", + "name": "TableName" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestQueryBuilder" + } + }, + "comment": { + "shortText": "Perform a query on a table or a view." + }, + "altSignatures": [ + { + "params": [ + { + "name": "relation", + "type": { + "type": "nameOnly", + "name": "ViewName" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestQueryBuilder" + } + } + } + ] + }, + "@supabase/postgrest-js.PostgrestClient.rpc": { + "name": "@supabase/postgrest-js.PostgrestClient.rpc", + "params": [ + { + "name": "fn", + "type": { + "type": "nameOnly", + "name": "FnName" + }, + "comment": { + "shortText": "The function name to call" + } + }, + { + "name": "args", + "type": { + "type": "nameOnly", + "name": "Args" + }, + "comment": { + "shortText": "The arguments to pass to the function call" + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "count", + "type": { + "type": "union", + "subTypes": [ + null, + { + "type": "literal", + "value": "exact" + }, + { + "type": "literal", + "value": "planned" + }, + { + "type": "literal", + "value": "estimated" + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Count algorithm to use to count rows returned by the\nfunction. Only applicable for [set-returning\nfunctions](https://www.postgresql.org/docs/current/functions-srf.html).\n\n`\"exact\"`: Exact but slow count algorithm. Performs a `COUNT(*)` under the\nhood.\n\n`\"planned\"`: Approximated but fast count algorithm. Uses the Postgres\nstatistics under the hood.\n\n`\"estimated\"`: Uses exact count for low numbers and planned count for high\nnumbers." + } + }, + { + "name": "get", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "When set to `true`, the function will be called with\nread-only access mode." + } + }, + { + "name": "head", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "When set to `true`, `data` will not be returned.\nUseful if you only need the count." + } + } + ] + }, + "comment": { + "shortText": "Named parameters" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestFilterBuilder" + } + }, + "comment": { + "shortText": "Perform a function call.", + "examples": [ + { + "id": "example-1", + "name": "Example 1", + "code": "```ts\n// For cross-schema functions where type inference fails, use overrideTypes:\nconst { data } = await supabase\n .schema('schema_b')\n .rpc('function_a', {})\n .overrideTypes<{ id: string; user_id: string }[]>()\n```" + }, + { + "id": "call-a-postgres-function-without-arguments", + "name": "Call a Postgres function without arguments", + "code": "```ts\nconst { data, error } = await supabase.rpc('hello_world')\n```", + "data": { + "sql": "```sql\ncreate function hello_world() returns text as $$\n select 'Hello world';\n$$ language sql;\n```" + }, + "response": "```json\n{\n \"data\": \"Hello world\",\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + }, + { + "id": "call-a-postgres-function-with-arguments", + "name": "Call a Postgres function with arguments", + "code": "```ts\nconst { data, error } = await supabase.rpc('echo', { say: '👋' })\n```", + "data": { + "sql": "```sql\ncreate function echo(say text) returns text as $$\n select say;\n$$ language sql;\n```" + }, + "response": "```json\n {\n \"data\": \"👋\",\n \"status\": 200,\n \"statusText\": \"OK\"\n }\n\n```" + }, + { + "id": "bulk-processing", + "name": "Bulk processing", + "code": "```ts\nconst { data, error } = await supabase.rpc('add_one_each', { arr: [1, 2, 3] })\n```", + "description": "You can process large payloads by passing in an array as an argument.", + "data": { + "sql": "```sql\ncreate function add_one_each(arr int[]) returns int[] as $$\n select array_agg(n + 1) from unnest(arr) as n;\n$$ language sql;\n```" + }, + "response": "```json\n{\n \"data\": [\n 2,\n 3,\n 4\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + }, + { + "id": "call-a-postgres-function-with-filters", + "name": "Call a Postgres function with filters", + "code": "```ts\nconst { data, error } = await supabase\n .rpc('list_stored_countries')\n .eq('id', 1)\n .single()\n```", + "description": "Postgres functions that return tables can also be combined with [Filters](/docs/reference/javascript/using-filters) and [Modifiers](/docs/reference/javascript/using-modifiers).", + "data": { + "sql": "```sql\ncreate table\n countries (id int8 primary key, name text);\n\ninsert into\n countries (id, name)\nvalues\n (1, 'Rohan'),\n (2, 'The Shire');\n\ncreate function list_stored_countries() returns setof countries as $$\n select * from countries;\n$$ language sql;\n```" + }, + "response": "```json\n{\n \"data\": {\n \"id\": 1,\n \"name\": \"Rohan\"\n },\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + }, + { + "id": "call-a-read-only-postgres-function", + "name": "Call a read-only Postgres function", + "code": "```ts\nconst { data, error } = await supabase.rpc('hello_world', undefined, { get: true })\n```", + "data": { + "sql": "```sql\ncreate function hello_world() returns text as $$\n select 'Hello world';\n$$ language sql;\n```" + }, + "response": "```json\n{\n \"data\": \"Hello world\",\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + } + ] + } + }, + "@supabase/postgrest-js.PostgrestClient.schema": { + "name": "@supabase/postgrest-js.PostgrestClient.schema", + "params": [ + { + "name": "schema", + "type": { + "type": "nameOnly", + "name": "DynamicSchema" + }, + "comment": { + "shortText": "The schema to query" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestClient" + } + }, + "comment": { + "shortText": "Select a schema to query or perform an function (rpc) call.\n\nThe schema needs to be on the list of exposed schemas inside Supabase." + } + }, + "@supabase/postgrest-js.PostgrestError.constructor": { + "name": "@supabase/postgrest-js.PostgrestError.constructor", + "params": [ + { + "name": "context", + "type": { + "type": "object", + "properties": [ + { + "name": "code", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "details", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "hint", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestError" + } + }, + "comment": { + "shortText": "", + "examples": [ + { + "id": "example-1", + "name": "Example 1", + "code": "```ts\nimport PostgrestError from '@supabase/postgrest-js'\n\nthrow new PostgrestError({\n message: 'Row level security prevented the request',\n details: 'RLS denied the insert',\n hint: 'Check your policies',\n code: 'PGRST301',\n})\n```" + } + ] + } + }, + "@supabase/postgrest-js.PostgrestError.toJSON": { + "name": "@supabase/postgrest-js.PostgrestError.toJSON", + "params": [], + "ret": { + "type": { + "type": "object", + "properties": [ + { + "name": "code", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "details", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "hint", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + } + } + }, + "@supabase/postgrest-js.PostgrestFilterBuilder.constructor": { + "name": "@supabase/postgrest-js.PostgrestFilterBuilder.constructor", + "params": [ + { + "name": "builder", + "type": { + "type": "object", + "properties": [ + { + "name": "body", + "type": { + "type": "intrinsic", + "name": "unknown" + }, + "isOptional": true + }, + { + "name": "fetch", + "type": { + "type": "function", + "params": [ + { + "name": "input", + "type": { + "type": "union", + "subTypes": [ + { + "type": "nameOnly", + "name": "URL" + }, + { + "type": "nameOnly", + "name": "RequestInfo" + } + ] + } + }, + { + "name": "init", + "type": { + "type": "nameOnly", + "name": "RequestInit" + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "nameOnly", + "name": "Response" + } + } + }, + "comment": { + "shortText": "[MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch)" + } + }, + "isOptional": true + }, + { + "name": "headers", + "type": { + "type": "nameOnly", + "name": "HeadersInit" + } + }, + { + "name": "isMaybeSingle", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "method", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "GET" + }, + { + "type": "literal", + "value": "HEAD" + }, + { + "type": "literal", + "value": "POST" + }, + { + "type": "literal", + "value": "PATCH" + }, + { + "type": "literal", + "value": "DELETE" + } + ] + } + }, + { + "name": "retry", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "schema", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "shouldStripNulls", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "shouldThrowOnError", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "signal", + "type": { + "type": "nameOnly", + "name": "AbortSignal" + }, + "isOptional": true + }, + { + "name": "url", + "type": { + "type": "nameOnly", + "name": "URL" + } + }, + { + "name": "urlLengthLimit", + "type": { + "type": "intrinsic", + "name": "number" + }, + "isOptional": true + } + ] + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestFilterBuilder" + } + }, + "comment": { + "shortText": "Creates a builder configured for a specific PostgREST request.", + "examples": [ + { + "id": "using-supabase-js-recommended", + "name": "Using supabase-js (recommended)", + "code": "```ts\nimport { createClient } from '@supabase/supabase-js'\n\nconst supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key')\nconst { data, error } = await supabase.from('users').select('*')\n```" + }, + { + "id": "standalone-import-for-bundle-sensitive-environments", + "name": "Standalone import for bundle-sensitive environments", + "code": "```ts\nimport { PostgrestQueryBuilder } from '@supabase/postgrest-js'\n\nconst builder = new PostgrestQueryBuilder(\n new URL('https://xyzcompany.supabase.co/rest/v1/users'),\n { headers: new Headers({ apikey: 'your-publishable-key' }) }\n)\n```" + } + ] + } + }, + "@supabase/postgrest-js.PostgrestFilterBuilder.abortSignal": { + "name": "@supabase/postgrest-js.PostgrestFilterBuilder.abortSignal", + "params": [ + { + "name": "signal", + "type": { + "type": "nameOnly", + "name": "AbortSignal" + }, + "comment": { + "shortText": "The AbortSignal to use for the fetch request" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Set the AbortSignal for the fetch request.", + "text": "You can use this to set a timeout for the request.", + "examples": [ + { + "id": "aborting-requests-in-flight", + "name": "Aborting requests in-flight", + "code": "```ts\nconst ac = new AbortController()\n\nconst { data, error } = await supabase\n .from('very_big_table')\n .select()\n .abortSignal(ac.signal)\n\n// Abort the request after 100 ms\nsetTimeout(() => ac.abort(), 100)\n```", + "description": "You can use an [`AbortController`](https://developer.mozilla.org/en-US/docs/Web/API/AbortController) to abort requests.\nNote that `status` and `statusText` don't mean anything for aborted requests as the request wasn't fulfilled.", + "response": "```json\n {\n \"error\": {\n \"message\": \"AbortError: The user aborted a request.\",\n \"details\": \"\",\n \"hint\": \"The request was aborted locally via the provided AbortSignal.\",\n \"code\": \"\"\n },\n \"status\": 0,\n \"statusText\": \"\"\n }\n\n```" + }, + { + "id": "set-a-timeout", + "name": "Set a timeout", + "code": "```ts\nconst { data, error } = await supabase\n .from('very_big_table')\n .select()\n .abortSignal(AbortSignal.timeout(1000 /* ms */))\n```", + "response": "```json\n {\n \"error\": {\n \"message\": \"FetchError: The user aborted a request.\",\n \"details\": \"\",\n \"hint\": \"\",\n \"code\": \"\"\n },\n \"status\": 400,\n \"statusText\": \"Bad Request\"\n }\n\n```" + } + ] + } + }, + "@supabase/postgrest-js.PostgrestFilterBuilder.containedBy": { + "name": "@supabase/postgrest-js.PostgrestFilterBuilder.containedBy", + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + } + }, + { + "name": "value", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "string" + }, + { + "type": "record", + "name": "Record", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "unknown" + } + }, + { + "type": "array", + "elemType": { + "type": "nameOnly", + "name": "Row['ColumnName']" + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Only relevant for jsonb, array, and range columns. Match only rows where\nevery element appearing in `column` is contained by `value`.", + "examples": [ + { + "id": "on-array-columns", + "name": "On array columns", + "code": "```ts\nconst { data, error } = await supabase\n .from('classes')\n .select('name')\n .containedBy('days', ['monday', 'tuesday', 'wednesday', 'friday'])\n```", + "data": { + "sql": "```sql\ncreate table\n classes (\n id int8 primary key,\n name text,\n days text[]\n );\n\ninsert into\n classes (id, name, days)\nvalues\n (1, 'Chemistry', array['monday', 'friday']),\n (2, 'History', array['monday', 'wednesday', 'thursday']);\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"name\": \"Chemistry\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + }, + { + "id": "on-range-columns", + "name": "On range columns", + "code": "```ts\nconst { data, error } = await supabase\n .from('reservations')\n .select()\n .containedBy('during', '[2000-01-01 00:00, 2000-01-01 23:59)')\n```", + "description": "Postgres supports a number of [range\ntypes](https://www.postgresql.org/docs/current/rangetypes.html). You\ncan filter on range columns using the string representation of range\nvalues.", + "data": { + "sql": "```sql\ncreate table\n reservations (\n id int8 primary key,\n room_name text,\n during tsrange\n );\n\ninsert into\n reservations (id, room_name, during)\nvalues\n (1, 'Emerald', '[2000-01-01 13:00, 2000-01-01 15:00)'),\n (2, 'Topaz', '[2000-01-02 09:00, 2000-01-02 10:00)');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"room_name\": \"Emerald\",\n \"during\": \"[\\\"2000-01-01 13:00:00\\\",\\\"2000-01-01 15:00:00\\\")\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + }, + { + "id": "on-jsonb-columns", + "name": "On `jsonb` columns", + "code": "```ts\nconst { data, error } = await supabase\n .from('users')\n .select('name')\n .containedBy('address', {})\n```", + "data": { + "sql": "```sql\ncreate table\n users (\n id int8 primary key,\n name text,\n address jsonb\n );\n\ninsert into\n users (id, name, address)\nvalues\n (1, 'Michael', '{ \"postcode\": 90210, \"street\": \"Melrose Place\" }'),\n (2, 'Jane', '{}');\n```" + }, + "response": "```json\n {\n \"data\": [\n {\n \"name\": \"Jane\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n }\n\n```" + } + ] + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "value", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "string" + }, + { + "type": "record", + "name": "Record", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "unknown" + } + }, + { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "unknown" + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + } + ] + }, + "@supabase/postgrest-js.PostgrestFilterBuilder.contains": { + "name": "@supabase/postgrest-js.PostgrestFilterBuilder.contains", + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + } + }, + { + "name": "value", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "string" + }, + { + "type": "record", + "name": "Record", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "unknown" + } + }, + { + "type": "array", + "elemType": { + "type": "nameOnly", + "name": "Row['ColumnName']" + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Only relevant for jsonb, array, and range columns. Match only rows where\n`column` contains every element appearing in `value`.", + "examples": [ + { + "id": "on-array-columns", + "name": "On array columns", + "code": "```ts\nconst { data, error } = await supabase\n .from('issues')\n .select()\n .contains('tags', ['is:open', 'priority:low'])\n```", + "data": { + "sql": "```sql\ncreate table\n issues (\n id int8 primary key,\n title text,\n tags text[]\n );\n\ninsert into\n issues (id, title, tags)\nvalues\n (1, 'Cache invalidation is not working', array['is:open', 'severity:high', 'priority:low']),\n (2, 'Use better names', array['is:open', 'severity:low', 'priority:medium']);\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"title\": \"Cache invalidation is not working\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + }, + { + "id": "on-range-columns", + "name": "On range columns", + "code": "```ts\nconst { data, error } = await supabase\n .from('reservations')\n .select()\n .contains('during', '[2000-01-01 13:00, 2000-01-01 13:30)')\n```", + "description": "Postgres supports a number of [range\ntypes](https://www.postgresql.org/docs/current/rangetypes.html). You\ncan filter on range columns using the string representation of range\nvalues.", + "data": { + "sql": "```sql\ncreate table\n reservations (\n id int8 primary key,\n room_name text,\n during tsrange\n );\n\ninsert into\n reservations (id, room_name, during)\nvalues\n (1, 'Emerald', '[2000-01-01 13:00, 2000-01-01 15:00)'),\n (2, 'Topaz', '[2000-01-02 09:00, 2000-01-02 10:00)');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"room_name\": \"Emerald\",\n \"during\": \"[\\\"2000-01-01 13:00:00\\\",\\\"2000-01-01 15:00:00\\\")\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + }, + { + "id": "on-jsonb-columns", + "name": "On `jsonb` columns", + "code": "```ts\nconst { data, error } = await supabase\n .from('users')\n .select('name')\n .contains('address', { postcode: 90210 })\n```", + "data": { + "sql": "```sql\ncreate table\n users (\n id int8 primary key,\n name text,\n address jsonb\n );\n\ninsert into\n users (id, name, address)\nvalues\n (1, 'Michael', '{ \"postcode\": 90210, \"street\": \"Melrose Place\" }'),\n (2, 'Jane', '{}');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"name\": \"Michael\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + } + ] + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "value", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "string" + }, + { + "type": "record", + "name": "Record", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "unknown" + } + }, + { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "unknown" + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + } + ] + }, + "@supabase/postgrest-js.PostgrestFilterBuilder.csv": { + "name": "@supabase/postgrest-js.PostgrestFilterBuilder.csv", + "params": [], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestBuilder" + } + }, + "comment": { + "shortText": "Return `data` as a string in CSV format.", + "examples": [ + { + "id": "return-data-as-csv", + "name": "Return data as CSV", + "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .csv()\n```", + "description": "By default, the data is returned in JSON format, but can also be returned as Comma Separated Values.", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" + }, + "response": "```json\n{\n \"data\": \"id,name\\n1,Luke\\n2,Leia\\n3,Han\",\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + } + ] + } + }, + "@supabase/postgrest-js.PostgrestFilterBuilder.eq": { + "name": "@supabase/postgrest-js.PostgrestFilterBuilder.eq", + "params": [ + { + "name": "column", + "comment": { + "shortText": "The column to filter on" + } + }, + { + "name": "value", + "comment": { + "shortText": "The value to filter with" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Match only rows where `column` is equal to `value`.\n\nTo check if the value of `column` is NULL, you should use `.is()` instead.", + "examples": [ + { + "id": "with-select", + "name": "With `select()`", + "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .eq('name', 'Leia')\n```", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"id\": 2,\n \"name\": \"Leia\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + } + ] + } + }, + "@supabase/postgrest-js.PostgrestFilterBuilder.explain": { + "name": "@supabase/postgrest-js.PostgrestFilterBuilder.explain", + "params": [ + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "analyze", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "If `true`, the query will be executed and the\nactual run time will be returned" + } + }, + { + "name": "buffers", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "If `true`, include information on buffer usage" + } + }, + { + "name": "format", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "text" + }, + { + "type": "literal", + "value": "json" + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "The format of the output, can be `\"text\"` (default)\nor `\"json\"`" + } + }, + { + "name": "settings", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "If `true`, include information on configuration\nparameters that affect query planning" + } + }, + { + "name": "verbose", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "If `true`, the query identifier will be returned\nand `data` will include the output columns of the query" + } + }, + { + "name": "wal", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "If `true`, include information on WAL record generation" + } + } + ] + }, + "comment": { + "shortText": "Named parameters" + } + } + ], + "ret": { + "type": { + "type": "union", + "subTypes": [ + { + "type": "nameOnly", + "name": "PostgrestBuilder" + }, + { + "type": "nameOnly", + "name": "PostgrestBuilder" + } + ] + } + }, + "comment": { + "shortText": "Return `data` as the EXPLAIN plan for the query.\n\nYou need to enable the\n[db_plan_enabled](https://supabase.com/docs/guides/database/debugging-performance#enabling-explain)\nsetting before using this method.", + "examples": [ + { + "id": "get-the-execution-plan", + "name": "Get the execution plan", + "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .explain()\n```", + "description": "By default, the data is returned in TEXT format, but can also be returned as JSON by using the `format` parameter.", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" + }, + "response": "```js\nAggregate (cost=33.34..33.36 rows=1 width=112)\n -> Limit (cost=0.00..18.33 rows=1000 width=40)\n -> Seq Scan on characters (cost=0.00..22.00 rows=1200 width=40)\n```" + }, + { + "id": "get-the-execution-plan-with-analyze-and-verbose", + "name": "Get the execution plan with analyze and verbose", + "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .explain({analyze:true,verbose:true})\n```", + "description": "By default, the data is returned in TEXT format, but can also be returned as JSON by using the `format` parameter.", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" + }, + "response": "```js\nAggregate (cost=33.34..33.36 rows=1 width=112) (actual time=0.041..0.041 rows=1 loops=1)\n Output: NULL::bigint, count(ROW(characters.id, characters.name)), COALESCE(json_agg(ROW(characters.id, characters.name)), '[]'::json), NULLIF(current_setting('response.headers'::text, true), ''::text), NULLIF(current_setting('response.status'::text, true), ''::text)\n -> Limit (cost=0.00..18.33 rows=1000 width=40) (actual time=0.005..0.006 rows=3 loops=1)\n Output: characters.id, characters.name\n -> Seq Scan on public.characters (cost=0.00..22.00 rows=1200 width=40) (actual time=0.004..0.005 rows=3 loops=1)\n Output: characters.id, characters.name\nQuery Identifier: -4730654291623321173\nPlanning Time: 0.407 ms\nExecution Time: 0.119 ms\n```" + } + ] + } + }, + "@supabase/postgrest-js.PostgrestFilterBuilder.filter": { + "name": "@supabase/postgrest-js.PostgrestFilterBuilder.filter", + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + } + }, + { + "name": "operator", + "type": { + "type": "union", + "subTypes": [ + { + "type": "nameOnly", + "name": "FilterOperator" + }, + { + "type": "literal", + "value": "not.match" + }, + { + "type": "literal", + "value": "not.is" + }, + { + "type": "literal", + "value": "not.eq" + }, + { + "type": "literal", + "value": "not.neq" + }, + { + "type": "literal", + "value": "not.gt" + }, + { + "type": "literal", + "value": "not.gte" + }, + { + "type": "literal", + "value": "not.lt" + }, + { + "type": "literal", + "value": "not.lte" + }, + { + "type": "literal", + "value": "not.like" + }, + { + "type": "literal", + "value": "not.ilike" + }, + { + "type": "literal", + "value": "not.isdistinct" + }, + { + "type": "literal", + "value": "not.in" + }, + { + "type": "literal", + "value": "not.cs" + }, + { + "type": "literal", + "value": "not.cd" + }, + { + "type": "literal", + "value": "not.sl" + }, + { + "type": "literal", + "value": "not.sr" + }, + { + "type": "literal", + "value": "not.nxl" + }, + { + "type": "literal", + "value": "not.nxr" + }, + { + "type": "literal", + "value": "not.adj" + }, + { + "type": "literal", + "value": "not.ov" + }, + { + "type": "literal", + "value": "not.fts" + }, + { + "type": "literal", + "value": "not.plfts" + }, + { + "type": "literal", + "value": "not.phfts" + }, + { + "type": "literal", + "value": "not.wfts" + }, + { + "type": "literal", + "value": "not.imatch" + } + ] + } + }, + { + "name": "value", + "type": { + "type": "intrinsic", + "name": "unknown" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Match only rows which satisfy the filter. This is an escape hatch - you\nshould use the specific filter methods wherever possible.\n\nUnlike most filters, `opearator` and `value` are used as-is and need to\nfollow [PostgREST\nsyntax](https://postgrest.org/en/stable/api.html#operators). You also need\nto make sure they are properly sanitized.", + "text": "filter() expects you to use the raw PostgREST syntax for the filter values.\n\n```ts\n.filter('id', 'in', '(5,6,7)') // Use `()` for `in` filter\n.filter('arraycol', 'cs', '{\"a\",\"b\"}') // Use `cs` for `contains()`, `{}` for array values\n```", + "examples": [ + { + "id": "with-select", + "name": "With `select()`", + "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .filter('name', 'in', '(\"Han\",\"Yoda\")')\n```", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"id\": 3,\n \"name\": \"Han\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + }, + { + "id": "on-a-referenced-table", + "name": "On a referenced table", + "code": "```ts\nconst { data, error } = await supabase\n .from('orchestral_sections')\n .select(`\n name,\n instruments!inner (\n name\n )\n `)\n .filter('instruments.name', 'eq', 'flute')\n```", + "data": { + "sql": "```sql\ncreate table\n orchestral_sections (id int8 primary key, name text);\ncreate table\n instruments (\n id int8 primary key,\n section_id int8 not null references orchestral_sections,\n name text\n );\n\ninsert into\n orchestral_sections (id, name)\nvalues\n (1, 'strings'),\n (2, 'woodwinds');\ninsert into\n instruments (id, section_id, name)\nvalues\n (1, 2, 'flute'),\n (2, 1, 'violin');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"name\": \"woodwinds\",\n \"instruments\": [\n {\n \"name\": \"flute\"\n }\n ]\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + } + ] + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "operator", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "value", + "type": { + "type": "intrinsic", + "name": "unknown" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + } + ] + }, + "@supabase/postgrest-js.PostgrestFilterBuilder.geojson": { + "name": "@supabase/postgrest-js.PostgrestFilterBuilder.geojson", + "params": [], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestBuilder" + } + }, + "comment": { + "shortText": "Return `data` as an object in [GeoJSON](https://geojson.org) format." + } + }, + "@supabase/postgrest-js.PostgrestFilterBuilder.gt": { + "name": "@supabase/postgrest-js.PostgrestFilterBuilder.gt", + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + } + }, + { + "name": "value", + "type": { + "type": "nameOnly", + "name": "Row['ColumnName']" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Match only rows where `column` is greater than `value`.", + "examples": [ + { + "id": "with-select", + "name": "With `select()`", + "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .gt('id', 2)\n```", + "description": "When using [reserved words](https://www.postgresql.org/docs/current/sql-keywords-appendix.html) for column names you need\nto add double quotes e.g. `.gt('\"order\"', 2)`", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"id\": 3,\n \"name\": \"Han\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + } + ] + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "value", + "type": { + "type": "intrinsic", + "name": "unknown" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + } + ] + }, + "@supabase/postgrest-js.PostgrestFilterBuilder.gte": { + "name": "@supabase/postgrest-js.PostgrestFilterBuilder.gte", + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + } + }, + { + "name": "value", + "type": { + "type": "nameOnly", + "name": "Row['ColumnName']" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Match only rows where `column` is greater than or equal to `value`.", + "examples": [ + { + "id": "with-select", + "name": "With `select()`", + "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .gte('id', 2)\n```", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"id\": 2,\n \"name\": \"Leia\"\n },\n {\n \"id\": 3,\n \"name\": \"Han\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + } + ] + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "value", + "type": { + "type": "intrinsic", + "name": "unknown" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + } + ] + }, + "@supabase/postgrest-js.PostgrestFilterBuilder.ilike": { + "name": "@supabase/postgrest-js.PostgrestFilterBuilder.ilike", + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + } + }, + { + "name": "pattern", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Match only rows where `column` matches `pattern` case-insensitively.", + "examples": [ + { + "id": "with-select", + "name": "With `select()`", + "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .ilike('name', '%lu%')\n```", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"Luke\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + } + ] + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "pattern", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + } + ] + }, + "@supabase/postgrest-js.PostgrestFilterBuilder.ilikeAllOf": { + "name": "@supabase/postgrest-js.PostgrestFilterBuilder.ilikeAllOf", + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + } + }, + { + "name": "patterns", + "type": { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Match only rows where `column` matches all of `patterns` case-insensitively." + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "patterns", + "type": { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + } + ] + }, + "@supabase/postgrest-js.PostgrestFilterBuilder.ilikeAnyOf": { + "name": "@supabase/postgrest-js.PostgrestFilterBuilder.ilikeAnyOf", + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + } + }, + { + "name": "patterns", + "type": { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Match only rows where `column` matches any of `patterns` case-insensitively." + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "patterns", + "type": { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + } + ] + }, + "@supabase/postgrest-js.PostgrestFilterBuilder.in": { + "name": "@supabase/postgrest-js.PostgrestFilterBuilder.in", + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + }, + "comment": { + "shortText": "The column to filter on" + } + }, + { + "name": "values", + "type": { + "type": "array" + }, + "comment": { + "shortText": "The values array to filter with" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Match only rows where `column` is included in the `values` array.", + "examples": [ + { + "id": "with-select", + "name": "With `select()`", + "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .in('name', ['Leia', 'Han'])\n```", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"id\": 2,\n \"name\": \"Leia\"\n },\n {\n \"id\": 3,\n \"name\": \"Han\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + } + ] + } + }, + "@supabase/postgrest-js.PostgrestFilterBuilder.is": { + "name": "@supabase/postgrest-js.PostgrestFilterBuilder.is", + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + } + }, + { + "name": "value" + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Match only rows where `column` IS `value`.\n\nFor non-boolean columns, this is only relevant for checking if the value of\n`column` is NULL by setting `value` to `null`.\n\nFor boolean columns, you can also set `value` to `true` or `false` and it\nwill behave the same way as `.eq()`.", + "examples": [ + { + "id": "checking-for-nullness-true-or-false", + "name": "Checking for nullness, true or false", + "code": "```ts\nconst { data, error } = await supabase\n .from('countries')\n .select()\n .is('name', null)\n```", + "description": "Using the `eq()` filter doesn't work when filtering for `null`.\n\nInstead, you need to use `is()`.", + "data": { + "sql": "```sql\ncreate table\n countries (id int8 primary key, name text);\n\ninsert into\n countries (id, name)\nvalues\n (1, 'null'),\n (2, null);\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"id\": 2,\n \"name\": \"null\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + } + ] + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "value", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "intrinsic", + "name": "boolean" + } + ] + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + } + ] + }, + "@supabase/postgrest-js.PostgrestFilterBuilder.isDistinct": { + "name": "@supabase/postgrest-js.PostgrestFilterBuilder.isDistinct", + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + }, + "comment": { + "shortText": "The column to filter on" + } + }, + { + "name": "value", + "comment": { + "shortText": "The value to filter with" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Match only rows where `column` IS DISTINCT FROM `value`.\n\nUnlike `.neq()`, this treats `NULL` as a comparable value. Two `NULL` values\nare considered equal (not distinct), and comparing `NULL` with any non-NULL\nvalue returns true (distinct)." + } + }, + "@supabase/postgrest-js.PostgrestFilterBuilder.like": { + "name": "@supabase/postgrest-js.PostgrestFilterBuilder.like", + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + } + }, + { + "name": "pattern", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Match only rows where `column` matches `pattern` case-sensitively.", + "examples": [ + { + "id": "with-select", + "name": "With `select()`", + "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .like('name', '%Lu%')\n```", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"Luke\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + } + ] + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "pattern", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + } + ] + }, + "@supabase/postgrest-js.PostgrestFilterBuilder.likeAllOf": { + "name": "@supabase/postgrest-js.PostgrestFilterBuilder.likeAllOf", + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + } + }, + { + "name": "patterns", + "type": { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Match only rows where `column` matches all of `patterns` case-sensitively." + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "patterns", + "type": { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + } + ] + }, + "@supabase/postgrest-js.PostgrestFilterBuilder.likeAnyOf": { + "name": "@supabase/postgrest-js.PostgrestFilterBuilder.likeAnyOf", + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + } + }, + { + "name": "patterns", + "type": { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Match only rows where `column` matches any of `patterns` case-sensitively." + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "patterns", + "type": { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + } + ] + }, + "@supabase/postgrest-js.PostgrestFilterBuilder.limit": { + "name": "@supabase/postgrest-js.PostgrestFilterBuilder.limit", + "params": [ + { + "name": "rows", + "type": { + "type": "intrinsic", + "name": "number" + }, + "comment": { + "shortText": "The maximum number of rows to return" + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "foreignTable", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Deprecated, use `options.referencedTable`\ninstead" + } + }, + { + "name": "referencedTable", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Set this to limit rows of referenced\ntables instead of the parent table" + } + } + ] + }, + "comment": { + "shortText": "Named parameters" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Limit the query result by `rows`.", + "examples": [ + { + "id": "with-select", + "name": "With `select()`", + "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select('name')\n .limit(1)\n```", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"name\": \"Luke\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + }, + { + "id": "on-a-referenced-table", + "name": "On a referenced table", + "code": "```ts\nconst { data, error } = await supabase\n .from('orchestral_sections')\n .select(`\n name,\n instruments (\n name\n )\n `)\n .limit(1, { referencedTable: 'instruments' })\n```", + "data": { + "sql": "```sql\ncreate table\n orchestral_sections (id int8 primary key, name text);\ncreate table\n instruments (\n id int8 primary key,\n section_id int8 not null references orchestral_sections,\n name text\n );\n\ninsert into\n orchestral_sections (id, name)\nvalues\n (1, 'strings');\ninsert into\n instruments (id, section_id, name)\nvalues\n (1, 1, 'harp'),\n (2, 1, 'violin');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"name\": \"strings\",\n \"instruments\": [\n {\n \"name\": \"violin\"\n }\n ]\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + } + ] + } + }, + "@supabase/postgrest-js.PostgrestFilterBuilder.lt": { + "name": "@supabase/postgrest-js.PostgrestFilterBuilder.lt", + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + } + }, + { + "name": "value", + "type": { + "type": "nameOnly", + "name": "Row['ColumnName']" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Match only rows where `column` is less than `value`.", + "examples": [ + { + "id": "with-select", + "name": "With `select()`", + "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .lt('id', 2)\n```", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"Luke\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + } + ] + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "value", + "type": { + "type": "intrinsic", + "name": "unknown" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + } + ] + }, + "@supabase/postgrest-js.PostgrestFilterBuilder.lte": { + "name": "@supabase/postgrest-js.PostgrestFilterBuilder.lte", + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + } + }, + { + "name": "value", + "type": { + "type": "nameOnly", + "name": "Row['ColumnName']" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Match only rows where `column` is less than or equal to `value`.", + "examples": [ + { + "id": "with-select", + "name": "With `select()`", + "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .lte('id', 2)\n```", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"Luke\"\n },\n {\n \"id\": 2,\n \"name\": \"Leia\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + } + ] + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "value", + "type": { + "type": "intrinsic", + "name": "unknown" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + } + ] + }, + "@supabase/postgrest-js.PostgrestFilterBuilder.match": { + "name": "@supabase/postgrest-js.PostgrestFilterBuilder.match", + "params": [ + { + "name": "query", + "type": { + "type": "record", + "name": "Record", + "keyType": { + "type": "nameOnly", + "name": "ColumnName" + }, + "valueType": { + "type": "nameOnly", + "name": "Row['ColumnName']" + } + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Match only rows where each column in `query` keys is equal to its\nassociated value. Shorthand for multiple `.eq()`s.", + "examples": [ + { + "id": "with-select", + "name": "With `select()`", + "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select('name')\n .match({ id: 2, name: 'Leia' })\n```", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"name\": \"Leia\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + } + ] + }, + "altSignatures": [ + { + "params": [ + { + "name": "query", + "type": { + "type": "record", + "name": "Record", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "unknown" + } + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + } + ] + }, + "@supabase/postgrest-js.PostgrestFilterBuilder.maxAffected": { + "name": "@supabase/postgrest-js.PostgrestFilterBuilder.maxAffected", + "params": [ + { + "name": "rows", + "type": { + "type": "intrinsic", + "name": "number" + }, + "comment": { + "shortText": "The maximum number of rows that can be affected" + } + } + ], + "comment": { + "shortText": "Set the maximum number of rows that can be affected by the query.\nOnly available in PostgREST v13+ and only works with PATCH and DELETE methods." + } + }, + "@supabase/postgrest-js.PostgrestFilterBuilder.maybeSingle": { + "name": "@supabase/postgrest-js.PostgrestFilterBuilder.maybeSingle", + "params": [], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestBuilder" + } + }, + "comment": { + "shortText": "Return `data` as a single object instead of an array of objects.\n\nQuery result must be zero or one row (e.g. using `.limit(1)`), otherwise\nthis returns an error.", + "examples": [ + { + "id": "with-select", + "name": "With `select()`", + "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .eq('name', 'Katniss')\n .maybeSingle()\n```", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" + }, + "response": "```json\n{\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + } + ] + } + }, + "@supabase/postgrest-js.PostgrestFilterBuilder.neq": { + "name": "@supabase/postgrest-js.PostgrestFilterBuilder.neq", + "params": [ + { + "name": "column", + "comment": { + "shortText": "The column to filter on" + } + }, + { + "name": "value", + "comment": { + "shortText": "The value to filter with" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Match only rows where `column` is not equal to `value`.\n\nThis filter does not include rows where `column` is `NULL`. To match null\nvalues, use `.is(column, null)` instead.", + "examples": [ + { + "id": "with-select", + "name": "With `select()`", + "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .neq('name', 'Leia')\n```", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"Luke\"\n },\n {\n \"id\": 3,\n \"name\": \"Han\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + } + ] + } + }, + "@supabase/postgrest-js.PostgrestFilterBuilder.not": { + "name": "@supabase/postgrest-js.PostgrestFilterBuilder.not", + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + } + }, + { + "name": "operator", + "type": { + "type": "literal", + "value": "is" + } + }, + { + "name": "value", + "type": { + "type": "literal", + "value": null + } + } + ], + "comment": { + "shortText": "Match only rows which doesn't satisfy the filter.\n\nUnlike most filters, `opearator` and `value` are used as-is and need to\nfollow [PostgREST\nsyntax](https://postgrest.org/en/stable/api.html#operators). You also need\nto make sure they are properly sanitized.", + "text": "not() expects you to use the raw PostgREST syntax for the filter values.\n\n```ts\n.not('id', 'in', '(5,6,7)') // Use `()` for `in` filter\n.not('arraycol', 'cs', '{\"a\",\"b\"}') // Use `cs` for `contains()`, `{}` for array values\n```", + "examples": [ + { + "id": "with-select", + "name": "With `select()`", + "code": "```ts\nconst { data, error } = await supabase\n .from('countries')\n .select()\n .not('name', 'is', null)\n```", + "data": { + "sql": "```sql\ncreate table\n countries (id int8 primary key, name text);\n\ninsert into\n countries (id, name)\nvalues\n (1, 'null'),\n (2, null);\n```" + }, + "response": "```json\n {\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"null\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n }\n\n```" + } + ] + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + } + }, + { + "name": "operator", + "type": { + "type": "nameOnly", + "name": "FilterOperator" + } + }, + { + "name": "value", + "type": { + "type": "nameOnly", + "name": "Row['ColumnName']" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + }, + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "operator", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "value", + "type": { + "type": "intrinsic", + "name": "unknown" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + } + ] + }, + "@supabase/postgrest-js.PostgrestFilterBuilder.notIn": { + "name": "@supabase/postgrest-js.PostgrestFilterBuilder.notIn", + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + }, + "comment": { + "shortText": "The column to filter on" + } + }, + { + "name": "values", + "type": { + "type": "array" + }, + "comment": { + "shortText": "The values array to filter with" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Match only rows where `column` is NOT included in the `values` array." + } + }, + "@supabase/postgrest-js.PostgrestFilterBuilder.or": { + "name": "@supabase/postgrest-js.PostgrestFilterBuilder.or", + "params": [ + { + "name": "filters", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The filters to use, following PostgREST syntax" + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "foreignTable", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Deprecated, use `referencedTable` instead" + } + }, + { + "name": "referencedTable", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Set this to filter on referenced tables\ninstead of the parent table" + } + } + ] + }, + "comment": { + "shortText": "Named parameters" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Match only rows which satisfy at least one of the filters.\n\nUnlike most filters, `filters` is used as-is and needs to follow [PostgREST\nsyntax](https://postgrest.org/en/stable/api.html#operators). You also need\nto make sure it's properly sanitized.\n\nIt's currently not possible to do an `.or()` filter across multiple tables.", + "text": "or() expects you to use the raw PostgREST syntax for the filter names and values.\n\n```ts\n.or('id.in.(5,6,7), arraycol.cs.{\"a\",\"b\"}') // Use `()` for `in` filter, `{}` for array values and `cs` for `contains()`.\n.or('id.in.(5,6,7), arraycol.cd.{\"a\",\"b\"}') // Use `cd` for `containedBy()`\n```", + "examples": [ + { + "id": "with-select", + "name": "With `select()`", + "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select('name')\n .or('id.eq.2,name.eq.Han')\n```", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"name\": \"Leia\"\n },\n {\n \"name\": \"Han\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + }, + { + "id": "use-or-with-and", + "name": "Use `or` with `and`", + "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select('name')\n .or('id.gt.3,and(id.eq.1,name.eq.Luke)')\n```", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"name\": \"Luke\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + }, + { + "id": "use-or-on-referenced-tables", + "name": "Use `or` on referenced tables", + "code": "```ts\nconst { data, error } = await supabase\n .from('orchestral_sections')\n .select(`\n name,\n instruments!inner (\n name\n )\n `)\n .or('section_id.eq.1,name.eq.guzheng', { referencedTable: 'instruments' })\n```", + "data": { + "sql": "```sql\ncreate table\n orchestral_sections (id int8 primary key, name text);\ncreate table\n instruments (\n id int8 primary key,\n section_id int8 not null references orchestral_sections,\n name text\n );\n\ninsert into\n orchestral_sections (id, name)\nvalues\n (1, 'strings'),\n (2, 'woodwinds');\ninsert into\n instruments (id, section_id, name)\nvalues\n (1, 2, 'flute'),\n (2, 1, 'violin');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"name\": \"strings\",\n \"instruments\": [\n {\n \"name\": \"violin\"\n }\n ]\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + } + ] + } + }, + "@supabase/postgrest-js.PostgrestFilterBuilder.order": { + "name": "@supabase/postgrest-js.PostgrestFilterBuilder.order", + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "ascending", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "nullsFirst", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "referencedTable", + "type": { + "type": "intrinsic", + "name": "undefined" + }, + "isOptional": true + } + ] + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Order the query result by `column`.\n\nYou can call this method multiple times to order by multiple columns.\n\nYou can order referenced tables, but it only affects the ordering of the\nparent table if you use `!inner` in the query.", + "examples": [ + { + "id": "with-select", + "name": "With `select()`", + "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select('id, name')\n .order('id', { ascending: false })\n```", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"id\": 3,\n \"name\": \"Han\"\n },\n {\n \"id\": 2,\n \"name\": \"Leia\"\n },\n {\n \"id\": 1,\n \"name\": \"Luke\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + }, + { + "id": "on-a-referenced-table", + "name": "On a referenced table", + "code": "```ts\n const { data, error } = await supabase\n .from('orchestral_sections')\n .select(`\n name,\n instruments (\n name\n )\n `)\n .order('name', { referencedTable: 'instruments', ascending: false })\n\n```", + "description": "Ordering with `referencedTable` doesn't affect the ordering of the\nparent table.", + "data": { + "sql": "```sql\ncreate table\n orchestral_sections (id int8 primary key, name text);\ncreate table\n instruments (\n id int8 primary key,\n section_id int8 not null references orchestral_sections,\n name text\n );\n\ninsert into\n orchestral_sections (id, name)\nvalues\n (1, 'strings'),\n (2, 'woodwinds');\ninsert into\n instruments (id, section_id, name)\nvalues\n (1, 1, 'harp'),\n (2, 1, 'violin');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"name\": \"strings\",\n \"instruments\": [\n {\n \"name\": \"violin\"\n },\n {\n \"name\": \"harp\"\n }\n ]\n },\n {\n \"name\": \"woodwinds\",\n \"instruments\": []\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + }, + { + "id": "order-parent-table-by-a-referenced-table", + "name": "Order parent table by a referenced table", + "code": "```ts\n const { data, error } = await supabase\n .from('instruments')\n .select(`\n name,\n section:orchestral_sections (\n name\n )\n `)\n .order('section(name)', { ascending: true })\n\n```", + "description": "Ordering with `referenced_table(col)` affects the ordering of the\nparent table.", + "data": { + "sql": "```sql\ncreate table\n orchestral_sections (id int8 primary key, name text);\ncreate table\n instruments (\n id int8 primary key,\n section_id int8 not null references orchestral_sections,\n name text\n );\n\ninsert into\n orchestral_sections (id, name)\nvalues\n (1, 'strings'),\n (2, 'woodwinds');\ninsert into\n instruments (id, section_id, name)\nvalues\n (1, 2, 'flute'),\n (2, 1, 'violin');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"name\": \"violin\",\n \"orchestral_sections\": {\"name\": \"strings\"}\n },\n {\n \"name\": \"flute\",\n \"orchestral_sections\": {\"name\": \"woodwinds\"}\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + } + ] + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "ascending", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "nullsFirst", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "referencedTable", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + } + ] + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + }, + { + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "ascending", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "foreignTable", + "type": { + "type": "intrinsic", + "name": "undefined" + }, + "isOptional": true + }, + { + "name": "nullsFirst", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + } + ] + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + }, + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "ascending", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "foreignTable", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "nullsFirst", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + } + ] + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + } + ] + }, + "@supabase/postgrest-js.PostgrestFilterBuilder.overlaps": { + "name": "@supabase/postgrest-js.PostgrestFilterBuilder.overlaps", + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + } + }, + { + "name": "value", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "string" + }, + { + "type": "array", + "elemType": { + "type": "nameOnly", + "name": "Row['ColumnName']" + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Only relevant for array and range columns. Match only rows where\n`column` and `value` have an element in common.", + "examples": [ + { + "id": "on-array-columns", + "name": "On array columns", + "code": "```ts\nconst { data, error } = await supabase\n .from('issues')\n .select('title')\n .overlaps('tags', ['is:closed', 'severity:high'])\n```", + "data": { + "sql": "```sql\ncreate table\n issues (\n id int8 primary key,\n title text,\n tags text[]\n );\n\ninsert into\n issues (id, title, tags)\nvalues\n (1, 'Cache invalidation is not working', array['is:open', 'severity:high', 'priority:low']),\n (2, 'Use better names', array['is:open', 'severity:low', 'priority:medium']);\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"title\": \"Cache invalidation is not working\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + }, + { + "id": "on-range-columns", + "name": "On range columns", + "code": "```ts\nconst { data, error } = await supabase\n .from('reservations')\n .select()\n .overlaps('during', '[2000-01-01 12:45, 2000-01-01 13:15)')\n```", + "description": "Postgres supports a number of [range\ntypes](https://www.postgresql.org/docs/current/rangetypes.html). You\ncan filter on range columns using the string representation of range\nvalues.", + "data": { + "sql": "```sql\ncreate table\n reservations (\n id int8 primary key,\n room_name text,\n during tsrange\n );\n\ninsert into\n reservations (id, room_name, during)\nvalues\n (1, 'Emerald', '[2000-01-01 13:00, 2000-01-01 15:00)'),\n (2, 'Topaz', '[2000-01-02 09:00, 2000-01-02 10:00)');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"room_name\": \"Emerald\",\n \"during\": \"[\\\"2000-01-01 13:00:00\\\",\\\"2000-01-01 15:00:00\\\")\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + } + ] + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "value", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "string" + }, + { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "unknown" + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + } + ] + }, + "@supabase/postgrest-js.PostgrestFilterBuilder.overrideTypes": { + "name": "@supabase/postgrest-js.PostgrestFilterBuilder.overrideTypes", + "params": [], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestBuilder" + } + }, + "comment": { + "shortText": "Override the type of the returned `data` field in the response.", + "examples": [ + { + "id": "example-1", + "name": "Example 1", + "code": "```typescript\n// Merge with existing types (default behavior)\nconst query = supabase\n .from('users')\n .select()\n .overrideTypes<{ custom_field: string }>()\n\n// Replace existing types completely\nconst replaceQuery = supabase\n .from('users')\n .select()\n .overrideTypes<{ id: number; name: string }, { merge: false }>()\n```" + }, + { + "id": "complete-override-type-of-successful-response", + "name": "Complete Override type of successful response", + "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .overrideTypes, { merge: false }>()\n```", + "response": "```ts\nlet x: typeof data // MyType[]\n```" + }, + { + "id": "complete-override-type-of-object-response", + "name": "Complete Override type of object response", + "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .maybeSingle()\n .overrideTypes()\n```", + "response": "```ts\nlet x: typeof data // MyType | null\n```" + }, + { + "id": "partial-override-type-of-successful-response", + "name": "Partial Override type of successful response", + "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .overrideTypes>()\n```", + "response": "```ts\nlet x: typeof data // Array\n```" + }, + { + "id": "partial-override-type-of-object-response", + "name": "Partial Override type of object response", + "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .maybeSingle()\n .overrideTypes<{ status: \"A\" | \"B\" }>()\n```", + "response": "```ts\nlet x: typeof data // CountryRowProperties & { status: \"A\" | \"B\" } | null\n```" + }, + { + "id": "merge-vs-replace-existing-types", + "name": "Merge vs replace existing types", + "code": "```typescript\n// Merge with existing types (default behavior)\nconst query = supabase\n .from('users')\n .select()\n .overrideTypes<{ custom_field: string }>()\n\n// Replace existing types completely\nconst replaceQuery = supabase\n .from('users')\n .select()\n .overrideTypes<{ id: number; name: string }, { merge: false }>()\n```" + } + ] + } + }, + "@supabase/postgrest-js.PostgrestFilterBuilder.range": { + "name": "@supabase/postgrest-js.PostgrestFilterBuilder.range", + "params": [ + { + "name": "from", + "type": { + "type": "intrinsic", + "name": "number" + }, + "comment": { + "shortText": "The starting index from which to limit the result" + } + }, + { + "name": "to", + "type": { + "type": "intrinsic", + "name": "number" + }, + "comment": { + "shortText": "The last index to which to limit the result" + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "foreignTable", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Deprecated, use `options.referencedTable`\ninstead" + } + }, + { + "name": "referencedTable", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Set this to limit rows of referenced\ntables instead of the parent table" + } + } + ] + }, + "comment": { + "shortText": "Named parameters" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Limit the query result by starting at an offset `from` and ending at the offset `to`.\nOnly records within this range are returned.\nThis respects the query order and if there is no order clause the range could behave unexpectedly.\nThe `from` and `to` values are 0-based and inclusive: `range(1, 3)` will include the second, third\nand fourth rows of the query.", + "examples": [ + { + "id": "with-select", + "name": "With `select()`", + "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select('name')\n .range(0, 1)\n```", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"name\": \"Luke\"\n },\n {\n \"name\": \"Leia\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + } + ] + } + }, + "@supabase/postgrest-js.PostgrestFilterBuilder.rangeAdjacent": { + "name": "@supabase/postgrest-js.PostgrestFilterBuilder.rangeAdjacent", + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + } + }, + { + "name": "range", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Only relevant for range columns. Match only rows where `column` is\nmutually exclusive to `range` and there can be no element between the two\nranges.", + "examples": [ + { + "id": "with-select", + "name": "With `select()`", + "code": "```ts\nconst { data, error } = await supabase\n .from('reservations')\n .select()\n .rangeAdjacent('during', '[2000-01-01 12:00, 2000-01-01 13:00)')\n```", + "description": "Postgres supports a number of [range\ntypes](https://www.postgresql.org/docs/current/rangetypes.html). You\ncan filter on range columns using the string representation of range\nvalues.", + "data": { + "sql": "```sql\ncreate table\n reservations (\n id int8 primary key,\n room_name text,\n during tsrange\n );\n\ninsert into\n reservations (id, room_name, during)\nvalues\n (1, 'Emerald', '[2000-01-01 13:00, 2000-01-01 15:00)'),\n (2, 'Topaz', '[2000-01-02 09:00, 2000-01-02 10:00)');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"room_name\": \"Emerald\",\n \"during\": \"[\\\"2000-01-01 13:00:00\\\",\\\"2000-01-01 15:00:00\\\")\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + } + ] + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "range", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + } + ] + }, + "@supabase/postgrest-js.PostgrestFilterBuilder.rangeGt": { + "name": "@supabase/postgrest-js.PostgrestFilterBuilder.rangeGt", + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + } + }, + { + "name": "range", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Only relevant for range columns. Match only rows where every element in\n`column` is greater than any element in `range`.", + "examples": [ + { + "id": "with-select", + "name": "With `select()`", + "code": "```ts\nconst { data, error } = await supabase\n .from('reservations')\n .select()\n .rangeGt('during', '[2000-01-02 08:00, 2000-01-02 09:00)')\n```", + "description": "Postgres supports a number of [range\ntypes](https://www.postgresql.org/docs/current/rangetypes.html). You\ncan filter on range columns using the string representation of range\nvalues.", + "data": { + "sql": "```sql\ncreate table\n reservations (\n id int8 primary key,\n room_name text,\n during tsrange\n );\n\ninsert into\n reservations (id, room_name, during)\nvalues\n (1, 'Emerald', '[2000-01-01 13:00, 2000-01-01 15:00)'),\n (2, 'Topaz', '[2000-01-02 09:00, 2000-01-02 10:00)');\n```" + }, + "response": "```json\n {\n \"data\": [\n {\n \"id\": 2,\n \"room_name\": \"Topaz\",\n \"during\": \"[\\\"2000-01-02 09:00:00\\\",\\\"2000-01-02 10:00:00\\\")\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n }\n\n```" + } + ] + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "range", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + } + ] + }, + "@supabase/postgrest-js.PostgrestFilterBuilder.rangeGte": { + "name": "@supabase/postgrest-js.PostgrestFilterBuilder.rangeGte", + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + } + }, + { + "name": "range", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Only relevant for range columns. Match only rows where every element in\n`column` is either contained in `range` or greater than any element in\n`range`.", + "examples": [ + { + "id": "with-select", + "name": "With `select()`", + "code": "```ts\nconst { data, error } = await supabase\n .from('reservations')\n .select()\n .rangeGte('during', '[2000-01-02 08:30, 2000-01-02 09:30)')\n```", + "description": "Postgres supports a number of [range\ntypes](https://www.postgresql.org/docs/current/rangetypes.html). You\ncan filter on range columns using the string representation of range\nvalues.", + "data": { + "sql": "```sql\ncreate table\n reservations (\n id int8 primary key,\n room_name text,\n during tsrange\n );\n\ninsert into\n reservations (id, room_name, during)\nvalues\n (1, 'Emerald', '[2000-01-01 13:00, 2000-01-01 15:00)'),\n (2, 'Topaz', '[2000-01-02 09:00, 2000-01-02 10:00)');\n```" + }, + "response": "```json\n {\n \"data\": [\n {\n \"id\": 2,\n \"room_name\": \"Topaz\",\n \"during\": \"[\\\"2000-01-02 09:00:00\\\",\\\"2000-01-02 10:00:00\\\")\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n }\n\n```" + } + ] + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "range", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + } + ] + }, + "@supabase/postgrest-js.PostgrestFilterBuilder.rangeLt": { + "name": "@supabase/postgrest-js.PostgrestFilterBuilder.rangeLt", + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + } + }, + { + "name": "range", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Only relevant for range columns. Match only rows where every element in\n`column` is less than any element in `range`.", + "examples": [ + { + "id": "with-select", + "name": "With `select()`", + "code": "```ts\nconst { data, error } = await supabase\n .from('reservations')\n .select()\n .rangeLt('during', '[2000-01-01 15:00, 2000-01-01 16:00)')\n```", + "description": "Postgres supports a number of [range\ntypes](https://www.postgresql.org/docs/current/rangetypes.html). You\ncan filter on range columns using the string representation of range\nvalues.", + "data": { + "sql": "```sql\ncreate table\n reservations (\n id int8 primary key,\n room_name text,\n during tsrange\n );\n\ninsert into\n reservations (id, room_name, during)\nvalues\n (1, 'Emerald', '[2000-01-01 13:00, 2000-01-01 15:00)'),\n (2, 'Topaz', '[2000-01-02 09:00, 2000-01-02 10:00)');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"room_name\": \"Emerald\",\n \"during\": \"[\\\"2000-01-01 13:00:00\\\",\\\"2000-01-01 15:00:00\\\")\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + } + ] + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "range", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + } + ] + }, + "@supabase/postgrest-js.PostgrestFilterBuilder.rangeLte": { + "name": "@supabase/postgrest-js.PostgrestFilterBuilder.rangeLte", + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + } + }, + { + "name": "range", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Only relevant for range columns. Match only rows where every element in\n`column` is either contained in `range` or less than any element in\n`range`.", + "examples": [ + { + "id": "with-select", + "name": "With `select()`", + "code": "```ts\nconst { data, error } = await supabase\n .from('reservations')\n .select()\n .rangeLte('during', '[2000-01-01 14:00, 2000-01-01 16:00)')\n```", + "description": "Postgres supports a number of [range\ntypes](https://www.postgresql.org/docs/current/rangetypes.html). You\ncan filter on range columns using the string representation of range\nvalues.", + "data": { + "sql": "```sql\ncreate table\n reservations (\n id int8 primary key,\n room_name text,\n during tsrange\n );\n\ninsert into\n reservations (id, room_name, during)\nvalues\n (1, 'Emerald', '[2000-01-01 13:00, 2000-01-01 15:00)'),\n (2, 'Topaz', '[2000-01-02 09:00, 2000-01-02 10:00)');\n```" + }, + "response": "```json\n {\n \"data\": [\n {\n \"id\": 1,\n \"room_name\": \"Emerald\",\n \"during\": \"[\\\"2000-01-01 13:00:00\\\",\\\"2000-01-01 15:00:00\\\")\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n }\n\n```" + } + ] + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "range", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + } + ] + }, + "@supabase/postgrest-js.PostgrestFilterBuilder.regexIMatch": { + "name": "@supabase/postgrest-js.PostgrestFilterBuilder.regexIMatch", + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + } + }, + { + "name": "pattern", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Match only rows where `column` matches the PostgreSQL regex `pattern`\ncase-insensitively (using the `~*` operator)." + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "pattern", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + } + ] + }, + "@supabase/postgrest-js.PostgrestFilterBuilder.regexMatch": { + "name": "@supabase/postgrest-js.PostgrestFilterBuilder.regexMatch", + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + } + }, + { + "name": "pattern", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Match only rows where `column` matches the PostgreSQL regex `pattern`\ncase-sensitively (using the `~` operator)." + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "pattern", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + } + ] + }, + "@supabase/postgrest-js.PostgrestFilterBuilder.retry": { + "name": "@supabase/postgrest-js.PostgrestFilterBuilder.retry", + "params": [ + { + "name": "enabled", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "comment": { + "shortText": "Whether to enable retries for this request" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "", + "examples": [ + { + "id": "example-1", + "name": "Example 1", + "code": "```ts\n// Disable retries for a specific query\nconst { data, error } = await supabase\n .from('users')\n .select()\n .retry(false)\n```" + } + ] + } + }, + "@supabase/postgrest-js.PostgrestFilterBuilder.returns": { + "name": "@supabase/postgrest-js.PostgrestFilterBuilder.returns", + "params": [], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestTransformBuilder" + } + }, + "comment": { + "shortText": "Override the type of the returned `data`.", + "text": "- Deprecated: use overrideTypes method instead", + "examples": [ + { + "id": "override-type-of-successful-response", + "name": "Override type of successful response", + "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .returns>()\n```", + "response": "```js\nlet x: typeof data // MyType[]\n```" + }, + { + "id": "override-type-of-object-response", + "name": "Override type of object response", + "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .maybeSingle()\n .returns()\n```", + "response": "```js\nlet x: typeof data // MyType | null\n```" + } + ] + } + }, + "@supabase/postgrest-js.PostgrestFilterBuilder.rollback": { + "name": "@supabase/postgrest-js.PostgrestFilterBuilder.rollback", + "params": [], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Dry-run this request: execute the query but discard the changes.\n\nServer-side, PostgREST runs the query inside a transaction and rolls it back\ninstead of committing. The response still contains the data that *would* have\nbeen returned — `RETURNING` clauses execute and RLS, triggers, and constraints\nare all evaluated — but no row is actually inserted, updated, or deleted.\n\nThis affects only the single request it is chained to. The JS caller has no\nhandle on the transaction: supabase-js does not group multiple queries into\none transaction. For multi-statement transactional logic, use a database\nfunction (`supabase.rpc(...)`).\n\nSets the `Prefer: tx=rollback` header. See PostgREST's docs on transaction\npreferences for the underlying mechanism.", + "examples": [ + { + "id": "validate-an-insert-without-persisting", + "name": "Validate an insert without persisting", + "code": "```ts\nconst { data, error } = await supabase\n .from('countries')\n .insert({ name: 'France' })\n .select()\n .rollback()\n// `data` shows what would have been inserted; nothing is saved.\n```" + } + ] + } + }, + "@supabase/postgrest-js.PostgrestFilterBuilder.select": { + "name": "@supabase/postgrest-js.PostgrestFilterBuilder.select", + "params": [ + { + "name": "columns", + "type": { + "type": "nameOnly", + "name": "Query" + }, + "isOptional": true, + "comment": { + "shortText": "The columns to retrieve, separated by commas" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestFilterBuilder" + } + }, + "comment": { + "shortText": "Perform a SELECT on the query result.\n\nBy default, `.insert()`, `.update()`, `.upsert()`, and `.delete()` do not\nreturn modified rows. By calling this method, modified rows are returned in\n`data`.", + "examples": [ + { + "id": "with-upsert", + "name": "With `upsert()`", + "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .upsert({ id: 1, name: 'Han Solo' })\n .select()\n```", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Han');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"Han Solo\"\n }\n ],\n \"status\": 201,\n \"statusText\": \"Created\"\n}\n```" + } + ] + } + }, + "@supabase/postgrest-js.PostgrestFilterBuilder.setHeader": { + "name": "@supabase/postgrest-js.PostgrestFilterBuilder.setHeader", + "params": [ + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "HTTP header name" + } + }, + { + "name": "value", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "HTTP header value" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Set an HTTP header on this single PostgREST request, overriding any header\nwith the same name set on the client.\n\nThis is an advanced escape hatch for one-off needs (passing a custom\n`Authorization` for a single query, attaching a tracing header, etc.).\nMost callers do not need it: configure client-wide headers via the\n`headers` option when constructing the client, and authentication via\nSupabase Auth." + } + }, + "@supabase/postgrest-js.PostgrestFilterBuilder.single": { + "name": "@supabase/postgrest-js.PostgrestFilterBuilder.single", + "params": [], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestBuilder" + } + }, + "comment": { + "shortText": "Return `data` as a single object instead of an array of objects.\n\nQuery result must be one row (e.g. using `.limit(1)`), otherwise this\nreturns an error.", + "examples": [ + { + "id": "with-select", + "name": "With `select()`", + "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select('name')\n .limit(1)\n .single()\n```", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" + }, + "response": "```json\n{\n \"data\": {\n \"name\": \"Luke\"\n },\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + } + ] + } + }, + "@supabase/postgrest-js.PostgrestFilterBuilder.stripNulls": { + "name": "@supabase/postgrest-js.PostgrestFilterBuilder.stripNulls", + "params": [], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Strip null values from the response data. Properties with `null` values\nwill be omitted from the returned JSON objects.\n\nRequires PostgREST 11.2.0+.\n\nhttps://docs.postgrest.org/en/stable/references/api/resource_representation.html#stripped-nulls", + "examples": [ + { + "id": "with-select", + "name": "With `select()`", + "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .stripNulls()\n```", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text, bio text);\n\ninsert into\n characters (id, name, bio)\nvalues\n (1, 'Luke', null),\n (2, 'Leia', 'Princess of Alderaan');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"Luke\"\n },\n {\n \"id\": 2,\n \"name\": \"Leia\",\n \"bio\": \"Princess of Alderaan\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + } + ] + } + }, + "@supabase/postgrest-js.PostgrestFilterBuilder.textSearch": { + "name": "@supabase/postgrest-js.PostgrestFilterBuilder.textSearch", + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + } + }, + { + "name": "query", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "config", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "type", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "plain" + }, + { + "type": "literal", + "value": "phrase" + }, + { + "type": "literal", + "value": "websearch" + } + ] + }, + "isOptional": true + } + ] + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Only relevant for text and tsvector columns. Match only rows where\n`column` matches the query string in `query`.", + "text": "- For more information, see [Postgres full text search](/docs/guides/database/full-text-search).", + "examples": [ + { + "id": "text-search", + "name": "Text search", + "code": "```ts\nconst result = await supabase\n .from(\"texts\")\n .select(\"content\")\n .textSearch(\"content\", `'eggs' & 'ham'`, {\n config: \"english\",\n });\n```", + "data": { + "sql": "```sql\ncreate table texts (\n id bigint\n primary key\n generated always as identity,\n content text\n);\n\ninsert into texts (content) values\n ('Four score and seven years ago'),\n ('The road goes ever on and on'),\n ('Green eggs and ham')\n;\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"content\": \"Green eggs and ham\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + }, + { + "id": "basic-normalization", + "name": "Basic normalization", + "code": "```ts\nconst { data, error } = await supabase\n .from('quotes')\n .select('catchphrase')\n .textSearch('catchphrase', `'fat' & 'cat'`, {\n type: 'plain',\n config: 'english'\n })\n```", + "description": "Uses PostgreSQL's `plainto_tsquery` function." + }, + { + "id": "full-normalization", + "name": "Full normalization", + "code": "```ts\nconst { data, error } = await supabase\n .from('quotes')\n .select('catchphrase')\n .textSearch('catchphrase', `'fat' & 'cat'`, {\n type: 'phrase',\n config: 'english'\n })\n```", + "description": "Uses PostgreSQL's `phraseto_tsquery` function." + }, + { + "id": "websearch", + "name": "Websearch", + "code": "```ts\nconst { data, error } = await supabase\n .from('quotes')\n .select('catchphrase')\n .textSearch('catchphrase', `'fat or cat'`, {\n type: 'websearch',\n config: 'english'\n })\n```", + "description": "Uses PostgreSQL's `websearch_to_tsquery` function.\nThis function will never raise syntax errors, which makes it possible to use raw user-supplied input for search, and can be used\nwith advanced operators.\n\n- `unquoted text`: text not inside quote marks will be converted to terms separated by & operators, as if processed by plainto_tsquery.\n- `\"quoted text\"`: text inside quote marks will be converted to terms separated by `<->` operators, as if processed by phraseto_tsquery.\n- `OR`: the word “or” will be converted to the | operator.\n- `-`: a dash will be converted to the ! operator." + } + ] + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "query", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "config", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "type", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "plain" + }, + { + "type": "literal", + "value": "phrase" + }, + { + "type": "literal", + "value": "websearch" + } + ] + }, + "isOptional": true + } + ] + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + } + ] + }, + "@supabase/postgrest-js.PostgrestFilterBuilder.then": { + "name": "@supabase/postgrest-js.PostgrestFilterBuilder.then", + "params": [ + { + "name": "onfulfilled", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "function", + "params": [ + { + "name": "value" + } + ], + "ret": { + "type": { + "type": "union", + "subTypes": [ + { + "type": "nameOnly", + "name": "TResult1" + }, + { + "type": "nameOnly", + "name": "PromiseLike" + } + ] + } + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "The callback to execute when the Promise is resolved." + } + }, + { + "name": "onrejected", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "function", + "params": [ + { + "name": "reason", + "type": { + "type": "intrinsic", + "name": "any" + } + } + ], + "ret": { + "type": { + "type": "union", + "subTypes": [ + { + "type": "nameOnly", + "name": "TResult2" + }, + { + "type": "nameOnly", + "name": "PromiseLike" + } + ] + } + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "The callback to execute when the Promise is rejected." + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "PromiseLike" + } + }, + "comment": { + "shortText": "Attaches callbacks for the resolution and/or rejection of the Promise." + } + }, + "@supabase/postgrest-js.PostgrestFilterBuilder.throwOnError": { + "name": "@supabase/postgrest-js.PostgrestFilterBuilder.throwOnError", + "params": [], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestFilterBuilder" + } + }, + "comment": { + "shortText": "If there's an error with the query, throwOnError will reject the promise by\nthrowing the error instead of returning it as part of a successful response.\n\nhttps://github.com/supabase/supabase-js/issues/92" + } + }, + "@supabase/postgrest-js.PostgrestQueryBuilder.constructor": { + "name": "@supabase/postgrest-js.PostgrestQueryBuilder.constructor", + "params": [ + { + "name": "url", + "type": { + "type": "nameOnly", + "name": "URL" + }, + "comment": { + "shortText": "The URL for the query" + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "fetch", + "type": { + "type": "function", + "params": [ + { + "name": "input", + "type": { + "type": "union", + "subTypes": [ + { + "type": "nameOnly", + "name": "URL" + }, + { + "type": "nameOnly", + "name": "RequestInfo" + } + ] + } + }, + { + "name": "init", + "type": { + "type": "nameOnly", + "name": "RequestInit" + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "nameOnly", + "name": "Response" + } + } + }, + "comment": { + "shortText": "[MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch)" + } + }, + "isOptional": true, + "comment": { + "shortText": "Custom fetch implementation" + } + }, + { + "name": "headers", + "type": { + "type": "nameOnly", + "name": "HeadersInit" + }, + "isOptional": true, + "comment": { + "shortText": "Custom headers" + } + }, + { + "name": "retry", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "Enable automatic retries for transient errors (default: true)" + } + }, + { + "name": "schema", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Postgres schema to use" + } + }, + { + "name": "urlLengthLimit", + "type": { + "type": "intrinsic", + "name": "number" + }, + "isOptional": true, + "comment": { + "shortText": "Maximum URL length before warning" + } + } + ] + }, + "comment": { + "shortText": "Named parameters" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestQueryBuilder" + } + }, + "comment": { + "shortText": "Creates a query builder scoped to a Postgres table or view.", + "examples": [ + { + "id": "using-supabase-js-recommended", + "name": "Using supabase-js (recommended)", + "code": "```ts\nimport { createClient } from '@supabase/supabase-js'\n\nconst supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key')\nconst { data, error } = await supabase.from('users').select('*')\n```" + }, + { + "id": "standalone-import-for-bundle-sensitive-environments", + "name": "Standalone import for bundle-sensitive environments", + "code": "```ts\nimport { PostgrestQueryBuilder } from '@supabase/postgrest-js'\n\nconst query = new PostgrestQueryBuilder(\n new URL('https://xyzcompany.supabase.co/rest/v1/users'),\n { headers: { apikey: 'your-publishable-key' }, retry: true }\n)\n```" + } + ] + } + }, + "@supabase/postgrest-js.PostgrestQueryBuilder.delete": { + "name": "@supabase/postgrest-js.PostgrestQueryBuilder.delete", + "params": [ + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "count", + "type": { + "type": "union", + "subTypes": [ + null, + { + "type": "literal", + "value": "exact" + }, + { + "type": "literal", + "value": "planned" + }, + { + "type": "literal", + "value": "estimated" + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Count algorithm to use to count deleted rows.\n\n`\"exact\"`: Exact but slow count algorithm. Performs a `COUNT(*)` under the\nhood.\n\n`\"planned\"`: Approximated but fast count algorithm. Uses the Postgres\nstatistics under the hood.\n\n`\"estimated\"`: Uses exact count for low numbers and planned count for high\nnumbers." + } + } + ] + }, + "comment": { + "shortText": "Named parameters" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestFilterBuilder" + } + }, + "comment": { + "shortText": "Perform a DELETE on the table or view.\n\nBy default, deleted rows are not returned. To return it, chain the call\nwith `.select()` after filters.", + "text": "- `delete()` should always be combined with [filters](/docs/reference/javascript/using-filters) to target the item(s) you wish to delete.\n- If you use `delete()` with filters and you have\n [RLS](/docs/learn/auth-deep-dive/auth-row-level-security) enabled, only\n rows visible through `SELECT` policies are deleted. Note that by default\n no rows are visible, so you need at least one `SELECT`/`ALL` policy that\n makes the rows visible.\n- When using `delete().in()`, specify an array of values to target multiple rows with a single query. This is particularly useful for batch deleting entries that share common criteria, such as deleting users by their IDs. Ensure that the array you provide accurately represents all records you intend to delete to avoid unintended data removal.", + "examples": [ + { + "id": "delete-a-single-record", + "name": "Delete a single record", + "code": "```ts\nconst response = await supabase\n .from('countries')\n .delete()\n .eq('id', 1)\n```", + "data": { + "sql": "```sql\ncreate table\n countries (id int8 primary key, name text);\n\ninsert into\n countries (id, name)\nvalues\n (1, 'Mordor');\n```" + }, + "response": "```json\n{\n \"status\": 204,\n \"statusText\": \"No Content\"\n}\n```" + }, + { + "id": "handling-errors", + "name": "Handling errors", + "code": "```js\nconst { error } = await supabase.from('countries').delete().eq('id', 1)\nif (error) console.error(error)\n```", + "description": "`error.hint` from Postgres often contains the actionable fix (e.g. `\"Grant the required privileges to the current role with: GRANT DELETE ON public.countries TO anon;\"` for a `42501` permission-denied error). Log the full `error` object so it isn't hidden behind `error.message`." + }, + { + "id": "delete-a-record-and-return-it", + "name": "Delete a record and return it", + "code": "```ts\nconst { data, error } = await supabase\n .from('countries')\n .delete()\n .eq('id', 1)\n .select()\n```", + "data": { + "sql": "```sql\ncreate table\n countries (id int8 primary key, name text);\n\ninsert into\n countries (id, name)\nvalues\n (1, 'Mordor');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"Mordor\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + }, + { + "id": "delete-multiple-records", + "name": "Delete multiple records", + "code": "```ts\nconst response = await supabase\n .from('countries')\n .delete()\n .in('id', [1, 2, 3])\n```", + "data": { + "sql": "```sql\ncreate table\n countries (id int8 primary key, name text);\n\ninsert into\n countries (id, name)\nvalues\n (1, 'Rohan'), (2, 'The Shire'), (3, 'Mordor');\n```" + }, + "response": "```json\n{\n \"status\": 204,\n \"statusText\": \"No Content\"\n}\n```" + } + ] + } + }, + "@supabase/postgrest-js.PostgrestQueryBuilder.insert": { + "name": "@supabase/postgrest-js.PostgrestQueryBuilder.insert", + "params": [ + { + "name": "values", + "type": { + "type": "union", + "subTypes": [ + { + "type": "nameOnly", + "name": "RejectExcessProperties" + }, + { + "type": "array", + "elemType": { + "type": "nameOnly", + "name": "RejectExcessProperties" + } + } + ] + }, + "comment": { + "shortText": "The values to insert. Pass an object to insert a single row\nor an array to insert multiple rows." + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "count", + "type": { + "type": "union", + "subTypes": [ + null, + { + "type": "literal", + "value": "exact" + }, + { + "type": "literal", + "value": "planned" + }, + { + "type": "literal", + "value": "estimated" + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Count algorithm to use to count inserted rows.\n\n`\"exact\"`: Exact but slow count algorithm. Performs a `COUNT(*)` under the\nhood.\n\n`\"planned\"`: Approximated but fast count algorithm. Uses the Postgres\nstatistics under the hood.\n\n`\"estimated\"`: Uses exact count for low numbers and planned count for high\nnumbers." + } + }, + { + "name": "defaultToNull", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "Make missing fields default to `null`.\nOtherwise, use the default value for the column. Only applies for bulk\ninserts." + } + } + ] + }, + "comment": { + "shortText": "Named parameters" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestFilterBuilder" + } + }, + "comment": { + "shortText": "Perform an INSERT into the table or view.\n\nBy default, inserted rows are not returned. To return it, chain the call\nwith `.select()`.", + "examples": [ + { + "id": "create-a-record", + "name": "Create a record", + "code": "```ts\nconst { error } = await supabase\n .from('countries')\n .insert({ id: 1, name: 'Mordor' })\n```", + "data": { + "sql": "```sql\ncreate table\n countries (id int8 primary key, name text);\n```" + }, + "response": "```json\n{\n \"status\": 201,\n \"statusText\": \"Created\"\n}\n```" + }, + { + "id": "handling-errors", + "name": "Handling errors", + "code": "```js\nconst { error } = await supabase.from('countries').insert({ id: 1, name: 'Mordor' })\nif (error) console.error(error)\n```", + "description": "`error.hint` from Postgres often contains the actionable fix (e.g. `\"Grant the required privileges to the current role with: GRANT INSERT ON public.countries TO anon;\"` for a `42501` permission-denied error). Log the full `error` object so it isn't hidden behind `error.message`." + }, + { + "id": "create-a-record-and-return-it", + "name": "Create a record and return it", + "code": "```ts\nconst { data, error } = await supabase\n .from('countries')\n .insert({ id: 1, name: 'Mordor' })\n .select()\n```", + "data": { + "sql": "```sql\ncreate table\n countries (id int8 primary key, name text);\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"Mordor\"\n }\n ],\n \"status\": 201,\n \"statusText\": \"Created\"\n}\n```" + }, + { + "id": "bulk-create", + "name": "Bulk create", + "code": "```ts\nconst { error } = await supabase\n .from('countries')\n .insert([\n { id: 1, name: 'Mordor' },\n { id: 1, name: 'The Shire' },\n ])\n```", + "description": "A bulk create operation is handled in a single transaction.\nIf any of the inserts fail, none of the rows are inserted.", + "data": { + "sql": "```sql\ncreate table\n countries (id int8 primary key, name text);\n```" + }, + "response": "```json\n{\n \"error\": {\n \"code\": \"23505\",\n \"details\": \"Key (id)=(1) already exists.\",\n \"hint\": null,\n \"message\": \"duplicate key value violates unique constraint \\\"countries_pkey\\\"\"\n },\n \"status\": 409,\n \"statusText\": \"Conflict\"\n}\n```" + } + ] + } + }, + "@supabase/postgrest-js.PostgrestQueryBuilder.select": { + "name": "@supabase/postgrest-js.PostgrestQueryBuilder.select", + "params": [ + { + "name": "columns", + "type": { + "type": "nameOnly", + "name": "Query" + }, + "isOptional": true, + "comment": { + "shortText": "The columns to retrieve, separated by commas. Columns can be renamed when returned with `customName:columnName`" + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "count", + "type": { + "type": "union", + "subTypes": [ + null, + { + "type": "literal", + "value": "exact" + }, + { + "type": "literal", + "value": "planned" + }, + { + "type": "literal", + "value": "estimated" + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Count algorithm to use to count rows in the table or view.\n\n`\"exact\"`: Exact but slow count algorithm. Performs a `COUNT(*)` under the\nhood.\n\n`\"planned\"`: Approximated but fast count algorithm. Uses the Postgres\nstatistics under the hood.\n\n`\"estimated\"`: Uses exact count for low numbers and planned count for high\nnumbers." + } + }, + { + "name": "head", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "When set to `true`, `data` will not be returned.\nUseful if you only need the count." + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Named parameters" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestFilterBuilder" + } + }, + "comment": { + "shortText": "Perform a SELECT query on the table or view.", + "text": "When using `count` with `.range()` or `.limit()`, the returned `count` is the total number of rows\nthat match your filters, not the number of rows in the current page. Use this to build pagination UI.\n\n- By default, Supabase projects return a maximum of 1,000 rows. This setting can be changed in your project's [API settings](/dashboard/project/_/settings/api). It's recommended that you keep it low to limit the payload size of accidental or malicious requests. You can use `range()` queries to paginate through your data.\n- `select()` can be combined with [Filters](/docs/reference/javascript/using-filters)\n- `select()` can be combined with [Modifiers](/docs/reference/javascript/using-modifiers)\n- `apikey` is a reserved keyword if you're using the [Supabase Platform](/docs/guides/platform) and [should be avoided as a column name](https://github.com/supabase/supabase/issues/5465). *", + "examples": [ + { + "id": "getting-your-data", + "name": "Getting your data", + "code": "```js\nconst { data, error } = await supabase\n .from('characters')\n .select()\n```", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Harry'),\n (2, 'Frodo'),\n (3, 'Katniss');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"Harry\"\n },\n {\n \"id\": 2,\n \"name\": \"Frodo\"\n },\n {\n \"id\": 3,\n \"name\": \"Katniss\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + }, + { + "id": "handling-errors", + "name": "Handling errors", + "code": "```js\nconst { data, error } = await supabase.from('characters').select()\nif (error) {\n // Logs the full error: message, code, details, and hint.\n console.error(error)\n return\n}\n```", + "description": "The most useful field on a Postgres error is usually `hint` — when the database knows the fix, it puts the literal SQL there. For example, a permission-denied error (`code: '42501'`) arrives with a `hint` like `\"Grant the required privileges to the current role with: GRANT SELECT ON public.characters TO anon;\"`. Log the full `error` object so the hint isn't hidden behind `error.message`.", + "response": "```json\n{\n \"error\": {\n \"code\": \"42501\",\n \"details\": null,\n \"hint\": \"Grant the required privileges to the current role with: GRANT SELECT ON public.characters TO anon;\",\n \"message\": \"permission denied for table characters\"\n },\n \"status\": 401,\n \"statusText\": \"Unauthorized\"\n}\n```" + }, + { + "id": "selecting-specific-columns", + "name": "Selecting specific columns", + "code": "```js\nconst { data, error } = await supabase\n .from('characters')\n .select('name')\n```", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Frodo'),\n (2, 'Harry'),\n (3, 'Katniss');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"name\": \"Frodo\"\n },\n {\n \"name\": \"Harry\"\n },\n {\n \"name\": \"Katniss\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + }, + { + "id": "query-referenced-tables", + "name": "Query referenced tables", + "code": "```js\nconst { data, error } = await supabase\n .from('orchestral_sections')\n .select(`\n name,\n instruments (\n name\n )\n `)\n```", + "description": "If your database has foreign key relationships, you can query related tables too.", + "data": { + "sql": "```sql\ncreate table\n orchestral_sections (id int8 primary key, name text);\ncreate table\n instruments (\n id int8 primary key,\n section_id int8 not null references orchestral_sections,\n name text\n );\n\ninsert into\n orchestral_sections (id, name)\nvalues\n (1, 'strings'),\n (2, 'woodwinds');\ninsert into\n instruments (id, section_id, name)\nvalues\n (1, 2, 'flute'),\n (2, 1, 'violin');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"name\": \"strings\",\n \"instruments\": [\n {\n \"name\": \"violin\"\n }\n ]\n },\n {\n \"name\": \"woodwinds\",\n \"instruments\": [\n {\n \"name\": \"flute\"\n }\n ]\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + }, + { + "id": "query-referenced-tables-with-spaces-in-their-names", + "name": "Query referenced tables with spaces in their names", + "code": "```js\nconst { data, error } = await supabase\n .from('orchestral sections')\n .select(`\n name,\n \"musical instruments\" (\n name\n )\n `)\n```", + "description": "If your table name contains spaces, you must use double quotes in the `select` statement to reference the table.", + "data": { + "sql": "```sql\ncreate table\n \"orchestral sections\" (id int8 primary key, name text);\ncreate table\n \"musical instruments\" (\n id int8 primary key,\n section_id int8 not null references \"orchestral sections\",\n name text\n );\n\ninsert into\n \"orchestral sections\" (id, name)\nvalues\n (1, 'strings'),\n (2, 'woodwinds');\ninsert into\n \"musical instruments\" (id, section_id, name)\nvalues\n (1, 2, 'flute'),\n (2, 1, 'violin');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"name\": \"strings\",\n \"musical instruments\": [\n {\n \"name\": \"violin\"\n }\n ]\n },\n {\n \"name\": \"woodwinds\",\n \"musical instruments\": [\n {\n \"name\": \"flute\"\n }\n ]\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + }, + { + "id": "query-referenced-tables-through-a-join-table", + "name": "Query referenced tables through a join table", + "code": "```ts\nconst { data, error } = await supabase\n .from('users')\n .select(`\n name,\n teams (\n name\n )\n `)\n \n```", + "description": "If you're in a situation where your tables are **NOT** directly\nrelated, but instead are joined by a _join table_, you can still use\nthe `select()` method to query the related data. The join table needs\nto have the foreign keys as part of its composite primary key.", + "data": { + "sql": "```sql\ncreate table\n users (\n id int8 primary key,\n name text\n );\ncreate table\n teams (\n id int8 primary key,\n name text\n );\n-- join table\ncreate table\n users_teams (\n user_id int8 not null references users,\n team_id int8 not null references teams,\n -- both foreign keys must be part of a composite primary key\n primary key (user_id, team_id)\n );\n\ninsert into\n users (id, name)\nvalues\n (1, 'Kiran'),\n (2, 'Evan');\ninsert into\n teams (id, name)\nvalues\n (1, 'Green'),\n (2, 'Blue');\ninsert into\n users_teams (user_id, team_id)\nvalues\n (1, 1),\n (1, 2),\n (2, 2);\n```" + }, + "response": "```json\n {\n \"data\": [\n {\n \"name\": \"Kiran\",\n \"teams\": [\n {\n \"name\": \"Green\"\n },\n {\n \"name\": \"Blue\"\n }\n ]\n },\n {\n \"name\": \"Evan\",\n \"teams\": [\n {\n \"name\": \"Blue\"\n }\n ]\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n }\n \n```" + }, + { + "id": "query-the-same-referenced-table-multiple-times", + "name": "Query the same referenced table multiple times", + "code": "```ts\nconst { data, error } = await supabase\n .from('messages')\n .select(`\n content,\n from:sender_id(name),\n to:receiver_id(name)\n `)\n\n// To infer types, use the name of the table (in this case `users`) and\n// the name of the foreign key constraint.\nconst { data, error } = await supabase\n .from('messages')\n .select(`\n content,\n from:users!messages_sender_id_fkey(name),\n to:users!messages_receiver_id_fkey(name)\n `)\n```", + "description": "If you need to query the same referenced table twice, use the name of the\njoined column to identify which join to use. You can also give each\ncolumn an alias.", + "data": { + "sql": "```sql\n create table\n users (id int8 primary key, name text);\n\n create table\n messages (\n sender_id int8 not null references users,\n receiver_id int8 not null references users,\n content text\n );\n\n insert into\n users (id, name)\n values\n (1, 'Kiran'),\n (2, 'Evan');\n\n insert into\n messages (sender_id, receiver_id, content)\n values\n (1, 2, '👋');\n ```\n```\n\n@exampleResponse Query the same referenced table multiple times\n```json\n{\n \"data\": [\n {\n \"content\": \"👋\",\n \"from\": {\n \"name\": \"Kiran\"\n },\n \"to\": {\n \"name\": \"Evan\"\n }\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```\n\n@exampleDescription Query nested foreign tables through a join table\nYou can use the result of a joined table to gather data in\nanother foreign table. With multiple references to the same foreign\ntable you must specify the column on which to conduct the join.\n\n@example Query nested foreign tables through a join table\n```ts\n const { data, error } = await supabase\n .from('games')\n .select(`\n game_id:id,\n away_team:teams!games_away_team_fkey (\n users (\n id,\n name\n )\n )\n `)\n \n```\n\n@exampleSql Query nested foreign tables through a join table\n```sql\n```sql\ncreate table\n users (\n id int8 primary key,\n name text\n );\ncreate table\n teams (\n id int8 primary key,\n name text\n );\n-- join table\ncreate table\n users_teams (\n user_id int8 not null references users,\n team_id int8 not null references teams,\n\n primary key (user_id, team_id)\n );\ncreate table\n games (\n id int8 primary key,\n home_team int8 not null references teams,\n away_team int8 not null references teams,\n name text\n );\n\ninsert into users (id, name)\nvalues\n (1, 'Kiran'),\n (2, 'Evan');\ninsert into\n teams (id, name)\nvalues\n (1, 'Green'),\n (2, 'Blue');\ninsert into\n users_teams (user_id, team_id)\nvalues\n (1, 1),\n (1, 2),\n (2, 2);\ninsert into\n games (id, home_team, away_team, name)\nvalues\n (1, 1, 2, 'Green vs Blue'),\n (2, 2, 1, 'Blue vs Green');\n```" + } + }, + { + "id": "filtering-through-referenced-tables", + "name": "Filtering through referenced tables", + "code": "```ts\nconst { data, error } = await supabase\n .from('instruments')\n .select('name, orchestral_sections(*)')\n .eq('orchestral_sections.name', 'percussion')\n```", + "description": "If the filter on a referenced table's column is not satisfied, the referenced\ntable returns `[]` or `null` but the parent table is not filtered out.\nIf you want to filter out the parent table rows, use the `!inner` hint", + "data": { + "sql": "```sql\ncreate table\n orchestral_sections (id int8 primary key, name text);\ncreate table\n instruments (\n id int8 primary key,\n section_id int8 not null references orchestral_sections,\n name text\n );\n\ninsert into\n orchestral_sections (id, name)\nvalues\n (1, 'strings'),\n (2, 'woodwinds');\ninsert into\n instruments (id, section_id, name)\nvalues\n (1, 2, 'flute'),\n (2, 1, 'violin');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"name\": \"flute\",\n \"orchestral_sections\": null\n },\n {\n \"name\": \"violin\",\n \"orchestral_sections\": null\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + }, + { + "id": "querying-referenced-table-with-count", + "name": "Querying referenced table with count", + "code": "```ts\nconst { data, error } = await supabase\n .from('orchestral_sections')\n .select(`*, instruments(count)`)\n```", + "description": "You can get the number of rows in a related table by using the\n**count** property.", + "data": { + "sql": "```sql\ncreate table orchestral_sections (\n \"id\" \"uuid\" primary key default \"extensions\".\"uuid_generate_v4\"() not null,\n \"name\" text\n);\n\ncreate table characters (\n \"id\" \"uuid\" primary key default \"extensions\".\"uuid_generate_v4\"() not null,\n \"name\" text,\n \"section_id\" \"uuid\" references public.orchestral_sections on delete cascade\n);\n\nwith section as (\n insert into orchestral_sections (name)\n values ('strings') returning id\n)\ninsert into instruments (name, section_id) values\n('violin', (select id from section)),\n('viola', (select id from section)),\n('cello', (select id from section)),\n('double bass', (select id from section));\n```" + }, + "response": "```json\n[\n {\n \"id\": \"693694e7-d993-4360-a6d7-6294e325d9b6\",\n \"name\": \"strings\",\n \"instruments\": [\n {\n \"count\": 4\n }\n ]\n }\n]\n```" + }, + { + "id": "querying-with-count-option", + "name": "Querying with count option", + "code": "```ts\nconst { count, error } = await supabase\n .from('characters')\n .select('*', { count: 'exact', head: true })\n```", + "description": "You can get the number of rows by using the\n[count](/docs/reference/javascript/select#parameters) option.", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" + }, + "response": "```json\n{\n \"count\": 3,\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + }, + { + "id": "querying-json-data", + "name": "Querying JSON data", + "code": "```ts\nconst { data, error } = await supabase\n .from('users')\n .select(`\n id, name,\n address->city\n `)\n```", + "description": "You can select and filter data inside of\n[JSON](/docs/guides/database/json) columns. Postgres offers some\n[operators](/docs/guides/database/json#query-the-jsonb-data) for\nquerying JSON data.", + "data": { + "sql": "```sql\ncreate table\n users (\n id int8 primary key,\n name text,\n address jsonb\n );\n\ninsert into\n users (id, name, address)\nvalues\n (1, 'Frodo', '{\"city\":\"Hobbiton\"}');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"Frodo\",\n \"city\": \"Hobbiton\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + }, + { + "id": "querying-referenced-table-with-inner-join", + "name": "Querying referenced table with inner join", + "code": "```ts\nconst { data, error } = await supabase\n .from('instruments')\n .select('name, orchestral_sections!inner(name)')\n .eq('orchestral_sections.name', 'woodwinds')\n .limit(1)\n```", + "description": "If you don't want to return the referenced table contents, you can leave the parenthesis empty.\nLike `.select('name, orchestral_sections!inner()')`.", + "data": { + "sql": "```sql\ncreate table orchestral_sections (\n \"id\" \"uuid\" primary key default \"extensions\".\"uuid_generate_v4\"() not null,\n \"name\" text\n);\n\ncreate table instruments (\n \"id\" \"uuid\" primary key default \"extensions\".\"uuid_generate_v4\"() not null,\n \"name\" text,\n \"section_id\" \"uuid\" references public.orchestral_sections on delete cascade\n);\n\nwith section as (\n insert into orchestral_sections (name)\n values ('woodwinds') returning id\n)\ninsert into instruments (name, section_id) values\n('flute', (select id from section)),\n('clarinet', (select id from section)),\n('bassoon', (select id from section)),\n('piccolo', (select id from section));\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"name\": \"flute\",\n \"orchestral_sections\": {\"name\": \"woodwinds\"}\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + }, + { + "id": "switching-schemas-per-query", + "name": "Switching schemas per query", + "code": "```ts\nconst { data, error } = await supabase\n .schema('myschema')\n .from('mytable')\n .select()\n```", + "description": "In addition to setting the schema during initialization, you can also switch schemas on a per-query basis.\nMake sure you've set up your [database privileges and API settings](/docs/guides/api/using-custom-schemas).", + "data": { + "sql": "```sql\ncreate schema myschema;\n\ncreate table myschema.mytable (\n id uuid primary key default gen_random_uuid(),\n data text\n);\n\ninsert into myschema.mytable (data) values ('mydata');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"id\": \"4162e008-27b0-4c0f-82dc-ccaeee9a624d\",\n \"data\": \"mydata\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + } + ] + } + }, + "@supabase/postgrest-js.PostgrestQueryBuilder.update": { + "name": "@supabase/postgrest-js.PostgrestQueryBuilder.update", + "params": [ + { + "name": "values", + "type": { + "type": "nameOnly", + "name": "RejectExcessProperties" + }, + "comment": { + "shortText": "The values to update with" + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "count", + "type": { + "type": "union", + "subTypes": [ + null, + { + "type": "literal", + "value": "exact" + }, + { + "type": "literal", + "value": "planned" + }, + { + "type": "literal", + "value": "estimated" + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Count algorithm to use to count updated rows.\n\n`\"exact\"`: Exact but slow count algorithm. Performs a `COUNT(*)` under the\nhood.\n\n`\"planned\"`: Approximated but fast count algorithm. Uses the Postgres\nstatistics under the hood.\n\n`\"estimated\"`: Uses exact count for low numbers and planned count for high\nnumbers." + } + } + ] + }, + "comment": { + "shortText": "Named parameters" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestFilterBuilder" + } + }, + "comment": { + "shortText": "Perform an UPDATE on the table or view.\n\nBy default, updated rows are not returned. To return it, chain the call\nwith `.select()` after filters.", + "text": "- `update()` should always be combined with [Filters](/docs/reference/javascript/using-filters) to target the item(s) you wish to update.", + "examples": [ + { + "id": "updating-your-data", + "name": "Updating your data", + "code": "```ts\nconst { error } = await supabase\n .from('instruments')\n .update({ name: 'piano' })\n .eq('id', 1)\n```", + "data": { + "sql": "```sql\ncreate table\n instruments (id int8 primary key, name text);\n\ninsert into\n instruments (id, name)\nvalues\n (1, 'harpsichord');\n```" + }, + "response": "```json\n{\n \"status\": 204,\n \"statusText\": \"No Content\"\n}\n```" + }, + { + "id": "handling-errors", + "name": "Handling errors", + "code": "```js\nconst { error } = await supabase.from('instruments').update({ name: 'piano' }).eq('id', 1)\nif (error) console.error(error)\n```", + "description": "`error.hint` from Postgres often contains the actionable fix (e.g. `\"Grant the required privileges to the current role with: GRANT UPDATE ON public.instruments TO anon;\"` for a `42501` permission-denied error). Log the full `error` object so it isn't hidden behind `error.message`." + }, + { + "id": "update-a-record-and-return-it", + "name": "Update a record and return it", + "code": "```ts\nconst { data, error } = await supabase\n .from('instruments')\n .update({ name: 'piano' })\n .eq('id', 1)\n .select()\n```", + "data": { + "sql": "```sql\ncreate table\n instruments (id int8 primary key, name text);\n\ninsert into\n instruments (id, name)\nvalues\n (1, 'harpsichord');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"piano\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + }, + { + "id": "updating-json-data", + "name": "Updating JSON data", + "code": "```ts\nconst { data, error } = await supabase\n .from('users')\n .update({\n address: {\n street: 'Melrose Place',\n postcode: 90210\n }\n })\n .eq('address->postcode', 90210)\n .select()\n```", + "description": "Postgres offers some\n[operators](/docs/guides/database/json#query-the-jsonb-data) for\nworking with JSON data. Currently, it is only possible to update the entire JSON document.", + "data": { + "sql": "```sql\ncreate table\n users (\n id int8 primary key,\n name text,\n address jsonb\n );\n\ninsert into\n users (id, name, address)\nvalues\n (1, 'Michael', '{ \"postcode\": 90210 }');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"Michael\",\n \"address\": {\n \"street\": \"Melrose Place\",\n \"postcode\": 90210\n }\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + } + ] + } + }, + "@supabase/postgrest-js.PostgrestQueryBuilder.upsert": { + "name": "@supabase/postgrest-js.PostgrestQueryBuilder.upsert", + "params": [ + { + "name": "values", + "type": { + "type": "union", + "subTypes": [ + { + "type": "nameOnly", + "name": "RejectExcessProperties" + }, + { + "type": "array", + "elemType": { + "type": "nameOnly", + "name": "RejectExcessProperties" + } + } + ] + }, + "comment": { + "shortText": "The values to upsert with. Pass an object to upsert a\nsingle row or an array to upsert multiple rows." + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "count", + "type": { + "type": "union", + "subTypes": [ + null, + { + "type": "literal", + "value": "exact" + }, + { + "type": "literal", + "value": "planned" + }, + { + "type": "literal", + "value": "estimated" + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Count algorithm to use to count upserted rows.\n\n`\"exact\"`: Exact but slow count algorithm. Performs a `COUNT(*)` under the\nhood.\n\n`\"planned\"`: Approximated but fast count algorithm. Uses the Postgres\nstatistics under the hood.\n\n`\"estimated\"`: Uses exact count for low numbers and planned count for high\nnumbers." + } + }, + { + "name": "defaultToNull", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "Make missing fields default to `null`.\nOtherwise, use the default value for the column. This only applies when\ninserting new rows, not when merging with existing rows under\n`ignoreDuplicates: false`. This also only applies when doing bulk upserts." + } + }, + { + "name": "ignoreDuplicates", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "If `true`, duplicate rows are ignored. If\n`false`, duplicate rows are merged with existing rows." + } + }, + { + "name": "onConflict", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Comma-separated UNIQUE column(s) to specify how\nduplicate rows are determined. Two rows are duplicates if all the\n`onConflict` columns are equal." + } + } + ] + }, + "comment": { + "shortText": "Named parameters" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestFilterBuilder" + } + }, + "comment": { + "shortText": "Perform an UPSERT on the table or view. Depending on the column(s) passed\nto `onConflict`, `.upsert()` allows you to perform the equivalent of\n`.insert()` if a row with the corresponding `onConflict` columns doesn't\nexist, or if it does exist, perform an alternative action depending on\n`ignoreDuplicates`.\n\nBy default, upserted rows are not returned. To return it, chain the call\nwith `.select()`.", + "text": "- Primary keys must be included in `values` to use upsert.", + "examples": [ + { + "id": "upsert-a-single-row-using-a-unique-key", + "name": "Upsert a single row using a unique key", + "code": "```ts\n// Upserting a single row, overwriting based on the 'username' unique column\nconst { data, error } = await supabase\n .from('users')\n .upsert({ username: 'supabot' }, { onConflict: 'username' })\n\n// Example response:\n// {\n// data: [\n// { id: 4, message: 'bar', username: 'supabot' }\n// ],\n// error: null\n// }\n```" + }, + { + "id": "upsert-with-conflict-resolution-and-exact-row-counting", + "name": "Upsert with conflict resolution and exact row counting", + "code": "```ts\n// Upserting and returning exact count\nconst { data, error, count } = await supabase\n .from('users')\n .upsert(\n {\n id: 3,\n message: 'foo',\n username: 'supabot'\n },\n {\n onConflict: 'username',\n count: 'exact'\n }\n )\n\n// Example response:\n// {\n// data: [\n// {\n// id: 42,\n// handle: \"saoirse\",\n// display_name: \"Saoirse\"\n// }\n// ],\n// count: 1,\n// error: null\n// }\n```" + }, + { + "id": "upsert-your-data", + "name": "Upsert your data", + "code": "```ts\nconst { data, error } = await supabase\n .from('instruments')\n .upsert({ id: 1, name: 'piano' })\n .select()\n```", + "data": { + "sql": "```sql\ncreate table\n instruments (id int8 primary key, name text);\n\ninsert into\n instruments (id, name)\nvalues\n (1, 'harpsichord');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"piano\"\n }\n ],\n \"status\": 201,\n \"statusText\": \"Created\"\n}\n```" + }, + { + "id": "handling-errors", + "name": "Handling errors", + "code": "```js\nconst { data, error } = await supabase.from('instruments').upsert({ id: 1, name: 'piano' }).select()\nif (error) console.error(error)\n```", + "description": "`error.hint` from Postgres often contains the actionable fix (e.g. `\"Grant the required privileges to the current role with: GRANT INSERT, UPDATE ON public.instruments TO anon;\"` for a `42501` permission-denied error). Log the full `error` object so it isn't hidden behind `error.message`." + }, + { + "id": "bulk-upsert-your-data", + "name": "Bulk Upsert your data", + "code": "```ts\nconst { data, error } = await supabase\n .from('instruments')\n .upsert([\n { id: 1, name: 'piano' },\n { id: 2, name: 'harp' },\n ])\n .select()\n```", + "data": { + "sql": "```sql\ncreate table\n instruments (id int8 primary key, name text);\n\ninsert into\n instruments (id, name)\nvalues\n (1, 'harpsichord');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"piano\"\n },\n {\n \"id\": 2,\n \"name\": \"harp\"\n }\n ],\n \"status\": 201,\n \"statusText\": \"Created\"\n}\n```" + }, + { + "id": "upserting-into-tables-with-constraints", + "name": "Upserting into tables with constraints", + "code": "```ts\nconst { data, error } = await supabase\n .from('users')\n .upsert({ id: 42, handle: 'saoirse', display_name: 'Saoirse' })\n .select()\n```", + "description": "In the following query, `upsert()` implicitly uses the `id`\n(primary key) column to determine conflicts. If there is no existing\nrow with the same `id`, `upsert()` inserts a new row, which\nwill fail in this case as there is already a row with `handle` `\"saoirse\"`.\nUsing the `onConflict` option, you can instruct `upsert()` to use\nanother column with a unique constraint to determine conflicts.", + "data": { + "sql": "```sql\ncreate table\n users (\n id int8 generated by default as identity primary key,\n handle text not null unique,\n display_name text\n );\n\ninsert into\n users (id, handle, display_name)\nvalues\n (1, 'saoirse', null);\n```" + }, + "response": "```json\n{\n \"error\": {\n \"code\": \"23505\",\n \"details\": \"Key (handle)=(saoirse) already exists.\",\n \"hint\": null,\n \"message\": \"duplicate key value violates unique constraint \\\"users_handle_key\\\"\"\n },\n \"status\": 409,\n \"statusText\": \"Conflict\"\n}\n```" + } + ] + } + }, + "@supabase/postgrest-js.PostgrestTransformBuilder.constructor": { + "name": "@supabase/postgrest-js.PostgrestTransformBuilder.constructor", + "params": [ + { + "name": "builder", + "type": { + "type": "object", + "properties": [ + { + "name": "body", + "type": { + "type": "intrinsic", + "name": "unknown" + }, + "isOptional": true + }, + { + "name": "fetch", + "type": { + "type": "function", + "params": [ + { + "name": "input", + "type": { + "type": "union", + "subTypes": [ + { + "type": "nameOnly", + "name": "URL" + }, + { + "type": "nameOnly", + "name": "RequestInfo" + } + ] + } + }, + { + "name": "init", + "type": { + "type": "nameOnly", + "name": "RequestInit" + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "nameOnly", + "name": "Response" + } + } + }, + "comment": { + "shortText": "[MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch)" + } + }, + "isOptional": true + }, + { + "name": "headers", + "type": { + "type": "nameOnly", + "name": "HeadersInit" + } + }, + { + "name": "isMaybeSingle", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "method", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "GET" + }, + { + "type": "literal", + "value": "HEAD" + }, + { + "type": "literal", + "value": "POST" + }, + { + "type": "literal", + "value": "PATCH" + }, + { + "type": "literal", + "value": "DELETE" + } + ] + } + }, + { + "name": "retry", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "schema", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "shouldStripNulls", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "shouldThrowOnError", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "signal", + "type": { + "type": "nameOnly", + "name": "AbortSignal" + }, + "isOptional": true + }, + { + "name": "url", + "type": { + "type": "nameOnly", + "name": "URL" + } + }, + { + "name": "urlLengthLimit", + "type": { + "type": "intrinsic", + "name": "number" + }, + "isOptional": true + } + ] + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestTransformBuilder" + } + }, + "comment": { + "shortText": "Creates a builder configured for a specific PostgREST request.", + "examples": [ + { + "id": "using-supabase-js-recommended", + "name": "Using supabase-js (recommended)", + "code": "```ts\nimport { createClient } from '@supabase/supabase-js'\n\nconst supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key')\nconst { data, error } = await supabase.from('users').select('*')\n```" + }, + { + "id": "standalone-import-for-bundle-sensitive-environments", + "name": "Standalone import for bundle-sensitive environments", + "code": "```ts\nimport { PostgrestQueryBuilder } from '@supabase/postgrest-js'\n\nconst builder = new PostgrestQueryBuilder(\n new URL('https://xyzcompany.supabase.co/rest/v1/users'),\n { headers: new Headers({ apikey: 'your-publishable-key' }) }\n)\n```" + } + ] + } + }, + "@supabase/postgrest-js.PostgrestTransformBuilder.abortSignal": { + "name": "@supabase/postgrest-js.PostgrestTransformBuilder.abortSignal", + "params": [ + { + "name": "signal", + "type": { + "type": "nameOnly", + "name": "AbortSignal" + }, + "comment": { + "shortText": "The AbortSignal to use for the fetch request" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Set the AbortSignal for the fetch request.", + "text": "You can use this to set a timeout for the request.", + "examples": [ + { + "id": "aborting-requests-in-flight", + "name": "Aborting requests in-flight", + "code": "```ts\nconst ac = new AbortController()\n\nconst { data, error } = await supabase\n .from('very_big_table')\n .select()\n .abortSignal(ac.signal)\n\n// Abort the request after 100 ms\nsetTimeout(() => ac.abort(), 100)\n```", + "description": "You can use an [`AbortController`](https://developer.mozilla.org/en-US/docs/Web/API/AbortController) to abort requests.\nNote that `status` and `statusText` don't mean anything for aborted requests as the request wasn't fulfilled.", + "response": "```json\n {\n \"error\": {\n \"message\": \"AbortError: The user aborted a request.\",\n \"details\": \"\",\n \"hint\": \"The request was aborted locally via the provided AbortSignal.\",\n \"code\": \"\"\n },\n \"status\": 0,\n \"statusText\": \"\"\n }\n\n```" + }, + { + "id": "set-a-timeout", + "name": "Set a timeout", + "code": "```ts\nconst { data, error } = await supabase\n .from('very_big_table')\n .select()\n .abortSignal(AbortSignal.timeout(1000 /* ms */))\n```", + "response": "```json\n {\n \"error\": {\n \"message\": \"FetchError: The user aborted a request.\",\n \"details\": \"\",\n \"hint\": \"\",\n \"code\": \"\"\n },\n \"status\": 400,\n \"statusText\": \"Bad Request\"\n }\n\n```" + } + ] + } + }, + "@supabase/postgrest-js.PostgrestTransformBuilder.csv": { + "name": "@supabase/postgrest-js.PostgrestTransformBuilder.csv", + "params": [], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestBuilder" + } + }, + "comment": { + "shortText": "Return `data` as a string in CSV format.", + "examples": [ + { + "id": "return-data-as-csv", + "name": "Return data as CSV", + "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .csv()\n```", + "description": "By default, the data is returned in JSON format, but can also be returned as Comma Separated Values.", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" + }, + "response": "```json\n{\n \"data\": \"id,name\\n1,Luke\\n2,Leia\\n3,Han\",\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + } + ] + } + }, + "@supabase/postgrest-js.PostgrestTransformBuilder.explain": { + "name": "@supabase/postgrest-js.PostgrestTransformBuilder.explain", + "params": [ + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "analyze", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "If `true`, the query will be executed and the\nactual run time will be returned" + } + }, + { + "name": "buffers", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "If `true`, include information on buffer usage" + } + }, + { + "name": "format", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "text" + }, + { + "type": "literal", + "value": "json" + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "The format of the output, can be `\"text\"` (default)\nor `\"json\"`" + } + }, + { + "name": "settings", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "If `true`, include information on configuration\nparameters that affect query planning" + } + }, + { + "name": "verbose", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "If `true`, the query identifier will be returned\nand `data` will include the output columns of the query" + } + }, + { + "name": "wal", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "If `true`, include information on WAL record generation" + } + } + ] + }, + "comment": { + "shortText": "Named parameters" + } + } + ], + "ret": { + "type": { + "type": "union", + "subTypes": [ + { + "type": "nameOnly", + "name": "PostgrestBuilder" + }, + { + "type": "nameOnly", + "name": "PostgrestBuilder" + } + ] + } + }, + "comment": { + "shortText": "Return `data` as the EXPLAIN plan for the query.\n\nYou need to enable the\n[db_plan_enabled](https://supabase.com/docs/guides/database/debugging-performance#enabling-explain)\nsetting before using this method.", + "examples": [ + { + "id": "get-the-execution-plan", + "name": "Get the execution plan", + "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .explain()\n```", + "description": "By default, the data is returned in TEXT format, but can also be returned as JSON by using the `format` parameter.", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" + }, + "response": "```js\nAggregate (cost=33.34..33.36 rows=1 width=112)\n -> Limit (cost=0.00..18.33 rows=1000 width=40)\n -> Seq Scan on characters (cost=0.00..22.00 rows=1200 width=40)\n```" + }, + { + "id": "get-the-execution-plan-with-analyze-and-verbose", + "name": "Get the execution plan with analyze and verbose", + "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .explain({analyze:true,verbose:true})\n```", + "description": "By default, the data is returned in TEXT format, but can also be returned as JSON by using the `format` parameter.", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" + }, + "response": "```js\nAggregate (cost=33.34..33.36 rows=1 width=112) (actual time=0.041..0.041 rows=1 loops=1)\n Output: NULL::bigint, count(ROW(characters.id, characters.name)), COALESCE(json_agg(ROW(characters.id, characters.name)), '[]'::json), NULLIF(current_setting('response.headers'::text, true), ''::text), NULLIF(current_setting('response.status'::text, true), ''::text)\n -> Limit (cost=0.00..18.33 rows=1000 width=40) (actual time=0.005..0.006 rows=3 loops=1)\n Output: characters.id, characters.name\n -> Seq Scan on public.characters (cost=0.00..22.00 rows=1200 width=40) (actual time=0.004..0.005 rows=3 loops=1)\n Output: characters.id, characters.name\nQuery Identifier: -4730654291623321173\nPlanning Time: 0.407 ms\nExecution Time: 0.119 ms\n```" + } + ] + } + }, + "@supabase/postgrest-js.PostgrestTransformBuilder.geojson": { + "name": "@supabase/postgrest-js.PostgrestTransformBuilder.geojson", + "params": [], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestBuilder" + } + }, + "comment": { + "shortText": "Return `data` as an object in [GeoJSON](https://geojson.org) format." + } + }, + "@supabase/postgrest-js.PostgrestTransformBuilder.limit": { + "name": "@supabase/postgrest-js.PostgrestTransformBuilder.limit", + "params": [ + { + "name": "rows", + "type": { + "type": "intrinsic", + "name": "number" + }, + "comment": { + "shortText": "The maximum number of rows to return" + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "foreignTable", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Deprecated, use `options.referencedTable`\ninstead" + } + }, + { + "name": "referencedTable", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Set this to limit rows of referenced\ntables instead of the parent table" + } + } + ] + }, + "comment": { + "shortText": "Named parameters" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Limit the query result by `rows`.", + "examples": [ + { + "id": "with-select", + "name": "With `select()`", + "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select('name')\n .limit(1)\n```", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"name\": \"Luke\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + }, + { + "id": "on-a-referenced-table", + "name": "On a referenced table", + "code": "```ts\nconst { data, error } = await supabase\n .from('orchestral_sections')\n .select(`\n name,\n instruments (\n name\n )\n `)\n .limit(1, { referencedTable: 'instruments' })\n```", + "data": { + "sql": "```sql\ncreate table\n orchestral_sections (id int8 primary key, name text);\ncreate table\n instruments (\n id int8 primary key,\n section_id int8 not null references orchestral_sections,\n name text\n );\n\ninsert into\n orchestral_sections (id, name)\nvalues\n (1, 'strings');\ninsert into\n instruments (id, section_id, name)\nvalues\n (1, 1, 'harp'),\n (2, 1, 'violin');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"name\": \"strings\",\n \"instruments\": [\n {\n \"name\": \"violin\"\n }\n ]\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + } + ] + } + }, + "@supabase/postgrest-js.PostgrestTransformBuilder.maxAffected": { + "name": "@supabase/postgrest-js.PostgrestTransformBuilder.maxAffected", + "params": [ + { + "name": "rows", + "type": { + "type": "intrinsic", + "name": "number" + }, + "comment": { + "shortText": "The maximum number of rows that can be affected" + } + } + ], + "comment": { + "shortText": "Set the maximum number of rows that can be affected by the query.\nOnly available in PostgREST v13+ and only works with PATCH and DELETE methods." + } + }, + "@supabase/postgrest-js.PostgrestTransformBuilder.maybeSingle": { + "name": "@supabase/postgrest-js.PostgrestTransformBuilder.maybeSingle", + "params": [], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestBuilder" + } + }, + "comment": { + "shortText": "Return `data` as a single object instead of an array of objects.\n\nQuery result must be zero or one row (e.g. using `.limit(1)`), otherwise\nthis returns an error.", + "examples": [ + { + "id": "with-select", + "name": "With `select()`", + "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .eq('name', 'Katniss')\n .maybeSingle()\n```", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" + }, + "response": "```json\n{\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + } + ] + } + }, + "@supabase/postgrest-js.PostgrestTransformBuilder.order": { + "name": "@supabase/postgrest-js.PostgrestTransformBuilder.order", + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "ascending", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "nullsFirst", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "referencedTable", + "type": { + "type": "intrinsic", + "name": "undefined" + }, + "isOptional": true + } + ] + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Order the query result by `column`.\n\nYou can call this method multiple times to order by multiple columns.\n\nYou can order referenced tables, but it only affects the ordering of the\nparent table if you use `!inner` in the query.", + "examples": [ + { + "id": "with-select", + "name": "With `select()`", + "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select('id, name')\n .order('id', { ascending: false })\n```", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"id\": 3,\n \"name\": \"Han\"\n },\n {\n \"id\": 2,\n \"name\": \"Leia\"\n },\n {\n \"id\": 1,\n \"name\": \"Luke\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + }, + { + "id": "on-a-referenced-table", + "name": "On a referenced table", + "code": "```ts\n const { data, error } = await supabase\n .from('orchestral_sections')\n .select(`\n name,\n instruments (\n name\n )\n `)\n .order('name', { referencedTable: 'instruments', ascending: false })\n\n```", + "description": "Ordering with `referencedTable` doesn't affect the ordering of the\nparent table.", + "data": { + "sql": "```sql\ncreate table\n orchestral_sections (id int8 primary key, name text);\ncreate table\n instruments (\n id int8 primary key,\n section_id int8 not null references orchestral_sections,\n name text\n );\n\ninsert into\n orchestral_sections (id, name)\nvalues\n (1, 'strings'),\n (2, 'woodwinds');\ninsert into\n instruments (id, section_id, name)\nvalues\n (1, 1, 'harp'),\n (2, 1, 'violin');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"name\": \"strings\",\n \"instruments\": [\n {\n \"name\": \"violin\"\n },\n {\n \"name\": \"harp\"\n }\n ]\n },\n {\n \"name\": \"woodwinds\",\n \"instruments\": []\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + }, + { + "id": "order-parent-table-by-a-referenced-table", + "name": "Order parent table by a referenced table", + "code": "```ts\n const { data, error } = await supabase\n .from('instruments')\n .select(`\n name,\n section:orchestral_sections (\n name\n )\n `)\n .order('section(name)', { ascending: true })\n\n```", + "description": "Ordering with `referenced_table(col)` affects the ordering of the\nparent table.", + "data": { + "sql": "```sql\ncreate table\n orchestral_sections (id int8 primary key, name text);\ncreate table\n instruments (\n id int8 primary key,\n section_id int8 not null references orchestral_sections,\n name text\n );\n\ninsert into\n orchestral_sections (id, name)\nvalues\n (1, 'strings'),\n (2, 'woodwinds');\ninsert into\n instruments (id, section_id, name)\nvalues\n (1, 2, 'flute'),\n (2, 1, 'violin');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"name\": \"violin\",\n \"orchestral_sections\": {\"name\": \"strings\"}\n },\n {\n \"name\": \"flute\",\n \"orchestral_sections\": {\"name\": \"woodwinds\"}\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + } + ] + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "ascending", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "nullsFirst", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "referencedTable", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + } + ] + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + }, + { + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "ascending", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "foreignTable", + "type": { + "type": "intrinsic", + "name": "undefined" + }, + "isOptional": true + }, + { + "name": "nullsFirst", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + } + ] + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + }, + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "ascending", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "foreignTable", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "nullsFirst", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + } + ] + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + } + ] + }, + "@supabase/postgrest-js.PostgrestTransformBuilder.overrideTypes": { + "name": "@supabase/postgrest-js.PostgrestTransformBuilder.overrideTypes", + "params": [], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestBuilder" + } + }, + "comment": { + "shortText": "Override the type of the returned `data` field in the response.", + "examples": [ + { + "id": "example-1", + "name": "Example 1", + "code": "```typescript\n// Merge with existing types (default behavior)\nconst query = supabase\n .from('users')\n .select()\n .overrideTypes<{ custom_field: string }>()\n\n// Replace existing types completely\nconst replaceQuery = supabase\n .from('users')\n .select()\n .overrideTypes<{ id: number; name: string }, { merge: false }>()\n```" + }, + { + "id": "complete-override-type-of-successful-response", + "name": "Complete Override type of successful response", + "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .overrideTypes, { merge: false }>()\n```", + "response": "```ts\nlet x: typeof data // MyType[]\n```" + }, + { + "id": "complete-override-type-of-object-response", + "name": "Complete Override type of object response", + "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .maybeSingle()\n .overrideTypes()\n```", + "response": "```ts\nlet x: typeof data // MyType | null\n```" + }, + { + "id": "partial-override-type-of-successful-response", + "name": "Partial Override type of successful response", + "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .overrideTypes>()\n```", + "response": "```ts\nlet x: typeof data // Array\n```" + }, + { + "id": "partial-override-type-of-object-response", + "name": "Partial Override type of object response", + "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .maybeSingle()\n .overrideTypes<{ status: \"A\" | \"B\" }>()\n```", + "response": "```ts\nlet x: typeof data // CountryRowProperties & { status: \"A\" | \"B\" } | null\n```" + }, + { + "id": "merge-vs-replace-existing-types", + "name": "Merge vs replace existing types", + "code": "```typescript\n// Merge with existing types (default behavior)\nconst query = supabase\n .from('users')\n .select()\n .overrideTypes<{ custom_field: string }>()\n\n// Replace existing types completely\nconst replaceQuery = supabase\n .from('users')\n .select()\n .overrideTypes<{ id: number; name: string }, { merge: false }>()\n```" + } + ] + } + }, + "@supabase/postgrest-js.PostgrestTransformBuilder.range": { + "name": "@supabase/postgrest-js.PostgrestTransformBuilder.range", + "params": [ + { + "name": "from", + "type": { + "type": "intrinsic", + "name": "number" + }, + "comment": { + "shortText": "The starting index from which to limit the result" + } + }, + { + "name": "to", + "type": { + "type": "intrinsic", + "name": "number" + }, + "comment": { + "shortText": "The last index to which to limit the result" + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "foreignTable", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Deprecated, use `options.referencedTable`\ninstead" + } + }, + { + "name": "referencedTable", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Set this to limit rows of referenced\ntables instead of the parent table" + } + } + ] + }, + "comment": { + "shortText": "Named parameters" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Limit the query result by starting at an offset `from` and ending at the offset `to`.\nOnly records within this range are returned.\nThis respects the query order and if there is no order clause the range could behave unexpectedly.\nThe `from` and `to` values are 0-based and inclusive: `range(1, 3)` will include the second, third\nand fourth rows of the query.", + "examples": [ + { + "id": "with-select", + "name": "With `select()`", + "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select('name')\n .range(0, 1)\n```", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"name\": \"Luke\"\n },\n {\n \"name\": \"Leia\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + } + ] + } + }, + "@supabase/postgrest-js.PostgrestTransformBuilder.retry": { + "name": "@supabase/postgrest-js.PostgrestTransformBuilder.retry", + "params": [ + { + "name": "enabled", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "comment": { + "shortText": "Whether to enable retries for this request" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "", + "examples": [ + { + "id": "example-1", + "name": "Example 1", + "code": "```ts\n// Disable retries for a specific query\nconst { data, error } = await supabase\n .from('users')\n .select()\n .retry(false)\n```" + } + ] + } + }, + "@supabase/postgrest-js.PostgrestTransformBuilder.returns": { + "name": "@supabase/postgrest-js.PostgrestTransformBuilder.returns", + "params": [], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestTransformBuilder" + } + }, + "comment": { + "shortText": "Override the type of the returned `data`.", + "text": "- Deprecated: use overrideTypes method instead", + "examples": [ + { + "id": "override-type-of-successful-response", + "name": "Override type of successful response", + "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .returns>()\n```", + "response": "```js\nlet x: typeof data // MyType[]\n```" + }, + { + "id": "override-type-of-object-response", + "name": "Override type of object response", + "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .maybeSingle()\n .returns()\n```", + "response": "```js\nlet x: typeof data // MyType | null\n```" + } + ] + } + }, + "@supabase/postgrest-js.PostgrestTransformBuilder.rollback": { + "name": "@supabase/postgrest-js.PostgrestTransformBuilder.rollback", + "params": [], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Dry-run this request: execute the query but discard the changes.\n\nServer-side, PostgREST runs the query inside a transaction and rolls it back\ninstead of committing. The response still contains the data that *would* have\nbeen returned — `RETURNING` clauses execute and RLS, triggers, and constraints\nare all evaluated — but no row is actually inserted, updated, or deleted.\n\nThis affects only the single request it is chained to. The JS caller has no\nhandle on the transaction: supabase-js does not group multiple queries into\none transaction. For multi-statement transactional logic, use a database\nfunction (`supabase.rpc(...)`).\n\nSets the `Prefer: tx=rollback` header. See PostgREST's docs on transaction\npreferences for the underlying mechanism.", + "examples": [ + { + "id": "validate-an-insert-without-persisting", + "name": "Validate an insert without persisting", + "code": "```ts\nconst { data, error } = await supabase\n .from('countries')\n .insert({ name: 'France' })\n .select()\n .rollback()\n// `data` shows what would have been inserted; nothing is saved.\n```" + } + ] + } + }, + "@supabase/postgrest-js.PostgrestTransformBuilder.select": { + "name": "@supabase/postgrest-js.PostgrestTransformBuilder.select", + "params": [ + { + "name": "columns", + "type": { + "type": "nameOnly", + "name": "Query" + }, + "isOptional": true, + "comment": { + "shortText": "The columns to retrieve, separated by commas" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestFilterBuilder" + } + }, + "comment": { + "shortText": "Perform a SELECT on the query result.\n\nBy default, `.insert()`, `.update()`, `.upsert()`, and `.delete()` do not\nreturn modified rows. By calling this method, modified rows are returned in\n`data`.", + "examples": [ + { + "id": "with-upsert", + "name": "With `upsert()`", + "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .upsert({ id: 1, name: 'Han Solo' })\n .select()\n```", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Han');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"Han Solo\"\n }\n ],\n \"status\": 201,\n \"statusText\": \"Created\"\n}\n```" + } + ] + } + }, + "@supabase/postgrest-js.PostgrestTransformBuilder.setHeader": { + "name": "@supabase/postgrest-js.PostgrestTransformBuilder.setHeader", + "params": [ + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "HTTP header name" + } + }, + { + "name": "value", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "HTTP header value" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Set an HTTP header on this single PostgREST request, overriding any header\nwith the same name set on the client.\n\nThis is an advanced escape hatch for one-off needs (passing a custom\n`Authorization` for a single query, attaching a tracing header, etc.).\nMost callers do not need it: configure client-wide headers via the\n`headers` option when constructing the client, and authentication via\nSupabase Auth." + } + }, + "@supabase/postgrest-js.PostgrestTransformBuilder.single": { + "name": "@supabase/postgrest-js.PostgrestTransformBuilder.single", + "params": [], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestBuilder" + } + }, + "comment": { + "shortText": "Return `data` as a single object instead of an array of objects.\n\nQuery result must be one row (e.g. using `.limit(1)`), otherwise this\nreturns an error.", + "examples": [ + { + "id": "with-select", + "name": "With `select()`", + "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select('name')\n .limit(1)\n .single()\n```", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" + }, + "response": "```json\n{\n \"data\": {\n \"name\": \"Luke\"\n },\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + } + ] + } + }, + "@supabase/postgrest-js.PostgrestTransformBuilder.stripNulls": { + "name": "@supabase/postgrest-js.PostgrestTransformBuilder.stripNulls", + "params": [], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Strip null values from the response data. Properties with `null` values\nwill be omitted from the returned JSON objects.\n\nRequires PostgREST 11.2.0+.\n\nhttps://docs.postgrest.org/en/stable/references/api/resource_representation.html#stripped-nulls", + "examples": [ + { + "id": "with-select", + "name": "With `select()`", + "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .stripNulls()\n```", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text, bio text);\n\ninsert into\n characters (id, name, bio)\nvalues\n (1, 'Luke', null),\n (2, 'Leia', 'Princess of Alderaan');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"Luke\"\n },\n {\n \"id\": 2,\n \"name\": \"Leia\",\n \"bio\": \"Princess of Alderaan\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + } + ] + } + }, + "@supabase/postgrest-js.PostgrestTransformBuilder.then": { + "name": "@supabase/postgrest-js.PostgrestTransformBuilder.then", + "params": [ + { + "name": "onfulfilled", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "function", + "params": [ + { + "name": "value" + } + ], + "ret": { + "type": { + "type": "union", + "subTypes": [ + { + "type": "nameOnly", + "name": "TResult1" + }, + { + "type": "nameOnly", + "name": "PromiseLike" + } + ] + } + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "The callback to execute when the Promise is resolved." + } + }, + { + "name": "onrejected", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "function", + "params": [ + { + "name": "reason", + "type": { + "type": "intrinsic", + "name": "any" + } + } + ], + "ret": { + "type": { + "type": "union", + "subTypes": [ + { + "type": "nameOnly", + "name": "TResult2" + }, + { + "type": "nameOnly", + "name": "PromiseLike" + } + ] + } + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "The callback to execute when the Promise is rejected." + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "PromiseLike" + } + }, + "comment": { + "shortText": "Attaches callbacks for the resolution and/or rejection of the Promise." + } + }, + "@supabase/postgrest-js.PostgrestTransformBuilder.throwOnError": { + "name": "@supabase/postgrest-js.PostgrestTransformBuilder.throwOnError", + "params": [], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestTransformBuilder" + } + }, + "comment": { + "shortText": "If there's an error with the query, throwOnError will reject the promise by\nthrowing the error instead of returning it as part of a successful response.\n\nhttps://github.com/supabase/supabase-js/issues/92" + } + }, + "@supabase/realtime-js.RealtimeChannel.constructor": { + "name": "@supabase/realtime-js.RealtimeChannel.constructor", + "params": [ + { + "name": "topic", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Topic name can be any string." + } + }, + { + "name": "params", + "type": { + "name": "RealtimeChannelOptions", + "type": "object", + "properties": [ + { + "name": "config", + "type": { + "type": "object", + "properties": [ + { + "name": "broadcast", + "type": { + "type": "object", + "properties": [ + { + "name": "ack", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "replay", + "type": { + "type": "nameOnly", + "name": "ReplayOption" + }, + "isOptional": true + }, + { + "name": "self", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "self option enables client to receive message it broadcast\nack option instructs server to acknowledge that broadcast message was received\nreplay option instructs server to replay broadcast messages" + } + }, + { + "name": "presence", + "type": { + "type": "object", + "properties": [ + { + "name": "enabled", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "key", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "key option is used to track presence payload across clients" + } + }, + { + "name": "private", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "defines if the channel is private or not and if RLS policies will be used to check data" + } + } + ] + } + } + ] + } + }, + { + "name": "socket", + "type": { + "type": "nameOnly", + "name": "RealtimeClient" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "RealtimeChannel" + } + }, + "comment": { + "shortText": "Creates a channel that can broadcast messages, sync presence, and listen to Postgres changes.\n\nThe topic determines which realtime stream you are subscribing to. Config options let you\nenable acknowledgement for broadcasts, presence tracking, or private channels.", + "examples": [ + { + "id": "using-supabase-js-recommended", + "name": "Using supabase-js (recommended)", + "code": "```ts\nimport { createClient } from '@supabase/supabase-js'\n\nconst supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key')\nconst channel = supabase.channel('room1')\nchannel\n .on('broadcast', { event: 'cursor-pos' }, (payload) => console.log(payload))\n .subscribe()\n```" + }, + { + "id": "standalone-import-for-bundle-sensitive-environments", + "name": "Standalone import for bundle-sensitive environments", + "code": "```ts\nimport RealtimeClient from '@supabase/realtime-js'\n\nconst client = new RealtimeClient('https://xyzcompany.supabase.co/realtime/v1', {\n params: { apikey: 'your-publishable-key' },\n})\nconst channel = new RealtimeChannel('realtime:public:messages', { config: {} }, client)\n```" + } + ] + } + }, + "@supabase/realtime-js.RealtimeChannel.copyBindings": { + "name": "@supabase/realtime-js.RealtimeChannel.copyBindings", + "params": [ + { + "name": "other", + "type": { + "type": "nameOnly", + "name": "RealtimeChannel" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + } + }, + "@supabase/realtime-js.RealtimeChannel.httpSend": { + "name": "@supabase/realtime-js.RealtimeChannel.httpSend", + "params": [ + { + "name": "event", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The name of the broadcast event" + } + }, + { + "name": "payload", + "type": { + "type": "intrinsic", + "name": "any" + }, + "comment": { + "shortText": "Payload to be sent (required)" + } + }, + { + "name": "opts", + "type": { + "type": "object", + "properties": [ + { + "name": "timeout", + "type": { + "type": "intrinsic", + "name": "number" + }, + "isOptional": true + } + ] + }, + "comment": { + "shortText": "Options including timeout" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "success", + "type": { + "type": "literal", + "value": true + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "error", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "status", + "type": { + "type": "intrinsic", + "name": "number" + } + }, + { + "name": "success", + "type": { + "type": "literal", + "value": false + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Sends a broadcast message explicitly via REST API.\n\nThis method always uses the REST API endpoint regardless of WebSocket connection state.\nUseful when you want to guarantee REST delivery or when gradually migrating from implicit REST fallback.\n\nPayloads that are `ArrayBuffer` or `ArrayBufferView` (e.g. `Uint8Array`) are sent as\n`application/octet-stream`; all other payloads are JSON-encoded." + } + }, + "@supabase/realtime-js.RealtimeChannel.on": { + "name": "@supabase/realtime-js.RealtimeChannel.on", + "params": [ + { + "name": "type", + "type": { + "type": "literal", + "value": "presence" + } + }, + { + "name": "filter", + "type": { + "type": "object", + "properties": [ + { + "name": "event", + "type": { + "type": "literal", + "value": "sync" + } + } + ] + } + }, + { + "name": "callback", + "type": { + "type": "function", + "params": [], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + } + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "RealtimeChannel" + } + }, + "comment": { + "shortText": "Creates an event handler that listens to changes.", + "text": "- By default, Broadcast and Presence are enabled for all projects.\n- By default, listening to database changes is disabled for new projects due to database performance and security concerns. You can turn it on by managing Realtime's [replication](/docs/guides/api#realtime-api-overview).\n- You can receive the \"previous\" data for updates and deletes by setting the table's `REPLICA IDENTITY` to `FULL` (e.g., `ALTER TABLE your_table REPLICA IDENTITY FULL;`).\n- Row level security is not applied to delete statements. When RLS is enabled and replica identity is set to full, only the primary key is sent to clients.", + "examples": [ + { + "id": "listen-to-broadcast-messages", + "name": "Listen to broadcast messages", + "code": "```js\nconst channel = supabase.channel(\"room1\")\n\nchannel.on(\"broadcast\", { event: \"cursor-pos\" }, (payload) => {\n console.log(\"Cursor position received!\", payload);\n}).subscribe((status) => {\n if (status === \"SUBSCRIBED\") {\n channel.send({\n type: \"broadcast\",\n event: \"cursor-pos\",\n payload: { x: Math.random(), y: Math.random() },\n });\n }\n});\n```" + }, + { + "id": "listen-to-presence-sync", + "name": "Listen to presence sync", + "code": "```js\nconst channel = supabase.channel('room1')\nchannel\n .on('presence', { event: 'sync' }, () => {\n console.log('Synced presence state: ', channel.presenceState())\n })\n .subscribe(async (status) => {\n if (status === 'SUBSCRIBED') {\n await channel.track({ online_at: new Date().toISOString() })\n }\n })\n```" + }, + { + "id": "listen-to-presence-join", + "name": "Listen to presence join", + "code": "```js\nconst channel = supabase.channel('room1')\nchannel\n .on('presence', { event: 'join' }, ({ newPresences }) => {\n console.log('Newly joined presences: ', newPresences)\n })\n .subscribe(async (status) => {\n if (status === 'SUBSCRIBED') {\n await channel.track({ online_at: new Date().toISOString() })\n }\n })\n```" + }, + { + "id": "listen-to-presence-leave", + "name": "Listen to presence leave", + "code": "```js\nconst channel = supabase.channel('room1')\nchannel\n .on('presence', { event: 'leave' }, ({ leftPresences }) => {\n console.log('Newly left presences: ', leftPresences)\n })\n .subscribe(async (status) => {\n if (status === 'SUBSCRIBED') {\n await channel.track({ online_at: new Date().toISOString() })\n await channel.untrack()\n }\n })\n```" + }, + { + "id": "listen-to-all-database-changes", + "name": "Listen to all database changes", + "code": "```js\nsupabase\n .channel('room1')\n .on('postgres_changes', { event: '*', schema: '*' }, payload => {\n console.log('Change received!', payload)\n })\n .subscribe()\n```" + }, + { + "id": "listen-to-a-specific-table", + "name": "Listen to a specific table", + "code": "```js\nsupabase\n .channel('room1')\n .on('postgres_changes', { event: '*', schema: 'public', table: 'countries' }, payload => {\n console.log('Change received!', payload)\n })\n .subscribe()\n```" + }, + { + "id": "listen-to-inserts", + "name": "Listen to inserts", + "code": "```js\nsupabase\n .channel('room1')\n .on('postgres_changes', { event: 'INSERT', schema: 'public', table: 'countries' }, payload => {\n console.log('Change received!', payload)\n })\n .subscribe()\n```" + }, + { + "id": "listen-to-updates", + "name": "Listen to updates", + "code": "```js\nsupabase\n .channel('room1')\n .on('postgres_changes', { event: 'UPDATE', schema: 'public', table: 'countries' }, payload => {\n console.log('Change received!', payload)\n })\n .subscribe()\n```", + "description": "By default, Supabase will send only the updated record. If you want to receive the previous values as well you can\nenable full replication for the table you are listening to:\n\n```sql\nalter table \"your_table\" replica identity full;\n```" + }, + { + "id": "listen-to-deletes", + "name": "Listen to deletes", + "code": "```js\nsupabase\n .channel('room1')\n .on('postgres_changes', { event: 'DELETE', schema: 'public', table: 'countries' }, payload => {\n console.log('Change received!', payload)\n })\n .subscribe()\n```", + "description": "By default, Supabase does not send deleted records. If you want to receive the deleted record you can\nenable full replication for the table you are listening to:\n\n```sql\nalter table \"your_table\" replica identity full;\n```" + }, + { + "id": "listen-to-multiple-events", + "name": "Listen to multiple events", + "code": "```js\nsupabase\n .channel('room1')\n .on('postgres_changes', { event: 'INSERT', schema: 'public', table: 'countries' }, handleRecordInserted)\n .on('postgres_changes', { event: 'DELETE', schema: 'public', table: 'countries' }, handleRecordDeleted)\n .subscribe()\n```", + "description": "You can chain listeners if you want to listen to multiple events for each table." + }, + { + "id": "listen-to-row-level-changes", + "name": "Listen to row level changes", + "code": "```js\nsupabase\n .channel('room1')\n .on('postgres_changes', { event: 'UPDATE', schema: 'public', table: 'countries', filter: 'id=eq.200' }, handleRecordUpdated)\n .subscribe()\n```", + "description": "You can listen to individual rows using the format `{table}:{col}=eq.{val}` - where `{col}` is the column name, and `{val}` is the value which you want to match." + } + ] + }, + "altSignatures": [ + { + "params": [ + { + "name": "type", + "type": { + "type": "literal", + "value": "presence" + } + }, + { + "name": "filter", + "type": { + "type": "object", + "properties": [ + { + "name": "event", + "type": { + "type": "literal", + "value": "join" + } + } + ] + } + }, + { + "name": "callback", + "type": { + "type": "function", + "params": [ + { + "name": "payload", + "type": { + "name": "RealtimePresenceJoinPayload", + "type": "object", + "properties": [ + { + "name": "currentPresences", + "type": { + "type": "array", + "elemType": { + "type": "nameOnly", + "name": "Presence" + } + } + }, + { + "name": "event" + }, + { + "name": "key", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "newPresences", + "type": { + "type": "array", + "elemType": { + "type": "nameOnly", + "name": "Presence" + } + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + } + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "RealtimeChannel" + } + } + }, + { + "params": [ + { + "name": "type", + "type": { + "type": "literal", + "value": "presence" + } + }, + { + "name": "filter", + "type": { + "type": "object", + "properties": [ + { + "name": "event", + "type": { + "type": "literal", + "value": "leave" + } + } + ] + } + }, + { + "name": "callback", + "type": { + "type": "function", + "params": [ + { + "name": "payload", + "type": { + "name": "RealtimePresenceLeavePayload", + "type": "object", + "properties": [ + { + "name": "currentPresences", + "type": { + "type": "array", + "elemType": { + "type": "nameOnly", + "name": "Presence" + } + } + }, + { + "name": "event" + }, + { + "name": "key", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "leftPresences", + "type": { + "type": "array", + "elemType": { + "type": "nameOnly", + "name": "Presence" + } + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + } + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "RealtimeChannel" + } + } + }, + { + "params": [ + { + "name": "type", + "type": { + "type": "literal", + "value": "presence" + } + }, + { + "name": "filter", + "type": { + "type": "object", + "properties": [ + { + "name": "event", + "type": { + "type": "literal", + "value": "*" + } + } + ] + } + }, + { + "name": "callback", + "type": { + "type": "function", + "params": [ + { + "name": "payload", + "type": { + "type": "union", + "subTypes": [ + { + "name": "RealtimePresenceJoinPayload", + "type": "object", + "properties": [ + { + "name": "currentPresences", + "type": { + "type": "array", + "elemType": { + "type": "nameOnly", + "name": "Presence" + } + } + }, + { + "name": "event" + }, + { + "name": "key", + "type": "[Circular]" + }, + { + "name": "newPresences", + "type": { + "type": "array", + "elemType": { + "type": "nameOnly", + "name": "Presence" + } + } + } + ] + }, + { + "name": "RealtimePresenceLeavePayload", + "type": "object", + "properties": [ + { + "name": "currentPresences", + "type": { + "type": "array", + "elemType": { + "type": "nameOnly", + "name": "Presence" + } + } + }, + { + "name": "event" + }, + { + "name": "key", + "type": "[Circular]" + }, + { + "name": "leftPresences", + "type": { + "type": "array", + "elemType": { + "type": "nameOnly", + "name": "Presence" + } + } + } + ] + } + ] + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + } + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "RealtimeChannel" + } + } + }, + { + "params": [ + { + "name": "type", + "type": { + "type": "literal", + "value": "postgres_changes" + } + }, + { + "name": "filter", + "type": { + "name": "RealtimePostgresChangesFilter", + "type": "object", + "properties": [ + { + "name": "event", + "type": { + "type": "literal", + "value": "*" + }, + "comment": { + "shortText": "The type of database change to listen to." + } + }, + { + "name": "filter", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Receive database changes when filter is matched." + } + }, + { + "name": "schema", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The database schema to listen to." + } + }, + { + "name": "table", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "The database table to listen to." + } + } + ] + } + }, + { + "name": "callback", + "type": { + "type": "function", + "params": [ + { + "name": "payload", + "type": { + "type": "union", + "name": "RealtimePostgresChangesPayload", + "subTypes": [ + { + "type": "nameOnly", + "name": "RealtimePostgresInsertPayload" + }, + { + "type": "nameOnly", + "name": "RealtimePostgresUpdatePayload" + }, + { + "type": "nameOnly", + "name": "RealtimePostgresDeletePayload" + } + ] + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + } + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "RealtimeChannel" + } + } + }, + { + "params": [ + { + "name": "type", + "type": { + "type": "literal", + "value": "postgres_changes" + } + }, + { + "name": "filter", + "type": { + "name": "RealtimePostgresChangesFilter", + "type": "object", + "properties": [ + { + "name": "event", + "type": { + "type": "literal", + "value": "INSERT" + }, + "comment": { + "shortText": "The type of database change to listen to." + } + }, + { + "name": "filter", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Receive database changes when filter is matched." + } + }, + { + "name": "schema", + "type": "[Circular]", + "comment": { + "shortText": "The database schema to listen to." + } + }, + { + "name": "table", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The database table to listen to." + } + } + ] + } + }, + { + "name": "callback", + "type": { + "type": "function", + "params": [ + { + "name": "payload", + "type": { + "type": "nameOnly", + "name": "RealtimePostgresInsertPayload" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + } + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "RealtimeChannel" + } + } + }, + { + "params": [ + { + "name": "type", + "type": { + "type": "literal", + "value": "postgres_changes" + } + }, + { + "name": "filter", + "type": { + "name": "RealtimePostgresChangesFilter", + "type": "object", + "properties": [ + { + "name": "event", + "type": { + "type": "literal", + "value": "UPDATE" + }, + "comment": { + "shortText": "The type of database change to listen to." + } + }, + { + "name": "filter", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Receive database changes when filter is matched." + } + }, + { + "name": "schema", + "type": "[Circular]", + "comment": { + "shortText": "The database schema to listen to." + } + }, + { + "name": "table", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The database table to listen to." + } + } + ] + } + }, + { + "name": "callback", + "type": { + "type": "function", + "params": [ + { + "name": "payload", + "type": { + "type": "nameOnly", + "name": "RealtimePostgresUpdatePayload" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + } + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "RealtimeChannel" + } + } + }, + { + "params": [ + { + "name": "type", + "type": { + "type": "literal", + "value": "postgres_changes" + } + }, + { + "name": "filter", + "type": { + "name": "RealtimePostgresChangesFilter", + "type": "object", + "properties": [ + { + "name": "event", + "type": { + "type": "literal", + "value": "DELETE" + }, + "comment": { + "shortText": "The type of database change to listen to." + } + }, + { + "name": "filter", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Receive database changes when filter is matched." + } + }, + { + "name": "schema", + "type": "[Circular]", + "comment": { + "shortText": "The database schema to listen to." + } + }, + { + "name": "table", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The database table to listen to." + } + } + ] + } + }, + { + "name": "callback", + "type": { + "type": "function", + "params": [ + { + "name": "payload", + "type": { + "type": "nameOnly", + "name": "RealtimePostgresDeletePayload" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + } + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "RealtimeChannel" + } + } + }, + { + "params": [ + { + "name": "type", + "type": { + "type": "literal", + "value": "postgres_changes" + } + }, + { + "name": "filter", + "type": { + "name": "RealtimePostgresChangesFilter", + "type": "object", + "properties": [ + { + "name": "event", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "INSERT" + }, + { + "type": "literal", + "value": "UPDATE" + }, + { + "type": "literal", + "value": "DELETE" + }, + { + "type": "literal", + "value": "*" + } + ] + }, + "comment": { + "shortText": "The type of database change to listen to." + } + }, + { + "name": "filter", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Receive database changes when filter is matched." + } + }, + { + "name": "schema", + "type": "[Circular]", + "comment": { + "shortText": "The database schema to listen to." + } + }, + { + "name": "table", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The database table to listen to." + } + } + ] + } + }, + { + "name": "callback", + "type": { + "type": "function", + "params": [ + { + "name": "payload", + "type": { + "type": "union", + "name": "RealtimePostgresChangesPayload", + "subTypes": [ + { + "type": "nameOnly", + "name": "RealtimePostgresInsertPayload" + }, + { + "type": "nameOnly", + "name": "RealtimePostgresUpdatePayload" + }, + { + "type": "nameOnly", + "name": "RealtimePostgresDeletePayload" + } + ] + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + } + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "RealtimeChannel" + } + } + }, + { + "params": [ + { + "name": "type", + "type": { + "type": "literal", + "value": "broadcast" + }, + "comment": { + "shortText": "One of \"broadcast\", \"presence\", or \"postgres_changes\"." + } + }, + { + "name": "filter", + "type": { + "type": "object", + "properties": [ + { + "name": "event", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + }, + "comment": { + "shortText": "Custom object specific to the Realtime feature detailing which payloads to receive." + } + }, + { + "name": "callback", + "type": { + "type": "function", + "params": [ + { + "name": "payload", + "type": { + "type": "object", + "properties": [ + { + "name": "event", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "meta", + "type": { + "type": "object", + "properties": [ + { + "name": "id", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "replayed", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + } + ] + }, + "isOptional": true + }, + { + "name": "type", + "type": { + "type": "literal", + "value": "broadcast" + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + } + }, + "comment": { + "shortText": "Function to be invoked when event handler is triggered." + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "RealtimeChannel" + } + } + }, + { + "params": [ + { + "name": "type", + "type": { + "type": "literal", + "value": "broadcast" + } + }, + { + "name": "filter", + "type": { + "type": "object", + "properties": [ + { + "name": "event", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + } + }, + { + "name": "callback", + "type": { + "type": "function", + "params": [ + { + "name": "payload", + "type": { + "type": "object", + "properties": [ + { + "name": "event", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "meta", + "type": { + "type": "object", + "properties": [ + { + "name": "id", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "replayed", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + } + ] + }, + "isOptional": true + }, + { + "name": "payload", + "type": { + "type": "nameOnly", + "name": "T" + } + }, + { + "name": "type", + "type": { + "type": "literal", + "value": "broadcast" + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + } + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "RealtimeChannel" + } + } + }, + { + "params": [ + { + "name": "type", + "type": { + "type": "literal", + "value": "broadcast" + } + }, + { + "name": "filter", + "type": { + "type": "object", + "properties": [ + { + "name": "event", + "type": { + "type": "literal", + "value": "*", + "name": "ALL" + } + } + ] + } + }, + { + "name": "callback", + "type": { + "type": "function", + "params": [ + { + "name": "payload", + "type": { + "type": "object", + "properties": [ + { + "name": "event", + "type": "[Circular]" + }, + { + "name": "payload", + "type": { + "type": "nameOnly", + "name": "RealtimeBroadcastPayload" + } + }, + { + "name": "type", + "type": { + "type": "literal", + "value": "broadcast" + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + } + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "RealtimeChannel" + } + } + }, + { + "params": [ + { + "name": "type", + "type": { + "type": "literal", + "value": "broadcast" + } + }, + { + "name": "filter", + "type": { + "type": "object", + "properties": [ + { + "name": "event", + "type": { + "type": "literal", + "value": "INSERT", + "name": "INSERT" + } + } + ] + } + }, + { + "name": "callback", + "type": { + "type": "function", + "params": [ + { + "name": "payload", + "type": { + "type": "object", + "properties": [ + { + "name": "event", + "type": "[Circular]" + }, + { + "name": "payload", + "type": { + "type": "nameOnly", + "name": "RealtimeBroadcastInsertPayload" + } + }, + { + "name": "type", + "type": { + "type": "literal", + "value": "broadcast" + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + } + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "RealtimeChannel" + } + } + }, + { + "params": [ + { + "name": "type", + "type": { + "type": "literal", + "value": "broadcast" + } + }, + { + "name": "filter", + "type": { + "type": "object", + "properties": [ + { + "name": "event", + "type": { + "type": "literal", + "value": "UPDATE", + "name": "UPDATE" + } + } + ] + } + }, + { + "name": "callback", + "type": { + "type": "function", + "params": [ + { + "name": "payload", + "type": { + "type": "object", + "properties": [ + { + "name": "event", + "type": "[Circular]" + }, + { + "name": "payload", + "type": { + "type": "nameOnly", + "name": "RealtimeBroadcastUpdatePayload" + } + }, + { + "name": "type", + "type": { + "type": "literal", + "value": "broadcast" + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + } + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "RealtimeChannel" + } + } + }, + { + "params": [ + { + "name": "type", + "type": { + "type": "literal", + "value": "broadcast" + } + }, + { + "name": "filter", + "type": { + "type": "object", + "properties": [ + { + "name": "event", + "type": { + "type": "literal", + "value": "DELETE", + "name": "DELETE" + } + } + ] + } + }, + { + "name": "callback", + "type": { + "type": "function", + "params": [ + { + "name": "payload", + "type": { + "type": "object", + "properties": [ + { + "name": "event", + "type": "[Circular]" + }, + { + "name": "payload", + "type": { + "type": "nameOnly", + "name": "RealtimeBroadcastDeletePayload" + } + }, + { + "name": "type", + "type": { + "type": "literal", + "value": "broadcast" + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + } + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "RealtimeChannel" + } + } + }, + { + "params": [ + { + "name": "type", + "type": { + "type": "literal", + "value": "system" + } + }, + { + "name": "filter" + }, + { + "name": "callback", + "type": { + "type": "function", + "params": [ + { + "name": "payload", + "type": { + "type": "intrinsic", + "name": "any" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + } + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "RealtimeChannel" + } + } + } + ] + }, + "@supabase/realtime-js.RealtimeChannel.presenceState": { + "name": "@supabase/realtime-js.RealtimeChannel.presenceState", + "params": [], + "ret": { + "type": { + "name": "RealtimePresenceState", + "type": "index signature", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "array", + "elemType": { + "type": "nameOnly", + "name": "Presence" + } + } + } + }, + "comment": { + "shortText": "Returns the current presence state for this channel.\n\nThe shape is a map keyed by presence key (for example a user id) where each entry contains the\ntracked metadata for that user." + } + }, + "@supabase/realtime-js.RealtimeChannel.send": { + "name": "@supabase/realtime-js.RealtimeChannel.send", + "params": [ + { + "name": "args", + "type": { + "type": "object", + "properties": [ + { + "name": "event", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The name of the event being sent" + } + }, + { + "name": "payload", + "type": { + "type": "intrinsic", + "name": "any" + }, + "isOptional": true, + "comment": { + "shortText": "Payload to be sent" + } + }, + { + "name": "type", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "broadcast" + }, + { + "type": "literal", + "value": "presence" + }, + { + "type": "literal", + "value": "postgres_changes" + } + ] + }, + "comment": { + "shortText": "The type of event to send" + } + } + ] + }, + "comment": { + "shortText": "Arguments to send to channel" + } + }, + { + "name": "opts", + "type": { + "type": "index signature", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "any" + } + }, + "comment": { + "shortText": "Options to be used during the send process" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "RealtimeChannelSendResponse", + "subTypes": [ + { + "type": "literal", + "value": "ok" + }, + { + "type": "literal", + "value": "timed out" + }, + { + "type": "literal", + "value": "error" + }, + null + ] + } + } + }, + "comment": { + "shortText": "Sends a message into the channel.", + "text": "- When using REST you don't need to subscribe to the channel\n- REST calls are only available from 2.37.0 onwards\n- If you create a channel only to send a REST broadcast, remove it from\n the client when the send completes", + "examples": [ + { + "id": "send-a-message-via-websocket", + "name": "Send a message via websocket", + "code": "```js\nconst channel = supabase.channel('room1')\n\nchannel.subscribe((status) => {\n if (status === 'SUBSCRIBED') {\n channel.send({\n type: 'broadcast',\n event: 'cursor-pos',\n payload: { x: Math.random(), y: Math.random() },\n })\n }\n})\n```", + "response": "```js\nok | timed out | error\n```" + }, + { + "id": "send-a-message-via-rest", + "name": "Send a message via REST", + "code": "```js\nconst channel = supabase.channel('room1')\n\ntry {\n await channel.httpSend('cursor-pos', { x: Math.random(), y: Math.random() })\n} finally {\n await supabase.removeChannel(channel)\n}\n```" + } + ] + } + }, + "@supabase/realtime-js.RealtimeChannel.subscribe": { + "name": "@supabase/realtime-js.RealtimeChannel.subscribe", + "params": [ + { + "name": "callback", + "type": { + "type": "function", + "params": [ + { + "name": "status", + "type": { + "type": "nameOnly", + "name": "REALTIME_SUBSCRIBE_STATES" + } + }, + { + "name": "err", + "type": { + "type": "nameOnly", + "name": "Error" + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + } + }, + "isOptional": true + }, + { + "name": "timeout", + "type": { + "type": "intrinsic", + "name": "number" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "RealtimeChannel" + } + }, + "comment": { + "shortText": "Subscribe registers your client with the server.\n\nThe optional `callback` receives a `status` and, on failure, an `err` argument.\nLog the full `err` so its `cause`, `name`, and any structured fields aren't hidden\nbehind `err.message`.", + "examples": [ + { + "id": "handling-errors", + "name": "Handling errors", + "code": "```js\nsupabase.channel('room1').subscribe((status, err) => {\n if (status === 'CHANNEL_ERROR' || status === 'TIMED_OUT') {\n // Log the full error: its `cause` often holds the underlying reason.\n console.error(status, err)\n }\n})\n```" + } + ] + } + }, + "@supabase/realtime-js.RealtimeChannel.teardown": { + "name": "@supabase/realtime-js.RealtimeChannel.teardown", + "params": [], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + }, + "comment": { + "shortText": "Destroys and stops related timers." + } + }, + "@supabase/realtime-js.RealtimeChannel.track": { + "name": "@supabase/realtime-js.RealtimeChannel.track", + "params": [ + { + "name": "payload", + "type": { + "type": "index signature", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "any" + } + } + }, + { + "name": "opts", + "type": { + "type": "index signature", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "any" + } + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "RealtimeChannelSendResponse", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]", + null + ] + } + } + }, + "comment": { + "shortText": "Sends the supplied payload to the presence tracker so other subscribers can see that this\nclient is online. Use `untrack` to stop broadcasting presence for the same key." + } + }, + "@supabase/realtime-js.RealtimeChannel.unsubscribe": { + "name": "@supabase/realtime-js.RealtimeChannel.unsubscribe", + "params": [ + { + "name": "timeout", + "type": { + "type": "intrinsic", + "name": "number" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "RealtimeChannelSendResponse", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]", + null + ] + } + } + }, + "comment": { + "shortText": "Leaves the channel.\n\nUnsubscribes from server events, and instructs channel to terminate on server.\nTriggers onClose() hooks.\n\nTo receive leave acknowledgements, use the a `receive` hook to bind to the server ack, ie:\nchannel.unsubscribe().receive(\"ok\", () => alert(\"left!\") )" + } + }, + "@supabase/realtime-js.RealtimeChannel.untrack": { + "name": "@supabase/realtime-js.RealtimeChannel.untrack", + "params": [ + { + "name": "opts", + "type": { + "type": "index signature", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "any" + } + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "RealtimeChannelSendResponse", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]", + null + ] + } + } + }, + "comment": { + "shortText": "Removes the current presence state for this client." + } + }, + "@supabase/realtime-js.RealtimeChannel.updateJoinPayload": { + "name": "@supabase/realtime-js.RealtimeChannel.updateJoinPayload", + "params": [ + { + "name": "payload", + "type": { + "type": "record", + "name": "Record", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "any" + } + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + }, + "comment": { + "shortText": "Updates the payload that will be sent the next time the channel joins (reconnects).\nUseful for rotating access tokens or updating config without re-creating the channel." + } + }, + "@supabase/realtime-js.RealtimeClient.constructor": { + "name": "@supabase/realtime-js.RealtimeClient.constructor", + "params": [ + { + "name": "endPoint", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The string WebSocket endpoint, ie, \"ws://example.com/socket\", \"wss://example.com\", \"/socket\" (inherited host & protocol)" + } + }, + { + "name": "options", + "type": { + "name": "RealtimeClientOptions", + "type": "object", + "properties": [ + { + "name": "accessToken", + "type": { + "type": "function", + "params": [], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "string" + }, + { + "type": "literal", + "value": null + } + ] + } + } + } + }, + "isOptional": true + }, + { + "name": "decode", + "type": { + "type": "nameOnly", + "name": "Decode" + }, + "isOptional": true + }, + { + "name": "disconnectOnEmptyChannelsAfterMs", + "type": { + "type": "intrinsic", + "name": "number" + }, + "isOptional": true + }, + { + "name": "encode", + "type": { + "type": "nameOnly", + "name": "Encode" + }, + "isOptional": true + }, + { + "name": "fetch", + "type": { + "type": "nameOnly", + "name": "Fetch" + }, + "isOptional": true + }, + { + "name": "headers", + "type": { + "type": "index signature", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "string" + } + }, + "isOptional": true + }, + { + "name": "heartbeatCallback", + "type": { + "type": "function", + "params": [ + { + "name": "status", + "type": { + "type": "nameOnly", + "name": "HeartbeatStatus" + } + }, + { + "name": "latency", + "type": { + "type": "intrinsic", + "name": "number" + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + } + }, + "isOptional": true + }, + { + "name": "heartbeatIntervalMs", + "type": { + "type": "intrinsic", + "name": "number" + }, + "isOptional": true + }, + { + "name": "log_level", + "type": { + "type": "nameOnly", + "name": "LogLevel" + }, + "isOptional": true + }, + { + "name": "logger", + "type": { + "type": "function", + "params": [ + { + "name": "kind", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "msg", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "data", + "type": { + "type": "intrinsic", + "name": "any" + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + } + }, + "isOptional": true + }, + { + "name": "logLevel", + "type": { + "type": "nameOnly", + "name": "LogLevel" + }, + "isOptional": true + }, + { + "name": "params", + "type": { + "type": "index signature", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "any" + } + }, + "isOptional": true + }, + { + "name": "reconnectAfterMs", + "type": { + "type": "function", + "params": [ + { + "name": "tries", + "type": { + "type": "intrinsic", + "name": "number" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "number" + } + } + }, + "isOptional": true + }, + { + "name": "sessionStorage", + "type": { + "type": "nameOnly", + "name": "Storage" + }, + "isOptional": true, + "comment": { + "shortText": "Storage compatible object used by the underlying socket for longpoll fallback history.\nProvide a custom implementation in environments where reading `globalThis.sessionStorage`\nthrows (sandboxed iframes, in-app webviews, \"block third-party storage\" privacy modes).\nDefaults to `globalThis.sessionStorage` when accessible, otherwise an in-memory store." + } + }, + { + "name": "timeout", + "type": { + "type": "intrinsic", + "name": "number" + }, + "isOptional": true + }, + { + "name": "transport", + "type": { + "type": "object", + "name": "WebSocketLikeConstructor", + "properties": [] + }, + "isOptional": true + }, + { + "name": "vsn", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "worker", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "workerUrl", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + } + ] + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "RealtimeClient" + } + }, + "comment": { + "shortText": "Initializes the Socket.", + "examples": [ + { + "id": "using-supabase-js-recommended", + "name": "Using supabase-js (recommended)", + "code": "```ts\nimport { createClient } from '@supabase/supabase-js'\n\nconst supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key')\nconst channel = supabase.channel('room1')\nchannel\n .on('broadcast', { event: 'cursor-pos' }, (payload) => console.log(payload))\n .subscribe()\n```" + }, + { + "id": "standalone-import-for-bundle-sensitive-environments", + "name": "Standalone import for bundle-sensitive environments", + "code": "```ts\nimport RealtimeClient from '@supabase/realtime-js'\n\nconst client = new RealtimeClient('https://xyzcompany.supabase.co/realtime/v1', {\n params: { apikey: 'your-publishable-key' },\n})\nclient.connect()\n```" + } + ] + } + }, + "@supabase/realtime-js.RealtimeClient.channel": { + "name": "@supabase/realtime-js.RealtimeClient.channel", + "params": [ + { + "name": "topic", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "params", + "type": { + "name": "RealtimeChannelOptions", + "type": "object", + "properties": [ + { + "name": "config", + "type": { + "type": "object", + "properties": [ + { + "name": "broadcast", + "type": { + "type": "object", + "properties": [ + { + "name": "ack", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "replay", + "type": { + "type": "nameOnly", + "name": "ReplayOption" + }, + "isOptional": true + }, + { + "name": "self", + "type": "[Circular]", + "isOptional": true + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "self option enables client to receive message it broadcast\nack option instructs server to acknowledge that broadcast message was received\nreplay option instructs server to replay broadcast messages" + } + }, + { + "name": "presence", + "type": { + "type": "object", + "properties": [ + { + "name": "enabled", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "key", + "type": "[Circular]", + "isOptional": true + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "key option is used to track presence payload across clients" + } + }, + { + "name": "private", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "defines if the channel is private or not and if RLS policies will be used to check data" + } + } + ] + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "RealtimeChannel" + } + }, + "comment": { + "shortText": "Creates (or reuses) a RealtimeChannel for the provided topic.\n\nTopics are automatically prefixed with `realtime:` to match the Realtime service.\nIf a channel with the same topic already exists it will be returned instead of creating\na duplicate connection." + } + }, + "@supabase/realtime-js.RealtimeClient.connect": { + "name": "@supabase/realtime-js.RealtimeClient.connect", + "params": [], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + }, + "comment": { + "shortText": "Connects the socket, unless already connected." + } + }, + "@supabase/realtime-js.RealtimeClient.connectionState": { + "name": "@supabase/realtime-js.RealtimeClient.connectionState", + "params": [], + "ret": { + "type": { + "type": "nameOnly", + "name": "ConnectionState" + } + }, + "comment": { + "shortText": "Returns the current state of the socket." + } + }, + "@supabase/realtime-js.RealtimeClient.disconnect": { + "name": "@supabase/realtime-js.RealtimeClient.disconnect", + "params": [ + { + "name": "code", + "type": { + "type": "intrinsic", + "name": "number" + }, + "isOptional": true, + "comment": { + "shortText": "A numeric status code to send on disconnect." + } + }, + { + "name": "reason", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "A custom reason for the disconnect." + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "ok" + }, + { + "type": "literal", + "value": "timeout" + } + ] + } + } + }, + "comment": { + "shortText": "Disconnects the socket." + } + }, + "@supabase/realtime-js.RealtimeClient.endpointURL": { + "name": "@supabase/realtime-js.RealtimeClient.endpointURL", + "params": [], + "ret": { + "type": { + "type": "intrinsic", + "name": "string" + } + }, + "comment": { + "shortText": "Returns the URL of the websocket." + } + }, + "@supabase/realtime-js.RealtimeClient.getChannels": { + "name": "@supabase/realtime-js.RealtimeClient.getChannels", + "params": [], + "ret": { + "type": { + "type": "array", + "elemType": { + "type": "nameOnly", + "name": "RealtimeChannel" + } + } + }, + "comment": { + "shortText": "Returns all created channels" + } + }, + "@supabase/realtime-js.RealtimeClient.isConnected": { + "name": "@supabase/realtime-js.RealtimeClient.isConnected", + "params": [], + "ret": { + "type": { + "type": "intrinsic", + "name": "boolean" + } + }, + "comment": { + "shortText": "Returns `true` is the connection is open." + } + }, + "@supabase/realtime-js.RealtimeClient.isConnecting": { + "name": "@supabase/realtime-js.RealtimeClient.isConnecting", + "params": [], + "ret": { + "type": { + "type": "intrinsic", + "name": "boolean" + } + }, + "comment": { + "shortText": "Returns `true` if the connection is currently connecting." + } + }, + "@supabase/realtime-js.RealtimeClient.isDisconnecting": { + "name": "@supabase/realtime-js.RealtimeClient.isDisconnecting", + "params": [], + "ret": { + "type": { + "type": "intrinsic", + "name": "boolean" + } + }, + "comment": { + "shortText": "Returns `true` if the connection is currently disconnecting." + } + }, + "@supabase/realtime-js.RealtimeClient.log": { + "name": "@supabase/realtime-js.RealtimeClient.log", + "params": [ + { + "name": "kind", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "msg", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "data", + "type": { + "type": "intrinsic", + "name": "any" + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + }, + "comment": { + "shortText": "Logs the message.\n\nFor customized logging, `this.logger` can be overridden in Client constructor." + } + }, + "@supabase/realtime-js.RealtimeClient.onHeartbeat": { + "name": "@supabase/realtime-js.RealtimeClient.onHeartbeat", + "params": [ + { + "name": "callback", + "type": { + "type": "nameOnly", + "name": "HeartbeatCallback" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + }, + "comment": { + "shortText": "Sets a callback that receives lifecycle events for internal heartbeat messages.\nUseful for instrumenting connection health (e.g. sent/ok/timeout/disconnected)." + } + }, + "@supabase/realtime-js.RealtimeClient.push": { + "name": "@supabase/realtime-js.RealtimeClient.push", + "params": [ + { + "name": "data", + "type": { + "name": "RealtimeMessage", + "type": "object", + "properties": [ + { + "name": "event", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "join_ref", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "payload", + "type": { + "type": "intrinsic", + "name": "any" + } + }, + { + "name": "ref", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "topic", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + }, + "comment": { + "shortText": "Push out a message if the socket is connected.\n\nIf the socket is not connected, the message gets enqueued within a local buffer, and sent out when a connection is next established." + } + }, + "@supabase/realtime-js.RealtimeClient.removeAllChannels": { + "name": "@supabase/realtime-js.RealtimeClient.removeAllChannels", + "params": [], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "array", + "elemType": { + "type": "union", + "name": "RealtimeRemoveChannelResponse", + "subTypes": [ + { + "type": "literal", + "value": "ok" + }, + { + "type": "literal", + "value": "timed out" + }, + { + "type": "literal", + "value": "error" + }, + null + ] + } + } + } + }, + "comment": { + "shortText": "Unsubscribes, removes and tears down all channels" + } + }, + "@supabase/realtime-js.RealtimeClient.removeChannel": { + "name": "@supabase/realtime-js.RealtimeClient.removeChannel", + "params": [ + { + "name": "channel", + "type": { + "type": "nameOnly", + "name": "RealtimeChannel" + }, + "comment": { + "shortText": "A RealtimeChannel instance" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "RealtimeRemoveChannelResponse", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]", + null + ] + } + } + }, + "comment": { + "shortText": "Unsubscribes, removes and tears down a single channel" + } + }, + "@supabase/realtime-js.RealtimeClient.sendHeartbeat": { + "name": "@supabase/realtime-js.RealtimeClient.sendHeartbeat", + "params": [], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "intrinsic", + "name": "void" + } + } + }, + "comment": { + "shortText": "Sends a heartbeat message if the socket is connected." + } + }, + "@supabase/realtime-js.RealtimeClient.setAuth": { + "name": "@supabase/realtime-js.RealtimeClient.setAuth", + "params": [ + { + "name": "token", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "intrinsic", + "name": "string" + } + ] + }, + "comment": { + "shortText": "A JWT string to override the token set on the client." + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "intrinsic", + "name": "void" + } + } + }, + "comment": { + "shortText": "Sets the JWT access token used for channel subscription authorization and Realtime RLS.\n\nIf param is null it will use the `accessToken` callback function or the token set on the client.\n\nOn callback used, it will set the value of the token internal to the client.\n\nWhen a token is explicitly provided, it will be preserved across channel operations\n(including removeChannel and resubscribe). The `accessToken` callback will not be\ninvoked until `setAuth()` is called without arguments.", + "examples": [ + { + "id": "example-1", + "name": "Example 1", + "code": "```ts\nSetting the authorization header\n// Use a manual token (preserved across resubscribes, ignores accessToken callback)\nclient.realtime.setAuth('my-custom-jwt')\n\n// Switch back to using the accessToken callback\nclient.realtime.setAuth()\n```" + } + ] + } + }, + "@supabase/realtime-js.RealtimePresence.constructor": { + "name": "@supabase/realtime-js.RealtimePresence.constructor", + "params": [ + { + "name": "channel", + "type": { + "type": "nameOnly", + "name": "RealtimeChannel" + }, + "comment": { + "shortText": "The realtime channel to bind to." + } + }, + { + "name": "opts", + "type": { + "type": "nameOnly", + "name": "RealtimePresenceOptions" + }, + "isOptional": true, + "comment": { + "shortText": "Optional custom event names, e.g. `{ events: { state: 'state', diff: 'diff' } }`." + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "RealtimePresence" + } + }, + "comment": { + "shortText": "Creates a Presence helper that keeps the local presence state in sync with the server.", + "examples": [ + { + "id": "example-for-a-presence-channel", + "name": "Example for a presence channel", + "code": "```ts\nconst presence = new RealtimePresence(channel)\n\nchannel.on('presence', ({ event, key }) => {\n console.log(`Presence ${event} on ${key}`)\n})\n```" + } + ] + } + }, + "@supabase/realtime-js.WebSocketFactory.getWebSocketConstructor": { + "name": "@supabase/realtime-js.WebSocketFactory.getWebSocketConstructor", + "params": [], + "ret": { + "type": { + "type": "function", + "params": [ + { + "name": "url", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "string" + }, + { + "type": "nameOnly", + "name": "URL" + } + ] + } + }, + { + "name": "protocols", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "string" + }, + { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + } + ] + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "WebSocket" + } + } + } + }, + "comment": { + "shortText": "Returns the best available WebSocket constructor for the current runtime.", + "examples": [ + { + "id": "example-with-error-handling", + "name": "Example with error handling", + "code": "```ts\ntry {\n const WS = WebSocketFactory.getWebSocketConstructor()\n const socket = new WS('wss://example.com/socket')\n} catch (error) {\n console.error('WebSocket not available in this environment.', error)\n}\n```" + } + ] + } + }, + "@supabase/realtime-js.WebSocketFactory.isWebSocketSupported": { + "name": "@supabase/realtime-js.WebSocketFactory.isWebSocketSupported", + "params": [], + "ret": { + "type": { + "type": "intrinsic", + "name": "boolean" + } + }, + "comment": { + "shortText": "Detects whether the runtime can establish WebSocket connections.", + "examples": [ + { + "id": "example-in-a-node-js-script", + "name": "Example in a Node.js script", + "code": "```ts\nif (!WebSocketFactory.isWebSocketSupported()) {\n console.error('WebSockets are required for this script.')\n process.exitCode = 1\n}\n```" + } + ] + } + }, + "@supabase/realtime-js.WebSocketLike.addEventListener": { + "name": "@supabase/realtime-js.WebSocketLike.addEventListener", + "params": [ + { + "name": "type", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "listener", + "type": { + "type": "nameOnly", + "name": "EventListener" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + }, + "comment": { + "shortText": "Registers an event listener on the socket (compatible with browser WebSocket API)." + } + }, + "@supabase/realtime-js.WebSocketLike.close": { + "name": "@supabase/realtime-js.WebSocketLike.close", + "params": [ + { + "name": "code", + "type": { + "type": "intrinsic", + "name": "number" + }, + "isOptional": true + }, + { + "name": "reason", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + }, + "comment": { + "shortText": "Closes the socket, optionally providing a close code and reason." + } + }, + "@supabase/realtime-js.WebSocketLike.removeEventListener": { + "name": "@supabase/realtime-js.WebSocketLike.removeEventListener", + "params": [ + { + "name": "type", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "listener", + "type": { + "type": "nameOnly", + "name": "EventListener" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + }, + "comment": { + "shortText": "Removes a previously registered event listener." + } + }, + "@supabase/realtime-js.WebSocketLike.send": { + "name": "@supabase/realtime-js.WebSocketLike.send", + "params": [ + { + "name": "data", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "string" + }, + { + "type": "nameOnly", + "name": "ArrayBufferLike" + }, + { + "type": "nameOnly", + "name": "Blob" + }, + { + "type": "nameOnly", + "name": "ArrayBufferView" + } + ] + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + }, + "comment": { + "shortText": "Sends data through the socket using the underlying implementation." + } + }, + "@supabase/realtime-js.WebSocketLikeConstructor.constructor": { + "name": "@supabase/realtime-js.WebSocketLikeConstructor.constructor", + "params": [ + { + "name": "address", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "string" + }, + { + "type": "nameOnly", + "name": "URL" + } + ] + } + }, + { + "name": "subprotocols", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "string" + }, + { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + } + ] + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "object", + "name": "WebSocketLike", + "properties": [ + { + "name": "binaryType", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "bufferedAmount", + "type": { + "type": "intrinsic", + "name": "number" + }, + "isOptional": true + }, + { + "name": "CLOSED", + "type": { + "type": "intrinsic", + "name": "number" + } + }, + { + "name": "CLOSING", + "type": { + "type": "intrinsic", + "name": "number" + } + }, + { + "name": "CONNECTING", + "type": { + "type": "intrinsic", + "name": "number" + } + }, + { + "name": "dispatchEvent", + "type": { + "type": "function", + "params": [ + { + "name": "event", + "type": { + "type": "nameOnly", + "name": "Event" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "boolean" + } + } + }, + "isOptional": true + }, + { + "name": "extensions", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "onclose", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "function", + "params": [ + { + "name": "this", + "type": { + "type": "intrinsic", + "name": "any" + } + }, + { + "name": "ev", + "type": { + "type": "nameOnly", + "name": "CloseEvent" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "any" + } + } + } + ] + } + }, + { + "name": "onerror", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "function", + "params": [ + { + "name": "this", + "type": { + "type": "intrinsic", + "name": "any" + } + }, + { + "name": "ev", + "type": { + "type": "nameOnly", + "name": "Event" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "any" + } + } + } + ] + } + }, + { + "name": "onmessage", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "function", + "params": [ + { + "name": "this", + "type": { + "type": "intrinsic", + "name": "any" + } + }, + { + "name": "ev", + "type": { + "type": "nameOnly", + "name": "MessageEvent" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "any" + } + } + } + ] + } + }, + { + "name": "onopen", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "function", + "params": [ + { + "name": "this", + "type": { + "type": "intrinsic", + "name": "any" + } + }, + { + "name": "ev", + "type": { + "type": "nameOnly", + "name": "Event" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "any" + } + } + } + ] + } + }, + { + "name": "OPEN", + "type": { + "type": "intrinsic", + "name": "number" + } + }, + { + "name": "protocol", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "readyState", + "type": { + "type": "intrinsic", + "name": "number" + } + }, + { + "name": "url", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + } + } + }, + "@supabase/storage-js.StorageApiError.constructor": { + "name": "@supabase/storage-js.StorageApiError.constructor", + "params": [ + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "status", + "type": { + "type": "intrinsic", + "name": "number" + } + }, + { + "name": "statusCode", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "namespace", + "type": { + "type": "union", + "name": "ErrorNamespace", + "subTypes": [ + { + "type": "literal", + "value": "storage" + }, + { + "type": "literal", + "value": "vectors" + } + ] + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "StorageApiError" + } + } + }, + "@supabase/storage-js.StorageApiError.toJSON": { + "name": "@supabase/storage-js.StorageApiError.toJSON", + "params": [], + "ret": { + "type": { + "type": "object", + "properties": [ + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "intrinsic", + "name": "number" + } + ] + } + }, + { + "name": "statusCode", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "intrinsic", + "name": "string" + } + ] + } + } + ] + } + } + }, + "@supabase/storage-js.StorageClient.constructor": { + "name": "@supabase/storage-js.StorageClient.constructor", + "params": [ + { + "name": "url", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "headers", + "type": { + "type": "index signature", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "string" + } + } + }, + { + "name": "fetch", + "type": { + "type": "function", + "params": [ + { + "name": "input", + "type": { + "type": "union", + "subTypes": [ + { + "type": "nameOnly", + "name": "RequestInfo" + }, + { + "type": "nameOnly", + "name": "URL" + } + ] + } + }, + { + "name": "init", + "type": { + "type": "nameOnly", + "name": "RequestInit" + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "nameOnly", + "name": "Response" + } + } + }, + "comment": { + "shortText": "[MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch)" + } + }, + "isOptional": true + }, + { + "name": "opts", + "type": { + "type": "object", + "name": "StorageClientOptions", + "properties": [ + { + "name": "useNewHostname", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + } + ] + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "StorageClient" + } + }, + "comment": { + "shortText": "Creates a client for Storage buckets, files, analytics, and vectors.", + "examples": [ + { + "id": "using-supabase-js-recommended", + "name": "Using supabase-js (recommended)", + "code": "```ts\nimport { createClient } from '@supabase/supabase-js'\n\nconst supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key')\nconst avatars = supabase.storage.from('avatars')\n```" + }, + { + "id": "standalone-import-for-bundle-sensitive-environments", + "name": "Standalone import for bundle-sensitive environments", + "code": "```ts\nimport { StorageClient } from '@supabase/storage-js'\n\nconst storage = new StorageClient('https://xyzcompany.supabase.co/storage/v1', {\n apikey: 'your-publishable-key',\n})\nconst avatars = storage.from('avatars')\n```" + } + ] + } + }, + "@supabase/storage-js.StorageClient.createBucket": { + "name": "@supabase/storage-js.StorageClient.createBucket", + "params": [ + { + "name": "id", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "A unique identifier for the bucket you are creating." + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "allowedMimeTypes", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "specifies the allowed mime types that this bucket can accept during upload.\nThe default value is null, which allows files with all mime types to be uploaded.\nEach mime type specified can be a wildcard, e.g. image/*, or a specific mime type, e.g. image/png." + } + }, + { + "name": "fileSizeLimit", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "intrinsic", + "name": "string" + }, + { + "type": "intrinsic", + "name": "number" + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "specifies the max file size in bytes that can be uploaded to this bucket.\nThe global file size limit takes precedence over this value.\nThe default value is null, which doesn't set a per bucket file size limit." + } + }, + { + "name": "public", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "comment": { + "shortText": "The visibility of the bucket. Public buckets don't require an authorization token to download objects, but still require a valid token for all other operations. By default, buckets are private." + } + }, + { + "name": "type", + "type": { + "type": "union", + "name": "BucketType", + "subTypes": [ + { + "type": "literal", + "value": "STANDARD" + }, + { + "type": "literal", + "value": "ANALYTICS" + }, + null + ] + }, + "isOptional": true, + "comment": { + "shortText": "(private-beta) specifies the bucket type. see `BucketType` for more details.\n - default bucket type is `STANDARD`" + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data" + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "literal", + "value": null + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "StorageError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Creates a new Storage bucket", + "text": "- RLS policy permissions required:\n - `buckets` table permissions: `insert`\n - `objects` table permissions: none\n- Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works", + "examples": [ + { + "id": "create-bucket", + "name": "Create bucket", + "code": "```js\nconst { data, error } = await supabase\n .storage\n .createBucket('avatars', {\n public: false,\n allowedMimeTypes: ['image/png'],\n fileSizeLimit: 1024\n })\n```", + "response": "```json\n{\n \"data\": {\n \"name\": \"avatars\"\n },\n \"error\": null\n}\n```" + } + ] + } + }, + "@supabase/storage-js.StorageClient.deleteBucket": { + "name": "@supabase/storage-js.StorageClient.deleteBucket", + "params": [ + { + "name": "id", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The unique identifier of the bucket you would like to delete." + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + } + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "literal", + "value": null + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "StorageError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Deletes an existing bucket. A bucket can't be deleted with existing objects inside it.\nYou must first `empty()` the bucket.", + "text": "- RLS policy permissions required:\n - `buckets` table permissions: `select` and `delete`\n - `objects` table permissions: none\n- Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works", + "examples": [ + { + "id": "delete-bucket", + "name": "Delete bucket", + "code": "```js\nconst { data, error } = await supabase\n .storage\n .deleteBucket('avatars')\n```", + "response": "```json\n{\n \"data\": {\n \"message\": \"Successfully deleted\"\n },\n \"error\": null\n}\n```" + } + ] + } + }, + "@supabase/storage-js.StorageClient.emptyBucket": { + "name": "@supabase/storage-js.StorageClient.emptyBucket", + "params": [ + { + "name": "id", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The unique identifier of the bucket you would like to empty." + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + } + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "literal", + "value": null + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "StorageError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Removes all objects inside a single bucket.", + "text": "- RLS policy permissions required:\n - `buckets` table permissions: `select`\n - `objects` table permissions: `select` and `delete`\n- Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works", + "examples": [ + { + "id": "empty-bucket", + "name": "Empty bucket", + "code": "```js\nconst { data, error } = await supabase\n .storage\n .emptyBucket('avatars')\n```", + "response": "```json\n{\n \"data\": {\n \"message\": \"Successfully emptied\"\n },\n \"error\": null\n}\n```" + } + ] + } + }, + "@supabase/storage-js.StorageClient.from": { + "name": "@supabase/storage-js.StorageClient.from", + "params": [ + { + "name": "id", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The bucket id to operate on." + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "default" + } + }, + "comment": { + "shortText": "Perform file operation in a bucket.", + "examples": [ + { + "id": "accessing-a-bucket", + "name": "Accessing a bucket", + "code": "```typescript\nconst avatars = supabase.storage.from('avatars')\n```" + } + ] + } + }, + "@supabase/storage-js.StorageClient.getBucket": { + "name": "@supabase/storage-js.StorageClient.getBucket", + "params": [ + { + "name": "id", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The unique identifier of the bucket you would like to retrieve." + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "name": "Bucket", + "properties": [ + { + "name": "allowed_mime_types", + "type": { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + }, + "isOptional": true + }, + { + "name": "created_at", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "file_size_limit", + "type": { + "type": "intrinsic", + "name": "number" + }, + "isOptional": true + }, + { + "name": "id", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "owner", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "public", + "type": { + "type": "intrinsic", + "name": "boolean" + } + }, + { + "name": "type", + "type": { + "type": "union", + "name": "BucketType", + "subTypes": [ + "[Circular]", + "[Circular]", + null + ] + }, + "isOptional": true + }, + { + "name": "updated_at", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + } + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "literal", + "value": null + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "StorageError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Retrieves the details of an existing Storage bucket.", + "text": "- RLS policy permissions required:\n - `buckets` table permissions: `select`\n - `objects` table permissions: none\n- Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works", + "examples": [ + { + "id": "get-bucket", + "name": "Get bucket", + "code": "```js\nconst { data, error } = await supabase\n .storage\n .getBucket('avatars')\n```", + "response": "```json\n{\n \"data\": {\n \"id\": \"avatars\",\n \"name\": \"avatars\",\n \"owner\": \"\",\n \"public\": false,\n \"file_size_limit\": 1024,\n \"allowed_mime_types\": [\n \"image/png\"\n ],\n \"created_at\": \"2024-05-22T22:26:05.100Z\",\n \"updated_at\": \"2024-05-22T22:26:05.100Z\"\n },\n \"error\": null\n}\n```" + } + ] + } + }, + "@supabase/storage-js.StorageClient.listBuckets": { + "name": "@supabase/storage-js.StorageClient.listBuckets", + "params": [ + { + "name": "options", + "type": { + "type": "object", + "name": "ListBucketOptions", + "properties": [ + { + "name": "limit", + "type": { + "type": "intrinsic", + "name": "number" + }, + "isOptional": true + }, + { + "name": "offset", + "type": { + "type": "intrinsic", + "name": "number" + }, + "isOptional": true + }, + { + "name": "search", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "sortColumn", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "id" + }, + { + "type": "literal", + "value": "name" + }, + { + "type": "literal", + "value": "created_at" + }, + { + "type": "literal", + "value": "updated_at" + } + ] + }, + "isOptional": true + }, + { + "name": "sortOrder", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "asc" + }, + { + "type": "literal", + "value": "desc" + } + ] + }, + "isOptional": true + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Query parameters for listing buckets" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "Bucket", + "properties": [ + { + "name": "allowed_mime_types", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "file_size_limit", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "name", + "type": "[Circular]" + }, + { + "name": "owner", + "type": "[Circular]" + }, + { + "name": "public", + "type": "[Circular]" + }, + { + "name": "type", + "type": { + "type": "union", + "name": "BucketType", + "subTypes": [ + "[Circular]", + "[Circular]", + null + ] + }, + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + } + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "literal", + "value": null + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "StorageError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Retrieves the details of all Storage buckets within an existing project.", + "text": "- RLS policy permissions required:\n - `buckets` table permissions: `select`\n - `objects` table permissions: none\n- Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works", + "examples": [ + { + "id": "list-buckets", + "name": "List buckets", + "code": "```js\nconst { data, error } = await supabase\n .storage\n .listBuckets()\n```" + }, + { + "id": "list-buckets-with-options", + "name": "List buckets with options", + "code": "```js\nconst { data, error } = await supabase\n .storage\n .listBuckets({\n limit: 10,\n offset: 0,\n sortColumn: 'created_at',\n sortOrder: 'desc',\n search: 'prod'\n })\n```" + } + ] + } + }, + "@supabase/storage-js.StorageClient.setHeader": { + "name": "@supabase/storage-js.StorageClient.setHeader", + "params": [ + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Header name" + } + }, + { + "name": "value", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Header value" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Set an HTTP header for the request.\nCreates a shallow copy of headers to avoid mutating shared state." + } + }, + "@supabase/storage-js.StorageClient.throwOnError": { + "name": "@supabase/storage-js.StorageClient.throwOnError", + "params": [], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Enable throwing errors instead of returning them.\nWhen enabled, errors are thrown instead of returned in { data, error } format." + } + }, + "@supabase/storage-js.StorageClient.updateBucket": { + "name": "@supabase/storage-js.StorageClient.updateBucket", + "params": [ + { + "name": "id", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "A unique identifier for the bucket you are updating." + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "allowedMimeTypes", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "specifies the allowed mime types that this bucket can accept during upload.\nThe default value is null, which allows files with all mime types to be uploaded.\nEach mime type specified can be a wildcard, e.g. image/*, or a specific mime type, e.g. image/png." + } + }, + { + "name": "fileSizeLimit", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "intrinsic", + "name": "string" + }, + { + "type": "intrinsic", + "name": "number" + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "specifies the max file size in bytes that can be uploaded to this bucket.\nThe global file size limit takes precedence over this value.\nThe default value is null, which doesn't set a per bucket file size limit." + } + }, + { + "name": "public", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "comment": { + "shortText": "The visibility of the bucket. Public buckets don't require an authorization token to download objects, but still require a valid token for all other operations." + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + } + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "literal", + "value": null + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "StorageError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Updates a Storage bucket", + "text": "- RLS policy permissions required:\n - `buckets` table permissions: `select` and `update`\n - `objects` table permissions: none\n- Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works", + "examples": [ + { + "id": "update-bucket", + "name": "Update bucket", + "code": "```js\nconst { data, error } = await supabase\n .storage\n .updateBucket('avatars', {\n public: false,\n allowedMimeTypes: ['image/png'],\n fileSizeLimit: 1024\n })\n```", + "response": "```json\n{\n \"data\": {\n \"message\": \"Successfully updated\"\n },\n \"error\": null\n}\n```" + } + ] + } + }, + "@supabase/storage-js.StorageError.constructor": { + "name": "@supabase/storage-js.StorageError.constructor", + "params": [ + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "namespace", + "type": { + "type": "union", + "name": "ErrorNamespace", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + } + }, + { + "name": "status", + "type": { + "type": "intrinsic", + "name": "number" + }, + "isOptional": true + }, + { + "name": "statusCode", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "StorageError" + } + } + }, + "@supabase/storage-js.StorageError.toJSON": { + "name": "@supabase/storage-js.StorageError.toJSON", + "params": [], + "ret": { + "type": { + "type": "object", + "properties": [ + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "intrinsic", + "name": "number" + } + ] + } + }, + { + "name": "statusCode", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "intrinsic", + "name": "string" + } + ] + } + } + ] + } + } + }, + "@supabase/storage-js.StorageUnknownError.constructor": { + "name": "@supabase/storage-js.StorageUnknownError.constructor", + "params": [ + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "originalError", + "type": { + "type": "intrinsic", + "name": "unknown" + } + }, + { + "name": "namespace", + "type": { + "type": "union", + "name": "ErrorNamespace", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "StorageUnknownError" + } + } + }, + "@supabase/storage-js.StorageUnknownError.toJSON": { + "name": "@supabase/storage-js.StorageUnknownError.toJSON", + "params": [], + "ret": { + "type": { + "type": "object", + "properties": [ + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "intrinsic", + "name": "number" + } + ] + } + }, + { + "name": "statusCode", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "intrinsic", + "name": "string" + } + ] + } + } + ] + } + } + }, + "@supabase/storage-js.StorageVectorsApiError.constructor": { + "name": "@supabase/storage-js.StorageVectorsApiError.constructor", + "params": [ + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "status", + "type": { + "type": "intrinsic", + "name": "number" + } + }, + { + "name": "statusCode", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "StorageVectorsApiError" + } + } + }, + "@supabase/storage-js.StorageVectorsApiError.toJSON": { + "name": "@supabase/storage-js.StorageVectorsApiError.toJSON", + "params": [], + "ret": { + "type": { + "type": "object", + "properties": [ + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "intrinsic", + "name": "number" + } + ] + } + }, + { + "name": "statusCode", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "intrinsic", + "name": "string" + } + ] + } + } + ] + } + } + }, + "@supabase/storage-js.StorageVectorsError.constructor": { + "name": "@supabase/storage-js.StorageVectorsError.constructor", + "params": [ + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "StorageVectorsError" + } + } + }, + "@supabase/storage-js.StorageVectorsError.toJSON": { + "name": "@supabase/storage-js.StorageVectorsError.toJSON", + "params": [], + "ret": { + "type": { + "type": "object", + "properties": [ + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "intrinsic", + "name": "number" + } + ] + } + }, + { + "name": "statusCode", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "intrinsic", + "name": "string" + } + ] + } + } + ] + } + } + }, + "@supabase/storage-js.StorageVectorsUnknownError.constructor": { + "name": "@supabase/storage-js.StorageVectorsUnknownError.constructor", + "params": [ + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "originalError", + "type": { + "type": "intrinsic", + "name": "unknown" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "StorageVectorsUnknownError" + } + } + }, + "@supabase/storage-js.StorageVectorsUnknownError.toJSON": { + "name": "@supabase/storage-js.StorageVectorsUnknownError.toJSON", + "params": [], + "ret": { + "type": { + "type": "object", + "properties": [ + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "intrinsic", + "name": "number" + } + ] + } + }, + { + "name": "statusCode", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "intrinsic", + "name": "string" + } + ] + } + } + ] + } + } + }, + "@supabase/storage-js.isStorageError": { + "name": "@supabase/storage-js.isStorageError", + "params": [ + { + "name": "error", + "type": { + "type": "intrinsic", + "name": "unknown" + }, + "comment": { + "shortText": "The error to check" + } + } + ], + "comment": { + "shortText": "Type guard to check if an error is a StorageError" + } + }, + "@supabase/storage-js.isStorageVectorsError": { + "name": "@supabase/storage-js.isStorageVectorsError", + "params": [ + { + "name": "error", + "type": { + "type": "intrinsic", + "name": "unknown" + }, + "comment": { + "shortText": "The error to check" + } + } + ], + "comment": { + "shortText": "Type guard to check if an error is a StorageVectorsError" + } + }, + "@supabase/storage-js.packages/BlobDownloadBuilder.default.constructor": { + "name": "@supabase/storage-js.packages/BlobDownloadBuilder.default.constructor", + "params": [ + { + "name": "downloadFn", + "type": { + "type": "function", + "params": [], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "nameOnly", + "name": "Response" + } + } + } + } + }, + { + "name": "shouldThrowOnError", + "type": { + "type": "intrinsic", + "name": "boolean" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "default" + } + } + }, + "@supabase/storage-js.packages/BlobDownloadBuilder.default.asStream": { + "name": "@supabase/storage-js.packages/BlobDownloadBuilder.default.asStream", + "params": [], + "ret": { + "type": { + "type": "nameOnly", + "name": "default" + } + } + }, + "@supabase/storage-js.packages/BlobDownloadBuilder.default.catch": { + "name": "@supabase/storage-js.packages/BlobDownloadBuilder.default.catch", + "params": [ + { + "name": "onrejected", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "function", + "params": [ + { + "name": "reason", + "type": { + "type": "intrinsic", + "name": "any" + } + } + ], + "ret": { + "type": { + "type": "union", + "subTypes": [ + { + "type": "nameOnly", + "name": "TResult" + }, + { + "type": "nameOnly", + "name": "PromiseLike" + } + ] + } + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "The callback to execute when the Promise is rejected." + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + { + "type": "union", + "name": "DownloadResult", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "nameOnly", + "name": "Blob" + } + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "literal", + "value": null + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "StorageError" + } + } + ] + } + ] + }, + { + "type": "nameOnly", + "name": "TResult" + } + ] + } + } + }, + "comment": { + "shortText": "Attaches a callback for only the rejection of the Promise." + } + }, + "@supabase/storage-js.packages/BlobDownloadBuilder.default.finally": { + "name": "@supabase/storage-js.packages/BlobDownloadBuilder.default.finally", + "params": [ + { + "name": "onfinally", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "function", + "params": [], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "The callback to execute when the Promise is settled (fulfilled or rejected)." + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "DownloadResult", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "nameOnly", + "name": "Blob" + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "StorageError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The\nresolved value cannot be modified from the callback." + } + }, + "@supabase/storage-js.packages/BlobDownloadBuilder.default.then": { + "name": "@supabase/storage-js.packages/BlobDownloadBuilder.default.then", + "params": [ + { + "name": "onfulfilled", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "function", + "params": [ + { + "name": "value", + "type": { + "type": "union", + "name": "DownloadResult", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "nameOnly", + "name": "Blob" + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "StorageError" + } + } + ] + } + ] + } + } + ], + "ret": { + "type": { + "type": "union", + "subTypes": [ + { + "type": "nameOnly", + "name": "TResult1" + }, + { + "type": "nameOnly", + "name": "PromiseLike" + } + ] + } + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "The callback to execute when the Promise is resolved." + } + }, + { + "name": "onrejected", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "function", + "params": [ + { + "name": "reason", + "type": { + "type": "intrinsic", + "name": "any" + } + } + ], + "ret": { + "type": { + "type": "union", + "subTypes": [ + { + "type": "nameOnly", + "name": "TResult2" + }, + { + "type": "nameOnly", + "name": "PromiseLike" + } + ] + } + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "The callback to execute when the Promise is rejected." + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + { + "type": "nameOnly", + "name": "TResult1" + }, + { + "type": "nameOnly", + "name": "TResult2" + } + ] + } + } + }, + "comment": { + "shortText": "Attaches callbacks for the resolution and/or rejection of the Promise." + } + }, + "@supabase/storage-js.packages/StorageAnalyticsClient.default.constructor": { + "name": "@supabase/storage-js.packages/StorageAnalyticsClient.default.constructor", + "params": [ + { + "name": "url", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The base URL for the storage API" + } + }, + { + "name": "headers", + "type": { + "type": "index signature", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "string" + } + }, + "comment": { + "shortText": "HTTP headers to include in requests" + } + }, + { + "name": "fetch", + "type": { + "type": "function", + "params": [ + { + "name": "input", + "type": { + "type": "union", + "subTypes": [ + { + "type": "nameOnly", + "name": "RequestInfo" + }, + { + "type": "nameOnly", + "name": "URL" + } + ] + } + }, + { + "name": "init", + "type": { + "type": "nameOnly", + "name": "RequestInit" + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "nameOnly", + "name": "Response" + } + } + }, + "comment": { + "shortText": "[MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch)" + } + }, + "isOptional": true, + "comment": { + "shortText": "Optional custom fetch implementation" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "default" + } + }, + "comment": { + "shortText": "Creates a new StorageAnalyticsClient instance\n\n**Public alpha:** This API is part of a public alpha release and may not be available to your account type.", + "tags": [ + { + "tag": "alpha", + "text": "" + } + ], + "examples": [ + { + "id": "using-supabase-js-recommended", + "name": "Using supabase-js (recommended)", + "code": "```typescript\nimport { createClient } from '@supabase/supabase-js'\n\nconst supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key')\nconst { data, error } = await supabase.storage.analytics.listBuckets()\n```" + }, + { + "id": "standalone-import-for-bundle-sensitive-environments", + "name": "Standalone import for bundle-sensitive environments", + "code": "```typescript\nimport { StorageAnalyticsClient } from '@supabase/storage-js'\n\nconst client = new StorageAnalyticsClient(url, headers)\n```" + } + ] + } + }, + "@supabase/storage-js.packages/StorageAnalyticsClient.default.createBucket": { + "name": "@supabase/storage-js.packages/StorageAnalyticsClient.default.createBucket", + "params": [ + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "A unique name for the bucket you are creating" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "name": "AnalyticBucket", + "properties": [ + { + "name": "created_at", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "ISO 8601 timestamp of bucket creation" + } + }, + { + "name": "format", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Storage format used (e.g., 'iceberg')" + } + }, + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Unique identifier for the bucket" + } + }, + { + "name": "type", + "type": { + "type": "literal", + "value": "ANALYTICS" + }, + "comment": { + "shortText": "Bucket type - always 'ANALYTICS' for analytics buckets" + } + }, + { + "name": "updated_at", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "ISO 8601 timestamp of last update" + } + } + ] + } + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "literal", + "value": null + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "StorageError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Creates a new analytics bucket using Iceberg tables\nAnalytics buckets are optimized for analytical queries and data processing\n\n**Public alpha:** This API is part of a public alpha release and may not be available to your account type.", + "tags": [ + { + "tag": "alpha", + "text": "" + } + ], + "text": "- Creates a new analytics bucket using Iceberg tables\n- Analytics buckets are optimized for analytical queries and data processing", + "examples": [ + { + "id": "create-analytics-bucket", + "name": "Create analytics bucket", + "code": "```js\nconst { data, error } = await supabase\n .storage\n .analytics\n .createBucket('analytics-data')\n```", + "response": "```json\n{\n \"data\": {\n \"name\": \"analytics-data\",\n \"type\": \"ANALYTICS\",\n \"format\": \"iceberg\",\n \"created_at\": \"2024-05-22T22:26:05.100Z\",\n \"updated_at\": \"2024-05-22T22:26:05.100Z\"\n },\n \"error\": null\n}\n```" + } + ] + } + }, + "@supabase/storage-js.packages/StorageAnalyticsClient.default.deleteBucket": { + "name": "@supabase/storage-js.packages/StorageAnalyticsClient.default.deleteBucket", + "params": [ + { + "name": "bucketName", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The unique identifier of the bucket you would like to delete" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + } + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "literal", + "value": null + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "StorageError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Deletes an existing analytics bucket\nA bucket can't be deleted with existing objects inside it\nYou must first empty the bucket before deletion\n\n**Public alpha:** This API is part of a public alpha release and may not be available to your account type.", + "tags": [ + { + "tag": "alpha", + "text": "" + } + ], + "text": "- Deletes an analytics bucket", + "examples": [ + { + "id": "delete-analytics-bucket", + "name": "Delete analytics bucket", + "code": "```js\nconst { data, error } = await supabase\n .storage\n .analytics\n .deleteBucket('analytics-data')\n```", + "response": "```json\n{\n \"data\": {\n \"message\": \"Successfully deleted\"\n },\n \"error\": null\n}\n```" + } + ] + } + }, + "@supabase/storage-js.packages/StorageAnalyticsClient.default.from": { + "name": "@supabase/storage-js.packages/StorageAnalyticsClient.default.from", + "params": [ + { + "name": "bucketName", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The name of the analytics bucket (warehouse) to connect to" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "WrappedIcebergRestCatalog" + } + }, + "comment": { + "shortText": "Get an Iceberg REST Catalog client configured for a specific analytics bucket\nUse this to perform advanced table and namespace operations within the bucket\nThe returned client provides full access to the Apache Iceberg REST Catalog API\nwith the Supabase `{ data, error }` pattern for consistent error handling on all operations.\n\n**Public alpha:** This API is part of a public alpha release and may not be available to your account type.", + "tags": [ + { + "tag": "alpha", + "text": "" + } + ], + "text": "This method provides a bridge between Supabase's bucket management and the standard\nApache Iceberg REST Catalog API. The bucket name maps to the Iceberg warehouse parameter.\nAll authentication and configuration is handled automatically using your Supabase credentials.\n\n**Error Handling**: Invalid bucket names throw immediately. All catalog\noperations return `{ data, error }` where errors are `IcebergError` instances from iceberg-js.\nUse helper methods like `error.isNotFound()` or check `error.status` for specific error handling.\nUse `.throwOnError()` on the analytics client if you prefer exceptions for catalog operations.\n\n**Cleanup Operations**: When using `dropTable`, the `purge: true` option permanently\ndeletes all table data. Without it, the table is marked as deleted but data remains.\n\n**Library Dependency**: The returned catalog wraps `IcebergRestCatalog` from iceberg-js.\nFor complete API documentation and advanced usage, refer to the\n[iceberg-js documentation](https://supabase.github.io/iceberg-js/).", + "examples": [ + { + "id": "get-catalog-and-create-table", + "name": "Get catalog and create table", + "code": "```js\n// First, create an analytics bucket\nconst { data: bucket, error: bucketError } = await supabase\n .storage\n .analytics\n .createBucket('analytics-data')\n\n// Get the Iceberg catalog for that bucket\nconst catalog = supabase.storage.analytics.from('analytics-data')\n\n// Create a namespace\nconst { error: nsError } = await catalog.createNamespace({ namespace: ['default'] })\n\n// Create a table with schema\nconst { data: tableMetadata, error: tableError } = await catalog.createTable(\n { namespace: ['default'] },\n {\n name: 'events',\n schema: {\n type: 'struct',\n fields: [\n { id: 1, name: 'id', type: 'long', required: true },\n { id: 2, name: 'timestamp', type: 'timestamp', required: true },\n { id: 3, name: 'user_id', type: 'string', required: false }\n ],\n 'schema-id': 0,\n 'identifier-field-ids': [1]\n },\n 'partition-spec': {\n 'spec-id': 0,\n fields: []\n },\n 'write-order': {\n 'order-id': 0,\n fields: []\n },\n properties: {\n 'write.format.default': 'parquet'\n }\n }\n)\n```" + }, + { + "id": "list-tables-in-namespace", + "name": "List tables in namespace", + "code": "```js\nconst catalog = supabase.storage.analytics.from('analytics-data')\n\n// List all tables in the default namespace\nconst { data: tables, error: listError } = await catalog.listTables({ namespace: ['default'] })\nif (listError) {\n if (listError.isNotFound()) {\n console.log('Namespace not found')\n }\n return\n}\nconsole.log(tables) // [{ namespace: ['default'], name: 'events' }]\n```" + }, + { + "id": "working-with-namespaces", + "name": "Working with namespaces", + "code": "```js\nconst catalog = supabase.storage.analytics.from('analytics-data')\n\n// List all namespaces\nconst { data: namespaces } = await catalog.listNamespaces()\n\n// Create namespace with properties\nawait catalog.createNamespace(\n { namespace: ['production'] },\n { properties: { owner: 'data-team', env: 'prod' } }\n)\n```" + }, + { + "id": "cleanup-operations", + "name": "Cleanup operations", + "code": "```js\nconst catalog = supabase.storage.analytics.from('analytics-data')\n\n// Drop table with purge option (removes all data)\nconst { error: dropError } = await catalog.dropTable(\n { namespace: ['default'], name: 'events' },\n { purge: true }\n)\n\nif (dropError?.isNotFound()) {\n console.log('Table does not exist')\n}\n\n// Drop namespace (must be empty)\nawait catalog.dropNamespace({ namespace: ['default'] })\n```" + } + ] + } + }, + "@supabase/storage-js.packages/StorageAnalyticsClient.default.listBuckets": { + "name": "@supabase/storage-js.packages/StorageAnalyticsClient.default.listBuckets", + "params": [ + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "limit", + "type": { + "type": "intrinsic", + "name": "number" + }, + "isOptional": true, + "comment": { + "shortText": "Maximum number of buckets to return" + } + }, + { + "name": "offset", + "type": { + "type": "intrinsic", + "name": "number" + }, + "isOptional": true, + "comment": { + "shortText": "Number of buckets to skip" + } + }, + { + "name": "search", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Search term to filter bucket names" + } + }, + { + "name": "sortColumn", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "name" + }, + { + "type": "literal", + "value": "created_at" + }, + { + "type": "literal", + "value": "updated_at" + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Column to sort by ('name', 'created_at', 'updated_at')" + } + }, + { + "name": "sortOrder", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "asc" + }, + { + "type": "literal", + "value": "desc" + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Sort order ('asc' or 'desc')" + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Query parameters for listing buckets" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "AnalyticBucket", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "comment": { + "shortText": "ISO 8601 timestamp of bucket creation" + } + }, + { + "name": "format", + "type": "[Circular]", + "comment": { + "shortText": "Storage format used (e.g., 'iceberg')" + } + }, + { + "name": "name", + "type": "[Circular]", + "comment": { + "shortText": "Unique identifier for the bucket" + } + }, + { + "name": "type", + "type": "[Circular]", + "comment": { + "shortText": "Bucket type - always 'ANALYTICS' for analytics buckets" + } + }, + { + "name": "updated_at", + "type": "[Circular]", + "comment": { + "shortText": "ISO 8601 timestamp of last update" + } + } + ] + } + } + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "literal", + "value": null + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "StorageError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Retrieves the details of all Analytics Storage buckets within an existing project\nOnly returns buckets of type 'ANALYTICS'\n\n**Public alpha:** This API is part of a public alpha release and may not be available to your account type.", + "tags": [ + { + "tag": "alpha", + "text": "" + } + ], + "text": "- Retrieves the details of all Analytics Storage buckets within an existing project\n- Only returns buckets of type 'ANALYTICS'", + "examples": [ + { + "id": "list-analytics-buckets", + "name": "List analytics buckets", + "code": "```js\nconst { data, error } = await supabase\n .storage\n .analytics\n .listBuckets({\n limit: 10,\n offset: 0,\n sortColumn: 'created_at',\n sortOrder: 'desc'\n })\n```", + "response": "```json\n{\n \"data\": [\n {\n \"name\": \"analytics-data\",\n \"type\": \"ANALYTICS\",\n \"format\": \"iceberg\",\n \"created_at\": \"2024-05-22T22:26:05.100Z\",\n \"updated_at\": \"2024-05-22T22:26:05.100Z\"\n }\n ],\n \"error\": null\n}\n```" + } + ] + } + }, + "@supabase/storage-js.packages/StorageAnalyticsClient.default.setHeader": { + "name": "@supabase/storage-js.packages/StorageAnalyticsClient.default.setHeader", + "params": [ + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Header name" + } + }, + { + "name": "value", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Header value" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Set an HTTP header for the request.\nCreates a shallow copy of headers to avoid mutating shared state." + } + }, + "@supabase/storage-js.packages/StorageAnalyticsClient.default.throwOnError": { + "name": "@supabase/storage-js.packages/StorageAnalyticsClient.default.throwOnError", + "params": [], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Enable throwing errors instead of returning them.\nWhen enabled, errors are thrown instead of returned in { data, error } format." + } + }, + "@supabase/storage-js.packages/StorageBucketApi.default.constructor": { + "name": "@supabase/storage-js.packages/StorageBucketApi.default.constructor", + "params": [ + { + "name": "url", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "headers", + "type": { + "type": "index signature", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "string" + } + } + }, + { + "name": "fetch", + "type": { + "type": "function", + "params": [ + { + "name": "input", + "type": { + "type": "union", + "subTypes": [ + { + "type": "nameOnly", + "name": "RequestInfo" + }, + { + "type": "nameOnly", + "name": "URL" + } + ] + } + }, + { + "name": "init", + "type": { + "type": "nameOnly", + "name": "RequestInit" + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "nameOnly", + "name": "Response" + } + } + }, + "comment": { + "shortText": "[MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch)" + } + }, + "isOptional": true + }, + { + "name": "opts", + "type": { + "type": "object", + "name": "StorageClientOptions", + "properties": [ + { + "name": "useNewHostname", + "type": "[Circular]", + "isOptional": true + } + ] + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "default" + } + } + }, + "@supabase/storage-js.packages/StorageBucketApi.default.createBucket": { + "name": "@supabase/storage-js.packages/StorageBucketApi.default.createBucket", + "params": [ + { + "name": "id", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "A unique identifier for the bucket you are creating." + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "allowedMimeTypes", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "specifies the allowed mime types that this bucket can accept during upload.\nThe default value is null, which allows files with all mime types to be uploaded.\nEach mime type specified can be a wildcard, e.g. image/*, or a specific mime type, e.g. image/png." + } + }, + { + "name": "fileSizeLimit", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "intrinsic", + "name": "string" + }, + { + "type": "intrinsic", + "name": "number" + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "specifies the max file size in bytes that can be uploaded to this bucket.\nThe global file size limit takes precedence over this value.\nThe default value is null, which doesn't set a per bucket file size limit." + } + }, + { + "name": "public", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "comment": { + "shortText": "The visibility of the bucket. Public buckets don't require an authorization token to download objects, but still require a valid token for all other operations. By default, buckets are private." + } + }, + { + "name": "type", + "type": { + "type": "union", + "name": "BucketType", + "subTypes": [ + "[Circular]", + "[Circular]", + null + ] + }, + "isOptional": true, + "comment": { + "shortText": "(private-beta) specifies the bucket type. see `BucketType` for more details.\n - default bucket type is `STANDARD`" + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data" + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "literal", + "value": null + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "StorageError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Creates a new Storage bucket", + "text": "- RLS policy permissions required:\n - `buckets` table permissions: `insert`\n - `objects` table permissions: none\n- Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works", + "examples": [ + { + "id": "create-bucket", + "name": "Create bucket", + "code": "```js\nconst { data, error } = await supabase\n .storage\n .createBucket('avatars', {\n public: false,\n allowedMimeTypes: ['image/png'],\n fileSizeLimit: 1024\n })\n```", + "response": "```json\n{\n \"data\": {\n \"name\": \"avatars\"\n },\n \"error\": null\n}\n```" + } + ] + } + }, + "@supabase/storage-js.packages/StorageBucketApi.default.deleteBucket": { + "name": "@supabase/storage-js.packages/StorageBucketApi.default.deleteBucket", + "params": [ + { + "name": "id", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The unique identifier of the bucket you would like to delete." + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + } + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "literal", + "value": null + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "StorageError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Deletes an existing bucket. A bucket can't be deleted with existing objects inside it.\nYou must first `empty()` the bucket.", + "text": "- RLS policy permissions required:\n - `buckets` table permissions: `select` and `delete`\n - `objects` table permissions: none\n- Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works", + "examples": [ + { + "id": "delete-bucket", + "name": "Delete bucket", + "code": "```js\nconst { data, error } = await supabase\n .storage\n .deleteBucket('avatars')\n```", + "response": "```json\n{\n \"data\": {\n \"message\": \"Successfully deleted\"\n },\n \"error\": null\n}\n```" + } + ] + } + }, + "@supabase/storage-js.packages/StorageBucketApi.default.emptyBucket": { + "name": "@supabase/storage-js.packages/StorageBucketApi.default.emptyBucket", + "params": [ + { + "name": "id", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The unique identifier of the bucket you would like to empty." + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + } + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "literal", + "value": null + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "StorageError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Removes all objects inside a single bucket.", + "text": "- RLS policy permissions required:\n - `buckets` table permissions: `select`\n - `objects` table permissions: `select` and `delete`\n- Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works", + "examples": [ + { + "id": "empty-bucket", + "name": "Empty bucket", + "code": "```js\nconst { data, error } = await supabase\n .storage\n .emptyBucket('avatars')\n```", + "response": "```json\n{\n \"data\": {\n \"message\": \"Successfully emptied\"\n },\n \"error\": null\n}\n```" + } + ] + } + }, + "@supabase/storage-js.packages/StorageBucketApi.default.getBucket": { + "name": "@supabase/storage-js.packages/StorageBucketApi.default.getBucket", + "params": [ + { + "name": "id", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The unique identifier of the bucket you would like to retrieve." + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "name": "Bucket", + "properties": [ + { + "name": "allowed_mime_types", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "file_size_limit", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "name", + "type": "[Circular]" + }, + { + "name": "owner", + "type": "[Circular]" + }, + { + "name": "public", + "type": "[Circular]" + }, + { + "name": "type", + "type": { + "type": "union", + "name": "BucketType", + "subTypes": [ + "[Circular]", + "[Circular]", + null + ] + }, + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "literal", + "value": null + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "StorageError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Retrieves the details of an existing Storage bucket.", + "text": "- RLS policy permissions required:\n - `buckets` table permissions: `select`\n - `objects` table permissions: none\n- Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works", + "examples": [ + { + "id": "get-bucket", + "name": "Get bucket", + "code": "```js\nconst { data, error } = await supabase\n .storage\n .getBucket('avatars')\n```", + "response": "```json\n{\n \"data\": {\n \"id\": \"avatars\",\n \"name\": \"avatars\",\n \"owner\": \"\",\n \"public\": false,\n \"file_size_limit\": 1024,\n \"allowed_mime_types\": [\n \"image/png\"\n ],\n \"created_at\": \"2024-05-22T22:26:05.100Z\",\n \"updated_at\": \"2024-05-22T22:26:05.100Z\"\n },\n \"error\": null\n}\n```" + } + ] + } + }, + "@supabase/storage-js.packages/StorageBucketApi.default.listBuckets": { + "name": "@supabase/storage-js.packages/StorageBucketApi.default.listBuckets", + "params": [ + { + "name": "options", + "type": { + "type": "object", + "name": "ListBucketOptions", + "properties": [ + { + "name": "limit", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "offset", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "search", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "sortColumn", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true + }, + { + "name": "sortOrder", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Query parameters for listing buckets" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "Bucket", + "properties": [ + { + "name": "allowed_mime_types", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "file_size_limit", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "name", + "type": "[Circular]" + }, + { + "name": "owner", + "type": "[Circular]" + }, + { + "name": "public", + "type": "[Circular]" + }, + { + "name": "type", + "type": { + "type": "union", + "name": "BucketType", + "subTypes": [ + "[Circular]", + "[Circular]", + null + ] + }, + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + } + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "literal", + "value": null + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "StorageError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Retrieves the details of all Storage buckets within an existing project.", + "text": "- RLS policy permissions required:\n - `buckets` table permissions: `select`\n - `objects` table permissions: none\n- Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works", + "examples": [ + { + "id": "list-buckets", + "name": "List buckets", + "code": "```js\nconst { data, error } = await supabase\n .storage\n .listBuckets()\n```" + }, + { + "id": "list-buckets-with-options", + "name": "List buckets with options", + "code": "```js\nconst { data, error } = await supabase\n .storage\n .listBuckets({\n limit: 10,\n offset: 0,\n sortColumn: 'created_at',\n sortOrder: 'desc',\n search: 'prod'\n })\n```" + } + ] + } + }, + "@supabase/storage-js.packages/StorageBucketApi.default.setHeader": { + "name": "@supabase/storage-js.packages/StorageBucketApi.default.setHeader", + "params": [ + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Header name" + } + }, + { + "name": "value", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Header value" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Set an HTTP header for the request.\nCreates a shallow copy of headers to avoid mutating shared state." + } + }, + "@supabase/storage-js.packages/StorageBucketApi.default.throwOnError": { + "name": "@supabase/storage-js.packages/StorageBucketApi.default.throwOnError", + "params": [], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Enable throwing errors instead of returning them.\nWhen enabled, errors are thrown instead of returned in { data, error } format." + } + }, + "@supabase/storage-js.packages/StorageBucketApi.default.updateBucket": { + "name": "@supabase/storage-js.packages/StorageBucketApi.default.updateBucket", + "params": [ + { + "name": "id", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "A unique identifier for the bucket you are updating." + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "allowedMimeTypes", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "specifies the allowed mime types that this bucket can accept during upload.\nThe default value is null, which allows files with all mime types to be uploaded.\nEach mime type specified can be a wildcard, e.g. image/*, or a specific mime type, e.g. image/png." + } + }, + { + "name": "fileSizeLimit", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "intrinsic", + "name": "string" + }, + { + "type": "intrinsic", + "name": "number" + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "specifies the max file size in bytes that can be uploaded to this bucket.\nThe global file size limit takes precedence over this value.\nThe default value is null, which doesn't set a per bucket file size limit." + } + }, + { + "name": "public", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "comment": { + "shortText": "The visibility of the bucket. Public buckets don't require an authorization token to download objects, but still require a valid token for all other operations." + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + } + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "literal", + "value": null + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "StorageError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Updates a Storage bucket", + "text": "- RLS policy permissions required:\n - `buckets` table permissions: `select` and `update`\n - `objects` table permissions: none\n- Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works", + "examples": [ + { + "id": "update-bucket", + "name": "Update bucket", + "code": "```js\nconst { data, error } = await supabase\n .storage\n .updateBucket('avatars', {\n public: false,\n allowedMimeTypes: ['image/png'],\n fileSizeLimit: 1024\n })\n```", + "response": "```json\n{\n \"data\": {\n \"message\": \"Successfully updated\"\n },\n \"error\": null\n}\n```" + } + ] + } + }, + "@supabase/storage-js.packages/StorageFileApi.default.constructor": { + "name": "@supabase/storage-js.packages/StorageFileApi.default.constructor", + "params": [ + { + "name": "url", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "headers", + "type": { + "type": "index signature", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "string" + } + } + }, + { + "name": "bucketId", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "fetch", + "type": { + "type": "function", + "params": [ + { + "name": "input", + "type": { + "type": "union", + "subTypes": [ + { + "type": "nameOnly", + "name": "RequestInfo" + }, + { + "type": "nameOnly", + "name": "URL" + } + ] + } + }, + { + "name": "init", + "type": { + "type": "nameOnly", + "name": "RequestInit" + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "nameOnly", + "name": "Response" + } + } + }, + "comment": { + "shortText": "[MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch)" + } + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "default" + } + } + }, + "@supabase/storage-js.packages/StorageFileApi.default.copy": { + "name": "@supabase/storage-js.packages/StorageFileApi.default.copy", + "params": [ + { + "name": "fromPath", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The original file path, including the current file name. For example `folder/image.png`." + } + }, + { + "name": "toPath", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The new file path, including the new file name. For example `folder/image-copy.png`." + } + }, + { + "name": "options", + "type": { + "type": "object", + "name": "DestinationOptions", + "properties": [ + { + "name": "destinationBucket", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "The destination options." + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "path", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + } + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "literal", + "value": null + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "StorageError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Copies an existing file to a new path in the same bucket.", + "text": "- RLS policy permissions required:\n - `buckets` table permissions: none\n - `objects` table permissions: `insert` and `select`\n- Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works", + "examples": [ + { + "id": "copy-file", + "name": "Copy file", + "code": "```js\nconst { data, error } = await supabase\n .storage\n .from('avatars')\n .copy('public/avatar1.png', 'private/avatar2.png')\n```", + "response": "```json\n{\n \"data\": {\n \"path\": \"avatars/private/avatar2.png\"\n },\n \"error\": null\n}\n```" + } + ] + } + }, + "@supabase/storage-js.packages/StorageFileApi.default.createSignedUploadUrl": { + "name": "@supabase/storage-js.packages/StorageFileApi.default.createSignedUploadUrl", + "params": [ + { + "name": "path", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The file path, including the current file name. For example `folder/image.png`." + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "upsert", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "comment": { + "shortText": "If set to true, allows the file to be overwritten if it already exists." + } + } + ] + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "path", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "signedUrl", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "token", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + } + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "literal", + "value": null + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "StorageError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Creates a signed upload URL.\nSigned upload URLs can be used to upload files to the bucket without further authentication.\nThey are valid for 2 hours.", + "text": "- RLS policy permissions required:\n - `buckets` table permissions: none\n - `objects` table permissions: `insert`\n- Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works", + "examples": [ + { + "id": "create-signed-upload-url", + "name": "Create Signed Upload URL", + "code": "```js\nconst { data, error } = await supabase\n .storage\n .from('avatars')\n .createSignedUploadUrl('folder/cat.jpg')\n```", + "response": "```json\n{\n \"data\": {\n \"signedUrl\": \"https://example.supabase.co/storage/v1/object/upload/sign/avatars/folder/cat.jpg?token=\",\n \"path\": \"folder/cat.jpg\",\n \"token\": \"\"\n },\n \"error\": null\n}\n```" + } + ] + } + }, + "@supabase/storage-js.packages/StorageFileApi.default.createSignedUrl": { + "name": "@supabase/storage-js.packages/StorageFileApi.default.createSignedUrl", + "params": [ + { + "name": "path", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The file path, including the current file name. For example `folder/image.png`." + } + }, + { + "name": "expiresIn", + "type": { + "type": "intrinsic", + "name": "number" + }, + "comment": { + "shortText": "The number of seconds until the signed URL expires. For example, `60` for a URL which is valid for one minute." + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "cacheNonce", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Append a cache nonce parameter to the URL to invalidate the cache." + } + }, + { + "name": "download", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "string" + }, + { + "type": "intrinsic", + "name": "boolean" + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "triggers the file as a download if set to true. Set this parameter as the name of the file if you want to trigger the download with a different filename." + } + }, + { + "name": "transform", + "type": { + "type": "object", + "name": "TransformOptions", + "properties": [ + { + "name": "format", + "type": { + "type": "literal", + "value": "origin" + }, + "isOptional": true, + "comment": { + "shortText": "Specify the format of the image requested.\n\nWhen using 'origin' we force the format to be the same as the original image.\nWhen this option is not passed in, images are optimized to modern image formats like Webp." + } + }, + { + "name": "height", + "type": { + "type": "intrinsic", + "name": "number" + }, + "isOptional": true, + "comment": { + "shortText": "The height of the image in pixels." + } + }, + { + "name": "quality", + "type": { + "type": "intrinsic", + "name": "number" + }, + "isOptional": true, + "comment": { + "shortText": "Set the quality of the returned image.\nA number from 20 to 100, with 100 being the highest quality.\nDefaults to 80" + } + }, + { + "name": "resize", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "cover" + }, + { + "type": "literal", + "value": "contain" + }, + { + "type": "literal", + "value": "fill" + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "The resize mode can be cover, contain or fill. Defaults to cover.\nCover resizes the image to maintain it's aspect ratio while filling the entire width and height.\nContain resizes the image to maintain it's aspect ratio while fitting the entire image within the width and height.\nFill resizes the image to fill the entire width and height. If the object's aspect ratio does not match the width and height, the image will be stretched to fit." + } + }, + { + "name": "width", + "type": { + "type": "intrinsic", + "name": "number" + }, + "isOptional": true, + "comment": { + "shortText": "The width of the image in pixels." + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Transform the asset before serving it to the client." + } + } + ] + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "signedUrl", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + } + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "literal", + "value": null + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "StorageError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Creates a signed URL. Use a signed URL to share a file for a fixed amount of time.", + "text": "- RLS policy permissions required:\n - `buckets` table permissions: none\n - `objects` table permissions: `select`\n- Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works", + "examples": [ + { + "id": "create-signed-url", + "name": "Create Signed URL", + "code": "```js\nconst { data, error } = await supabase\n .storage\n .from('avatars')\n .createSignedUrl('folder/avatar1.png', 60)\n```", + "response": "```json\n{\n \"data\": {\n \"signedUrl\": \"https://example.supabase.co/storage/v1/object/sign/avatars/folder/avatar1.png?token=\"\n },\n \"error\": null\n}\n```" + }, + { + "id": "create-a-signed-url-for-an-asset-with-transformations", + "name": "Create a signed URL for an asset with transformations", + "code": "```js\nconst { data } = await supabase\n .storage\n .from('avatars')\n .createSignedUrl('folder/avatar1.png', 60, {\n transform: {\n width: 100,\n height: 100,\n }\n })\n```" + }, + { + "id": "create-a-signed-url-which-triggers-the-download-of-the-asset", + "name": "Create a signed URL which triggers the download of the asset", + "code": "```js\nconst { data } = await supabase\n .storage\n .from('avatars')\n .createSignedUrl('folder/avatar1.png', 60, {\n download: true,\n })\n```" + } + ] + } + }, + "@supabase/storage-js.packages/StorageFileApi.default.createSignedUrls": { + "name": "@supabase/storage-js.packages/StorageFileApi.default.createSignedUrls", + "params": [ + { + "name": "paths", + "type": { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + }, + "comment": { + "shortText": "The file paths to be downloaded, including the current file names. For example `['folder/image.png', 'folder2/image2.png']`." + } + }, + { + "name": "expiresIn", + "type": { + "type": "intrinsic", + "name": "number" + }, + "comment": { + "shortText": "The number of seconds until the signed URLs expire. For example, `60` for URLs which are valid for one minute." + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "cacheNonce", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Append a cache nonce parameter to the URL to invalidate the cache." + } + }, + { + "name": "download", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "string" + }, + { + "type": "intrinsic", + "name": "boolean" + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "triggers the file as a download if set to true. Set this parameter as the name of the file if you want to trigger the download with a different filename." + } + } + ] + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "array", + "elemType": { + "type": "object", + "properties": [ + { + "name": "error", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "intrinsic", + "name": "string" + } + ] + } + }, + { + "name": "path", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "intrinsic", + "name": "string" + } + ] + } + }, + { + "name": "signedUrl", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "intrinsic", + "name": "string" + } + ] + } + } + ] + } + } + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "literal", + "value": null + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "StorageError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Creates multiple signed URLs. Use a signed URL to share a file for a fixed amount of time.", + "text": "- RLS policy permissions required:\n - `buckets` table permissions: none\n - `objects` table permissions: `select`\n- Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works", + "examples": [ + { + "id": "create-signed-urls", + "name": "Create Signed URLs", + "code": "```js\nconst { data, error } = await supabase\n .storage\n .from('avatars')\n .createSignedUrls(['folder/avatar1.png', 'folder/avatar2.png'], 60)\n```", + "response": "```json\n{\n \"data\": [\n {\n \"error\": null,\n \"path\": \"folder/avatar1.png\",\n \"signedURL\": \"/object/sign/avatars/folder/avatar1.png?token=\",\n \"signedUrl\": \"https://example.supabase.co/storage/v1/object/sign/avatars/folder/avatar1.png?token=\"\n },\n {\n \"error\": null,\n \"path\": \"folder/avatar2.png\",\n \"signedURL\": \"/object/sign/avatars/folder/avatar2.png?token=\",\n \"signedUrl\": \"https://example.supabase.co/storage/v1/object/sign/avatars/folder/avatar2.png?token=\"\n }\n ],\n \"error\": null\n}\n```" + } + ] + } + }, + "@supabase/storage-js.packages/StorageFileApi.default.download": { + "name": "@supabase/storage-js.packages/StorageFileApi.default.download", + "params": [ + { + "name": "path", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The full path and file name of the file to be downloaded. For example `folder/image.png`." + } + }, + { + "name": "options", + "type": { + "type": "nameOnly", + "name": "Options" + }, + "isOptional": true + }, + { + "name": "parameters", + "type": { + "type": "object", + "name": "FetchParameters", + "properties": [ + { + "name": "cache", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "default" + }, + { + "type": "literal", + "value": "no-store" + }, + { + "type": "literal", + "value": "reload" + }, + { + "type": "literal", + "value": "no-cache" + }, + { + "type": "literal", + "value": "force-cache" + }, + { + "type": "literal", + "value": "only-if-cached" + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Controls how the request interacts with the browser's HTTP cache.\n- 'default': Use standard cache behavior\n- 'no-store': Bypass cache entirely (useful in Edge Functions)\n- 'reload': Bypass cache but update it with response\n- 'no-cache': Validate with server before using cached response\n- 'force-cache': Use cache even if stale\n- 'only-if-cached': Only use cache, fail if not cached" + } + }, + { + "name": "signal", + "type": { + "type": "nameOnly", + "name": "AbortSignal" + }, + "isOptional": true, + "comment": { + "shortText": "Pass in an AbortController's signal to cancel the request." + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Additional fetch parameters like signal for cancellation. Supports standard fetch options including cache control." + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "default" + } + }, + "comment": { + "shortText": "Downloads a file from a private bucket. For public buckets, make a request to the URL returned from `getPublicUrl` instead.", + "text": "- RLS policy permissions required:\n - `buckets` table permissions: none\n - `objects` table permissions: `select`\n- Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works", + "examples": [ + { + "id": "download-file", + "name": "Download file", + "code": "```js\nconst { data, error } = await supabase\n .storage\n .from('avatars')\n .download('folder/avatar1.png')\n```", + "response": "```json\n{\n \"data\": ,\n \"error\": null\n}\n```" + }, + { + "id": "download-file-with-transformations", + "name": "Download file with transformations", + "code": "```js\nconst { data, error } = await supabase\n .storage\n .from('avatars')\n .download('folder/avatar1.png', {\n transform: {\n width: 100,\n height: 100,\n quality: 80\n }\n })\n```" + }, + { + "id": "download-with-cache-control-useful-in-edge-functions", + "name": "Download with cache control (useful in Edge Functions)", + "code": "```js\nconst { data, error } = await supabase\n .storage\n .from('avatars')\n .download('folder/avatar1.png', {}, { cache: 'no-store' })\n```" + }, + { + "id": "download-with-abort-signal", + "name": "Download with abort signal", + "code": "```js\nconst controller = new AbortController()\nsetTimeout(() => controller.abort(), 5000)\n\nconst { data, error } = await supabase\n .storage\n .from('avatars')\n .download('folder/avatar1.png', {}, { signal: controller.signal })\n```" + } + ] + } + }, + "@supabase/storage-js.packages/StorageFileApi.default.exists": { + "name": "@supabase/storage-js.packages/StorageFileApi.default.exists", + "params": [ + { + "name": "path", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The file path, including the file name. For example `folder/image.png`." + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "intrinsic", + "name": "boolean" + } + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "intrinsic", + "name": "boolean" + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "StorageError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Checks the existence of a file.", + "examples": [ + { + "id": "check-file-existence", + "name": "Check file existence", + "code": "```js\nconst { data, error } = await supabase\n .storage\n .from('avatars')\n .exists('folder/avatar1.png')\n```" + } + ] + } + }, + "@supabase/storage-js.packages/StorageFileApi.default.getPublicUrl": { + "name": "@supabase/storage-js.packages/StorageFileApi.default.getPublicUrl", + "params": [ + { + "name": "path", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The path and name of the file to generate the public URL for. For example `folder/image.png`." + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "cacheNonce", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Append a cache nonce parameter to the URL to invalidate the cache." + } + }, + { + "name": "download", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "string" + }, + { + "type": "intrinsic", + "name": "boolean" + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Triggers the file as a download if set to true. Set this parameter as the name of the file if you want to trigger the download with a different filename." + } + }, + { + "name": "transform", + "type": { + "type": "object", + "name": "TransformOptions", + "properties": [ + { + "name": "format", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Specify the format of the image requested.\n\nWhen using 'origin' we force the format to be the same as the original image.\nWhen this option is not passed in, images are optimized to modern image formats like Webp." + } + }, + { + "name": "height", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The height of the image in pixels." + } + }, + { + "name": "quality", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Set the quality of the returned image.\nA number from 20 to 100, with 100 being the highest quality.\nDefaults to 80" + } + }, + { + "name": "resize", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The resize mode can be cover, contain or fill. Defaults to cover.\nCover resizes the image to maintain it's aspect ratio while filling the entire width and height.\nContain resizes the image to maintain it's aspect ratio while fitting the entire image within the width and height.\nFill resizes the image to fill the entire width and height. If the object's aspect ratio does not match the width and height, the image will be stretched to fit." + } + }, + { + "name": "width", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The width of the image in pixels." + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Transform the asset before serving it to the client." + } + } + ] + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "publicUrl", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + } + } + ] + } + }, + "comment": { + "shortText": "A simple convenience function to get the URL for an asset in a public bucket. If you do not want to use this function, you can construct the public URL by concatenating the bucket URL with the path to the asset.\nThis function does not verify if the bucket is public. If a public URL is created for a bucket which is not public, you will not be able to download the asset.", + "text": "- The bucket needs to be set to public, either via [updateBucket()](/docs/reference/javascript/storage-updatebucket) or by going to Storage on [supabase.com/dashboard](https://supabase.com/dashboard), clicking the overflow menu on a bucket and choosing \"Make public\"\n- RLS policy permissions required:\n - `buckets` table permissions: none\n - `objects` table permissions: none\n- Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works", + "examples": [ + { + "id": "returns-the-url-for-an-asset-in-a-public-bucket", + "name": "Returns the URL for an asset in a public bucket", + "code": "```js\nconst { data } = supabase\n .storage\n .from('public-bucket')\n .getPublicUrl('folder/avatar1.png')\n```", + "response": "```json\n{\n \"data\": {\n \"publicUrl\": \"https://example.supabase.co/storage/v1/object/public/public-bucket/folder/avatar1.png\"\n }\n}\n```" + }, + { + "id": "returns-the-url-for-an-asset-in-a-public-bucket-with-transformations", + "name": "Returns the URL for an asset in a public bucket with transformations", + "code": "```js\nconst { data } = supabase\n .storage\n .from('public-bucket')\n .getPublicUrl('folder/avatar1.png', {\n transform: {\n width: 100,\n height: 100,\n }\n })\n```" + }, + { + "id": "returns-the-url-which-triggers-the-download-of-an-asset-in-a-public-bucket", + "name": "Returns the URL which triggers the download of an asset in a public bucket", + "code": "```js\nconst { data } = supabase\n .storage\n .from('public-bucket')\n .getPublicUrl('folder/avatar1.png', {\n download: true,\n })\n```" + } + ] + } + }, + "@supabase/storage-js.packages/StorageFileApi.default.info": { + "name": "@supabase/storage-js.packages/StorageFileApi.default.info", + "params": [ + { + "name": "path", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The file path, including the file name. For example `folder/image.png`." + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "nameOnly", + "name": "Camelize" + } + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "literal", + "value": null + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "StorageError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Retrieves the details of an existing file.\n\nReturns detailed file metadata including size, content type, and timestamps.\nNote: The API returns `last_modified` field, not `updated_at`.", + "examples": [ + { + "id": "get-file-info", + "name": "Get file info", + "code": "```js\nconst { data, error } = await supabase\n .storage\n .from('avatars')\n .info('folder/avatar1.png')\n\nif (data) {\n console.log('Last modified:', data.lastModified)\n console.log('Size:', data.size)\n}\n```" + } + ] + } + }, + "@supabase/storage-js.packages/StorageFileApi.default.list": { + "name": "@supabase/storage-js.packages/StorageFileApi.default.list", + "params": [ + { + "name": "path", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "The folder path." + } + }, + { + "name": "options", + "type": { + "type": "object", + "name": "SearchOptions", + "properties": [ + { + "name": "limit", + "type": { + "type": "intrinsic", + "name": "number" + }, + "isOptional": true, + "comment": { + "shortText": "The number of files you want to be returned." + } + }, + { + "name": "offset", + "type": { + "type": "intrinsic", + "name": "number" + }, + "isOptional": true, + "comment": { + "shortText": "The starting position." + } + }, + { + "name": "search", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "The search string to filter files by." + } + }, + { + "name": "sortBy", + "type": { + "type": "object", + "name": "SortBy", + "properties": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "order", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "The column to sort by. Can be any column inside a FileObject." + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Search options including limit (defaults to 100), offset, sortBy, and search" + } + }, + { + "name": "parameters", + "type": { + "type": "object", + "name": "FetchParameters", + "properties": [ + { + "name": "cache", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "Controls how the request interacts with the browser's HTTP cache.\n- 'default': Use standard cache behavior\n- 'no-store': Bypass cache entirely (useful in Edge Functions)\n- 'reload': Bypass cache but update it with response\n- 'no-cache': Validate with server before using cached response\n- 'force-cache': Use cache even if stale\n- 'only-if-cached': Only use cache, fail if not cached" + } + }, + { + "name": "signal", + "type": { + "type": "nameOnly", + "name": "AbortSignal" + }, + "isOptional": true, + "comment": { + "shortText": "Pass in an AbortController's signal to cancel the request." + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Optional fetch parameters including signal for cancellation" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "FileObject", + "properties": [ + { + "name": "bucket_id", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "" + } + }, + { + "name": "buckets", + "type": { + "type": "object", + "name": "Bucket", + "properties": [ + { + "name": "allowed_mime_types", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "file_size_limit", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "name", + "type": "[Circular]" + }, + { + "name": "owner", + "type": "[Circular]" + }, + { + "name": "public", + "type": "[Circular]" + }, + { + "name": "type", + "type": { + "type": "union", + "name": "BucketType", + "subTypes": [ + "[Circular]", + "[Circular]", + null + ] + }, + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "" + } + }, + { + "name": "created_at", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "intrinsic", + "name": "string" + } + ] + }, + "comment": { + "shortText": "Creation timestamp (null for folders)" + } + }, + { + "name": "id", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "intrinsic", + "name": "string" + } + ] + }, + "comment": { + "shortText": "Unique identifier for the file (null for folders)" + } + }, + { + "name": "last_accessed_at", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "intrinsic", + "name": "string" + } + ] + }, + "comment": { + "shortText": "" + } + }, + { + "name": "metadata", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "object", + "name": "FileMetadata", + "properties": [ + { + "name": "cacheControl", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Cache control directive (e.g., \"max-age=3600\")" + } + }, + { + "name": "contentLength", + "type": { + "type": "intrinsic", + "name": "number" + }, + "comment": { + "shortText": "Content length in bytes (usually same as size)" + } + }, + { + "name": "eTag", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Entity tag for caching and conditional requests" + } + }, + { + "name": "httpStatusCode", + "type": { + "type": "intrinsic", + "name": "number" + }, + "comment": { + "shortText": "HTTP status code from the storage backend" + } + }, + { + "name": "lastModified", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Last modification timestamp (ISO 8601)" + } + }, + { + "name": "mimetype", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "MIME type of the file" + } + }, + { + "name": "size", + "type": { + "type": "intrinsic", + "name": "number" + }, + "comment": { + "shortText": "File size in bytes" + } + } + ] + } + ] + }, + "comment": { + "shortText": "File metadata including size, mimetype, etc. (null for folders)" + } + }, + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "File or folder name (relative to the prefix) - always present" + } + }, + { + "name": "owner", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "" + } + }, + { + "name": "updated_at", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "intrinsic", + "name": "string" + } + ] + }, + "comment": { + "shortText": "Last update timestamp (null for folders)" + } + } + ] + } + } + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "literal", + "value": null + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "StorageError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Lists all the files and folders within a path of the bucket.\n\n**Important:** For folder entries, fields like `id`, `updated_at`, `created_at`,\n`last_accessed_at`, and `metadata` will be `null`. Only files have these fields populated.\nAdditionally, deprecated fields like `bucket_id`, `owner`, and `buckets` are NOT returned\nby this method.", + "text": "- RLS policy permissions required:\n - `buckets` table permissions: none\n - `objects` table permissions: `select`\n- Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works", + "examples": [ + { + "id": "list-files-in-a-bucket", + "name": "List files in a bucket", + "code": "```js\nconst { data, error } = await supabase\n .storage\n .from('avatars')\n .list('folder', {\n limit: 100,\n offset: 0,\n sortBy: { column: 'name', order: 'asc' },\n })\n\n// Handle files vs folders\ndata?.forEach(item => {\n if (item.id !== null) {\n // It's a file\n console.log('File:', item.name, 'Size:', item.metadata?.size)\n } else {\n // It's a folder\n console.log('Folder:', item.name)\n }\n})\n```", + "response": "```json\n{\n \"data\": [\n {\n \"name\": \"avatar1.png\",\n \"id\": \"e668cf7f-821b-4a2f-9dce-7dfa5dd1cfd2\",\n \"updated_at\": \"2024-05-22T23:06:05.580Z\",\n \"created_at\": \"2024-05-22T23:04:34.443Z\",\n \"last_accessed_at\": \"2024-05-22T23:04:34.443Z\",\n \"metadata\": {\n \"eTag\": \"\\\"c5e8c553235d9af30ef4f6e280790b92\\\"\",\n \"size\": 32175,\n \"mimetype\": \"image/png\",\n \"cacheControl\": \"max-age=3600\",\n \"lastModified\": \"2024-05-22T23:06:05.574Z\",\n \"contentLength\": 32175,\n \"httpStatusCode\": 200\n }\n }\n ],\n \"error\": null\n}\n```" + }, + { + "id": "search-files-in-a-bucket", + "name": "Search files in a bucket", + "code": "```js\nconst { data, error } = await supabase\n .storage\n .from('avatars')\n .list('folder', {\n limit: 100,\n offset: 0,\n sortBy: { column: 'name', order: 'asc' },\n search: 'jon'\n })\n```" + } + ] + } + }, + "@supabase/storage-js.packages/StorageFileApi.default.listV2": { + "name": "@supabase/storage-js.packages/StorageFileApi.default.listV2", + "params": [ + { + "name": "options", + "type": { + "type": "object", + "name": "SearchV2Options", + "properties": [ + { + "name": "cursor", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "The cursor used for pagination. Pass the value received from nextCursor of the previous request." + } + }, + { + "name": "limit", + "type": { + "type": "intrinsic", + "name": "number" + }, + "isOptional": true, + "comment": { + "shortText": "The number of files you want to be returned." + } + }, + { + "name": "prefix", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "The prefix search string to filter files by." + } + }, + { + "name": "sortBy", + "type": { + "type": "object", + "name": "SortByV2", + "properties": [ + { + "name": "column", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "name" + }, + { + "type": "literal", + "value": "created_at" + }, + { + "type": "literal", + "value": "updated_at" + } + ] + } + }, + { + "name": "order", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "asc" + }, + { + "type": "literal", + "value": "desc" + } + ] + }, + "isOptional": true + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "The column and order to sort by" + } + }, + { + "name": "with_delimiter", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "Whether to emulate a hierarchical listing of objects using delimiters.\n\n- When `false` (default), all objects are listed as flat key/value pairs.\n- When `true`, the response groups objects by delimiter, making it appear\n like a file/folder hierarchy." + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Search options including prefix, cursor for pagination, limit, with_delimiter" + } + }, + { + "name": "parameters", + "type": { + "type": "object", + "name": "FetchParameters", + "properties": [ + { + "name": "cache", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "Controls how the request interacts with the browser's HTTP cache.\n- 'default': Use standard cache behavior\n- 'no-store': Bypass cache entirely (useful in Edge Functions)\n- 'reload': Bypass cache but update it with response\n- 'no-cache': Validate with server before using cached response\n- 'force-cache': Use cache even if stale\n- 'only-if-cached': Only use cache, fail if not cached" + } + }, + { + "name": "signal", + "type": { + "type": "nameOnly", + "name": "AbortSignal" + }, + "isOptional": true, + "comment": { + "shortText": "Pass in an AbortController's signal to cancel the request." + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Optional fetch parameters including signal for cancellation" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "name": "SearchV2Result", + "properties": [ + { + "name": "folders", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "SearchV2Folder", + "properties": [ + { + "name": "key", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Full folder key/path" + } + }, + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Folder name/prefix" + } + } + ] + } + } + }, + { + "name": "hasNext", + "type": { + "type": "intrinsic", + "name": "boolean" + } + }, + { + "name": "nextCursor", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "objects", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "SearchV2Object", + "properties": [ + { + "name": "created_at", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Creation timestamp" + } + }, + { + "name": "id", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Unique identifier for the file" + } + }, + { + "name": "key", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Full object key/path" + } + }, + { + "name": "last_accessed_at", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "" + } + }, + { + "name": "metadata", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "object", + "name": "FileMetadata", + "properties": [ + { + "name": "cacheControl", + "type": "[Circular]", + "comment": { + "shortText": "Cache control directive (e.g., \"max-age=3600\")" + } + }, + { + "name": "contentLength", + "type": "[Circular]", + "comment": { + "shortText": "Content length in bytes (usually same as size)" + } + }, + { + "name": "eTag", + "type": "[Circular]", + "comment": { + "shortText": "Entity tag for caching and conditional requests" + } + }, + { + "name": "httpStatusCode", + "type": "[Circular]", + "comment": { + "shortText": "HTTP status code from the storage backend" + } + }, + { + "name": "lastModified", + "type": "[Circular]", + "comment": { + "shortText": "Last modification timestamp (ISO 8601)" + } + }, + { + "name": "mimetype", + "type": "[Circular]", + "comment": { + "shortText": "MIME type of the file" + } + }, + { + "name": "size", + "type": "[Circular]", + "comment": { + "shortText": "File size in bytes" + } + } + ] + } + ] + }, + "comment": { + "shortText": "File metadata including size, mimetype, etc. (null if not yet set)" + } + }, + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "File name" + } + }, + { + "name": "updated_at", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Last update timestamp" + } + } + ] + } + } + } + ] + } + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "literal", + "value": null + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "StorageError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Lists all the files and folders within a bucket using the V2 API with pagination support.\n\n**Important:** Folder entries in the `folders` array only contain `name` and optionally `key` —\nthey have no `id`, timestamps, or `metadata` fields. Full file metadata is only available\non entries in the `objects` array.\n\n this method signature might change in the future", + "tags": [ + { + "tag": "experimental", + "text": "" + } + ], + "examples": [ + { + "id": "list-files-with-pagination", + "name": "List files with pagination", + "code": "```js\nconst { data, error } = await supabase\n .storage\n .from('avatars')\n .listV2({\n prefix: 'folder/',\n limit: 100,\n })\n\n// Handle pagination\nif (data?.hasNext) {\n const nextPage = await supabase\n .storage\n .from('avatars')\n .listV2({\n prefix: 'folder/',\n cursor: data.nextCursor,\n })\n}\n\n// Handle files vs folders\ndata?.objects.forEach(file => {\n if (file.id !== null) {\n console.log('File:', file.name, 'Size:', file.metadata?.size)\n }\n})\ndata?.folders.forEach(folder => {\n console.log('Folder:', folder.name)\n})\n```" + } + ] + } + }, + "@supabase/storage-js.packages/StorageFileApi.default.move": { + "name": "@supabase/storage-js.packages/StorageFileApi.default.move", + "params": [ + { + "name": "fromPath", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The original file path, including the current file name. For example `folder/image.png`." + } + }, + { + "name": "toPath", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The new file path, including the new file name. For example `folder/image-new.png`." + } + }, + { + "name": "options", + "type": { + "type": "object", + "name": "DestinationOptions", + "properties": [ + { + "name": "destinationBucket", + "type": "[Circular]", + "isOptional": true + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "The destination options." + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + } + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "literal", + "value": null + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "StorageError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Moves an existing file to a new path in the same bucket.", + "text": "- RLS policy permissions required:\n - `buckets` table permissions: none\n - `objects` table permissions: `update` and `select`\n- Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works", + "examples": [ + { + "id": "move-file", + "name": "Move file", + "code": "```js\nconst { data, error } = await supabase\n .storage\n .from('avatars')\n .move('public/avatar1.png', 'private/avatar2.png')\n```", + "response": "```json\n{\n \"data\": {\n \"message\": \"Successfully moved\"\n },\n \"error\": null\n}\n```" + } + ] + } + }, + "@supabase/storage-js.packages/StorageFileApi.default.remove": { + "name": "@supabase/storage-js.packages/StorageFileApi.default.remove", + "params": [ + { + "name": "paths", + "type": { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + }, + "comment": { + "shortText": "An array of files to delete, including the path and file name. For example [`'folder/image.png'`]." + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "FileObject", + "properties": [ + { + "name": "bucket_id", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "" + } + }, + { + "name": "buckets", + "type": { + "type": "object", + "name": "Bucket", + "properties": [ + { + "name": "allowed_mime_types", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "file_size_limit", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "name", + "type": "[Circular]" + }, + { + "name": "owner", + "type": "[Circular]" + }, + { + "name": "public", + "type": "[Circular]" + }, + { + "name": "type", + "type": { + "type": "union", + "name": "BucketType", + "subTypes": [ + "[Circular]", + "[Circular]", + null + ] + }, + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "" + } + }, + { + "name": "created_at", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Creation timestamp (null for folders)" + } + }, + { + "name": "id", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Unique identifier for the file (null for folders)" + } + }, + { + "name": "last_accessed_at", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "" + } + }, + { + "name": "metadata", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + { + "type": "object", + "name": "FileMetadata", + "properties": [ + { + "name": "cacheControl", + "type": "[Circular]", + "comment": { + "shortText": "Cache control directive (e.g., \"max-age=3600\")" + } + }, + { + "name": "contentLength", + "type": "[Circular]", + "comment": { + "shortText": "Content length in bytes (usually same as size)" + } + }, + { + "name": "eTag", + "type": "[Circular]", + "comment": { + "shortText": "Entity tag for caching and conditional requests" + } + }, + { + "name": "httpStatusCode", + "type": "[Circular]", + "comment": { + "shortText": "HTTP status code from the storage backend" + } + }, + { + "name": "lastModified", + "type": "[Circular]", + "comment": { + "shortText": "Last modification timestamp (ISO 8601)" + } + }, + { + "name": "mimetype", + "type": "[Circular]", + "comment": { + "shortText": "MIME type of the file" + } + }, + { + "name": "size", + "type": "[Circular]", + "comment": { + "shortText": "File size in bytes" + } + } + ] + } + ] + }, + "comment": { + "shortText": "File metadata including size, mimetype, etc. (null for folders)" + } + }, + { + "name": "name", + "type": "[Circular]", + "comment": { + "shortText": "File or folder name (relative to the prefix) - always present" + } + }, + { + "name": "owner", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "" + } + }, + { + "name": "updated_at", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Last update timestamp (null for folders)" + } + } + ] + } + } + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "literal", + "value": null + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "StorageError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Deletes files within the same bucket\n\nReturns an array of FileObject entries for the deleted files. Note that deprecated\nfields like `bucket_id` may or may not be present in the response - do not rely on them.", + "text": "- RLS policy permissions required:\n - `buckets` table permissions: none\n - `objects` table permissions: `delete` and `select`\n- Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works", + "examples": [ + { + "id": "delete-file", + "name": "Delete file", + "code": "```js\nconst { data, error } = await supabase\n .storage\n .from('avatars')\n .remove(['folder/avatar1.png'])\n```", + "response": "```json\n{\n \"data\": [],\n \"error\": null\n}\n```" + } + ] + } + }, + "@supabase/storage-js.packages/StorageFileApi.default.setHeader": { + "name": "@supabase/storage-js.packages/StorageFileApi.default.setHeader", + "params": [ + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Header name" + } + }, + { + "name": "value", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Header value" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Set an HTTP header for the request.\nCreates a shallow copy of headers to avoid mutating shared state." + } + }, + "@supabase/storage-js.packages/StorageFileApi.default.throwOnError": { + "name": "@supabase/storage-js.packages/StorageFileApi.default.throwOnError", + "params": [], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Enable throwing errors instead of returning them.\nWhen enabled, errors are thrown instead of returned in { data, error } format." + } + }, + "@supabase/storage-js.packages/StorageFileApi.default.toBase64": { + "name": "@supabase/storage-js.packages/StorageFileApi.default.toBase64", + "params": [ + { + "name": "data", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "string" + } + } + }, + "@supabase/storage-js.packages/StorageFileApi.default.update": { + "name": "@supabase/storage-js.packages/StorageFileApi.default.update", + "params": [ + { + "name": "path", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The relative file path. Should be of the format `folder/subfolder/filename.png`. The bucket must already exist before attempting to update." + } + }, + { + "name": "fileBody", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "string" + }, + { + "type": "nameOnly", + "name": "ArrayBuffer" + }, + { + "type": "nameOnly", + "name": "ReadableStream" + }, + { + "type": "nameOnly", + "name": "Blob" + }, + { + "type": "nameOnly", + "name": "File" + }, + { + "type": "nameOnly", + "name": "FormData" + }, + { + "type": "nameOnly", + "name": "@types/node.__global.NodeJS.ReadableStream" + }, + { + "type": "nameOnly", + "name": "URLSearchParams" + }, + { + "type": "nameOnly", + "name": "ArrayBufferView" + }, + { + "type": "nameOnly", + "name": "@types/node.__global.Buffer" + } + ] + }, + "comment": { + "shortText": "The body of the file to be stored in the bucket." + } + }, + { + "name": "fileOptions", + "type": { + "type": "object", + "name": "FileOptions", + "properties": [ + { + "name": "cacheControl", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "The number of seconds the asset is cached in the browser and in the Supabase CDN. This is set in the `Cache-Control: max-age=` header. Defaults to 3600 seconds." + } + }, + { + "name": "contentType", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "the `Content-Type` header value. Should be specified if using a `fileBody` that is neither `Blob` nor `File` nor `FormData`, otherwise will default to `text/plain;charset=UTF-8`." + } + }, + { + "name": "duplex", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "The duplex option is a string parameter that enables or disables duplex streaming, allowing for both reading and writing data in the same stream. It can be passed as an option to the fetch() method." + } + }, + { + "name": "headers", + "type": { + "type": "record", + "name": "Record", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "string" + } + }, + "isOptional": true, + "comment": { + "shortText": "Optionally add extra headers" + } + }, + { + "name": "metadata", + "type": { + "type": "record", + "name": "Record", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "any" + } + }, + "isOptional": true, + "comment": { + "shortText": "The metadata option is an object that allows you to store additional information about the file. This information can be used to filter and search for files. The metadata object can contain any key-value pairs you want to store." + } + }, + { + "name": "upsert", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "When upsert is set to true, the file is overwritten if it exists. When set to false, an error is thrown if the object already exists. Defaults to false." + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Optional file upload options including cacheControl, contentType, and metadata.\n**Note:** The `upsert` option has no effect here. `update()` always replaces the\nfile at the given path, so the `x-upsert` header is not sent. To control upsert\nbehavior, use `upload()` instead." + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "fullPath", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "id", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "path", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + } + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "literal", + "value": null + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "StorageError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Replaces an existing file at the specified path with a new one.", + "text": "- RLS policy permissions required:\n - `buckets` table permissions: none\n - `objects` table permissions: `update` and `select`\n- `update()` always replaces the file at the given path regardless of the `upsert` option.\n- Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works\n- For React Native, using either `Blob`, `File` or `FormData` does not work as intended. Update file using `ArrayBuffer` from base64 file data instead, see example below.", + "examples": [ + { + "id": "update-file", + "name": "Update file", + "code": "```js\nconst avatarFile = event.target.files[0]\nconst { data, error } = await supabase\n .storage\n .from('avatars')\n .update('public/avatar1.png', avatarFile, {\n cacheControl: '3600'\n })\n```", + "response": "```json\n{\n \"data\": {\n \"path\": \"public/avatar1.png\",\n \"fullPath\": \"avatars/public/avatar1.png\"\n },\n \"error\": null\n}\n```" + }, + { + "id": "update-file-using-arraybuffer-from-base64-file-data", + "name": "Update file using `ArrayBuffer` from base64 file data", + "code": "```js\nimport {decode} from 'base64-arraybuffer'\n\nconst { data, error } = await supabase\n .storage\n .from('avatars')\n .update('public/avatar1.png', decode('base64FileData'), {\n contentType: 'image/png'\n })\n```" + } + ] + } + }, + "@supabase/storage-js.packages/StorageFileApi.default.upload": { + "name": "@supabase/storage-js.packages/StorageFileApi.default.upload", + "params": [ + { + "name": "path", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The file path, including the file name. Should be of the format `folder/subfolder/filename.png`. The bucket must already exist before attempting to upload." + } + }, + { + "name": "fileBody", + "type": { + "type": "nameOnly", + "name": "FileBody" + }, + "comment": { + "shortText": "The body of the file to be stored in the bucket." + } + }, + { + "name": "fileOptions", + "type": { + "type": "object", + "name": "FileOptions", + "properties": [ + { + "name": "cacheControl", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The number of seconds the asset is cached in the browser and in the Supabase CDN. This is set in the `Cache-Control: max-age=` header. Defaults to 3600 seconds." + } + }, + { + "name": "contentType", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "the `Content-Type` header value. Should be specified if using a `fileBody` that is neither `Blob` nor `File` nor `FormData`, otherwise will default to `text/plain;charset=UTF-8`." + } + }, + { + "name": "duplex", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The duplex option is a string parameter that enables or disables duplex streaming, allowing for both reading and writing data in the same stream. It can be passed as an option to the fetch() method." + } + }, + { + "name": "headers", + "type": { + "type": "record", + "name": "Record", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "Optionally add extra headers" + } + }, + { + "name": "metadata", + "type": { + "type": "record", + "name": "Record", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "The metadata option is an object that allows you to store additional information about the file. This information can be used to filter and search for files. The metadata object can contain any key-value pairs you want to store." + } + }, + { + "name": "upsert", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "When upsert is set to true, the file is overwritten if it exists. When set to false, an error is thrown if the object already exists. Defaults to false." + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Optional file upload options including cacheControl, contentType, upsert, and metadata." + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "fullPath", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "id", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "path", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + } + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "literal", + "value": null + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "StorageError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Uploads a file to an existing bucket.", + "text": "- RLS policy permissions required:\n - `buckets` table permissions: none\n - `objects` table permissions: only `insert` when you are uploading new files and `select`, `insert` and `update` when you are upserting files\n- Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works\n- For React Native, using either `Blob`, `File` or `FormData` does not work as intended. Upload file using `ArrayBuffer` from base64 file data instead, see example below.", + "examples": [ + { + "id": "upload-file", + "name": "Upload file", + "code": "```js\nconst avatarFile = event.target.files[0]\nconst { data, error } = await supabase\n .storage\n .from('avatars')\n .upload('public/avatar1.png', avatarFile, {\n cacheControl: '3600',\n upsert: false\n })\n```", + "response": "```json\n{\n \"data\": {\n \"path\": \"public/avatar1.png\",\n \"fullPath\": \"avatars/public/avatar1.png\"\n },\n \"error\": null\n}\n```" + }, + { + "id": "upload-file-using-arraybuffer-from-base64-file-data", + "name": "Upload file using `ArrayBuffer` from base64 file data", + "code": "```js\nimport { decode } from 'base64-arraybuffer'\n\nconst { data, error } = await supabase\n .storage\n .from('avatars')\n .upload('public/avatar1.png', decode('base64FileData'), {\n contentType: 'image/png'\n })\n```" + }, + { + "id": "handling-errors", + "name": "Handling errors", + "code": "```js\nconst { data, error } = await supabase\n .storage\n .from('avatars')\n .upload('public/avatar1.png', avatarFile)\n\nif (error) {\n // Log the full error so fields like `statusCode` and `error` (the\n // Storage error name, e.g. \"Duplicate\") aren't hidden behind `error.message`.\n console.error(error)\n return\n}\n```" + } + ] + } + }, + "@supabase/storage-js.packages/StorageFileApi.default.uploadToSignedUrl": { + "name": "@supabase/storage-js.packages/StorageFileApi.default.uploadToSignedUrl", + "params": [ + { + "name": "path", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The file path, including the file name. Should be of the format `folder/subfolder/filename.png`. The bucket must already exist before attempting to upload." + } + }, + { + "name": "token", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The token generated from `createSignedUploadUrl`" + } + }, + { + "name": "fileBody", + "type": { + "type": "nameOnly", + "name": "FileBody" + }, + "comment": { + "shortText": "The body of the file to be stored in the bucket." + } + }, + { + "name": "fileOptions", + "type": { + "type": "object", + "name": "FileOptions", + "properties": [ + { + "name": "cacheControl", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The number of seconds the asset is cached in the browser and in the Supabase CDN. This is set in the `Cache-Control: max-age=` header. Defaults to 3600 seconds." + } + }, + { + "name": "contentType", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "the `Content-Type` header value. Should be specified if using a `fileBody` that is neither `Blob` nor `File` nor `FormData`, otherwise will default to `text/plain;charset=UTF-8`." + } + }, + { + "name": "duplex", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The duplex option is a string parameter that enables or disables duplex streaming, allowing for both reading and writing data in the same stream. It can be passed as an option to the fetch() method." + } + }, + { + "name": "headers", + "type": { + "type": "record", + "name": "Record", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "Optionally add extra headers" + } + }, + { + "name": "metadata", + "type": { + "type": "record", + "name": "Record", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "The metadata option is an object that allows you to store additional information about the file. This information can be used to filter and search for files. The metadata object can contain any key-value pairs you want to store." + } + }, + { + "name": "upsert", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "When upsert is set to true, the file is overwritten if it exists. When set to false, an error is thrown if the object already exists. Defaults to false." + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "HTTP headers (cacheControl, contentType, etc.).\n**Note:** The `upsert` option has no effect here. To enable upsert behavior,\npass `{ upsert: true }` when calling `createSignedUploadUrl()` instead." + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "literal", + "value": null + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "StorageError" + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "fullPath", + "type": { + "type": "intrinsic", + "name": "any" + } + }, + { + "name": "path", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + } + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Upload a file with a token generated from `createSignedUploadUrl`.", + "text": "- RLS policy permissions required:\n - `buckets` table permissions: none\n - `objects` table permissions: none\n- Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works", + "examples": [ + { + "id": "upload-to-a-signed-url", + "name": "Upload to a signed URL", + "code": "```js\nconst { data, error } = await supabase\n .storage\n .from('avatars')\n .uploadToSignedUrl('folder/cat.jpg', 'token-from-createSignedUploadUrl', file)\n```", + "response": "```json\n{\n \"data\": {\n \"path\": \"folder/cat.jpg\",\n \"fullPath\": \"avatars/folder/cat.jpg\"\n },\n \"error\": null\n}\n```" + } + ] + } + }, + "@supabase/storage-js.packages/StorageVectorsClient.StorageVectorsClient.constructor": { + "name": "@supabase/storage-js.packages/StorageVectorsClient.StorageVectorsClient.constructor", + "params": [ + { + "name": "url", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Base URL of the Storage Vectors REST API." + } + }, + { + "name": "options", + "type": { + "type": "object", + "name": "StorageVectorsClientOptions", + "properties": [ + { + "name": "fetch", + "type": { + "type": "function", + "params": [ + { + "name": "input", + "type": { + "type": "union", + "subTypes": [ + { + "type": "nameOnly", + "name": "RequestInfo" + }, + { + "type": "nameOnly", + "name": "URL" + } + ] + } + }, + { + "name": "init", + "type": { + "type": "nameOnly", + "name": "RequestInit" + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "nameOnly", + "name": "Response" + } + } + }, + "comment": { + "shortText": "[MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch)" + } + }, + "isOptional": true, + "comment": { + "shortText": "Custom fetch implementation (optional)\nUseful for testing or custom request handling", + "tags": [ + { + "tag": "alpha", + "text": "" + } + ] + } + }, + { + "name": "headers", + "type": { + "type": "index signature", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "string" + } + }, + "isOptional": true, + "comment": { + "shortText": "Custom headers to include in all requests", + "tags": [ + { + "tag": "alpha", + "text": "" + } + ] + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "StorageVectorsClient" + } + }, + "comment": { + "shortText": "Creates a StorageVectorsClient that can manage buckets, indexes, and vectors.\n\n**Public alpha:** This API is part of a public alpha release and may not be available to your account type.", + "tags": [ + { + "tag": "alpha", + "text": "" + } + ], + "examples": [ + { + "id": "using-supabase-js-recommended", + "name": "Using supabase-js (recommended)", + "code": "```typescript\nimport { createClient } from '@supabase/supabase-js'\n\nconst supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key')\nconst bucket = supabase.storage.vectors.from('embeddings-prod')\n```" + }, + { + "id": "standalone-import-for-bundle-sensitive-environments", + "name": "Standalone import for bundle-sensitive environments", + "code": "```typescript\nimport { StorageVectorsClient } from '@supabase/storage-js'\n\nconst client = new StorageVectorsClient(url, options)\n```" + } + ] + } + }, + "@supabase/storage-js.packages/StorageVectorsClient.StorageVectorsClient.createBucket": { + "name": "@supabase/storage-js.packages/StorageVectorsClient.StorageVectorsClient.createBucket", + "params": [ + { + "name": "vectorBucketName", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Unique name for the vector bucket" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "ApiResponse", + "subTypes": [ + { + "type": "object", + "name": "SuccessResponse", + "properties": [ + { + "name": "data", + "type": { + "type": "intrinsic", + "name": "undefined" + }, + "comment": { + "shortText": "Response data of type T" + } + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + }, + "comment": { + "shortText": "Null on success" + } + } + ] + }, + { + "type": "object", + "name": "ErrorResponse", + "properties": [ + { + "name": "data", + "type": { + "type": "literal", + "value": null + }, + "comment": { + "shortText": "Null on error" + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "StorageError" + }, + "comment": { + "shortText": "StorageError with details (named StorageVectorsError for vector operations)" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Creates a new vector bucket\nVector buckets are containers for vector indexes and their data\n\n**Public alpha:** This API is part of a public alpha release and may not be available to your account type.", + "tags": [ + { + "tag": "alpha", + "text": "" + } + ], + "examples": [ + { + "id": "creating-a-vector-bucket", + "name": "Creating a vector bucket", + "code": "```typescript\nconst { data, error } = await supabase\n .storage\n .vectors\n .createBucket('embeddings-prod')\n```" + } + ] + } + }, + "@supabase/storage-js.packages/StorageVectorsClient.StorageVectorsClient.deleteBucket": { + "name": "@supabase/storage-js.packages/StorageVectorsClient.StorageVectorsClient.deleteBucket", + "params": [ + { + "name": "vectorBucketName", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Name of the vector bucket to delete" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "ApiResponse", + "subTypes": [ + { + "type": "object", + "name": "SuccessResponse", + "properties": [ + { + "name": "data", + "type": { + "type": "intrinsic", + "name": "undefined" + }, + "comment": { + "shortText": "Response data of type T" + } + }, + { + "name": "error", + "type": "[Circular]", + "comment": { + "shortText": "Null on success" + } + } + ] + }, + { + "type": "object", + "name": "ErrorResponse", + "properties": [ + { + "name": "data", + "type": "[Circular]", + "comment": { + "shortText": "Null on error" + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "StorageError" + }, + "comment": { + "shortText": "StorageError with details (named StorageVectorsError for vector operations)" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Deletes a vector bucket (bucket must be empty)\nAll indexes must be deleted before deleting the bucket\n\n**Public alpha:** This API is part of a public alpha release and may not be available to your account type.", + "tags": [ + { + "tag": "alpha", + "text": "" + } + ], + "examples": [ + { + "id": "delete-a-vector-bucket", + "name": "Delete a vector bucket", + "code": "```typescript\nconst { data, error } = await supabase\n .storage\n .vectors\n .deleteBucket('embeddings-old')\n```" + } + ] + } + }, + "@supabase/storage-js.packages/StorageVectorsClient.StorageVectorsClient.from": { + "name": "@supabase/storage-js.packages/StorageVectorsClient.StorageVectorsClient.from", + "params": [ + { + "name": "vectorBucketName", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Name of the vector bucket" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "VectorBucketScope" + } + }, + "comment": { + "shortText": "Access operations for a specific vector bucket\nReturns a scoped client for index and vector operations within the bucket\n\n**Public alpha:** This API is part of a public alpha release and may not be available to your account type.", + "tags": [ + { + "tag": "alpha", + "text": "" + } + ], + "examples": [ + { + "id": "accessing-a-vector-bucket", + "name": "Accessing a vector bucket", + "code": "```typescript\nconst bucket = supabase.storage.vectors.from('embeddings-prod')\n```" + } + ] + } + }, + "@supabase/storage-js.packages/StorageVectorsClient.StorageVectorsClient.getBucket": { + "name": "@supabase/storage-js.packages/StorageVectorsClient.StorageVectorsClient.getBucket", + "params": [ + { + "name": "vectorBucketName", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Name of the vector bucket" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "ApiResponse", + "subTypes": [ + { + "type": "object", + "name": "SuccessResponse", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "vectorBucket", + "type": { + "type": "object", + "name": "VectorBucket", + "properties": [ + { + "name": "creationTime", + "type": { + "type": "intrinsic", + "name": "number" + }, + "isOptional": true, + "comment": { + "shortText": "Unix timestamp of when the bucket was created" + } + }, + { + "name": "encryptionConfiguration", + "type": { + "type": "object", + "name": "EncryptionConfiguration", + "properties": [ + { + "name": "kmsKeyArn", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "ARN of the KMS key used for encryption" + } + }, + { + "name": "sseType", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Server-side encryption type (e.g., 'KMS')" + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Optional encryption settings" + } + }, + { + "name": "vectorBucketName", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Unique name of the vector bucket" + } + } + ] + } + } + ] + }, + "comment": { + "shortText": "Response data of type T" + } + }, + { + "name": "error", + "type": "[Circular]", + "comment": { + "shortText": "Null on success" + } + } + ] + }, + { + "type": "object", + "name": "ErrorResponse", + "properties": [ + { + "name": "data", + "type": "[Circular]", + "comment": { + "shortText": "Null on error" + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "StorageError" + }, + "comment": { + "shortText": "StorageError with details (named StorageVectorsError for vector operations)" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Retrieves metadata for a specific vector bucket\n\n**Public alpha:** This API is part of a public alpha release and may not be available to your account type.", + "tags": [ + { + "tag": "alpha", + "text": "" + } + ], + "examples": [ + { + "id": "get-bucket-metadata", + "name": "Get bucket metadata", + "code": "```typescript\nconst { data, error } = await supabase\n .storage\n .vectors\n .getBucket('embeddings-prod')\n\nconsole.log('Bucket created:', data?.vectorBucket.creationTime)\n```" + } + ] + } + }, + "@supabase/storage-js.packages/StorageVectorsClient.StorageVectorsClient.listBuckets": { + "name": "@supabase/storage-js.packages/StorageVectorsClient.StorageVectorsClient.listBuckets", + "params": [ + { + "name": "options", + "type": { + "type": "object", + "name": "ListVectorBucketsOptions", + "properties": [ + { + "name": "maxResults", + "type": { + "type": "intrinsic", + "name": "number" + }, + "isOptional": true, + "comment": { + "shortText": "Maximum number of results to return (default: 100)" + } + }, + { + "name": "nextToken", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Token for pagination from previous response" + } + }, + { + "name": "prefix", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Filter buckets by name prefix" + } + } + ] + }, + "comment": { + "shortText": "Optional filters (prefix, maxResults, nextToken)" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "ApiResponse", + "subTypes": [ + { + "type": "object", + "name": "SuccessResponse", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "name": "ListVectorBucketsResponse", + "properties": [ + { + "name": "nextToken", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Token for fetching next page (if more results exist)" + } + }, + { + "name": "vectorBuckets", + "type": { + "type": "array", + "elemType": { + "type": "object", + "properties": [ + { + "name": "vectorBucketName", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + } + }, + "comment": { + "shortText": "Array of bucket names" + } + } + ] + }, + "comment": { + "shortText": "Response data of type T" + } + }, + { + "name": "error", + "type": "[Circular]", + "comment": { + "shortText": "Null on success" + } + } + ] + }, + { + "type": "object", + "name": "ErrorResponse", + "properties": [ + { + "name": "data", + "type": "[Circular]", + "comment": { + "shortText": "Null on error" + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "StorageError" + }, + "comment": { + "shortText": "StorageError with details (named StorageVectorsError for vector operations)" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Lists all vector buckets with optional filtering and pagination\n\n**Public alpha:** This API is part of a public alpha release and may not be available to your account type.", + "tags": [ + { + "tag": "alpha", + "text": "" + } + ], + "examples": [ + { + "id": "list-vector-buckets", + "name": "List vector buckets", + "code": "```typescript\nconst { data, error } = await supabase\n .storage\n .vectors\n .listBuckets({ prefix: 'embeddings-' })\n\ndata?.vectorBuckets.forEach(bucket => {\n console.log(bucket.vectorBucketName)\n})\n```" + } + ] + } + }, + "@supabase/storage-js.packages/StorageVectorsClient.StorageVectorsClient.setHeader": { + "name": "@supabase/storage-js.packages/StorageVectorsClient.StorageVectorsClient.setHeader", + "params": [ + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Header name" + } + }, + { + "name": "value", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Header value" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Set an HTTP header for the request.\nCreates a shallow copy of headers to avoid mutating shared state.", + "tags": [ + { + "tag": "alpha", + "text": "" + } + ] + } + }, + "@supabase/storage-js.packages/StorageVectorsClient.StorageVectorsClient.throwOnError": { + "name": "@supabase/storage-js.packages/StorageVectorsClient.StorageVectorsClient.throwOnError", + "params": [], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Enable throwing errors instead of returning them.\nWhen enabled, errors are thrown instead of returned in { data, error } format.", + "tags": [ + { + "tag": "alpha", + "text": "" + } + ] + } + }, + "@supabase/storage-js.packages/StorageVectorsClient.VectorBucketScope.constructor": { + "name": "@supabase/storage-js.packages/StorageVectorsClient.VectorBucketScope.constructor", + "params": [ + { + "name": "url", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "headers", + "type": { + "type": "index signature", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "string" + } + } + }, + { + "name": "vectorBucketName", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "fetch", + "type": { + "type": "function", + "params": [ + { + "name": "input", + "type": { + "type": "union", + "subTypes": [ + { + "type": "nameOnly", + "name": "RequestInfo" + }, + { + "type": "nameOnly", + "name": "URL" + } + ] + } + }, + { + "name": "init", + "type": { + "type": "nameOnly", + "name": "RequestInit" + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "nameOnly", + "name": "Response" + } + } + }, + "comment": { + "shortText": "[MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch)" + } + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "VectorBucketScope" + } + }, + "comment": { + "shortText": "Creates a helper that automatically scopes all index operations to the provided bucket.\n\n**Public alpha:** This API is part of a public alpha release and may not be available to your account type.", + "tags": [ + { + "tag": "alpha", + "text": "" + } + ], + "examples": [ + { + "id": "creating-a-vector-bucket-scope", + "name": "Creating a vector bucket scope", + "code": "```typescript\nconst bucket = supabase.storage.vectors.from('embeddings-prod')\n```" + } + ] + } + }, + "@supabase/storage-js.packages/StorageVectorsClient.VectorBucketScope.createIndex": { + "name": "@supabase/storage-js.packages/StorageVectorsClient.VectorBucketScope.createIndex", + "params": [ + { + "name": "options", + "type": { + "type": "nameOnly", + "name": "Omit" + }, + "comment": { + "shortText": "Index configuration (vectorBucketName is automatically set)" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "ApiResponse", + "subTypes": [ + { + "type": "object", + "name": "SuccessResponse", + "properties": [ + { + "name": "data", + "type": { + "type": "intrinsic", + "name": "undefined" + }, + "comment": { + "shortText": "Response data of type T" + } + }, + { + "name": "error", + "type": "[Circular]", + "comment": { + "shortText": "Null on success" + } + } + ] + }, + { + "type": "object", + "name": "ErrorResponse", + "properties": [ + { + "name": "data", + "type": "[Circular]", + "comment": { + "shortText": "Null on error" + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "StorageError" + }, + "comment": { + "shortText": "StorageError with details (named StorageVectorsError for vector operations)" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Creates a new vector index in this bucket\nConvenience method that automatically includes the bucket name\n\n**Public alpha:** This API is part of a public alpha release and may not be available to your account type.", + "tags": [ + { + "tag": "alpha", + "text": "" + } + ], + "examples": [ + { + "id": "creating-a-vector-index", + "name": "Creating a vector index", + "code": "```typescript\nconst bucket = supabase.storage.vectors.from('embeddings-prod')\nawait bucket.createIndex({\n indexName: 'documents-openai',\n dataType: 'float32',\n dimension: 1536,\n distanceMetric: 'cosine',\n metadataConfiguration: {\n nonFilterableMetadataKeys: ['raw_text']\n }\n})\n```" + } + ] + } + }, + "@supabase/storage-js.packages/StorageVectorsClient.VectorBucketScope.deleteIndex": { + "name": "@supabase/storage-js.packages/StorageVectorsClient.VectorBucketScope.deleteIndex", + "params": [ + { + "name": "indexName", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Name of the index to delete" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "ApiResponse", + "subTypes": [ + { + "type": "object", + "name": "SuccessResponse", + "properties": [ + { + "name": "data", + "type": { + "type": "intrinsic", + "name": "undefined" + }, + "comment": { + "shortText": "Response data of type T" + } + }, + { + "name": "error", + "type": "[Circular]", + "comment": { + "shortText": "Null on success" + } + } + ] + }, + { + "type": "object", + "name": "ErrorResponse", + "properties": [ + { + "name": "data", + "type": "[Circular]", + "comment": { + "shortText": "Null on error" + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "StorageError" + }, + "comment": { + "shortText": "StorageError with details (named StorageVectorsError for vector operations)" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Deletes an index from this bucket\nConvenience method that automatically includes the bucket name\n\n**Public alpha:** This API is part of a public alpha release and may not be available to your account type.", + "tags": [ + { + "tag": "alpha", + "text": "" + } + ], + "examples": [ + { + "id": "delete-an-index", + "name": "Delete an index", + "code": "```typescript\nconst bucket = supabase.storage.vectors.from('embeddings-prod')\nawait bucket.deleteIndex('old-index')\n```" + } + ] + } + }, + "@supabase/storage-js.packages/StorageVectorsClient.VectorBucketScope.getIndex": { + "name": "@supabase/storage-js.packages/StorageVectorsClient.VectorBucketScope.getIndex", + "params": [ + { + "name": "indexName", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Name of the index to retrieve" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "ApiResponse", + "subTypes": [ + { + "type": "object", + "name": "SuccessResponse", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "index", + "type": { + "type": "object", + "name": "VectorIndex", + "properties": [ + { + "name": "creationTime", + "type": { + "type": "intrinsic", + "name": "number" + }, + "isOptional": true, + "comment": { + "shortText": "Unix timestamp of when the index was created" + } + }, + { + "name": "dataType", + "type": { + "type": "union", + "name": "VectorDataType", + "subTypes": [ + { + "type": "literal", + "value": "float32" + }, + null + ] + }, + "comment": { + "shortText": "Data type of vector components (currently only 'float32')" + } + }, + { + "name": "dimension", + "type": { + "type": "intrinsic", + "name": "number" + }, + "comment": { + "shortText": "Dimensionality of vectors (e.g., 384, 768, 1536)" + } + }, + { + "name": "distanceMetric", + "type": { + "type": "union", + "name": "DistanceMetric", + "subTypes": [ + { + "type": "literal", + "value": "cosine" + }, + { + "type": "literal", + "value": "euclidean" + }, + { + "type": "literal", + "value": "dotproduct" + }, + null + ] + }, + "comment": { + "shortText": "Similarity metric used for queries" + } + }, + { + "name": "indexName", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Unique name of the index within the bucket" + } + }, + { + "name": "metadataConfiguration", + "type": { + "type": "object", + "name": "MetadataConfiguration", + "properties": [ + { + "name": "nonFilterableMetadataKeys", + "type": { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + }, + "isOptional": true, + "comment": { + "shortText": "Array of metadata keys that cannot be used in filters" + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Configuration for metadata filtering" + } + }, + { + "name": "vectorBucketName", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Name of the parent vector bucket" + } + } + ] + } + } + ] + }, + "comment": { + "shortText": "Response data of type T" + } + }, + { + "name": "error", + "type": "[Circular]", + "comment": { + "shortText": "Null on success" + } + } + ] + }, + { + "type": "object", + "name": "ErrorResponse", + "properties": [ + { + "name": "data", + "type": "[Circular]", + "comment": { + "shortText": "Null on error" + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "StorageError" + }, + "comment": { + "shortText": "StorageError with details (named StorageVectorsError for vector operations)" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Retrieves metadata for a specific index in this bucket\nConvenience method that automatically includes the bucket name\n\n**Public alpha:** This API is part of a public alpha release and may not be available to your account type.", + "tags": [ + { + "tag": "alpha", + "text": "" + } + ], + "examples": [ + { + "id": "get-index-metadata", + "name": "Get index metadata", + "code": "```typescript\nconst bucket = supabase.storage.vectors.from('embeddings-prod')\nconst { data } = await bucket.getIndex('documents-openai')\nconsole.log('Dimension:', data?.index.dimension)\n```" + } + ] + } + }, + "@supabase/storage-js.packages/StorageVectorsClient.VectorBucketScope": { + "name": "@supabase/storage-js.packages/StorageVectorsClient.VectorBucketScope", + "params": [ + { + "name": "indexName", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Name of the index" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "VectorIndexScope" + } + }, + "comment": { + "shortText": "Access operations for a specific index within this bucket\nReturns a scoped client for vector data operations\n\n**Public alpha:** This API is part of a public alpha release and may not be available to your account type.", + "tags": [ + { + "tag": "alpha", + "text": "" + } + ], + "examples": [ + { + "id": "accessing-an-index", + "name": "Accessing an index", + "code": "```typescript\nconst index = supabase.storage.vectors.from('embeddings-prod').index('documents-openai')\n\n// Insert vectors\nawait index.putVectors({\n vectors: [\n { key: 'doc-1', data: { float32: [...] }, metadata: { title: 'Intro' } }\n ]\n})\n\n// Query similar vectors\nconst { data } = await index.queryVectors({\n queryVector: { float32: [...] },\n topK: 5\n})\n```" + } + ] + } + }, + "@supabase/storage-js.packages/StorageVectorsClient.VectorBucketScope.listIndexes": { + "name": "@supabase/storage-js.packages/StorageVectorsClient.VectorBucketScope.listIndexes", + "params": [ + { + "name": "options", + "type": { + "type": "nameOnly", + "name": "Omit" + }, + "comment": { + "shortText": "Listing options (vectorBucketName is automatically set)" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "ApiResponse", + "subTypes": [ + { + "type": "object", + "name": "SuccessResponse", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "name": "ListIndexesResponse", + "properties": [ + { + "name": "indexes", + "type": { + "type": "array", + "elemType": { + "type": "object", + "properties": [ + { + "name": "indexName", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + } + }, + "comment": { + "shortText": "Array of index names" + } + }, + { + "name": "nextToken", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Token for fetching next page (if more results exist)" + } + } + ] + }, + "comment": { + "shortText": "Response data of type T" + } + }, + { + "name": "error", + "type": "[Circular]", + "comment": { + "shortText": "Null on success" + } + } + ] + }, + { + "type": "object", + "name": "ErrorResponse", + "properties": [ + { + "name": "data", + "type": "[Circular]", + "comment": { + "shortText": "Null on error" + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "StorageError" + }, + "comment": { + "shortText": "StorageError with details (named StorageVectorsError for vector operations)" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Lists indexes in this bucket\nConvenience method that automatically includes the bucket name\n\n**Public alpha:** This API is part of a public alpha release and may not be available to your account type.", + "tags": [ + { + "tag": "alpha", + "text": "" + } + ], + "examples": [ + { + "id": "list-indexes", + "name": "List indexes", + "code": "```typescript\nconst bucket = supabase.storage.vectors.from('embeddings-prod')\nconst { data } = await bucket.listIndexes({ prefix: 'documents-' })\n```" + } + ] + } + }, + "@supabase/storage-js.packages/StorageVectorsClient.VectorBucketScope.setHeader": { + "name": "@supabase/storage-js.packages/StorageVectorsClient.VectorBucketScope.setHeader", + "params": [ + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Header name" + } + }, + { + "name": "value", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Header value" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Set an HTTP header for the request.\nCreates a shallow copy of headers to avoid mutating shared state.", + "tags": [ + { + "tag": "alpha", + "text": "" + } + ] + } + }, + "@supabase/storage-js.packages/StorageVectorsClient.VectorBucketScope.throwOnError": { + "name": "@supabase/storage-js.packages/StorageVectorsClient.VectorBucketScope.throwOnError", + "params": [], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Enable throwing errors instead of returning them.\nWhen enabled, errors are thrown instead of returned in { data, error } format.", + "tags": [ + { + "tag": "alpha", + "text": "" + } + ] + } + }, + "@supabase/storage-js.packages/StorageVectorsClient.VectorIndexScope.constructor": { + "name": "@supabase/storage-js.packages/StorageVectorsClient.VectorIndexScope.constructor", + "params": [ + { + "name": "url", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "headers", + "type": { + "type": "index signature", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "string" + } + } + }, + { + "name": "vectorBucketName", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "indexName", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "fetch", + "type": { + "type": "function", + "params": [ + { + "name": "input", + "type": { + "type": "union", + "subTypes": [ + { + "type": "nameOnly", + "name": "RequestInfo" + }, + { + "type": "nameOnly", + "name": "URL" + } + ] + } + }, + { + "name": "init", + "type": { + "type": "nameOnly", + "name": "RequestInit" + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "nameOnly", + "name": "Response" + } + } + }, + "comment": { + "shortText": "[MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch)" + } + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "VectorIndexScope" + } + }, + "comment": { + "shortText": "Creates a helper that automatically scopes all vector operations to the provided bucket/index names.\n\n**Public alpha:** This API is part of a public alpha release and may not be available to your account type.", + "tags": [ + { + "tag": "alpha", + "text": "" + } + ], + "examples": [ + { + "id": "creating-a-vector-index-scope", + "name": "Creating a vector index scope", + "code": "```typescript\nconst index = supabase.storage.vectors.from('embeddings-prod').index('documents-openai')\n```" + } + ] + } + }, + "@supabase/storage-js.packages/StorageVectorsClient.VectorIndexScope.deleteVectors": { + "name": "@supabase/storage-js.packages/StorageVectorsClient.VectorIndexScope.deleteVectors", + "params": [ + { + "name": "options", + "type": { + "type": "nameOnly", + "name": "Omit" + }, + "comment": { + "shortText": "Deletion options (bucket and index names automatically set)" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "ApiResponse", + "subTypes": [ + { + "type": "object", + "name": "SuccessResponse", + "properties": [ + { + "name": "data", + "type": { + "type": "intrinsic", + "name": "undefined" + }, + "comment": { + "shortText": "Response data of type T" + } + }, + { + "name": "error", + "type": "[Circular]", + "comment": { + "shortText": "Null on success" + } + } + ] + }, + { + "type": "object", + "name": "ErrorResponse", + "properties": [ + { + "name": "data", + "type": "[Circular]", + "comment": { + "shortText": "Null on error" + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "StorageError" + }, + "comment": { + "shortText": "StorageError with details (named StorageVectorsError for vector operations)" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Deletes vectors by keys from this index\nConvenience method that automatically includes bucket and index names\n\n**Public alpha:** This API is part of a public alpha release and may not be available to your account type.", + "tags": [ + { + "tag": "alpha", + "text": "" + } + ], + "examples": [ + { + "id": "delete-vectors-by-keys", + "name": "Delete vectors by keys", + "code": "```typescript\nconst index = supabase.storage.vectors.from('embeddings-prod').index('documents-openai')\nawait index.deleteVectors({\n keys: ['doc-1', 'doc-2', 'doc-3']\n})\n```" + } + ] + } + }, + "@supabase/storage-js.packages/StorageVectorsClient.VectorIndexScope.getVectors": { + "name": "@supabase/storage-js.packages/StorageVectorsClient.VectorIndexScope.getVectors", + "params": [ + { + "name": "options", + "type": { + "type": "nameOnly", + "name": "Omit" + }, + "comment": { + "shortText": "Vector retrieval options (bucket and index names automatically set)" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "ApiResponse", + "subTypes": [ + { + "type": "object", + "name": "SuccessResponse", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "name": "GetVectorsResponse", + "properties": [ + { + "name": "vectors", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "VectorMatch", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "name": "VectorData", + "properties": [ + { + "name": "float32", + "type": { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "number" + } + }, + "comment": { + "shortText": "Array of 32-bit floating point numbers" + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Vector embedding data (if requested)" + } + }, + { + "name": "distance", + "type": { + "type": "intrinsic", + "name": "number" + }, + "isOptional": true, + "comment": { + "shortText": "Similarity distance from query vector (if requested)" + } + }, + { + "name": "key", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Unique identifier for the vector" + } + }, + { + "name": "metadata", + "type": { + "type": "record", + "name": "VectorMetadata", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "any" + } + }, + "isOptional": true, + "comment": { + "shortText": "Arbitrary metadata (if requested)" + } + } + ] + } + }, + "comment": { + "shortText": "Array of retrieved vector objects" + } + } + ] + }, + "comment": { + "shortText": "Response data of type T" + } + }, + { + "name": "error", + "type": "[Circular]", + "comment": { + "shortText": "Null on success" + } + } + ] + }, + { + "type": "object", + "name": "ErrorResponse", + "properties": [ + { + "name": "data", + "type": "[Circular]", + "comment": { + "shortText": "Null on error" + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "StorageError" + }, + "comment": { + "shortText": "StorageError with details (named StorageVectorsError for vector operations)" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Retrieves vectors by keys from this index\nConvenience method that automatically includes bucket and index names\n\n**Public alpha:** This API is part of a public alpha release and may not be available to your account type.", + "tags": [ + { + "tag": "alpha", + "text": "" + } + ], + "examples": [ + { + "id": "get-vectors-by-keys", + "name": "Get vectors by keys", + "code": "```typescript\nconst index = supabase.storage.vectors.from('embeddings-prod').index('documents-openai')\nconst { data } = await index.getVectors({\n keys: ['doc-1', 'doc-2'],\n returnMetadata: true\n})\n```" + } + ] + } + }, + "@supabase/storage-js.packages/StorageVectorsClient.VectorIndexScope.listVectors": { + "name": "@supabase/storage-js.packages/StorageVectorsClient.VectorIndexScope.listVectors", + "params": [ + { + "name": "options", + "type": { + "type": "nameOnly", + "name": "Omit" + }, + "comment": { + "shortText": "Listing options (bucket and index names automatically set)" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "ApiResponse", + "subTypes": [ + { + "type": "object", + "name": "SuccessResponse", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "name": "ListVectorsResponse", + "properties": [ + { + "name": "nextToken", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Token for fetching next page (if more results exist)" + } + }, + { + "name": "vectors", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "VectorMatch", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "name": "VectorData", + "properties": [ + { + "name": "float32", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "comment": { + "shortText": "Array of 32-bit floating point numbers" + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Vector embedding data (if requested)" + } + }, + { + "name": "distance", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Similarity distance from query vector (if requested)" + } + }, + { + "name": "key", + "type": "[Circular]", + "comment": { + "shortText": "Unique identifier for the vector" + } + }, + { + "name": "metadata", + "type": { + "type": "record", + "name": "VectorMetadata", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "Arbitrary metadata (if requested)" + } + } + ] + } + }, + "comment": { + "shortText": "Array of vector objects" + } + } + ] + }, + "comment": { + "shortText": "Response data of type T" + } + }, + { + "name": "error", + "type": "[Circular]", + "comment": { + "shortText": "Null on success" + } + } + ] + }, + { + "type": "object", + "name": "ErrorResponse", + "properties": [ + { + "name": "data", + "type": "[Circular]", + "comment": { + "shortText": "Null on error" + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "StorageError" + }, + "comment": { + "shortText": "StorageError with details (named StorageVectorsError for vector operations)" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Lists vectors in this index with pagination\nConvenience method that automatically includes bucket and index names\n\n**Public alpha:** This API is part of a public alpha release and may not be available to your account type.", + "tags": [ + { + "tag": "alpha", + "text": "" + } + ], + "examples": [ + { + "id": "list-vectors-with-pagination", + "name": "List vectors with pagination", + "code": "```typescript\nconst index = supabase.storage.vectors.from('embeddings-prod').index('documents-openai')\nconst { data } = await index.listVectors({\n maxResults: 500,\n returnMetadata: true\n})\n```" + } + ] + } + }, + "@supabase/storage-js.packages/StorageVectorsClient.VectorIndexScope.putVectors": { + "name": "@supabase/storage-js.packages/StorageVectorsClient.VectorIndexScope.putVectors", + "params": [ + { + "name": "options", + "type": { + "type": "nameOnly", + "name": "Omit" + }, + "comment": { + "shortText": "Vector insertion options (bucket and index names automatically set)" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "ApiResponse", + "subTypes": [ + { + "type": "object", + "name": "SuccessResponse", + "properties": [ + { + "name": "data", + "type": { + "type": "intrinsic", + "name": "undefined" + }, + "comment": { + "shortText": "Response data of type T" + } + }, + { + "name": "error", + "type": "[Circular]", + "comment": { + "shortText": "Null on success" + } + } + ] + }, + { + "type": "object", + "name": "ErrorResponse", + "properties": [ + { + "name": "data", + "type": "[Circular]", + "comment": { + "shortText": "Null on error" + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "StorageError" + }, + "comment": { + "shortText": "StorageError with details (named StorageVectorsError for vector operations)" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Inserts or updates vectors in this index\nConvenience method that automatically includes bucket and index names\n\n**Public alpha:** This API is part of a public alpha release and may not be available to your account type.", + "tags": [ + { + "tag": "alpha", + "text": "" + } + ], + "examples": [ + { + "id": "insert-vectors-into-an-index", + "name": "Insert vectors into an index", + "code": "```typescript\nconst index = supabase.storage.vectors.from('embeddings-prod').index('documents-openai')\nawait index.putVectors({\n vectors: [\n {\n key: 'doc-1',\n data: { float32: [0.1, 0.2, ...] },\n metadata: { title: 'Introduction', page: 1 }\n }\n ]\n})\n```" + } + ] + } + }, + "@supabase/storage-js.packages/StorageVectorsClient.VectorIndexScope.queryVectors": { + "name": "@supabase/storage-js.packages/StorageVectorsClient.VectorIndexScope.queryVectors", + "params": [ + { + "name": "options", + "type": { + "type": "nameOnly", + "name": "Omit" + }, + "comment": { + "shortText": "Query options (bucket and index names automatically set)" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "ApiResponse", + "subTypes": [ + { + "type": "object", + "name": "SuccessResponse", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "name": "QueryVectorsResponse", + "properties": [ + { + "name": "distanceMetric", + "type": { + "type": "union", + "name": "DistanceMetric", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]", + null + ] + }, + "isOptional": true, + "comment": { + "shortText": "The distance metric used for the similarity search" + } + }, + { + "name": "vectors", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "VectorMatch", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "name": "VectorData", + "properties": [ + { + "name": "float32", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "comment": { + "shortText": "Array of 32-bit floating point numbers" + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Vector embedding data (if requested)" + } + }, + { + "name": "distance", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Similarity distance from query vector (if requested)" + } + }, + { + "name": "key", + "type": "[Circular]", + "comment": { + "shortText": "Unique identifier for the vector" + } + }, + { + "name": "metadata", + "type": { + "type": "record", + "name": "VectorMetadata", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "Arbitrary metadata (if requested)" + } + } + ] + } + }, + "comment": { + "shortText": "Array of similar vectors ordered by distance" + } + } + ] + }, + "comment": { + "shortText": "Response data of type T" + } + }, + { + "name": "error", + "type": "[Circular]", + "comment": { + "shortText": "Null on success" + } + } + ] + }, + { + "type": "object", + "name": "ErrorResponse", + "properties": [ + { + "name": "data", + "type": "[Circular]", + "comment": { + "shortText": "Null on error" + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "StorageError" + }, + "comment": { + "shortText": "StorageError with details (named StorageVectorsError for vector operations)" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Queries for similar vectors in this index\nConvenience method that automatically includes bucket and index names\n\n**Public alpha:** This API is part of a public alpha release and may not be available to your account type.", + "tags": [ + { + "tag": "alpha", + "text": "" + } + ], + "examples": [ + { + "id": "query-similar-vectors", + "name": "Query similar vectors", + "code": "```typescript\nconst index = supabase.storage.vectors.from('embeddings-prod').index('documents-openai')\nconst { data } = await index.queryVectors({\n queryVector: { float32: [0.1, 0.2, ...] },\n topK: 5,\n filter: { category: 'technical' },\n returnDistance: true,\n returnMetadata: true\n})\n```" + } + ] + } + }, + "@supabase/storage-js.packages/StorageVectorsClient.VectorIndexScope.setHeader": { + "name": "@supabase/storage-js.packages/StorageVectorsClient.VectorIndexScope.setHeader", + "params": [ + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Header name" + } + }, + { + "name": "value", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Header value" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Set an HTTP header for the request.\nCreates a shallow copy of headers to avoid mutating shared state.", + "tags": [ + { + "tag": "alpha", + "text": "" + } + ] + } + }, + "@supabase/storage-js.packages/StorageVectorsClient.VectorIndexScope.throwOnError": { + "name": "@supabase/storage-js.packages/StorageVectorsClient.VectorIndexScope.throwOnError", + "params": [], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Enable throwing errors instead of returning them.\nWhen enabled, errors are thrown instead of returned in { data, error } format.", + "tags": [ + { + "tag": "alpha", + "text": "" + } + ] + } + }, + "@supabase/storage-js.packages/StreamDownloadBuilder.default.constructor": { + "name": "@supabase/storage-js.packages/StreamDownloadBuilder.default.constructor", + "params": [ + { + "name": "downloadFn", + "type": { + "type": "function", + "params": [], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "nameOnly", + "name": "Response" + } + } + } + } + }, + { + "name": "shouldThrowOnError", + "type": { + "type": "intrinsic", + "name": "boolean" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "default" + } + } + }, + "@supabase/storage-js.packages/StreamDownloadBuilder.default.catch": { + "name": "@supabase/storage-js.packages/StreamDownloadBuilder.default.catch", + "params": [ + { + "name": "onrejected", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "function", + "params": [ + { + "name": "reason", + "type": { + "type": "intrinsic", + "name": "any" + } + } + ], + "ret": { + "type": { + "type": "union", + "subTypes": [ + { + "type": "nameOnly", + "name": "TResult" + }, + { + "type": "nameOnly", + "name": "PromiseLike" + } + ] + } + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "The callback to execute when the Promise is rejected." + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + { + "type": "union", + "name": "DownloadResult", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "nameOnly", + "name": "ReadableStream" + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "StorageError" + } + } + ] + } + ] + }, + { + "type": "nameOnly", + "name": "TResult" + } + ] + } + } + }, + "comment": { + "shortText": "Attaches a callback for only the rejection of the Promise." + } + }, + "@supabase/storage-js.packages/StreamDownloadBuilder.default.finally": { + "name": "@supabase/storage-js.packages/StreamDownloadBuilder.default.finally", + "params": [ + { + "name": "onfinally", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "function", + "params": [], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "The callback to execute when the Promise is settled (fulfilled or rejected)." + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "DownloadResult", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "nameOnly", + "name": "ReadableStream" + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "StorageError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The\nresolved value cannot be modified from the callback." + } + }, + "@supabase/storage-js.packages/StreamDownloadBuilder.default.then": { + "name": "@supabase/storage-js.packages/StreamDownloadBuilder.default.then", + "params": [ + { + "name": "onfulfilled", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "function", + "params": [ + { + "name": "value", + "type": { + "type": "union", + "name": "DownloadResult", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "nameOnly", + "name": "ReadableStream" + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "StorageError" + } + } + ] + } + ] + } + } + ], + "ret": { + "type": { + "type": "union", + "subTypes": [ + { + "type": "nameOnly", + "name": "TResult1" + }, + { + "type": "nameOnly", + "name": "PromiseLike" + } + ] + } + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "The callback to execute when the Promise is resolved." + } + }, + { + "name": "onrejected", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "function", + "params": [ + { + "name": "reason", + "type": { + "type": "intrinsic", + "name": "any" + } + } + ], + "ret": { + "type": { + "type": "union", + "subTypes": [ + { + "type": "nameOnly", + "name": "TResult2" + }, + { + "type": "nameOnly", + "name": "PromiseLike" + } + ] + } + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "The callback to execute when the Promise is rejected." + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + { + "type": "nameOnly", + "name": "TResult1" + }, + { + "type": "nameOnly", + "name": "TResult2" + } + ] + } + } + }, + "comment": { + "shortText": "Attaches callbacks for the resolution and/or rejection of the Promise." + } + }, + "@supabase/supabase-js.AuthApiError.constructor": { + "name": "@supabase/supabase-js.AuthApiError.constructor", + "params": [ + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "status", + "type": { + "type": "intrinsic", + "name": "number" + } + }, + { + "name": "code", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "intrinsic", + "name": "string" + } + ] + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "AuthApiError" + } + } + }, + "@supabase/supabase-js.AuthApiError.toJSON": { + "name": "@supabase/supabase-js.AuthApiError.toJSON", + "params": [], + "ret": { + "type": { + "type": "object", + "properties": [ + { + "name": "code", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "nameOnly", + "name": "ErrorCode" + }, + null + ] + } + }, + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "intrinsic", + "name": "number" + } + ] + } + } + ] + } + } + }, + "@supabase/supabase-js.AuthError.constructor": { + "name": "@supabase/supabase-js.AuthError.constructor", + "params": [ + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "status", + "type": { + "type": "intrinsic", + "name": "number" + }, + "isOptional": true + }, + { + "name": "code", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + }, + "@supabase/supabase-js.AuthError.toJSON": { + "name": "@supabase/supabase-js.AuthError.toJSON", + "params": [], + "ret": { + "type": { + "type": "object", + "properties": [ + { + "name": "code", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "nameOnly", + "name": "ErrorCode" + }, + null + ] + } + }, + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "intrinsic", + "name": "number" + } + ] + } + } + ] + } + } + }, + "@supabase/supabase-js.AuthImplicitGrantRedirectError.constructor": { + "name": "@supabase/supabase-js.AuthImplicitGrantRedirectError.constructor", + "params": [ + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "details", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "object", + "properties": [ + { + "name": "code", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "error", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + } + ] + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "AuthImplicitGrantRedirectError" + } + } + }, + "@supabase/supabase-js.AuthImplicitGrantRedirectError.toJSON": { + "name": "@supabase/supabase-js.AuthImplicitGrantRedirectError.toJSON", + "params": [], + "ret": { + "type": { + "type": "object", + "properties": [ + { + "name": "code", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "nameOnly", + "name": "ErrorCode" + }, + null + ] + } + }, + { + "name": "details", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "object", + "properties": [ + { + "name": "code", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "error", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + } + ] + } + }, + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "intrinsic", + "name": "number" + } + ] + } + } + ] + } + } + }, + "@supabase/supabase-js.AuthInvalidCredentialsError.constructor": { + "name": "@supabase/supabase-js.AuthInvalidCredentialsError.constructor", + "params": [ + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "AuthInvalidCredentialsError" + } + } + }, + "@supabase/supabase-js.AuthInvalidCredentialsError.toJSON": { + "name": "@supabase/supabase-js.AuthInvalidCredentialsError.toJSON", + "params": [], + "ret": { + "type": { + "type": "object", + "properties": [ + { + "name": "code", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "nameOnly", + "name": "ErrorCode" + }, + null + ] + } + }, + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "intrinsic", + "name": "number" + } + ] + } + } + ] + } + } + }, + "@supabase/supabase-js.AuthInvalidJwtError.constructor": { + "name": "@supabase/supabase-js.AuthInvalidJwtError.constructor", + "params": [ + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "AuthInvalidJwtError" + } + } + }, + "@supabase/supabase-js.AuthInvalidJwtError.toJSON": { + "name": "@supabase/supabase-js.AuthInvalidJwtError.toJSON", + "params": [], + "ret": { + "type": { + "type": "object", + "properties": [ + { + "name": "code", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "nameOnly", + "name": "ErrorCode" + }, + null + ] + } + }, + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "intrinsic", + "name": "number" + } + ] + } + } + ] + } + } + }, + "@supabase/supabase-js.AuthInvalidTokenResponseError.constructor": { + "name": "@supabase/supabase-js.AuthInvalidTokenResponseError.constructor", + "params": [], + "ret": { + "type": { + "type": "nameOnly", + "name": "AuthInvalidTokenResponseError" + } + } + }, + "@supabase/supabase-js.AuthInvalidTokenResponseError.toJSON": { + "name": "@supabase/supabase-js.AuthInvalidTokenResponseError.toJSON", + "params": [], + "ret": { + "type": { + "type": "object", + "properties": [ + { + "name": "code", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "nameOnly", + "name": "ErrorCode" + }, + null + ] + } + }, + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "intrinsic", + "name": "number" + } + ] + } + } + ] + } + } + }, + "@supabase/supabase-js.AuthPKCECodeVerifierMissingError.constructor": { + "name": "@supabase/supabase-js.AuthPKCECodeVerifierMissingError.constructor", + "params": [], + "ret": { + "type": { + "type": "nameOnly", + "name": "AuthPKCECodeVerifierMissingError" + } + } + }, + "@supabase/supabase-js.AuthPKCECodeVerifierMissingError.toJSON": { + "name": "@supabase/supabase-js.AuthPKCECodeVerifierMissingError.toJSON", + "params": [], + "ret": { + "type": { + "type": "object", + "properties": [ + { + "name": "code", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "nameOnly", + "name": "ErrorCode" + }, + null + ] + } + }, + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "intrinsic", + "name": "number" + } + ] + } + } + ] + } + } + }, + "@supabase/supabase-js.AuthPKCEGrantCodeExchangeError.constructor": { + "name": "@supabase/supabase-js.AuthPKCEGrantCodeExchangeError.constructor", + "params": [ + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "details", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "object", + "properties": [ + { + "name": "code", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "error", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + } + ] + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "AuthPKCEGrantCodeExchangeError" + } + } + }, + "@supabase/supabase-js.AuthPKCEGrantCodeExchangeError.toJSON": { + "name": "@supabase/supabase-js.AuthPKCEGrantCodeExchangeError.toJSON", + "params": [], + "ret": { + "type": { + "type": "object", + "properties": [ + { + "name": "code", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "nameOnly", + "name": "ErrorCode" + }, + null + ] + } + }, + { + "name": "details", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "object", + "properties": [ + { + "name": "code", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "error", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + } + ] + } + }, + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "intrinsic", + "name": "number" + } + ] + } + } + ] + } + } + }, + "@supabase/supabase-js.AuthRefreshDiscardedError.constructor": { + "name": "@supabase/supabase-js.AuthRefreshDiscardedError.constructor", + "params": [ + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "AuthRefreshDiscardedError" + } + } + }, + "@supabase/supabase-js.AuthRefreshDiscardedError.toJSON": { + "name": "@supabase/supabase-js.AuthRefreshDiscardedError.toJSON", + "params": [], + "ret": { + "type": { + "type": "object", + "properties": [ + { + "name": "code", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "nameOnly", + "name": "ErrorCode" + }, + null + ] + } + }, + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "intrinsic", + "name": "number" + } + ] + } + } + ] + } + } + }, + "@supabase/supabase-js.AuthRetryableFetchError.constructor": { + "name": "@supabase/supabase-js.AuthRetryableFetchError.constructor", + "params": [ + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "status", + "type": { + "type": "intrinsic", + "name": "number" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "AuthRetryableFetchError" + } + } + }, + "@supabase/supabase-js.AuthRetryableFetchError.toJSON": { + "name": "@supabase/supabase-js.AuthRetryableFetchError.toJSON", + "params": [], + "ret": { + "type": { + "type": "object", + "properties": [ + { + "name": "code", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "nameOnly", + "name": "ErrorCode" + }, + null + ] + } + }, + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "intrinsic", + "name": "number" + } + ] + } + } + ] + } + } + }, + "@supabase/supabase-js.AuthSessionMissingError.constructor": { + "name": "@supabase/supabase-js.AuthSessionMissingError.constructor", + "params": [], + "ret": { + "type": { + "type": "nameOnly", + "name": "AuthSessionMissingError" + } + } + }, + "@supabase/supabase-js.AuthSessionMissingError.toJSON": { + "name": "@supabase/supabase-js.AuthSessionMissingError.toJSON", + "params": [], + "ret": { + "type": { + "type": "object", + "properties": [ + { + "name": "code", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "nameOnly", + "name": "ErrorCode" + }, + null + ] + } + }, + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "intrinsic", + "name": "number" + } + ] + } + } + ] + } + } + }, + "@supabase/supabase-js.AuthUnknownError.constructor": { + "name": "@supabase/supabase-js.AuthUnknownError.constructor", + "params": [ + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "originalError", + "type": { + "type": "intrinsic", + "name": "unknown" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "AuthUnknownError" + } + } + }, + "@supabase/supabase-js.AuthUnknownError.toJSON": { + "name": "@supabase/supabase-js.AuthUnknownError.toJSON", + "params": [], + "ret": { + "type": { + "type": "object", + "properties": [ + { + "name": "code", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "nameOnly", + "name": "ErrorCode" + }, + null + ] + } + }, + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "intrinsic", + "name": "number" + } + ] + } + } + ] + } + } + }, + "@supabase/supabase-js.AuthWeakPasswordError.constructor": { + "name": "@supabase/supabase-js.AuthWeakPasswordError.constructor", + "params": [ + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "status", + "type": { + "type": "intrinsic", + "name": "number" + } + }, + { + "name": "reasons", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "length" + }, + { + "type": "literal", + "value": "characters" + }, + { + "type": "literal", + "value": "pwned" + } + ] + } + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "AuthWeakPasswordError" + } + } + }, + "@supabase/supabase-js.AuthWeakPasswordError.toJSON": { + "name": "@supabase/supabase-js.AuthWeakPasswordError.toJSON", + "params": [], + "ret": { + "type": { + "type": "object", + "properties": [ + { + "name": "code", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "nameOnly", + "name": "ErrorCode" + }, + null + ] + } + }, + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "reasons", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "length" + }, + { + "type": "literal", + "value": "characters" + }, + { + "type": "literal", + "value": "pwned" + } + ] + } + } + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "intrinsic", + "name": "number" + } + ] + } + } + ] + } + } + }, + "@supabase/supabase-js.CustomAuthError.constructor": { + "name": "@supabase/supabase-js.CustomAuthError.constructor", + "params": [ + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "status", + "type": { + "type": "intrinsic", + "name": "number" + } + }, + { + "name": "code", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "intrinsic", + "name": "string" + } + ] + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "CustomAuthError" + } + } + }, + "@supabase/supabase-js.CustomAuthError.toJSON": { + "name": "@supabase/supabase-js.CustomAuthError.toJSON", + "params": [], + "ret": { + "type": { + "type": "object", + "properties": [ + { + "name": "code", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "nameOnly", + "name": "ErrorCode" + }, + null + ] + } + }, + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "intrinsic", + "name": "number" + } + ] + } + } + ] + } + } + }, + "@supabase/supabase-js.FunctionsError.constructor": { + "name": "@supabase/supabase-js.FunctionsError.constructor", + "params": [ + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "context", + "type": { + "type": "intrinsic", + "name": "any" + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "FunctionsError" + } + } + }, + "@supabase/supabase-js.FunctionsError.toJSON": { + "name": "@supabase/supabase-js.FunctionsError.toJSON", + "params": [], + "ret": { + "type": { + "type": "object", + "properties": [ + { + "name": "context", + "type": { + "type": "intrinsic", + "name": "any" + } + }, + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + } + } + }, + "@supabase/supabase-js.FunctionsFetchError.constructor": { + "name": "@supabase/supabase-js.FunctionsFetchError.constructor", + "params": [ + { + "name": "context", + "type": { + "type": "intrinsic", + "name": "any" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "FunctionsFetchError" + } + } + }, + "@supabase/supabase-js.FunctionsFetchError.toJSON": { + "name": "@supabase/supabase-js.FunctionsFetchError.toJSON", + "params": [], + "ret": { + "type": { + "type": "object", + "properties": [ + { + "name": "context", + "type": { + "type": "intrinsic", + "name": "any" + } + }, + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + } + } + }, + "@supabase/supabase-js.FunctionsHttpError.constructor": { + "name": "@supabase/supabase-js.FunctionsHttpError.constructor", + "params": [ + { + "name": "context", + "type": { + "type": "intrinsic", + "name": "any" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "FunctionsHttpError" + } + } + }, + "@supabase/supabase-js.FunctionsHttpError.toJSON": { + "name": "@supabase/supabase-js.FunctionsHttpError.toJSON", + "params": [], + "ret": { + "type": { + "type": "object", + "properties": [ + { + "name": "context", + "type": { + "type": "intrinsic", + "name": "any" + } + }, + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + } + } + }, + "@supabase/supabase-js.FunctionsRelayError.constructor": { + "name": "@supabase/supabase-js.FunctionsRelayError.constructor", + "params": [ + { + "name": "context", + "type": { + "type": "intrinsic", + "name": "any" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "FunctionsRelayError" + } + } + }, + "@supabase/supabase-js.FunctionsRelayError.toJSON": { + "name": "@supabase/supabase-js.FunctionsRelayError.toJSON", + "params": [], + "ret": { + "type": { + "type": "object", + "properties": [ + { + "name": "context", + "type": { + "type": "intrinsic", + "name": "any" + } + }, + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + } + } + }, + "@supabase/supabase-js.GoTrueAdminApi.constructor": { + "name": "@supabase/supabase-js.GoTrueAdminApi.constructor", + "params": [ + { + "type": { + "type": "object", + "properties": [ + { + "name": "experimental", + "type": { + "name": "ExperimentalFeatureFlags", + "type": "object", + "properties": [ + { + "name": "passkey", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "Enables passkey support:\n - `auth.signInWithPasskey()`, `auth.registerPasskey()`\n - `auth.passkey.*`\n - `auth.admin.passkey.*`\n\nDefaults to `false`. Calling any passkey method while this flag is\ndisabled throws a descriptive error at call time." + } + } + ] + }, + "isOptional": true + }, + { + "name": "fetch", + "type": { + "type": "function", + "params": [ + { + "name": "input", + "type": { + "type": "union", + "subTypes": [ + { + "type": "nameOnly", + "name": "RequestInfo" + }, + { + "type": "nameOnly", + "name": "URL" + } + ] + } + }, + { + "name": "init", + "type": { + "type": "nameOnly", + "name": "RequestInit" + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "nameOnly", + "name": "Response" + } + } + }, + "comment": { + "shortText": "[MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch)" + } + }, + "isOptional": true + }, + { + "name": "headers", + "type": { + "type": "index signature", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "string" + } + }, + "isOptional": true + }, + { + "name": "url", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "GoTrueAdminApi" + } + }, + "comment": { + "shortText": "Creates an admin API client that can be used to manage users and OAuth clients.", + "examples": [ + { + "id": "using-supabase-js-recommended", + "name": "Using supabase-js (recommended)", + "code": "```ts\nimport { createClient } from '@supabase/supabase-js'\n\nconst supabase = createClient('https://xyzcompany.supabase.co', 'your-secret-key')\nconst { data, error } = await supabase.auth.admin.listUsers()\n```" + }, + { + "id": "standalone-import-for-bundle-sensitive-environments", + "name": "Standalone import for bundle-sensitive environments", + "code": "```ts\nimport { GoTrueAdminApi } from '@supabase/auth-js'\n\nconst admin = new GoTrueAdminApi({\n url: 'https://xyzcompany.supabase.co/auth/v1',\n headers: { Authorization: `Bearer ${process.env.SUPABASE_SECRET_KEY}` },\n})\n```" + } + ] + } + }, + "@supabase/supabase-js.GoTrueAdminApi.createUser": { + "name": "@supabase/supabase-js.GoTrueAdminApi.createUser", + "params": [ + { + "name": "attributes", + "type": { + "type": "object", + "name": "AdminUserAttributes", + "properties": [ + { + "name": "app_metadata", + "type": { + "type": "intrinsic", + "name": "object" + }, + "isOptional": true, + "comment": { + "shortText": "A custom data object to store the user's application specific metadata. This maps to the `auth.users.app_metadata` column.\n\nOnly a service role can modify.\n\nThe `app_metadata` should be a JSON object that includes app-specific info, such as identity providers, roles, and other\naccess control information." + } + }, + { + "name": "ban_duration", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Determines how long a user is banned for.\n\nThe format for the ban duration follows a strict sequence of decimal numbers with a unit suffix.\nValid time units are \"ns\", \"us\" (or \"µs\"), \"ms\", \"s\", \"m\", \"h\".\n\nFor example, some possible durations include: '300ms', '2h45m'.\n\nSetting the ban duration to 'none' lifts the ban on the user." + } + }, + { + "name": "current_password", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "The user's current password\n\nThis is only ever present when the user is resetting\ntheir password and GOTRUE_SECURITY_UPDATE_PASSWORD_REQUIRE_CURRENT_PASSWORD is true." + } + }, + { + "name": "email", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "The user's email." + } + }, + { + "name": "email_confirm", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "Sets the user's email as confirmed when true, or unconfirmed when false.\n\nOnly a service role can modify." + } + }, + { + "name": "id", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "The `id` for the user.\n\nAllows you to overwrite the default `id` set for the user." + } + }, + { + "name": "nonce", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "The nonce sent for reauthentication if the user's password is to be updated.\n\nCall reauthenticate() to obtain the nonce first." + } + }, + { + "name": "password", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "The user's password." + } + }, + { + "name": "password_hash", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "The `password_hash` for the user's password.\n\nAllows you to specify a password hash for the user. This is useful for migrating a user's password hash from another service.\n\nSupports bcrypt, scrypt (firebase), and argon2 password hashes." + } + }, + { + "name": "phone", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "The user's phone." + } + }, + { + "name": "phone_confirm", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "Sets the user's phone as confirmed when true, or unconfirmed when false.\n\nOnly a service role can modify." + } + }, + { + "name": "role", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "The `role` claim set in the user's access token JWT.\n\nWhen a user signs up, this role is set to `authenticated` by default. You should only modify the `role` if you need to provision several levels of admin access that have different permissions on individual columns in your database.\n\nSetting this role to `service_role` is not recommended as it grants the user admin privileges." + } + }, + { + "name": "user_metadata", + "type": { + "type": "intrinsic", + "name": "object" + }, + "isOptional": true, + "comment": { + "shortText": "A custom data object to store the user's metadata. This maps to the `auth.users.raw_user_meta_data` column.\n\n\nThe `user_metadata` should be a JSON object that includes user-specific info, such as their first and last name.\n\nNote: When using the GoTrueAdminApi and wanting to modify a user's metadata,\nthis attribute is used instead of UserAttributes data." + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "UserResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "user", + "type": { + "type": "object", + "name": "AuthUser", + "properties": [ + { + "name": "action_link", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "banned_until", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "confirmed_at", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "created_at", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "deleted_at", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "email", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "webauthn" + }, + { + "type": "literal", + "value": "totp" + }, + { + "type": "literal", + "value": "phone" + } + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "webauthn" + }, + { + "type": "literal", + "value": "totp" + }, + { + "type": "literal", + "value": "phone" + } + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "id", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "any" + } + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "last_sign_in_at", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "provider", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "updated_at", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "user_id", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "is_anonymous", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "is_sso_user", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "new_email", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "new_phone", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "phone", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "role", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "updated_at", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + } + } + ] + } + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "user", + "type": { + "type": "literal", + "value": null + } + } + ] + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Creates a new user.\nThis function should only be called on a server. Never expose your `service_role` key in the browser.", + "text": "- To confirm the user's email address or phone number, set `email_confirm` or `phone_confirm` to true. Both arguments default to false.\n- `createUser()` will not send a confirmation email to the user. You can use [`inviteUserByEmail()`](/docs/reference/javascript/auth-admin-inviteuserbyemail) if you want to send them an email invite instead.\n- If you are sure that the created user's email or phone number is legitimate and verified, you can set the `email_confirm` or `phone_confirm` param to `true`.", + "examples": [ + { + "id": "with-custom-user-metadata", + "name": "With custom user metadata", + "code": "```js\nconst { data, error } = await supabase.auth.admin.createUser({\n email: 'user@email.com',\n password: 'password',\n user_metadata: { name: 'Yoda' }\n})\n```", + "response": "```json\n{\n data: {\n user: {\n id: '1',\n aud: 'authenticated',\n role: 'authenticated',\n email: 'example@email.com',\n email_confirmed_at: '2024-01-01T00:00:00Z',\n phone: '',\n confirmation_sent_at: '2024-01-01T00:00:00Z',\n confirmed_at: '2024-01-01T00:00:00Z',\n last_sign_in_at: '2024-01-01T00:00:00Z',\n app_metadata: {},\n user_metadata: {},\n identities: [\n {\n \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n \"id\": \"1\",\n \"user_id\": \"1\",\n \"identity_data\": {\n \"email\": \"example@email.com\",\n \"email_verified\": true,\n \"phone_verified\": false,\n \"sub\": \"1\"\n },\n \"provider\": \"email\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"email@example.com\"\n },\n ],\n created_at: '2024-01-01T00:00:00Z',\n updated_at: '2024-01-01T00:00:00Z',\n is_anonymous: false,\n }\n }\n error: null\n}\n```" + }, + { + "id": "auto-confirm-the-user-s-email", + "name": "Auto-confirm the user's email", + "code": "```js\nconst { data, error } = await supabase.auth.admin.createUser({\n email: 'user@email.com',\n email_confirm: true\n})\n```" + }, + { + "id": "auto-confirm-the-user-s-phone-number", + "name": "Auto-confirm the user's phone number", + "code": "```js\nconst { data, error } = await supabase.auth.admin.createUser({\n phone: '1234567890',\n phone_confirm: true\n})\n```" + } + ] + } + }, + "@supabase/supabase-js.GoTrueAdminApi.deleteUser": { + "name": "@supabase/supabase-js.GoTrueAdminApi.deleteUser", + "params": [ + { + "name": "id", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The user id you want to remove." + } + }, + { + "name": "shouldSoftDelete", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "If true, then the user will be soft-deleted from the auth schema. Soft deletion allows user identification from the hashed user ID but is not reversible.\nDefaults to false for backward compatibility.\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser." + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "UserResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "user", + "type": { + "type": "object", + "name": "AuthUser", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "user", + "type": "[Circular]" + } + ] + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Delete a user. Requires a `service_role` key.", + "text": "- The `deleteUser()` method requires the user's ID, which maps to the `auth.users.id` column.", + "examples": [ + { + "id": "removes-a-user", + "name": "Removes a user", + "code": "```js\nconst { data, error } = await supabase.auth.admin.deleteUser(\n '715ed5db-f090-4b8c-a067-640ecee36aa0'\n)\n```", + "response": "```json\n{\n \"data\": {\n \"user\": {}\n },\n \"error\": null\n}\n```" + } + ] + } + }, + "@supabase/supabase-js.GoTrueAdminApi.generateLink": { + "name": "@supabase/supabase-js.GoTrueAdminApi.generateLink", + "params": [ + { + "name": "params", + "type": { + "type": "union", + "name": "GenerateLinkParams", + "subTypes": [ + { + "name": "GenerateSignupLinkParams", + "type": "object", + "properties": [ + { + "name": "email", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "options", + "isOptional": true + }, + { + "name": "password", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "type", + "type": { + "type": "literal", + "value": "signup" + } + } + ] + }, + { + "name": "GenerateInviteOrMagiclinkParams", + "type": "object", + "properties": [ + { + "name": "email", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The user's email" + } + }, + { + "name": "options", + "isOptional": true + }, + { + "name": "type", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "invite" + }, + { + "type": "literal", + "value": "magiclink" + } + ] + } + } + ] + }, + { + "name": "GenerateRecoveryLinkParams", + "type": "object", + "properties": [ + { + "name": "email", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The user's email" + } + }, + { + "name": "options", + "isOptional": true + }, + { + "name": "type", + "type": { + "type": "literal", + "value": "recovery" + } + } + ] + }, + { + "name": "GenerateEmailChangeLinkParams", + "type": "object", + "properties": [ + { + "name": "email", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The user's email" + } + }, + { + "name": "newEmail", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The user's new email. Only required if type is 'email_change_current' or 'email_change_new'." + } + }, + { + "name": "options", + "isOptional": true + }, + { + "name": "type", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "email_change_current" + }, + { + "type": "literal", + "value": "email_change_new" + } + ] + } + } + ] + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "GenerateLinkResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "properties", + "type": { + "name": "GenerateLinkProperties", + "type": "object", + "properties": [ + { + "name": "action_link", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The email link to send to the user.\nThe action_link follows the following format: auth/v1/verify?type={verification_type}&token={hashed_token}&redirect_to={redirect_to}" + } + }, + { + "name": "email_otp", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The raw email OTP.\nYou should send this in the email if you want your users to verify using an OTP instead of the action link." + } + }, + { + "name": "hashed_token", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The hashed token appended to the action link." + } + }, + { + "name": "redirect_to", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The URL appended to the action link." + } + }, + { + "name": "verification_type", + "type": { + "type": "union", + "name": "GenerateLinkType", + "subTypes": [ + { + "type": "literal", + "value": "signup" + }, + { + "type": "literal", + "value": "invite" + }, + { + "type": "literal", + "value": "magiclink" + }, + { + "type": "literal", + "value": "recovery" + }, + { + "type": "literal", + "value": "email_change_current" + }, + { + "type": "literal", + "value": "email_change_new" + } + ] + }, + "comment": { + "shortText": "The verification type that the email link is associated to." + } + } + ] + } + }, + { + "name": "user", + "type": { + "type": "object", + "name": "AuthUser", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "properties", + "type": "[Circular]" + }, + { + "name": "user", + "type": "[Circular]" + } + ] + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Generates email links and OTPs to be sent via a custom email provider.", + "text": "- The following types can be passed into `generateLink()`: `signup`, `magiclink`, `invite`, `recovery`, `email_change_current`, `email_change_new`, `phone_change`.\n- `generateLink()` only generates the email link for `email_change_email` if the **Secure email change** is enabled in your project's [email auth provider settings](/dashboard/project/_/auth/providers).\n- `generateLink()` handles the creation of the user for `signup`, `invite` and `magiclink`.", + "examples": [ + { + "id": "generate-a-signup-link", + "name": "Generate a signup link", + "code": "```js\nconst { data, error } = await supabase.auth.admin.generateLink({\n type: 'signup',\n email: 'email@example.com',\n password: 'secret'\n})\n```", + "response": "```json\n{\n \"data\": {\n \"properties\": {\n \"action_link\": \"\",\n \"email_otp\": \"999999\",\n \"hashed_token\": \"\",\n \"verification_type\": \"signup\"\n },\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"email@example.com\",\n \"phone\": \"\",\n \"confirmation_sent_at\": \"2024-01-01T00:00:00Z\",\n \"app_metadata\": {\n \"provider\": \"email\",\n \"providers\": [\n \"email\"\n ]\n },\n \"user_metadata\": {},\n \"identities\": [\n {\n \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n \"identity_data\": {\n \"email\": \"email@example.com\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"provider\": \"email\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"email@example.com\"\n }\n ],\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"is_anonymous\": false\n }\n },\n \"error\": null\n}\n```" + }, + { + "id": "generate-an-invite-link", + "name": "Generate an invite link", + "code": "```js\nconst { data, error } = await supabase.auth.admin.generateLink({\n type: 'invite',\n email: 'email@example.com'\n})\n```" + }, + { + "id": "generate-a-magic-link", + "name": "Generate a magic link", + "code": "```js\nconst { data, error } = await supabase.auth.admin.generateLink({\n type: 'magiclink',\n email: 'email@example.com'\n})\n```" + }, + { + "id": "generate-a-recovery-link", + "name": "Generate a recovery link", + "code": "```js\nconst { data, error } = await supabase.auth.admin.generateLink({\n type: 'recovery',\n email: 'email@example.com'\n})\n```" + }, + { + "id": "generate-links-to-change-current-email-address", + "name": "Generate links to change current email address", + "code": "```js\n// generate an email change link to be sent to the current email address\nconst { data, error } = await supabase.auth.admin.generateLink({\n type: 'email_change_current',\n email: 'current.email@example.com',\n newEmail: 'new.email@example.com'\n})\n\n// generate an email change link to be sent to the new email address\nconst { data, error } = await supabase.auth.admin.generateLink({\n type: 'email_change_new',\n email: 'current.email@example.com',\n newEmail: 'new.email@example.com'\n})\n```" + } + ] + } + }, + "@supabase/supabase-js.GoTrueAdminApi.getUserById": { + "name": "@supabase/supabase-js.GoTrueAdminApi.getUserById", + "params": [ + { + "name": "uid", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The user's unique identifier\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser." + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "UserResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "user", + "type": { + "type": "object", + "name": "AuthUser", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "user", + "type": "[Circular]" + } + ] + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Get user by id.", + "text": "- Fetches the user object from the database based on the user's id.\n- The `getUserById()` method requires the user's id which maps to the `auth.users.id` column.", + "examples": [ + { + "id": "fetch-the-user-object-using-the-access-token-jwt", + "name": "Fetch the user object using the access_token jwt", + "code": "```js\nconst { data, error } = await supabase.auth.admin.getUserById(1)\n```", + "response": "```json\n{\n data: {\n user: {\n id: '1',\n aud: 'authenticated',\n role: 'authenticated',\n email: 'example@email.com',\n email_confirmed_at: '2024-01-01T00:00:00Z',\n phone: '',\n confirmation_sent_at: '2024-01-01T00:00:00Z',\n confirmed_at: '2024-01-01T00:00:00Z',\n last_sign_in_at: '2024-01-01T00:00:00Z',\n app_metadata: {},\n user_metadata: {},\n identities: [\n {\n \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n \"id\": \"1\",\n \"user_id\": \"1\",\n \"identity_data\": {\n \"email\": \"example@email.com\",\n \"email_verified\": true,\n \"phone_verified\": false,\n \"sub\": \"1\"\n },\n \"provider\": \"email\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"email@example.com\"\n },\n ],\n created_at: '2024-01-01T00:00:00Z',\n updated_at: '2024-01-01T00:00:00Z',\n is_anonymous: false,\n }\n }\n error: null\n}\n```" + } + ] + } + }, + "@supabase/supabase-js.GoTrueAdminApi.inviteUserByEmail": { + "name": "@supabase/supabase-js.GoTrueAdminApi.inviteUserByEmail", + "params": [ + { + "name": "email", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The email address of the user." + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "intrinsic", + "name": "object" + }, + "isOptional": true, + "comment": { + "shortText": "A custom data object to store additional metadata about the user. This maps to the `auth.users.user_metadata` column." + } + }, + { + "name": "redirectTo", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "The URL which will be appended to the email link sent to the user's email address. Once clicked the user will end up on this URL." + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Additional options to be included when inviting." + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "UserResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "user", + "type": { + "type": "object", + "name": "AuthUser", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "user", + "type": "[Circular]" + } + ] + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Sends an invite link to an email address.", + "text": "- Sends an invite link to the user's email address.\n- The `inviteUserByEmail()` method is typically used by administrators to invite users to join the application.\n- Note that PKCE is not supported when using `inviteUserByEmail`. This is because the browser initiating the invite is often different from the browser accepting the invite which makes it difficult to provide the security guarantees required of the PKCE flow.", + "examples": [ + { + "id": "invite-a-user", + "name": "Invite a user", + "code": "```js\nconst { data, error } = await supabase.auth.admin.inviteUserByEmail('email@example.com')\n```", + "response": "```json\n{\n \"data\": {\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"example@email.com\",\n \"invited_at\": \"2024-01-01T00:00:00Z\",\n \"phone\": \"\",\n \"confirmation_sent_at\": \"2024-01-01T00:00:00Z\",\n \"app_metadata\": {\n \"provider\": \"email\",\n \"providers\": [\n \"email\"\n ]\n },\n \"user_metadata\": {},\n \"identities\": [\n {\n \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n \"identity_data\": {\n \"email\": \"example@email.com\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"provider\": \"email\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"example@email.com\"\n }\n ],\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"is_anonymous\": false\n }\n },\n \"error\": null\n}\n```" + } + ] + } + }, + "@supabase/supabase-js.GoTrueAdminApi.listUsers": { + "name": "@supabase/supabase-js.GoTrueAdminApi.listUsers", + "params": [ + { + "name": "params", + "type": { + "name": "PageParams", + "type": "object", + "properties": [ + { + "name": "page", + "type": { + "type": "intrinsic", + "name": "number" + }, + "isOptional": true, + "comment": { + "shortText": "The page number" + } + }, + { + "name": "perPage", + "type": { + "type": "intrinsic", + "name": "number" + }, + "isOptional": true, + "comment": { + "shortText": "Number of items returned per page" + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "An object which supports `page` and `perPage` as numbers, to alter the paginated results." + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data" + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "users" + } + ] + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Get a list of users.\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser.", + "text": "- Defaults to return 50 users per page.", + "examples": [ + { + "id": "get-a-page-of-users", + "name": "Get a page of users", + "code": "```js\nconst { data: { users }, error } = await supabase.auth.admin.listUsers()\n```" + }, + { + "id": "paginated-list-of-users", + "name": "Paginated list of users", + "code": "```js\nconst { data: { users }, error } = await supabase.auth.admin.listUsers({\n page: 1,\n perPage: 1000\n})\n```" + } + ] + } + }, + "@supabase/supabase-js.GoTrueAdminApi.signOut": { + "name": "@supabase/supabase-js.GoTrueAdminApi.signOut", + "params": [ + { + "name": "jwt", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "A valid, logged-in JWT." + } + }, + { + "name": "scope", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "global" + }, + { + "type": "literal", + "value": "local" + }, + { + "type": "literal", + "value": "others" + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "The logout sope." + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "literal", + "value": null + } + }, + { + "name": "error", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "nameOnly", + "name": "AuthError" + } + ] + } + } + ] + } + } + }, + "comment": { + "shortText": "Removes a logged-in session." + } + }, + "@supabase/supabase-js.GoTrueAdminApi.updateUserById": { + "name": "@supabase/supabase-js.GoTrueAdminApi.updateUserById", + "params": [ + { + "name": "uid", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The user's unique identifier" + } + }, + { + "name": "attributes", + "type": { + "type": "object", + "name": "AdminUserAttributes", + "properties": [ + { + "name": "app_metadata", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "A custom data object to store the user's application specific metadata. This maps to the `auth.users.app_metadata` column.\n\nOnly a service role can modify.\n\nThe `app_metadata` should be a JSON object that includes app-specific info, such as identity providers, roles, and other\naccess control information." + } + }, + { + "name": "ban_duration", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Determines how long a user is banned for.\n\nThe format for the ban duration follows a strict sequence of decimal numbers with a unit suffix.\nValid time units are \"ns\", \"us\" (or \"µs\"), \"ms\", \"s\", \"m\", \"h\".\n\nFor example, some possible durations include: '300ms', '2h45m'.\n\nSetting the ban duration to 'none' lifts the ban on the user." + } + }, + { + "name": "current_password", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The user's current password\n\nThis is only ever present when the user is resetting\ntheir password and GOTRUE_SECURITY_UPDATE_PASSWORD_REQUIRE_CURRENT_PASSWORD is true." + } + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The user's email." + } + }, + { + "name": "email_confirm", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Sets the user's email as confirmed when true, or unconfirmed when false.\n\nOnly a service role can modify." + } + }, + { + "name": "id", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The `id` for the user.\n\nAllows you to overwrite the default `id` set for the user." + } + }, + { + "name": "nonce", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The nonce sent for reauthentication if the user's password is to be updated.\n\nCall reauthenticate() to obtain the nonce first." + } + }, + { + "name": "password", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The user's password." + } + }, + { + "name": "password_hash", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The `password_hash` for the user's password.\n\nAllows you to specify a password hash for the user. This is useful for migrating a user's password hash from another service.\n\nSupports bcrypt, scrypt (firebase), and argon2 password hashes." + } + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The user's phone." + } + }, + { + "name": "phone_confirm", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Sets the user's phone as confirmed when true, or unconfirmed when false.\n\nOnly a service role can modify." + } + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The `role` claim set in the user's access token JWT.\n\nWhen a user signs up, this role is set to `authenticated` by default. You should only modify the `role` if you need to provision several levels of admin access that have different permissions on individual columns in your database.\n\nSetting this role to `service_role` is not recommended as it grants the user admin privileges." + } + }, + { + "name": "user_metadata", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "A custom data object to store the user's metadata. This maps to the `auth.users.raw_user_meta_data` column.\n\n\nThe `user_metadata` should be a JSON object that includes user-specific info, such as their first and last name.\n\nNote: When using the GoTrueAdminApi and wanting to modify a user's metadata,\nthis attribute is used instead of UserAttributes data." + } + } + ] + }, + "comment": { + "shortText": "The data you want to update.\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser." + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "UserResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "user", + "type": { + "type": "object", + "name": "AuthUser", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "user", + "type": "[Circular]" + } + ] + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Updates the user data. Changes are applied directly without confirmation flows.", + "text": "**Important:** This is a server-side operation and does **not** trigger client-side\n`onAuthStateChange` listeners. The admin API has no connection to client state.\n\nTo sync changes to the client after calling this method:\n1. On the client, call `supabase.auth.refreshSession()` to fetch the updated user data\n2. This will trigger the `TOKEN_REFRESHED` event and notify all listeners", + "examples": [ + { + "id": "example-1", + "name": "Example 1", + "code": "```typescript\n// Server-side (Edge Function)\nconst { data, error } = await supabase.auth.admin.updateUserById(\n userId,\n { user_metadata: { preferences: { theme: 'dark' } } }\n)\n\n// Client-side (to sync the changes)\nconst { data, error } = await supabase.auth.refreshSession()\n// onAuthStateChange listeners will now be notified with updated user\n```" + }, + { + "id": "updates-a-user-s-email", + "name": "Updates a user's email", + "code": "```js\nconst { data: user, error } = await supabase.auth.admin.updateUserById(\n '11111111-1111-1111-1111-111111111111',\n { email: 'new@email.com' }\n)\n```", + "response": "```json\n{\n \"data\": {\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"new@email.com\",\n \"email_confirmed_at\": \"2024-01-01T00:00:00Z\",\n \"phone\": \"\",\n \"confirmed_at\": \"2024-01-01T00:00:00Z\",\n \"recovery_sent_at\": \"2024-01-01T00:00:00Z\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"app_metadata\": {\n \"provider\": \"email\",\n \"providers\": [\n \"email\"\n ]\n },\n \"user_metadata\": {\n \"email\": \"example@email.com\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"identities\": [\n {\n \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n \"identity_data\": {\n \"email\": \"example@email.com\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"provider\": \"email\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"example@email.com\"\n }\n ],\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"is_anonymous\": false\n }\n },\n \"error\": null\n}\n```" + }, + { + "id": "updates-a-user-s-password", + "name": "Updates a user's password", + "code": "```js\nconst { data: user, error } = await supabase.auth.admin.updateUserById(\n '6aa5d0d4-2a9f-4483-b6c8-0cf4c6c98ac4',\n { password: 'new_password' }\n)\n```" + }, + { + "id": "updates-a-user-s-metadata", + "name": "Updates a user's metadata", + "code": "```js\nconst { data: user, error } = await supabase.auth.admin.updateUserById(\n '6aa5d0d4-2a9f-4483-b6c8-0cf4c6c98ac4',\n { user_metadata: { hello: 'world' } }\n)\n```" + }, + { + "id": "updates-a-user-s-app-metadata", + "name": "Updates a user's app_metadata", + "code": "```js\nconst { data: user, error } = await supabase.auth.admin.updateUserById(\n '6aa5d0d4-2a9f-4483-b6c8-0cf4c6c98ac4',\n { app_metadata: { plan: 'trial' } }\n)\n```" + }, + { + "id": "confirms-a-user-s-email-address", + "name": "Confirms a user's email address", + "code": "```js\nconst { data: user, error } = await supabase.auth.admin.updateUserById(\n '6aa5d0d4-2a9f-4483-b6c8-0cf4c6c98ac4',\n { email_confirm: true }\n)\n```" + }, + { + "id": "confirms-a-user-s-phone-number", + "name": "Confirms a user's phone number", + "code": "```js\nconst { data: user, error } = await supabase.auth.admin.updateUserById(\n '6aa5d0d4-2a9f-4483-b6c8-0cf4c6c98ac4',\n { phone_confirm: true }\n)\n```" + }, + { + "id": "ban-a-user-for-100-years", + "name": "Ban a user for 100 years", + "code": "```js\nconst { data: user, error } = await supabase.auth.admin.updateUserById(\n '6aa5d0d4-2a9f-4483-b6c8-0cf4c6c98ac4',\n { ban_duration: '876000h' }\n)\n```" + } + ] + } + }, + "@supabase/supabase-js.GoTrueClient.constructor": { + "name": "@supabase/supabase-js.GoTrueClient.constructor", + "params": [ + { + "name": "options", + "type": { + "name": "GoTrueClientOptions", + "type": "object", + "properties": [ + { + "name": "autoRefreshToken", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "debug", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "boolean" + }, + { + "type": "function", + "params": [ + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "args", + "type": { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "any" + } + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + } + } + ] + }, + "isOptional": true + }, + { + "name": "detectSessionInUrl", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "boolean" + }, + { + "type": "function", + "params": [ + { + "name": "url", + "type": { + "type": "nameOnly", + "name": "URL" + } + }, + { + "name": "params", + "type": { + "type": "index signature", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "string" + } + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "boolean" + } + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Set to \"true\" if you want to automatically detect OAuth grants in the URL and sign in the user.\nSet to \"false\" to disable automatic detection.\nSet to a function to provide custom logic for determining if a URL contains a Supabase auth callback.\nThe function receives the current URL and parsed parameters, and should return true if the URL\nshould be processed as a Supabase auth callback, or false to ignore it.\n\nThis is useful when your app uses other OAuth providers (e.g., Facebook Login) that also return\naccess_token in the URL fragment, which would otherwise be incorrectly intercepted by Supabase Auth.", + "examples": [ + { + "id": "example-1", + "name": "Example 1", + "code": "```ts\ndetectSessionInUrl: (url, params) => {\n // Ignore Facebook OAuth redirects\n if (url.pathname === '/facebook/redirect') return false\n // Use default detection for other URLs\n return Boolean(params.access_token || params.error_description)\n}\n```" + } + ] + } + }, + { + "name": "experimental", + "type": { + "name": "ExperimentalFeatureFlags", + "type": "object", + "properties": [ + { + "name": "passkey", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Enables passkey support:\n - `auth.signInWithPasskey()`, `auth.registerPasskey()`\n - `auth.passkey.*`\n - `auth.admin.passkey.*`\n\nDefaults to `false`. Calling any passkey method while this flag is\ndisabled throws a descriptive error at call time." + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Opt-in flags for experimental features. These APIs may change without\nnotice and are disabled by default.", + "tags": [ + { + "tag": "experimental", + "text": "" + } + ] + } + }, + { + "name": "fetch", + "type": { + "type": "nameOnly", + "name": "Fetch" + }, + "isOptional": true + }, + { + "name": "flowType", + "type": { + "type": "union", + "name": "AuthFlowType", + "subTypes": [ + { + "type": "literal", + "value": "implicit" + }, + { + "type": "literal", + "value": "pkce" + }, + null + ] + }, + "isOptional": true + }, + { + "name": "hasCustomAuthorizationHeader", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "Set to \"true\" if there is a custom authorization header set globally.", + "tags": [ + { + "tag": "experimental", + "text": "" + } + ] + } + }, + { + "name": "headers", + "type": { + "type": "index signature", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "string" + } + }, + "isOptional": true + }, + { + "name": "lock", + "type": { + "name": "LockFunc", + "type": "function", + "params": [ + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Name of the lock to be acquired." + } + }, + { + "name": "acquireTimeout", + "type": { + "type": "intrinsic", + "name": "number" + }, + "comment": { + "shortText": "If negative, no timeout should occur. If positive it\n should throw an Error with an `isAcquireTimeout`\n property set to true if the operation fails to be\n acquired after this much time (ms)." + } + }, + { + "name": "fn", + "type": { + "type": "function", + "params": [], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "nameOnly", + "name": "R" + } + } + } + }, + "comment": { + "shortText": "The operation to execute when the lock is acquired." + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "nameOnly", + "name": "R" + } + } + } + }, + "isOptional": true, + "comment": { + "shortText": "Provide your own locking mechanism based on the environment. By default\nthe client coordinates refreshes itself (single-flight via\n`refreshingDeferred` + commit guard) and relies on the GoTrue server to\nresolve cross-tab refresh races. Passing a custom lock opts into a\nlegacy path that wraps every auth operation in your supplied lock — this\npath is preserved for backwards compatibility (typically React Native\n`processLock` or Node multi-process setups)." + } + }, + { + "name": "lockAcquireTimeout", + "type": { + "type": "intrinsic", + "name": "number" + }, + "isOptional": true, + "comment": { + "shortText": "The maximum time in milliseconds to wait for acquiring the custom lock\nsupplied via the `lock` option. Only consulted when a custom `lock` is\npassed — the default lockless path doesn't use this timeout." + } + }, + { + "name": "persistSession", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "skipAutoInitialize", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "If true, skips automatic initialization in constructor. Useful for SSR\ncontexts where initialization timing must be controlled to prevent race\nconditions with HTTP response generation." + } + }, + { + "name": "storage", + "type": { + "type": "nameOnly", + "name": "SupportedStorage" + }, + "isOptional": true + }, + { + "name": "storageKey", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "throwOnError", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "If there is an error with the query, throwOnError will reject the promise by\nthrowing the error instead of returning it as part of a successful response." + } + }, + { + "name": "url", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "userStorage", + "type": { + "type": "nameOnly", + "name": "SupportedStorage" + }, + "isOptional": true, + "comment": { + "shortText": "Stores the user object in a separate storage location from the rest of the session data. When non-null, `storage` will only store a JSON object containing the access and refresh token and some adjacent metadata, while `userStorage` will only contain the user object under the key `storageKey + '-user'`.\n\nWhen this option is set and cookie storage is used, `getSession()` and other functions that load a session from the cookie store might not return back a user. It's very important to always use `getUser()` to fetch a user object in those scenarios.", + "tags": [ + { + "tag": "experimental", + "text": "" + } + ] + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "GoTrueClient" + } + }, + "comment": { + "shortText": "Create a new client for use in the browser.", + "examples": [ + { + "id": "using-supabase-js-recommended", + "name": "Using supabase-js (recommended)", + "code": "```ts\nimport { createClient } from '@supabase/supabase-js'\n\nconst supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key')\nconst { data, error } = await supabase.auth.getUser()\n```" + }, + { + "id": "standalone-import-for-bundle-sensitive-environments", + "name": "Standalone import for bundle-sensitive environments", + "code": "```ts\nimport { GoTrueClient } from '@supabase/auth-js'\n\nconst auth = new GoTrueClient({\n url: 'https://xyzcompany.supabase.co/auth/v1',\n headers: { apikey: 'your-publishable-key' },\n storageKey: 'supabase-auth',\n})\n```" + } + ] + } + }, + "@supabase/supabase-js.GoTrueClient._refreshSession": { + "name": "@supabase/supabase-js.GoTrueClient._refreshSession", + "params": [ + { + "name": "currentSession", + "type": { + "type": "object", + "properties": [ + { + "name": "refresh_token", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "session", + "type": { + "type": "union", + "subTypes": [ + { + "type": "object", + "name": "AuthSession", + "properties": [ + { + "name": "access_token", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The access token jwt. It is recommended to set the JWT_EXPIRY to a shorter expiry value." + } + }, + { + "name": "expires_at", + "type": { + "type": "intrinsic", + "name": "number" + }, + "isOptional": true, + "comment": { + "shortText": "A timestamp of when the token will expire. Returned when a login is confirmed." + } + }, + { + "name": "expires_in", + "type": { + "type": "intrinsic", + "name": "number" + }, + "comment": { + "shortText": "The number of seconds until the token expires (since it was issued). Returned when a login is confirmed." + } + }, + { + "name": "provider_refresh_token", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "intrinsic", + "name": "string" + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider refresh token. If present, this can be used to refresh the provider_token via the oauth provider's API.\nNot all oauth providers return a provider refresh token. If the provider_refresh_token is missing, please refer to the oauth provider's documentation for information on how to obtain the provider refresh token." + } + }, + { + "name": "provider_token", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "intrinsic", + "name": "string" + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider token. If present, this can be used to make external API requests to the oauth provider used." + } + }, + { + "name": "refresh_token", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "A one-time used refresh token that never expires." + } + }, + { + "name": "token_type", + "type": { + "type": "literal", + "value": "bearer" + } + }, + { + "name": "user", + "type": { + "type": "object", + "name": "AuthUser", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + "comment": { + "shortText": "When using a separate user storage, accessing properties of this object will throw an error." + } + } + ] + }, + { + "type": "literal", + "value": null + } + ] + } + }, + { + "name": "user", + "type": { + "type": "union", + "subTypes": [ + { + "type": "object", + "name": "AuthUser", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + { + "type": "literal", + "value": null + } + ] + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "session", + "type": "[Circular]" + }, + { + "name": "user", + "type": "[Circular]" + } + ] + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + } + ] + } + } + } + }, + "@supabase/supabase-js.GoTrueClient._setSession": { + "name": "@supabase/supabase-js.GoTrueClient._setSession", + "params": [ + { + "name": "currentSession", + "type": { + "type": "object", + "properties": [ + { + "name": "access_token", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "refresh_token", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "session", + "type": { + "type": "union", + "subTypes": [ + { + "type": "object", + "name": "AuthSession", + "properties": [ + { + "name": "access_token", + "type": "[Circular]", + "comment": { + "shortText": "The access token jwt. It is recommended to set the JWT_EXPIRY to a shorter expiry value." + } + }, + { + "name": "expires_at", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "A timestamp of when the token will expire. Returned when a login is confirmed." + } + }, + { + "name": "expires_in", + "type": "[Circular]", + "comment": { + "shortText": "The number of seconds until the token expires (since it was issued). Returned when a login is confirmed." + } + }, + { + "name": "provider_refresh_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider refresh token. If present, this can be used to refresh the provider_token via the oauth provider's API.\nNot all oauth providers return a provider refresh token. If the provider_refresh_token is missing, please refer to the oauth provider's documentation for information on how to obtain the provider refresh token." + } + }, + { + "name": "provider_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider token. If present, this can be used to make external API requests to the oauth provider used." + } + }, + { + "name": "refresh_token", + "type": "[Circular]", + "comment": { + "shortText": "A one-time used refresh token that never expires." + } + }, + { + "name": "token_type", + "type": "[Circular]" + }, + { + "name": "user", + "type": { + "type": "object", + "name": "AuthUser", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + "comment": { + "shortText": "When using a separate user storage, accessing properties of this object will throw an error." + } + } + ] + }, + "[Circular]" + ] + } + }, + { + "name": "user", + "type": { + "type": "union", + "subTypes": [ + { + "type": "object", + "name": "AuthUser", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + "[Circular]" + ] + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "session", + "type": "[Circular]" + }, + { + "name": "user", + "type": "[Circular]" + } + ] + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + } + ] + } + } + } + }, + "@supabase/supabase-js.GoTrueClient._signOut": { + "name": "@supabase/supabase-js.GoTrueClient._signOut", + "params": [ + { + "type": { + "name": "SignOut", + "type": "object", + "properties": [ + { + "name": "scope", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "global" + }, + { + "type": "literal", + "value": "local" + }, + { + "type": "literal", + "value": "others" + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Determines which sessions should be\nlogged out. Global means all\nsessions by this account. Local\nmeans only this session. Others\nmeans all other sessions except the\ncurrent one. When using others,\nthere is no sign-out event fired on\nthe current session!" + } + } + ] + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "object", + "properties": [ + { + "name": "error", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "nameOnly", + "name": "AuthError" + } + ] + } + } + ] + } + } + } + }, + "@supabase/supabase-js.GoTrueClient._updateUser": { + "name": "@supabase/supabase-js.GoTrueClient._updateUser", + "params": [ + { + "name": "attributes", + "type": { + "type": "object", + "name": "UserAttributes", + "properties": [ + { + "name": "current_password", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "The user's current password\n\nThis is only ever present when the user is resetting\ntheir password and GOTRUE_SECURITY_UPDATE_PASSWORD_REQUIRE_CURRENT_PASSWORD is true." + } + }, + { + "name": "data", + "type": { + "type": "intrinsic", + "name": "object" + }, + "isOptional": true, + "comment": { + "shortText": "A custom data object to store the user's metadata. This maps to the `auth.users.raw_user_meta_data` column.\n\nThe `data` should be a JSON object that includes user-specific info, such as their first and last name." + } + }, + { + "name": "email", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "The user's email." + } + }, + { + "name": "nonce", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "The nonce sent for reauthentication if the user's password is to be updated.\n\nCall reauthenticate() to obtain the nonce first." + } + }, + { + "name": "password", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "The user's password." + } + }, + { + "name": "phone", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "The user's phone." + } + } + ] + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "emailRedirectTo", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + } + ] + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "UserResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "user", + "type": { + "type": "object", + "name": "AuthUser", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "user", + "type": "[Circular]" + } + ] + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + } + ] + } + } + } + }, + "@supabase/supabase-js.GoTrueClient.dispose": { + "name": "@supabase/supabase-js.GoTrueClient.dispose", + "params": [], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "intrinsic", + "name": "void" + } + } + }, + "comment": { + "shortText": "Tears down the client's background work: stops the auto-refresh interval,\nremoves the `visibilitychange` listener, closes the cross-tab\n`BroadcastChannel`, and clears registered `onAuthStateChange` subscribers.\n\nCall this from cleanup hooks when the client is being replaced before\nits JS realm is destroyed. React Strict Mode and HMR are the common\ncases. Any in-flight `fetch` calls continue to completion and may still\nwrite to storage; dispose doesn't abort them or erase storage.\n\nLifecycle caveat: because in-flight refreshes are not aborted, a\ndisposed instance can still persist a rotated session to storage after\n`dispose()` returns. A subsequent `createClient` against the same\n`storageKey` will pick up that session on its next read. If you need\nstrict isolation between client lifecycles, await any pending auth\noperation before calling `dispose()` (or change the `storageKey` for\nthe replacement client).\n\nSafe to call repeatedly.", + "examples": [ + { + "id": "cleanup-on-react-unmount", + "name": "Cleanup on React unmount", + "code": "```ts\nuseEffect(() => {\n const client = createClient(...)\n return () => { client.auth.dispose() }\n}, [])\n```" + } + ] + } + }, + "@supabase/supabase-js.GoTrueClient.exchangeCodeForSession": { + "name": "@supabase/supabase-js.GoTrueClient.exchangeCodeForSession", + "params": [ + { + "name": "authCode", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthTokenResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "session", + "type": { + "type": "object", + "name": "AuthSession", + "properties": [ + { + "name": "access_token", + "type": "[Circular]", + "comment": { + "shortText": "The access token jwt. It is recommended to set the JWT_EXPIRY to a shorter expiry value." + } + }, + { + "name": "expires_at", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "A timestamp of when the token will expire. Returned when a login is confirmed." + } + }, + { + "name": "expires_in", + "type": "[Circular]", + "comment": { + "shortText": "The number of seconds until the token expires (since it was issued). Returned when a login is confirmed." + } + }, + { + "name": "provider_refresh_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider refresh token. If present, this can be used to refresh the provider_token via the oauth provider's API.\nNot all oauth providers return a provider refresh token. If the provider_refresh_token is missing, please refer to the oauth provider's documentation for information on how to obtain the provider refresh token." + } + }, + { + "name": "provider_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider token. If present, this can be used to make external API requests to the oauth provider used." + } + }, + { + "name": "refresh_token", + "type": "[Circular]", + "comment": { + "shortText": "A one-time used refresh token that never expires." + } + }, + { + "name": "token_type", + "type": "[Circular]" + }, + { + "name": "user", + "type": { + "type": "object", + "name": "AuthUser", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + "comment": { + "shortText": "When using a separate user storage, accessing properties of this object will throw an error." + } + } + ] + } + }, + { + "name": "user", + "type": { + "type": "object", + "name": "AuthUser", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "session", + "type": "[Circular]" + }, + { + "name": "user", + "type": "[Circular]" + } + ] + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Log in an existing user by exchanging an Auth Code issued during the PKCE flow.", + "text": "- Used when `flowType` is set to `pkce` in client options.", + "examples": [ + { + "id": "exchange-auth-code", + "name": "Exchange Auth Code", + "code": "```js\nsupabase.auth.exchangeCodeForSession('34e770dd-9ff9-416c-87fa-43b31d7ef225')\n```", + "response": "```json\n{\n \"data\": {\n session: {\n access_token: '',\n token_type: 'bearer',\n expires_in: 3600,\n expires_at: 1700000000,\n refresh_token: '',\n user: {\n id: '11111111-1111-1111-1111-111111111111',\n aud: 'authenticated',\n role: 'authenticated',\n email: 'example@email.com'\n email_confirmed_at: '2024-01-01T00:00:00Z',\n phone: '',\n confirmation_sent_at: '2024-01-01T00:00:00Z',\n confirmed_at: '2024-01-01T00:00:00Z',\n last_sign_in_at: '2024-01-01T00:00:00Z',\n app_metadata: {\n \"provider\": \"email\",\n \"providers\": [\n \"email\",\n \"\"\n ]\n },\n user_metadata: {\n email: 'email@email.com',\n email_verified: true,\n full_name: 'User Name',\n iss: '',\n name: 'User Name',\n phone_verified: false,\n provider_id: '',\n sub: ''\n },\n identities: [\n {\n \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n \"identity_data\": {\n \"email\": \"example@email.com\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"provider\": \"email\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"email@example.com\"\n },\n {\n \"identity_id\": \"33333333-3333-3333-3333-333333333333\",\n \"id\": \"\",\n \"user_id\": \"\",\n \"identity_data\": {\n \"email\": \"example@email.com\",\n \"email_verified\": true,\n \"full_name\": \"User Name\",\n \"iss\": \"\",\n \"name\": \"User Name\",\n \"phone_verified\": false,\n \"provider_id\": \"\",\n \"sub\": \"\"\n },\n \"provider\": \"\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"example@email.com\"\n }\n ],\n created_at: '2024-01-01T00:00:00Z',\n updated_at: '2024-01-01T00:00:00Z',\n is_anonymous: false\n },\n provider_token: '',\n provider_refresh_token: ''\n },\n user: {\n id: '11111111-1111-1111-1111-111111111111',\n aud: 'authenticated',\n role: 'authenticated',\n email: 'example@email.com',\n email_confirmed_at: '2024-01-01T00:00:00Z',\n phone: '',\n confirmation_sent_at: '2024-01-01T00:00:00Z',\n confirmed_at: '2024-01-01T00:00:00Z',\n last_sign_in_at: '2024-01-01T00:00:00Z',\n app_metadata: {\n provider: 'email',\n providers: [\n \"email\",\n \"\"\n ]\n },\n user_metadata: {\n email: 'email@email.com',\n email_verified: true,\n full_name: 'User Name',\n iss: '',\n name: 'User Name',\n phone_verified: false,\n provider_id: '',\n sub: ''\n },\n identities: [\n {\n \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n \"identity_data\": {\n \"email\": \"example@email.com\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"provider\": \"email\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"email@example.com\"\n },\n {\n \"identity_id\": \"33333333-3333-3333-3333-333333333333\",\n \"id\": \"\",\n \"user_id\": \"\",\n \"identity_data\": {\n \"email\": \"example@email.com\",\n \"email_verified\": true,\n \"full_name\": \"User Name\",\n \"iss\": \"\",\n \"name\": \"User Name\",\n \"phone_verified\": false,\n \"provider_id\": \"\",\n \"sub\": \"\"\n },\n \"provider\": \"\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"example@email.com\"\n }\n ],\n created_at: '2024-01-01T00:00:00Z',\n updated_at: '2024-01-01T00:00:00Z',\n is_anonymous: false\n },\n redirectType: null\n },\n \"error\": null\n}\n```" + } + ] + } + }, + "@supabase/supabase-js.GoTrueClient.getClaims": { + "name": "@supabase/supabase-js.GoTrueClient.getClaims", + "params": [ + { + "name": "jwt", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "An optional specific JWT you wish to verify, not the one you\n can obtain from #getSession." + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "allowExpired", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "If set to `true` the `exp` claim will not be validated against the current time." + } + }, + { + "name": "jwks", + "type": { + "type": "object", + "properties": [ + { + "name": "keys", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "JWK", + "properties": [ + { + "name": "alg", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "key_ops", + "type": { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + } + }, + { + "name": "kid", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "kty", + "type": { + "type": "union", + "subTypes": [ + null, + { + "type": "literal", + "value": "RSA" + }, + { + "type": "literal", + "value": "EC" + }, + { + "type": "literal", + "value": "oct" + } + ] + } + } + ] + } + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "If set, this JSON Web Key Set is going to have precedence over the cached value available on the server." + } + }, + { + "name": "keys", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "JWK", + "properties": [ + { + "name": "alg", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "key_ops", + "type": { + "type": "array", + "elemType": "[Circular]" + } + }, + { + "name": "kid", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "kty", + "type": { + "type": "union", + "subTypes": [ + null, + "[Circular]", + "[Circular]", + "[Circular]" + ] + } + } + ] + } + }, + "isOptional": true, + "comment": { + "shortText": "" + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Various additional options that allow you to customize the\n behavior of this method." + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "claims", + "type": { + "type": "object", + "name": "JwtPayload", + "properties": [ + { + "name": "aal", + "type": { + "type": "union", + "name": "AuthenticatorAssuranceLevels", + "subTypes": [ + { + "type": "literal", + "value": "aal1" + }, + { + "type": "literal", + "value": "aal2" + }, + null + ] + } + }, + { + "name": "amr", + "type": { + "type": "union", + "subTypes": [ + { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + }, + { + "type": "array", + "elemType": { + "type": "object", + "name": "AMREntry", + "properties": [ + { + "name": "method", + "type": { + "type": "union", + "name": "AMRMethod", + "subTypes": [ + { + "type": "nameOnly", + "name": "['number']" + }, + null + ] + }, + "comment": { + "shortText": "Authentication method name." + } + }, + { + "name": "timestamp", + "type": { + "type": "intrinsic", + "name": "number" + }, + "comment": { + "shortText": "Timestamp when the method was successfully used. Represents number of\nseconds since 1st January 1970 (UNIX epoch) in UTC." + } + } + ] + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Authentication Method References.\nSupports both RFC-8176 compliant format (string[]) and detailed format (AMREntry[]).\n- String format: ['password', 'otp'] - RFC-8176 compliant\n- Object format: [{ method: 'password', timestamp: 1234567890 }] - includes timestamps" + } + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + }, + "isOptional": true + }, + { + "name": "aud", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "string" + }, + { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + } + ] + } + }, + { + "name": "email", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "exp", + "type": { + "type": "intrinsic", + "name": "number" + } + }, + { + "name": "iat", + "type": { + "type": "intrinsic", + "name": "number" + } + }, + { + "name": "is_anonymous", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "iss", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "jti", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "nbf", + "type": { + "type": "intrinsic", + "name": "number" + }, + "isOptional": true + }, + { + "name": "phone", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "ref", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "role", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "session_id", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "sub", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + }, + "isOptional": true + } + ] + } + }, + { + "name": "header", + "type": { + "name": "JwtHeader", + "type": "object", + "properties": [ + { + "name": "alg", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "RS256" + }, + { + "type": "literal", + "value": "ES256" + }, + { + "type": "literal", + "value": "HS256" + }, + null + ] + } + }, + { + "name": "kid", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "typ", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + } + }, + { + "name": "signature", + "type": { + "type": "nameOnly", + "name": "Uint8Array" + } + } + ] + } + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "literal", + "value": null + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "literal", + "value": null + } + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Extracts the JWT claims present in the access token by first verifying the\nJWT against the server's JSON Web Key Set endpoint\n`/.well-known/jwks.json` which is often cached, resulting in significantly\nfaster responses. Prefer this method over #getUser which always\nsends a request to the Auth server for each JWT.\n\nIf the project is not using an asymmetric JWT signing key (like ECC or\nRSA) it always sends a request to the Auth server (similar to #getUser) to verify the JWT.", + "text": "- Parses the user's [access token](/docs/guides/auth/sessions#access-token-jwt-claims) as a [JSON Web Token (JWT)](/docs/guides/auth/jwts) and returns its components if valid and not expired.\n- If your project is using asymmetric JWT signing keys, then the verification is done locally usually without a network request using the [WebCrypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API).\n- A network request is sent to your project's JWT signing key discovery endpoint `https://project-id.supabase.co/auth/v1/.well-known/jwks.json`, which is cached locally. If your environment is ephemeral, such as a Lambda function that is destroyed after every request, a network request will be sent for each new invocation. Supabase provides a network-edge cache providing fast responses for these situations.\n- If the user's access token is about to expire when calling this function, the user's session will first be refreshed before validating the JWT.\n- If your project is using a symmetric secret to sign the JWT, it always sends a request similar to `getUser()` to validate the JWT at the server before returning the decoded token. This is also used if the WebCrypto API is not available in the environment. Make sure you polyfill it in such situations.\n- The returned claims can be customized per project using the [Custom Access Token Hook](/docs/guides/auth/auth-hooks/custom-access-token-hook).", + "examples": [ + { + "id": "get-jwt-claims-header-and-signature", + "name": "Get JWT claims, header and signature", + "code": "```js\nconst { data, error } = await supabase.auth.getClaims()\n```", + "response": "```json\n{\n \"data\": {\n \"claims\": {\n \"aal\": \"aal1\",\n \"amr\": [{\n \"method\": \"email\",\n \"timestamp\": 1715766000\n }],\n \"app_metadata\": {},\n \"aud\": \"authenticated\",\n \"email\": \"example@email.com\",\n \"exp\": 1715769600,\n \"iat\": 1715766000,\n \"is_anonymous\": false,\n \"iss\": \"https://project-id.supabase.co/auth/v1\",\n \"phone\": \"+13334445555\",\n \"role\": \"authenticated\",\n \"session_id\": \"11111111-1111-1111-1111-111111111111\",\n \"sub\": \"11111111-1111-1111-1111-111111111111\",\n \"user_metadata\": {}\n },\n \"header\": {\n \"alg\": \"RS256\",\n \"typ\": \"JWT\",\n \"kid\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"signature\": [/** Uint8Array */],\n },\n \"error\": null\n}\n```" + } + ] + } + }, + "@supabase/supabase-js.GoTrueClient.getSession": { + "name": "@supabase/supabase-js.GoTrueClient.getSession", + "params": [], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "session", + "type": { + "type": "object", + "name": "AuthSession", + "properties": [ + { + "name": "access_token", + "type": "[Circular]", + "comment": { + "shortText": "The access token jwt. It is recommended to set the JWT_EXPIRY to a shorter expiry value." + } + }, + { + "name": "expires_at", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "A timestamp of when the token will expire. Returned when a login is confirmed." + } + }, + { + "name": "expires_in", + "type": "[Circular]", + "comment": { + "shortText": "The number of seconds until the token expires (since it was issued). Returned when a login is confirmed." + } + }, + { + "name": "provider_refresh_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider refresh token. If present, this can be used to refresh the provider_token via the oauth provider's API.\nNot all oauth providers return a provider refresh token. If the provider_refresh_token is missing, please refer to the oauth provider's documentation for information on how to obtain the provider refresh token." + } + }, + { + "name": "provider_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider token. If present, this can be used to make external API requests to the oauth provider used." + } + }, + { + "name": "refresh_token", + "type": "[Circular]", + "comment": { + "shortText": "A one-time used refresh token that never expires." + } + }, + { + "name": "token_type", + "type": "[Circular]" + }, + { + "name": "user", + "type": { + "type": "object", + "name": "AuthUser", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + "comment": { + "shortText": "When using a separate user storage, accessing properties of this object will throw an error." + } + } + ] + } + } + ] + } + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "session", + "type": { + "type": "literal", + "value": null + } + } + ] + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "session", + "type": { + "type": "literal", + "value": null + } + } + ] + } + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Returns the session, refreshing it if necessary.\n\nThe session returned can be null if the session is not detected which can happen in the event a user is not signed-in or has logged out.\n\n**IMPORTANT:** This method loads values directly from the storage attached\nto the client. If that storage is based on request cookies for example,\nthe values in it may not be authentic and therefore it's strongly advised\nagainst using this method and its results in such circumstances. A warning\nwill be emitted if this is detected. Use #getUser() instead.", + "text": "- Since the introduction of [asymmetric JWT signing keys](/docs/guides/auth/signing-keys), this method is considered low-level and we encourage you to use `getClaims()` or `getUser()` instead.\n- Retrieves the current [user session](/docs/guides/auth/sessions) from the storage medium (local storage, cookies).\n- The session contains an access token (signed JWT), a refresh token and the user object.\n- If the session's access token is expired or is about to expire, this method will use the refresh token to refresh the session.\n- When using in a browser, or you've called `startAutoRefresh()` in your environment (React Native, etc.) this function always returns a valid access token without refreshing the session itself, as this is done in the background. This function returns very fast.\n- **IMPORTANT SECURITY NOTICE:** If using an insecure storage medium, such as cookies or request headers, the user object returned by this function **must not be trusted**. Always verify the JWT using `getClaims()` or your own JWT verification library to securely establish the user's identity and access. You can also use `getUser()` to fetch the user object directly from the Auth server for this purpose.\n- Cross-tab refresh races are handled by the GoTrue server (the rotated token from the first tab is returned to subsequent tabs via the parent-of-active mechanism), so no client-side serialization is needed.", + "examples": [ + { + "id": "get-the-session-data", + "name": "Get the session data", + "code": "```js\nconst { data, error } = await supabase.auth.getSession()\n```", + "response": "```json\n{\n \"data\": {\n \"session\": {\n \"access_token\": \"\",\n \"token_type\": \"bearer\",\n \"expires_in\": 3600,\n \"expires_at\": 1700000000,\n \"refresh_token\": \"\",\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"example@email.com\",\n \"email_confirmed_at\": \"2024-01-01T00:00:00Z\",\n \"phone\": \"\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"app_metadata\": {\n \"provider\": \"email\",\n \"providers\": [\n \"email\"\n ]\n },\n \"user_metadata\": {\n \"email\": \"example@email.com\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"identities\": [\n {\n \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n \"identity_data\": {\n \"email\": \"example@email.com\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"provider\": \"email\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"example@email.com\"\n }\n ],\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"is_anonymous\": false\n }\n }\n },\n \"error\": null\n}\n```" + } + ] + } + }, + "@supabase/supabase-js.GoTrueClient.getUser": { + "name": "@supabase/supabase-js.GoTrueClient.getUser", + "params": [ + { + "name": "jwt", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Takes in an optional access token JWT. If no JWT is provided, the JWT from the current session is used." + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "UserResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "user", + "type": { + "type": "object", + "name": "AuthUser", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "user", + "type": "[Circular]" + } + ] + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Gets the current user details if there is an existing session. This method\nperforms a network request to the Supabase Auth server, so the returned\nvalue is authentic and can be used to base authorization rules on.", + "text": "- This method fetches the user object from the database instead of local session.\n- This method is useful for checking if the user is authorized because it validates the user's access token JWT on the server.\n- Should always be used when checking for user authorization on the server. On the client, you can instead use `getSession().session.user` for faster results. `getSession` is insecure on the server.", + "examples": [ + { + "id": "get-the-logged-in-user-with-the-current-existing-session", + "name": "Get the logged in user with the current existing session", + "code": "```js\nconst { data: { user } } = await supabase.auth.getUser()\n```", + "response": "```json\n{\n \"data\": {\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"example@email.com\",\n \"email_confirmed_at\": \"2024-01-01T00:00:00Z\",\n \"phone\": \"\",\n \"confirmed_at\": \"2024-01-01T00:00:00Z\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"app_metadata\": {\n \"provider\": \"email\",\n \"providers\": [\n \"email\"\n ]\n },\n \"user_metadata\": {\n \"email\": \"example@email.com\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"identities\": [\n {\n \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n \"identity_data\": {\n \"email\": \"example@email.com\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"provider\": \"email\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"example@email.com\"\n }\n ],\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"is_anonymous\": false\n }\n },\n \"error\": null\n}\n```" + }, + { + "id": "get-the-logged-in-user-with-a-custom-access-token-jwt", + "name": "Get the logged in user with a custom access token jwt", + "code": "```js\nconst { data: { user } } = await supabase.auth.getUser(jwt)\n```" + } + ] + } + }, + "@supabase/supabase-js.GoTrueClient.getUserIdentities": { + "name": "@supabase/supabase-js.GoTrueClient.getUserIdentities", + "params": [], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + } + } + ] + } + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "literal", + "value": null + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Gets all the identities linked to a user.", + "text": "- The user needs to be signed in to call `getUserIdentities()`.", + "examples": [ + { + "id": "returns-a-list-of-identities-linked-to-the-user", + "name": "Returns a list of identities linked to the user", + "code": "```js\nconst { data, error } = await supabase.auth.getUserIdentities()\n```", + "response": "```json\n{\n \"data\": {\n \"identities\": [\n {\n \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n \"id\": \"2024-01-01T00:00:00Z\",\n \"user_id\": \"2024-01-01T00:00:00Z\",\n \"identity_data\": {\n \"email\": \"example@email.com\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"provider\": \"email\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"example@email.com\"\n }\n ]\n },\n \"error\": null\n}\n```" + } + ] + } + }, + "@supabase/supabase-js.GoTrueClient.initialize": { + "name": "@supabase/supabase-js.GoTrueClient.initialize", + "params": [], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "name": "InitializeResult", + "type": "object", + "properties": [ + { + "name": "error", + "type": { + "type": "union", + "subTypes": [ + { + "type": "nameOnly", + "name": "AuthError" + }, + { + "type": "literal", + "value": null + } + ] + } + } + ] + } + } + }, + "comment": { + "shortText": "Initialize the auth client by loading the session from storage or\ndetecting it from the URL after an OAuth, magic-link, or password-recovery\nredirect.\n\n**Most callers do not need to invoke this directly.** The client calls it\nautomatically during construction, and to react to sign-in events (including\npost-redirect events) you should subscribe to `onAuthStateChange` rather\nthan awaiting `initialize()`.\n\nYou only need to call it manually when you have opted out of the automatic\ncall by passing `skipAutoInitialize: true` — for example, in an SSR context\nwhere you need to control initialization timing. In that case, awaiting\n`initialize()` returns the resolved session result (or any error encountered\nwhile detecting it from the URL)." + } + }, + "@supabase/supabase-js.GoTrueClient.isThrowOnErrorEnabled": { + "name": "@supabase/supabase-js.GoTrueClient.isThrowOnErrorEnabled", + "params": [], + "ret": { + "type": { + "type": "intrinsic", + "name": "boolean" + } + }, + "comment": { + "shortText": "Returns whether error throwing mode is enabled for this client." + } + }, + "@supabase/supabase-js.GoTrueClient.linkIdentity": { + "name": "@supabase/supabase-js.GoTrueClient.linkIdentity", + "params": [ + { + "name": "credentials", + "type": { + "name": "SignInWithOAuthCredentials", + "type": "object", + "properties": [ + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "queryParams", + "type": { + "type": "index signature", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "string" + } + }, + "isOptional": true, + "comment": { + "shortText": "An object of query params" + } + }, + { + "name": "redirectTo", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "A URL to send the user to after they are confirmed." + } + }, + { + "name": "scopes", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "A space-separated list of scopes granted to the OAuth application." + } + }, + { + "name": "skipBrowserRedirect", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "If set to true does not immediately redirect the current browser context to visit the OAuth authorization page for the provider." + } + } + ] + }, + "isOptional": true + }, + { + "name": "provider", + "type": { + "type": "union", + "name": "Provider", + "subTypes": [ + { + "type": "literal", + "value": "apple" + }, + { + "type": "literal", + "value": "azure" + }, + { + "type": "literal", + "value": "bitbucket" + }, + { + "type": "literal", + "value": "discord" + }, + { + "type": "literal", + "value": "facebook" + }, + { + "type": "literal", + "value": "figma" + }, + { + "type": "literal", + "value": "github" + }, + { + "type": "literal", + "value": "gitlab" + }, + { + "type": "literal", + "value": "google" + }, + { + "type": "literal", + "value": "kakao" + }, + { + "type": "literal", + "value": "keycloak" + }, + { + "type": "literal", + "value": "linkedin" + }, + { + "type": "literal", + "value": "linkedin_oidc" + }, + { + "type": "literal", + "value": "notion" + }, + { + "type": "literal", + "value": "slack" + }, + { + "type": "literal", + "value": "slack_oidc" + }, + { + "type": "literal", + "value": "spotify" + }, + { + "type": "literal", + "value": "twitch" + }, + { + "type": "literal", + "value": "twitter" + }, + { + "type": "literal", + "value": "x" + }, + { + "type": "literal", + "value": "workos" + }, + { + "type": "literal", + "value": "zoom" + }, + { + "type": "literal", + "value": "fly" + }, + null + ] + }, + "comment": { + "shortText": "One of the providers supported by GoTrue." + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "OAuthResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "provider", + "type": { + "type": "union", + "name": "Provider", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + null + ] + } + }, + { + "name": "url", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + } + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "provider", + "type": { + "type": "union", + "name": "Provider", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + null + ] + } + }, + { + "name": "url", + "type": { + "type": "literal", + "value": null + } + } + ] + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Links an oauth identity to an existing user.\nThis method supports the PKCE flow." + }, + "altSignatures": [ + { + "params": [ + { + "name": "credentials", + "type": { + "name": "SignInWithIdTokenCredentials", + "type": "object", + "properties": [ + { + "name": "access_token", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "If the ID token contains an `at_hash` claim, then the hash of this value is compared to the value in the ID token." + } + }, + { + "name": "nonce", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "If the ID token contains a `nonce` claim, then the hash of this value is compared to the value in the ID token." + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "captchaToken", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Verification token received when the user completes the captcha on the site." + } + } + ] + }, + "isOptional": true + }, + { + "name": "provider", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "google" + }, + { + "type": "literal", + "value": "apple" + }, + { + "type": "literal", + "value": "azure" + }, + { + "type": "literal", + "value": "facebook" + }, + { + "type": "literal", + "value": "kakao" + }, + null, + null + ] + }, + "comment": { + "shortText": "Provider name or OIDC `iss` value identifying which provider should be used to verify the provided token. Supported names: `google`, `apple`, `azure`, `facebook`, `kakao`. Use the `custom:` prefix for custom OIDC providers (e.g. `custom:my-oidc-provider`)." + } + }, + { + "name": "token", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "OIDC ID token issued by the specified provider. The `iss` claim in the ID token must match the supplied provider. Some ID tokens contain an `at_hash` which require that you provide an `access_token` value to be accepted properly. If the token contains a `nonce` claim you must supply the nonce used to obtain the ID token." + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthTokenResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "session", + "type": { + "type": "object", + "name": "AuthSession", + "properties": [ + { + "name": "access_token", + "type": "[Circular]", + "comment": { + "shortText": "The access token jwt. It is recommended to set the JWT_EXPIRY to a shorter expiry value." + } + }, + { + "name": "expires_at", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "A timestamp of when the token will expire. Returned when a login is confirmed." + } + }, + { + "name": "expires_in", + "type": "[Circular]", + "comment": { + "shortText": "The number of seconds until the token expires (since it was issued). Returned when a login is confirmed." + } + }, + { + "name": "provider_refresh_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider refresh token. If present, this can be used to refresh the provider_token via the oauth provider's API.\nNot all oauth providers return a provider refresh token. If the provider_refresh_token is missing, please refer to the oauth provider's documentation for information on how to obtain the provider refresh token." + } + }, + { + "name": "provider_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider token. If present, this can be used to make external API requests to the oauth provider used." + } + }, + { + "name": "refresh_token", + "type": "[Circular]", + "comment": { + "shortText": "A one-time used refresh token that never expires." + } + }, + { + "name": "token_type", + "type": "[Circular]" + }, + { + "name": "user", + "type": { + "type": "object", + "name": "AuthUser", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + "comment": { + "shortText": "When using a separate user storage, accessing properties of this object will throw an error." + } + } + ] + } + }, + { + "name": "user", + "type": { + "type": "object", + "name": "AuthUser", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "session", + "type": "[Circular]" + }, + { + "name": "user", + "type": "[Circular]" + } + ] + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + } + ] + } + } + } + } + ] + }, + "@supabase/supabase-js.GoTrueClient.onAuthStateChange": { + "name": "@supabase/supabase-js.GoTrueClient.onAuthStateChange", + "params": [ + { + "name": "callback", + "type": { + "type": "function", + "params": [ + { + "name": "event", + "type": { + "type": "union", + "name": "AuthChangeEvent", + "subTypes": [ + { + "type": "literal", + "value": "INITIAL_SESSION" + }, + { + "type": "literal", + "value": "PASSWORD_RECOVERY" + }, + { + "type": "literal", + "value": "SIGNED_IN" + }, + { + "type": "literal", + "value": "SIGNED_OUT" + }, + { + "type": "literal", + "value": "TOKEN_REFRESHED" + }, + { + "type": "literal", + "value": "USER_UPDATED" + }, + { + "type": "literal", + "value": "MFA_CHALLENGE_VERIFIED", + "name": "AuthChangeEventMFA" + } + ] + } + }, + { + "name": "session", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "object", + "name": "AuthSession", + "properties": [ + { + "name": "access_token", + "type": "[Circular]", + "comment": { + "shortText": "The access token jwt. It is recommended to set the JWT_EXPIRY to a shorter expiry value." + } + }, + { + "name": "expires_at", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "A timestamp of when the token will expire. Returned when a login is confirmed." + } + }, + { + "name": "expires_in", + "type": "[Circular]", + "comment": { + "shortText": "The number of seconds until the token expires (since it was issued). Returned when a login is confirmed." + } + }, + { + "name": "provider_refresh_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider refresh token. If present, this can be used to refresh the provider_token via the oauth provider's API.\nNot all oauth providers return a provider refresh token. If the provider_refresh_token is missing, please refer to the oauth provider's documentation for information on how to obtain the provider refresh token." + } + }, + { + "name": "provider_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider token. If present, this can be used to make external API requests to the oauth provider used." + } + }, + { + "name": "refresh_token", + "type": "[Circular]", + "comment": { + "shortText": "A one-time used refresh token that never expires." + } + }, + { + "name": "token_type", + "type": "[Circular]" + }, + { + "name": "user", + "type": { + "type": "object", + "name": "AuthUser", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + "comment": { + "shortText": "When using a separate user storage, accessing properties of this object will throw an error." + } + } + ] + } + ] + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + } + }, + "comment": { + "shortText": "A callback function to be invoked when an auth event happens." + } + } + ], + "ret": { + "type": { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "subscription", + "type": { + "type": "object", + "name": "Subscription", + "properties": [ + { + "name": "callback", + "type": { + "type": "function", + "params": [ + { + "name": "event", + "type": { + "type": "union", + "name": "AuthChangeEvent", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]" + ] + } + }, + { + "name": "session", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "object", + "name": "AuthSession", + "properties": [ + { + "name": "access_token", + "type": "[Circular]", + "comment": { + "shortText": "The access token jwt. It is recommended to set the JWT_EXPIRY to a shorter expiry value." + } + }, + { + "name": "expires_at", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "A timestamp of when the token will expire. Returned when a login is confirmed." + } + }, + { + "name": "expires_in", + "type": "[Circular]", + "comment": { + "shortText": "The number of seconds until the token expires (since it was issued). Returned when a login is confirmed." + } + }, + { + "name": "provider_refresh_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider refresh token. If present, this can be used to refresh the provider_token via the oauth provider's API.\nNot all oauth providers return a provider refresh token. If the provider_refresh_token is missing, please refer to the oauth provider's documentation for information on how to obtain the provider refresh token." + } + }, + { + "name": "provider_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider token. If present, this can be used to make external API requests to the oauth provider used." + } + }, + { + "name": "refresh_token", + "type": "[Circular]", + "comment": { + "shortText": "A one-time used refresh token that never expires." + } + }, + { + "name": "token_type", + "type": "[Circular]" + }, + { + "name": "user", + "type": { + "type": "object", + "name": "AuthUser", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + "comment": { + "shortText": "When using a separate user storage, accessing properties of this object will throw an error." + } + } + ] + } + ] + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + } + }, + "comment": { + "shortText": "The function to call every time there is an event. eg: (eventName) => {}" + } + }, + { + "name": "id", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "string" + }, + { + "type": "intrinsic", + "name": "symbol" + } + ] + }, + "comment": { + "shortText": "A unique identifier for this subscription, set by the client.\nThis is an internal identifier used for managing callbacks and should not be\nrelied upon by application code. Use the unsubscribe() method to remove listeners." + } + }, + { + "name": "unsubscribe", + "type": { + "type": "function", + "params": [], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + } + }, + "comment": { + "shortText": "Call this to remove the listener." + } + } + ] + } + } + ] + } + } + ] + } + }, + "comment": { + "shortText": "Receive a notification every time an auth event happens.\nSafe to use without an async function as callback." + }, + "altSignatures": [ + { + "params": [ + { + "name": "callback", + "type": { + "type": "function", + "params": [ + { + "name": "event", + "type": { + "type": "union", + "name": "AuthChangeEvent", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]" + ] + } + }, + { + "name": "session", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "object", + "name": "AuthSession", + "properties": [ + { + "name": "access_token", + "type": "[Circular]", + "comment": { + "shortText": "The access token jwt. It is recommended to set the JWT_EXPIRY to a shorter expiry value." + } + }, + { + "name": "expires_at", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "A timestamp of when the token will expire. Returned when a login is confirmed." + } + }, + { + "name": "expires_in", + "type": "[Circular]", + "comment": { + "shortText": "The number of seconds until the token expires (since it was issued). Returned when a login is confirmed." + } + }, + { + "name": "provider_refresh_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider refresh token. If present, this can be used to refresh the provider_token via the oauth provider's API.\nNot all oauth providers return a provider refresh token. If the provider_refresh_token is missing, please refer to the oauth provider's documentation for information on how to obtain the provider refresh token." + } + }, + { + "name": "provider_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider token. If present, this can be used to make external API requests to the oauth provider used." + } + }, + { + "name": "refresh_token", + "type": "[Circular]", + "comment": { + "shortText": "A one-time used refresh token that never expires." + } + }, + { + "name": "token_type", + "type": "[Circular]" + }, + { + "name": "user", + "type": { + "type": "object", + "name": "AuthUser", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + "comment": { + "shortText": "When using a separate user storage, accessing properties of this object will throw an error." + } + } + ] + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "intrinsic", + "name": "void" + } + } + } + }, + "comment": { + "shortText": "A callback function to be invoked when an auth event happens." + } + } + ], + "ret": { + "type": { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "subscription", + "type": { + "type": "object", + "name": "Subscription", + "properties": [ + { + "name": "callback", + "type": { + "type": "function", + "params": [ + { + "name": "event", + "type": { + "type": "union", + "name": "AuthChangeEvent", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]" + ] + } + }, + { + "name": "session", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + { + "type": "object", + "name": "AuthSession", + "properties": [ + { + "name": "access_token", + "type": "[Circular]", + "comment": { + "shortText": "The access token jwt. It is recommended to set the JWT_EXPIRY to a shorter expiry value." + } + }, + { + "name": "expires_at", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "A timestamp of when the token will expire. Returned when a login is confirmed." + } + }, + { + "name": "expires_in", + "type": "[Circular]", + "comment": { + "shortText": "The number of seconds until the token expires (since it was issued). Returned when a login is confirmed." + } + }, + { + "name": "provider_refresh_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider refresh token. If present, this can be used to refresh the provider_token via the oauth provider's API.\nNot all oauth providers return a provider refresh token. If the provider_refresh_token is missing, please refer to the oauth provider's documentation for information on how to obtain the provider refresh token." + } + }, + { + "name": "provider_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider token. If present, this can be used to make external API requests to the oauth provider used." + } + }, + { + "name": "refresh_token", + "type": "[Circular]", + "comment": { + "shortText": "A one-time used refresh token that never expires." + } + }, + { + "name": "token_type", + "type": "[Circular]" + }, + { + "name": "user", + "type": { + "type": "object", + "name": "AuthUser", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + "comment": { + "shortText": "When using a separate user storage, accessing properties of this object will throw an error." + } + } + ] + } + ] + } + } + ], + "ret": { + "type": "[Circular]" + } + }, + "comment": { + "shortText": "The function to call every time there is an event. eg: (eventName) => {}" + } + }, + { + "name": "id", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "A unique identifier for this subscription, set by the client.\nThis is an internal identifier used for managing callbacks and should not be\nrelied upon by application code. Use the unsubscribe() method to remove listeners." + } + }, + { + "name": "unsubscribe", + "type": { + "type": "function", + "params": [], + "ret": { + "type": "[Circular]" + } + }, + "comment": { + "shortText": "Call this to remove the listener." + } + } + ] + } + } + ] + } + } + ] + } + } + } + ] + }, + "@supabase/supabase-js.GoTrueClient.reauthenticate": { + "name": "@supabase/supabase-js.GoTrueClient.reauthenticate", + "params": [], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "session", + "type": { + "type": "union", + "subTypes": [ + { + "type": "object", + "name": "AuthSession", + "properties": [ + { + "name": "access_token", + "type": "[Circular]", + "comment": { + "shortText": "The access token jwt. It is recommended to set the JWT_EXPIRY to a shorter expiry value." + } + }, + { + "name": "expires_at", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "A timestamp of when the token will expire. Returned when a login is confirmed." + } + }, + { + "name": "expires_in", + "type": "[Circular]", + "comment": { + "shortText": "The number of seconds until the token expires (since it was issued). Returned when a login is confirmed." + } + }, + { + "name": "provider_refresh_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider refresh token. If present, this can be used to refresh the provider_token via the oauth provider's API.\nNot all oauth providers return a provider refresh token. If the provider_refresh_token is missing, please refer to the oauth provider's documentation for information on how to obtain the provider refresh token." + } + }, + { + "name": "provider_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider token. If present, this can be used to make external API requests to the oauth provider used." + } + }, + { + "name": "refresh_token", + "type": "[Circular]", + "comment": { + "shortText": "A one-time used refresh token that never expires." + } + }, + { + "name": "token_type", + "type": "[Circular]" + }, + { + "name": "user", + "type": { + "type": "object", + "name": "AuthUser", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + "comment": { + "shortText": "When using a separate user storage, accessing properties of this object will throw an error." + } + } + ] + }, + "[Circular]" + ] + } + }, + { + "name": "user", + "type": { + "type": "union", + "subTypes": [ + { + "type": "object", + "name": "AuthUser", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + "[Circular]" + ] + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "session", + "type": "[Circular]" + }, + { + "name": "user", + "type": "[Circular]" + } + ] + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Sends a reauthentication OTP to the user's email or phone number.\nRequires the user to be signed-in.", + "text": "- This method is used together with `updateUser()` when a user's password needs to be updated.\n- If you require your user to reauthenticate before updating their password, you need to enable the **Secure password change** option in your [project's email provider settings](/dashboard/project/_/auth/providers).\n- A user is only require to reauthenticate before updating their password if **Secure password change** is enabled and the user **hasn't recently signed in**. A user is deemed recently signed in if the session was created in the last 24 hours.\n- This method will send a nonce to the user's email. If the user doesn't have a confirmed email address, the method will send the nonce to the user's confirmed phone number instead.\n- After receiving the OTP, include it as the `nonce` in your `updateUser()` call to finalize the password change.", + "examples": [ + { + "id": "send-reauthentication-nonce", + "name": "Send reauthentication nonce", + "code": "```js\nconst { error } = await supabase.auth.reauthenticate()\n```", + "description": "Sends a reauthentication nonce to the user's email or phone number." + } + ] + } + }, + "@supabase/supabase-js.GoTrueClient.refreshSession": { + "name": "@supabase/supabase-js.GoTrueClient.refreshSession", + "params": [ + { + "name": "currentSession", + "type": { + "type": "object", + "properties": [ + { + "name": "refresh_token", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "The current session. If passed in, it must contain a refresh token." + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "session", + "type": { + "type": "union", + "subTypes": [ + { + "type": "object", + "name": "AuthSession", + "properties": [ + { + "name": "access_token", + "type": "[Circular]", + "comment": { + "shortText": "The access token jwt. It is recommended to set the JWT_EXPIRY to a shorter expiry value." + } + }, + { + "name": "expires_at", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "A timestamp of when the token will expire. Returned when a login is confirmed." + } + }, + { + "name": "expires_in", + "type": "[Circular]", + "comment": { + "shortText": "The number of seconds until the token expires (since it was issued). Returned when a login is confirmed." + } + }, + { + "name": "provider_refresh_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider refresh token. If present, this can be used to refresh the provider_token via the oauth provider's API.\nNot all oauth providers return a provider refresh token. If the provider_refresh_token is missing, please refer to the oauth provider's documentation for information on how to obtain the provider refresh token." + } + }, + { + "name": "provider_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider token. If present, this can be used to make external API requests to the oauth provider used." + } + }, + { + "name": "refresh_token", + "type": "[Circular]", + "comment": { + "shortText": "A one-time used refresh token that never expires." + } + }, + { + "name": "token_type", + "type": "[Circular]" + }, + { + "name": "user", + "type": { + "type": "object", + "name": "AuthUser", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + "comment": { + "shortText": "When using a separate user storage, accessing properties of this object will throw an error." + } + } + ] + }, + "[Circular]" + ] + } + }, + { + "name": "user", + "type": { + "type": "union", + "subTypes": [ + { + "type": "object", + "name": "AuthUser", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + "[Circular]" + ] + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "session", + "type": "[Circular]" + }, + { + "name": "user", + "type": "[Circular]" + } + ] + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Returns a new session, regardless of expiry status.\nTakes in an optional current session. If not passed in, then refreshSession() will attempt to retrieve it from getSession().\nIf the current session's refresh token is invalid, an error will be thrown.", + "text": "- This method will refresh and return a new session whether the current one is expired or not.", + "examples": [ + { + "id": "refresh-session-using-the-current-session", + "name": "Refresh session using the current session", + "code": "```js\nconst { data, error } = await supabase.auth.refreshSession()\nconst { session, user } = data\n```", + "response": "```json\n{\n \"data\": {\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"example@email.com\",\n \"email_confirmed_at\": \"2024-01-01T00:00:00Z\",\n \"phone\": \"\",\n \"confirmed_at\": \"2024-01-01T00:00:00Z\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"app_metadata\": {\n \"provider\": \"email\",\n \"providers\": [\n \"email\"\n ]\n },\n \"user_metadata\": {\n \"email\": \"example@email.com\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"identities\": [\n {\n \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n \"identity_data\": {\n \"email\": \"example@email.com\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"provider\": \"email\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"example@email.com\"\n }\n ],\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"is_anonymous\": false\n },\n \"session\": {\n \"access_token\": \"\",\n \"token_type\": \"bearer\",\n \"expires_in\": 3600,\n \"expires_at\": 1700000000,\n \"refresh_token\": \"\",\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"example@email.com\",\n \"email_confirmed_at\": \"2024-01-01T00:00:00Z\",\n \"phone\": \"\",\n \"confirmed_at\": \"2024-01-01T00:00:00Z\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"app_metadata\": {\n \"provider\": \"email\",\n \"providers\": [\n \"email\"\n ]\n },\n \"user_metadata\": {\n \"email\": \"example@email.com\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"identities\": [\n {\n \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n \"identity_data\": {\n \"email\": \"example@email.com\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"provider\": \"email\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"example@email.com\"\n }\n ],\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"is_anonymous\": false\n }\n }\n },\n \"error\": null\n}\n```" + }, + { + "id": "refresh-session-using-a-refresh-token", + "name": "Refresh session using a refresh token", + "code": "```js\nconst { data, error } = await supabase.auth.refreshSession({ refresh_token })\nconst { session, user } = data\n```" + } + ] + } + }, + "@supabase/supabase-js.GoTrueClient.registerPasskey": { + "name": "@supabase/supabase-js.GoTrueClient.registerPasskey", + "params": [ + { + "name": "credentials", + "type": { + "name": "RegisterPasskeyCredentials", + "type": "object", + "properties": [ + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "signal", + "type": { + "type": "nameOnly", + "name": "AbortSignal" + }, + "isOptional": true + } + ] + }, + "isOptional": true + } + ] + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthPasskeyRegistrationVerifyResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "name": "PasskeyMetadata", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "friendly_name", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "id", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + } + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "literal", + "value": null + } + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Register a passkey for the current authenticated user. Handles the full WebAuthn ceremony:\n1. Fetches registration challenge from server\n2. Prompts user via navigator.credentials.create()\n3. Verifies credential with server\n\nRequires an active session. Requires `auth.experimental.passkey: true`." + } + }, + "@supabase/supabase-js.GoTrueClient.resend": { + "name": "@supabase/supabase-js.GoTrueClient.resend", + "params": [ + { + "name": "credentials", + "type": { + "type": "union", + "name": "ResendParams", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "email", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "captchaToken", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Verification token received when the user completes the captcha on the site." + } + }, + { + "name": "emailRedirectTo", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "A URL to send the user to after they have signed-in." + } + } + ] + }, + "isOptional": true + }, + { + "name": "type", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "signup" + }, + { + "type": "literal", + "value": "email_change" + } + ] + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "captchaToken", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Verification token received when the user completes the captcha on the site." + } + } + ] + }, + "isOptional": true + }, + { + "name": "phone", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "type", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "sms" + }, + { + "type": "literal", + "value": "phone_change" + } + ] + } + } + ] + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthOtpResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "messageId", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "string" + }, + { + "type": "literal", + "value": null + } + ] + }, + "isOptional": true + }, + { + "name": "session", + "type": { + "type": "literal", + "value": null + } + }, + { + "name": "user", + "type": { + "type": "literal", + "value": null + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "messageId", + "type": "[Circular]" + }, + { + "name": "session", + "type": "[Circular]" + }, + { + "name": "user", + "type": "[Circular]" + } + ] + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Resends an existing signup confirmation email, email change email, SMS OTP or phone change OTP.", + "text": "- Resends a signup confirmation, email change or phone change email to the user.\n- Passwordless sign-ins can be resent by calling the `signInWithOtp()` method again.\n- Password recovery emails can be resent by calling the `resetPasswordForEmail()` method again.\n- This method will only resend an email or phone OTP to the user if there was an initial signup, email change or phone change request being made(note: For existing users signing in with OTP, you should use `signInWithOtp()` again to resend the OTP).\n- You can specify a redirect url when you resend an email link using the `emailRedirectTo` option.", + "examples": [ + { + "id": "resend-an-email-signup-confirmation", + "name": "Resend an email signup confirmation", + "code": "```js\nconst { error } = await supabase.auth.resend({\n type: 'signup',\n email: 'email@example.com',\n options: {\n emailRedirectTo: 'https://example.com/welcome'\n }\n})\n```", + "description": "Resends the email signup confirmation to the user" + }, + { + "id": "resend-a-phone-signup-confirmation", + "name": "Resend a phone signup confirmation", + "code": "```js\nconst { error } = await supabase.auth.resend({\n type: 'sms',\n phone: '1234567890'\n})\n```", + "description": "Resends the phone signup confirmation email to the user" + }, + { + "id": "resend-email-change-email", + "name": "Resend email change email", + "code": "```js\nconst { error } = await supabase.auth.resend({\n type: 'email_change',\n email: 'email@example.com'\n})\n```", + "description": "Resends the email change email to the user" + }, + { + "id": "resend-phone-change-otp", + "name": "Resend phone change OTP", + "code": "```js\nconst { error } = await supabase.auth.resend({\n type: 'phone_change',\n phone: '1234567890'\n})\n```", + "description": "Resends the phone change OTP to the user" + } + ] + } + }, + "@supabase/supabase-js.GoTrueClient.resetPasswordForEmail": { + "name": "@supabase/supabase-js.GoTrueClient.resetPasswordForEmail", + "params": [ + { + "name": "email", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The email address of the user." + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "captchaToken", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Verification token received when the user completes the captcha on the site." + } + }, + { + "name": "redirectTo", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "The URL to send the user to after they click the password reset link." + } + } + ] + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data" + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "literal", + "value": null + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Sends a password reset request to an email address. This method supports the PKCE flow.", + "text": "- The password reset flow consist of 2 broad steps: (i) Allow the user to login via the password reset link; (ii) Update the user's password.\n- The `resetPasswordForEmail()` only sends a password reset link to the user's email.\nTo update the user's password, see [`updateUser()`](/docs/reference/javascript/auth-updateuser).\n- A `PASSWORD_RECOVERY` event will be emitted when the password recovery link is clicked.\nYou can use [`onAuthStateChange()`](/docs/reference/javascript/auth-onauthstatechange) to listen and invoke a callback function on these events.\n- When the user clicks the reset link in the email they are redirected back to your application.\nYou can configure the URL that the user is redirected to with the `redirectTo` parameter.\nSee [redirect URLs and wildcards](/docs/guides/auth/redirect-urls#use-wildcards-in-redirect-urls) to add additional redirect URLs to your project.\n- After the user has been redirected successfully, prompt them for a new password and call `updateUser()`:\n```js\nconst { data, error } = await supabase.auth.updateUser({\n password: new_password\n})\n```", + "examples": [ + { + "id": "reset-password", + "name": "Reset password", + "code": "```js\nconst { data, error } = await supabase.auth.resetPasswordForEmail(email, {\n redirectTo: 'https://example.com/update-password',\n})\n```", + "response": "```json\n{\n data: {}\n error: null\n}\n```" + }, + { + "id": "reset-password-react", + "name": "Reset password (React)", + "code": "```js\n/**\n * Step 1: Send the user an email to get a password reset token.\n * This email contains a link which sends the user back to your application.\n */\nconst { data, error } = await supabase.auth\n .resetPasswordForEmail('user@email.com')\n\n/**\n * Step 2: Once the user is redirected back to your application,\n * ask the user to reset their password.\n */\n useEffect(() => {\n supabase.auth.onAuthStateChange(async (event, session) => {\n if (event == \"PASSWORD_RECOVERY\") {\n const newPassword = prompt(\"What would you like your new password to be?\");\n const { data, error } = await supabase.auth\n .updateUser({ password: newPassword })\n\n if (data) alert(\"Password updated successfully!\")\n if (error) alert(\"There was an error updating your password.\")\n }\n })\n }, [])\n```" + } + ] + } + }, + "@supabase/supabase-js.GoTrueClient.setSession": { + "name": "@supabase/supabase-js.GoTrueClient.setSession", + "params": [ + { + "name": "currentSession", + "type": { + "type": "object", + "properties": [ + { + "name": "access_token", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "refresh_token", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + }, + "comment": { + "shortText": "The current session that minimally contains an access token and refresh token." + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "session", + "type": { + "type": "union", + "subTypes": [ + { + "type": "object", + "name": "AuthSession", + "properties": [ + { + "name": "access_token", + "type": "[Circular]", + "comment": { + "shortText": "The access token jwt. It is recommended to set the JWT_EXPIRY to a shorter expiry value." + } + }, + { + "name": "expires_at", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "A timestamp of when the token will expire. Returned when a login is confirmed." + } + }, + { + "name": "expires_in", + "type": "[Circular]", + "comment": { + "shortText": "The number of seconds until the token expires (since it was issued). Returned when a login is confirmed." + } + }, + { + "name": "provider_refresh_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider refresh token. If present, this can be used to refresh the provider_token via the oauth provider's API.\nNot all oauth providers return a provider refresh token. If the provider_refresh_token is missing, please refer to the oauth provider's documentation for information on how to obtain the provider refresh token." + } + }, + { + "name": "provider_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider token. If present, this can be used to make external API requests to the oauth provider used." + } + }, + { + "name": "refresh_token", + "type": "[Circular]", + "comment": { + "shortText": "A one-time used refresh token that never expires." + } + }, + { + "name": "token_type", + "type": "[Circular]" + }, + { + "name": "user", + "type": { + "type": "object", + "name": "AuthUser", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + "comment": { + "shortText": "When using a separate user storage, accessing properties of this object will throw an error." + } + } + ] + }, + "[Circular]" + ] + } + }, + { + "name": "user", + "type": { + "type": "union", + "subTypes": [ + { + "type": "object", + "name": "AuthUser", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + "[Circular]" + ] + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "session", + "type": "[Circular]" + }, + { + "name": "user", + "type": "[Circular]" + } + ] + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Sets the session data from the current session. If the current session is expired, setSession will take care of refreshing it to obtain a new session.\nIf the refresh token or access token in the current session is invalid, an error will be thrown.", + "text": "- This method sets the session using an `access_token` and `refresh_token`.\n- If successful, a `SIGNED_IN` event is emitted.", + "examples": [ + { + "id": "set-the-session", + "name": "Set the session", + "code": "```js\n const { data, error } = await supabase.auth.setSession({\n access_token,\n refresh_token\n })\n```", + "description": "Sets the session data from an access_token and refresh_token, then returns an auth response or error.", + "response": "```json\n{\n \"data\": {\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"example@email.com\",\n \"email_confirmed_at\": \"2024-01-01T00:00:00Z\",\n \"phone\": \"\",\n \"confirmed_at\": \"2024-01-01T00:00:00Z\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"app_metadata\": {\n \"provider\": \"email\",\n \"providers\": [\n \"email\"\n ]\n },\n \"user_metadata\": {\n \"email\": \"example@email.com\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"identities\": [\n {\n \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n \"identity_data\": {\n \"email\": \"example@email.com\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"provider\": \"email\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"example@email.com\"\n }\n ],\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"is_anonymous\": false\n },\n \"session\": {\n \"access_token\": \"\",\n \"refresh_token\": \"\",\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"example@email.com\",\n \"email_confirmed_at\": \"2024-01-01T00:00:00Z\",\n \"phone\": \"\",\n \"confirmed_at\": \"2024-01-01T00:00:00Z\",\n \"last_sign_in_at\": \"11111111-1111-1111-1111-111111111111\",\n \"app_metadata\": {\n \"provider\": \"email\",\n \"providers\": [\n \"email\"\n ]\n },\n \"user_metadata\": {\n \"email\": \"example@email.com\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"identities\": [\n {\n \"identity_id\": \"2024-01-01T00:00:00Z\",\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n \"identity_data\": {\n \"email\": \"example@email.com\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"provider\": \"email\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"example@email.com\"\n }\n ],\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"is_anonymous\": false\n },\n \"token_type\": \"bearer\",\n \"expires_in\": 3500,\n \"expires_at\": 1700000000\n }\n },\n \"error\": null\n}\n```" + } + ] + } + }, + "@supabase/supabase-js.GoTrueClient.signInAnonymously": { + "name": "@supabase/supabase-js.GoTrueClient.signInAnonymously", + "params": [ + { + "name": "credentials", + "type": { + "name": "SignInAnonymouslyCredentials", + "type": "object", + "properties": [ + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "captchaToken", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Verification token received when the user completes the captcha on the site." + } + }, + { + "name": "data", + "type": { + "type": "intrinsic", + "name": "object" + }, + "isOptional": true, + "comment": { + "shortText": "A custom data object to store the user's metadata. This maps to the `auth.users.raw_user_meta_data` column.\n\nThe `data` should be a JSON object that includes user-specific info, such as their first and last name." + } + } + ] + }, + "isOptional": true + } + ] + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "session", + "type": { + "type": "union", + "subTypes": [ + { + "type": "object", + "name": "AuthSession", + "properties": [ + { + "name": "access_token", + "type": "[Circular]", + "comment": { + "shortText": "The access token jwt. It is recommended to set the JWT_EXPIRY to a shorter expiry value." + } + }, + { + "name": "expires_at", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "A timestamp of when the token will expire. Returned when a login is confirmed." + } + }, + { + "name": "expires_in", + "type": "[Circular]", + "comment": { + "shortText": "The number of seconds until the token expires (since it was issued). Returned when a login is confirmed." + } + }, + { + "name": "provider_refresh_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider refresh token. If present, this can be used to refresh the provider_token via the oauth provider's API.\nNot all oauth providers return a provider refresh token. If the provider_refresh_token is missing, please refer to the oauth provider's documentation for information on how to obtain the provider refresh token." + } + }, + { + "name": "provider_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider token. If present, this can be used to make external API requests to the oauth provider used." + } + }, + { + "name": "refresh_token", + "type": "[Circular]", + "comment": { + "shortText": "A one-time used refresh token that never expires." + } + }, + { + "name": "token_type", + "type": "[Circular]" + }, + { + "name": "user", + "type": { + "type": "object", + "name": "AuthUser", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + "comment": { + "shortText": "When using a separate user storage, accessing properties of this object will throw an error." + } + } + ] + }, + "[Circular]" + ] + } + }, + { + "name": "user", + "type": { + "type": "union", + "subTypes": [ + { + "type": "object", + "name": "AuthUser", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + "[Circular]" + ] + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "session", + "type": "[Circular]" + }, + { + "name": "user", + "type": "[Circular]" + } + ] + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Creates a new anonymous user.", + "text": "- Returns an anonymous user\n- It is recommended to set up captcha for anonymous sign-ins to prevent abuse. You can pass in the captcha token in the `options` param.", + "examples": [ + { + "id": "create-an-anonymous-user", + "name": "Create an anonymous user", + "code": "```js\nconst { data, error } = await supabase.auth.signInAnonymously({\n options: {\n captchaToken\n }\n});\n```", + "response": "```json\n{\n \"data\": {\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"\",\n \"phone\": \"\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"app_metadata\": {},\n \"user_metadata\": {},\n \"identities\": [],\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"is_anonymous\": true\n },\n \"session\": {\n \"access_token\": \"\",\n \"token_type\": \"bearer\",\n \"expires_in\": 3600,\n \"expires_at\": 1700000000,\n \"refresh_token\": \"\",\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"\",\n \"phone\": \"\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"app_metadata\": {},\n \"user_metadata\": {},\n \"identities\": [],\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"is_anonymous\": true\n }\n }\n },\n \"error\": null\n}\n```" + }, + { + "id": "create-an-anonymous-user-with-custom-user-metadata", + "name": "Create an anonymous user with custom user metadata", + "code": "```js\nconst { data, error } = await supabase.auth.signInAnonymously({\n options: {\n data\n }\n})\n```" + } + ] + } + }, + "@supabase/supabase-js.GoTrueClient.signInWithIdToken": { + "name": "@supabase/supabase-js.GoTrueClient.signInWithIdToken", + "params": [ + { + "name": "credentials", + "type": { + "name": "SignInWithIdTokenCredentials", + "type": "object", + "properties": [ + { + "name": "access_token", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "If the ID token contains an `at_hash` claim, then the hash of this value is compared to the value in the ID token." + } + }, + { + "name": "nonce", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "If the ID token contains a `nonce` claim, then the hash of this value is compared to the value in the ID token." + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "captchaToken", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Verification token received when the user completes the captcha on the site." + } + } + ] + }, + "isOptional": true + }, + { + "name": "provider", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + null, + null + ] + }, + "comment": { + "shortText": "Provider name or OIDC `iss` value identifying which provider should be used to verify the provided token. Supported names: `google`, `apple`, `azure`, `facebook`, `kakao`. Use the `custom:` prefix for custom OIDC providers (e.g. `custom:my-oidc-provider`)." + } + }, + { + "name": "token", + "type": "[Circular]", + "comment": { + "shortText": "OIDC ID token issued by the specified provider. The `iss` claim in the ID token must match the supplied provider. Some ID tokens contain an `at_hash` which require that you provide an `access_token` value to be accepted properly. If the token contains a `nonce` claim you must supply the nonce used to obtain the ID token." + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthTokenResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "session", + "type": { + "type": "object", + "name": "AuthSession", + "properties": [ + { + "name": "access_token", + "type": "[Circular]", + "comment": { + "shortText": "The access token jwt. It is recommended to set the JWT_EXPIRY to a shorter expiry value." + } + }, + { + "name": "expires_at", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "A timestamp of when the token will expire. Returned when a login is confirmed." + } + }, + { + "name": "expires_in", + "type": "[Circular]", + "comment": { + "shortText": "The number of seconds until the token expires (since it was issued). Returned when a login is confirmed." + } + }, + { + "name": "provider_refresh_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider refresh token. If present, this can be used to refresh the provider_token via the oauth provider's API.\nNot all oauth providers return a provider refresh token. If the provider_refresh_token is missing, please refer to the oauth provider's documentation for information on how to obtain the provider refresh token." + } + }, + { + "name": "provider_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider token. If present, this can be used to make external API requests to the oauth provider used." + } + }, + { + "name": "refresh_token", + "type": "[Circular]", + "comment": { + "shortText": "A one-time used refresh token that never expires." + } + }, + { + "name": "token_type", + "type": "[Circular]" + }, + { + "name": "user", + "type": { + "type": "object", + "name": "AuthUser", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + "comment": { + "shortText": "When using a separate user storage, accessing properties of this object will throw an error." + } + } + ] + } + }, + { + "name": "user", + "type": { + "type": "object", + "name": "AuthUser", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "session", + "type": "[Circular]" + }, + { + "name": "user", + "type": "[Circular]" + } + ] + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Allows signing in with an OIDC ID token. The authentication provider used\nshould be enabled and configured.", + "text": "- Use an ID token to sign in.\n- Especially useful when implementing sign in using native platform dialogs in mobile or desktop apps using Sign in with Apple or Sign in with Google on iOS and Android.\n- You can also use Google's [One Tap](https://developers.google.com/identity/gsi/web/guides/display-google-one-tap) and [Automatic sign-in](https://developers.google.com/identity/gsi/web/guides/automatic-sign-in-sign-out) via this API.", + "examples": [ + { + "id": "sign-in-using-id-token", + "name": "Sign In using ID Token", + "code": "```js\nconst { data, error } = await supabase.auth.signInWithIdToken({\n provider: 'google',\n token: 'your-id-token'\n})\n```", + "response": "```json\n{\n \"data\": {\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"app_metadata\": {\n ...\n },\n \"user_metadata\": {\n ...\n },\n \"identities\": [\n {\n \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n \"provider\": \"google\",\n }\n ],\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n },\n \"session\": {\n \"access_token\": \"\",\n \"token_type\": \"bearer\",\n \"expires_in\": 3600,\n \"expires_at\": 1700000000,\n \"refresh_token\": \"\",\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"app_metadata\": {\n ...\n },\n \"user_metadata\": {\n ...\n },\n \"identities\": [\n {\n \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n \"provider\": \"google\",\n }\n ],\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n }\n }\n },\n \"error\": null\n}\n```" + } + ] + } + }, + "@supabase/supabase-js.GoTrueClient.signInWithOAuth": { + "name": "@supabase/supabase-js.GoTrueClient.signInWithOAuth", + "params": [ + { + "name": "credentials", + "type": { + "name": "SignInWithOAuthCredentials", + "type": "object", + "properties": [ + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "queryParams", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "An object of query params" + } + }, + { + "name": "redirectTo", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "A URL to send the user to after they are confirmed." + } + }, + { + "name": "scopes", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "A space-separated list of scopes granted to the OAuth application." + } + }, + { + "name": "skipBrowserRedirect", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "If set to true does not immediately redirect the current browser context to visit the OAuth authorization page for the provider." + } + } + ] + }, + "isOptional": true + }, + { + "name": "provider", + "type": { + "type": "union", + "name": "Provider", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + null + ] + }, + "comment": { + "shortText": "One of the providers supported by GoTrue." + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "OAuthResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "provider", + "type": { + "type": "union", + "name": "Provider", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + null + ] + } + }, + { + "name": "url", + "type": "[Circular]" + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "provider", + "type": { + "type": "union", + "name": "Provider", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + null + ] + } + }, + { + "name": "url", + "type": "[Circular]" + } + ] + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Log in an existing user via a third-party provider.\nThis method supports the PKCE flow.", + "text": "- This method is used for signing in using [Social Login (OAuth) providers](/docs/guides/auth#configure-third-party-providers).\n- It works by redirecting your application to the provider's authorization screen, before bringing back the user to your app.", + "examples": [ + { + "id": "sign-in-using-a-third-party-provider", + "name": "Sign in using a third-party provider", + "code": "```js\nconst { data, error } = await supabase.auth.signInWithOAuth({\n provider: 'github'\n})\n```", + "response": "```json\n{\n data: {\n provider: 'github',\n url: \n },\n error: null\n}\n```" + }, + { + "id": "sign-in-using-a-third-party-provider-with-redirect", + "name": "Sign in using a third-party provider with redirect", + "code": "```js\nconst { data, error } = await supabase.auth.signInWithOAuth({\n provider: 'github',\n options: {\n redirectTo: 'https://example.com/welcome'\n }\n})\n```", + "description": "- When the OAuth provider successfully authenticates the user, they are redirected to the URL specified in the `redirectTo` parameter. This parameter defaults to the [`SITE_URL`](/docs/guides/auth/redirect-urls#use-wildcards-in-redirect-urls). It does not redirect the user immediately after invoking this method.\n- See [redirect URLs and wildcards](/docs/guides/auth/redirect-urls#use-wildcards-in-redirect-urls) to add additional redirect URLs to your project." + }, + { + "id": "sign-in-with-scopes-and-access-provider-tokens", + "name": "Sign in with scopes and access provider tokens", + "code": "```js\n// Register this immediately after calling createClient!\n// Because signInWithOAuth causes a redirect, you need to fetch the\n// provider tokens from the callback.\nsupabase.auth.onAuthStateChange((event, session) => {\n if (session && session.provider_token) {\n window.localStorage.setItem('oauth_provider_token', session.provider_token)\n }\n\n if (session && session.provider_refresh_token) {\n window.localStorage.setItem('oauth_provider_refresh_token', session.provider_refresh_token)\n }\n\n if (event === 'SIGNED_OUT') {\n window.localStorage.removeItem('oauth_provider_token')\n window.localStorage.removeItem('oauth_provider_refresh_token')\n }\n})\n\n// Call this on your Sign in with GitHub button to initiate OAuth\n// with GitHub with the requested elevated scopes.\nawait supabase.auth.signInWithOAuth({\n provider: 'github',\n options: {\n scopes: 'repo gist notifications'\n }\n})\n```", + "description": "If you need additional access from an OAuth provider, in order to access provider specific APIs in the name of the user, you can do this by passing in the scopes the user should authorize for your application. Note that the `scopes` option takes in **a space-separated list** of scopes.\n\nBecause OAuth sign-in often includes redirects, you should register an `onAuthStateChange` callback immediately after you create the Supabase client. This callback will listen for the presence of `provider_token` and `provider_refresh_token` properties on the `session` object and store them in local storage. The client library will emit these values **only once** immediately after the user signs in. You can then access them by looking them up in local storage, or send them to your backend servers for further processing.\n\nFinally, make sure you remove them from local storage on the `SIGNED_OUT` event. If the OAuth provider supports token revocation, make sure you call those APIs either from the frontend or schedule them to be called on the backend." + } + ] + } + }, + "@supabase/supabase-js.GoTrueClient.signInWithOtp": { + "name": "@supabase/supabase-js.GoTrueClient.signInWithOtp", + "params": [ + { + "name": "credentials", + "type": { + "type": "union", + "name": "SignInWithPasswordlessCredentials", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "email", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The user's email address." + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "captchaToken", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Verification token received when the user completes the captcha on the site." + } + }, + { + "name": "data", + "type": { + "type": "intrinsic", + "name": "object" + }, + "isOptional": true, + "comment": { + "shortText": "A custom data object to store the user's metadata. This maps to the `auth.users.raw_user_meta_data` column.\n\nThe `data` should be a JSON object that includes user-specific info, such as their first and last name." + } + }, + { + "name": "emailRedirectTo", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "The redirect url embedded in the email link" + } + }, + { + "name": "shouldCreateUser", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "If set to false, this method will not create a new user. Defaults to true." + } + } + ] + }, + "isOptional": true + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "captchaToken", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Verification token received when the user completes the captcha on the site." + } + }, + { + "name": "channel", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "sms" + }, + { + "type": "literal", + "value": "whatsapp" + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Messaging channel to use (e.g. whatsapp or sms)" + } + }, + { + "name": "data", + "type": { + "type": "intrinsic", + "name": "object" + }, + "isOptional": true, + "comment": { + "shortText": "A custom data object to store the user's metadata. This maps to the `auth.users.raw_user_meta_data` column.\n\nThe `data` should be a JSON object that includes user-specific info, such as their first and last name." + } + }, + { + "name": "shouldCreateUser", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "If set to false, this method will not create a new user. Defaults to true." + } + } + ] + }, + "isOptional": true + }, + { + "name": "phone", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The user's phone number." + } + } + ] + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthOtpResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "messageId", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true + }, + { + "name": "session", + "type": "[Circular]" + }, + { + "name": "user", + "type": "[Circular]" + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "messageId", + "type": "[Circular]" + }, + { + "name": "session", + "type": "[Circular]" + }, + { + "name": "user", + "type": "[Circular]" + } + ] + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Log in a user using magiclink or a one-time password (OTP).\n\nIf the `{{ .ConfirmationURL }}` variable is specified in the email template, a magiclink will be sent.\nIf the `{{ .Token }}` variable is specified in the email template, an OTP will be sent.\nIf you're using phone sign-ins, only an OTP will be sent. You won't be able to send a magiclink for phone sign-ins.\n\nBe aware that you may get back an error message that will not distinguish\nbetween the cases where the account does not exist or, that the account\ncan only be accessed via social login.\n\nDo note that you will need to configure a Whatsapp sender on Twilio\nif you are using phone sign in with the 'whatsapp' channel. The whatsapp\nchannel is not supported on other providers\nat this time.\nThis method supports PKCE when an email is passed.", + "text": "- Requires either an email or phone number.\n- This method is used for passwordless sign-ins where a OTP is sent to the user's email or phone number.\n- If the user doesn't exist, `signInWithOtp()` will signup the user instead. To restrict this behavior, you can set `shouldCreateUser` in `SignInWithPasswordlessCredentials.options` to `false`.\n- If you're using an email, you can configure whether you want the user to receive a magiclink or a OTP.\n- If you're using phone, you can configure whether you want the user to receive a OTP.\n- The magic link's destination URL is determined by the [`SITE_URL`](/docs/guides/auth/redirect-urls#use-wildcards-in-redirect-urls).\n- See [redirect URLs and wildcards](/docs/guides/auth/redirect-urls#use-wildcards-in-redirect-urls) to add additional redirect URLs to your project.\n- Magic links and OTPs share the same implementation. To send users a one-time code instead of a magic link, [modify the magic link email template](/dashboard/project/_/auth/templates) to include `{{ .Token }}` instead of `{{ .ConfirmationURL }}`.\n- See our [Twilio Phone Auth Guide](/docs/guides/auth/phone-login?showSMSProvider=Twilio) for details about configuring WhatsApp sign in.", + "examples": [ + { + "id": "sign-in-with-email", + "name": "Sign in with email", + "code": "```js\nconst { data, error } = await supabase.auth.signInWithOtp({\n email: 'example@email.com',\n options: {\n emailRedirectTo: 'https://example.com/welcome'\n }\n})\n```", + "description": "The user will be sent an email which contains either a magiclink or a OTP or both. By default, a given user can only request a OTP once every 60 seconds.", + "response": "```json\n{\n \"data\": {\n \"user\": null,\n \"session\": null\n },\n \"error\": null\n}\n```" + }, + { + "id": "sign-in-with-sms-otp", + "name": "Sign in with SMS OTP", + "code": "```js\nconst { data, error } = await supabase.auth.signInWithOtp({\n phone: '+13334445555',\n})\n```", + "description": "The user will be sent a SMS which contains a OTP. By default, a given user can only request a OTP once every 60 seconds." + }, + { + "id": "sign-in-with-whatsapp-otp", + "name": "Sign in with WhatsApp OTP", + "code": "```js\nconst { data, error } = await supabase.auth.signInWithOtp({\n phone: '+13334445555',\n options: {\n channel:'whatsapp',\n }\n})\n```", + "description": "The user will be sent a WhatsApp message which contains a OTP. By default, a given user can only request a OTP once every 60 seconds. Note that a user will need to have a valid WhatsApp account that is linked to Twilio in order to use this feature." + } + ] + } + }, + "@supabase/supabase-js.GoTrueClient.signInWithPasskey": { + "name": "@supabase/supabase-js.GoTrueClient.signInWithPasskey", + "params": [ + { + "name": "credentials", + "type": { + "name": "SignInWithPasskeyCredentials", + "type": "object", + "properties": [ + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "captchaToken", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "signal", + "type": { + "type": "nameOnly", + "name": "AbortSignal" + }, + "isOptional": true + } + ] + }, + "isOptional": true + } + ] + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthPasskeyAuthenticationVerifyResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "session", + "type": { + "type": "union", + "subTypes": [ + { + "type": "object", + "name": "AuthSession", + "properties": [ + { + "name": "access_token", + "type": "[Circular]", + "comment": { + "shortText": "The access token jwt. It is recommended to set the JWT_EXPIRY to a shorter expiry value." + } + }, + { + "name": "expires_at", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "A timestamp of when the token will expire. Returned when a login is confirmed." + } + }, + { + "name": "expires_in", + "type": "[Circular]", + "comment": { + "shortText": "The number of seconds until the token expires (since it was issued). Returned when a login is confirmed." + } + }, + { + "name": "provider_refresh_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider refresh token. If present, this can be used to refresh the provider_token via the oauth provider's API.\nNot all oauth providers return a provider refresh token. If the provider_refresh_token is missing, please refer to the oauth provider's documentation for information on how to obtain the provider refresh token." + } + }, + { + "name": "provider_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider token. If present, this can be used to make external API requests to the oauth provider used." + } + }, + { + "name": "refresh_token", + "type": "[Circular]", + "comment": { + "shortText": "A one-time used refresh token that never expires." + } + }, + { + "name": "token_type", + "type": "[Circular]" + }, + { + "name": "user", + "type": { + "type": "object", + "name": "AuthUser", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + "comment": { + "shortText": "When using a separate user storage, accessing properties of this object will throw an error." + } + } + ] + }, + { + "type": "literal", + "value": null + } + ] + } + }, + { + "name": "user", + "type": { + "type": "union", + "subTypes": [ + { + "type": "object", + "name": "AuthUser", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + { + "type": "literal", + "value": null + } + ] + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Sign in with a passkey. Handles the full WebAuthn ceremony:\n1. Fetches authentication challenge from server\n2. Prompts user via navigator.credentials.get()\n3. Verifies credential with server and creates session\n\nRequires `auth.experimental.passkey: true`." + } + }, + "@supabase/supabase-js.GoTrueClient.signInWithPassword": { + "name": "@supabase/supabase-js.GoTrueClient.signInWithPassword", + "params": [ + { + "name": "credentials", + "type": { + "type": "nameOnly", + "name": "SignInWithPasswordCredentials" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthTokenResponsePassword", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "session", + "type": { + "type": "object", + "name": "AuthSession", + "properties": [ + { + "name": "access_token", + "type": "[Circular]", + "comment": { + "shortText": "The access token jwt. It is recommended to set the JWT_EXPIRY to a shorter expiry value." + } + }, + { + "name": "expires_at", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "A timestamp of when the token will expire. Returned when a login is confirmed." + } + }, + { + "name": "expires_in", + "type": "[Circular]", + "comment": { + "shortText": "The number of seconds until the token expires (since it was issued). Returned when a login is confirmed." + } + }, + { + "name": "provider_refresh_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider refresh token. If present, this can be used to refresh the provider_token via the oauth provider's API.\nNot all oauth providers return a provider refresh token. If the provider_refresh_token is missing, please refer to the oauth provider's documentation for information on how to obtain the provider refresh token." + } + }, + { + "name": "provider_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider token. If present, this can be used to make external API requests to the oauth provider used." + } + }, + { + "name": "refresh_token", + "type": "[Circular]", + "comment": { + "shortText": "A one-time used refresh token that never expires." + } + }, + { + "name": "token_type", + "type": "[Circular]" + }, + { + "name": "user", + "type": { + "type": "object", + "name": "AuthUser", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + "comment": { + "shortText": "When using a separate user storage, accessing properties of this object will throw an error." + } + } + ] + } + }, + { + "name": "user", + "type": { + "type": "object", + "name": "AuthUser", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + } + }, + { + "name": "weakPassword", + "type": { + "name": "WeakPassword", + "type": "object", + "properties": [ + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "reasons", + "type": { + "type": "array", + "elemType": { + "type": "nameOnly", + "name": "WeakPasswordReasons" + } + } + } + ] + }, + "isOptional": true + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "session", + "type": "[Circular]" + }, + { + "name": "user", + "type": "[Circular]" + }, + { + "name": "weakPassword", + "type": "[Circular]" + } + ] + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Log in an existing user with an email and password or phone and password.\n\nBe aware that you may get back an error message that will not distinguish\nbetween the cases where the account does not exist or that the\nemail/phone and password combination is wrong or that the account can only\nbe accessed via social login.", + "text": "- Requires either an email and password or a phone number and password.", + "examples": [ + { + "id": "sign-in-with-email-and-password", + "name": "Sign in with email and password", + "code": "```js\nconst { data, error } = await supabase.auth.signInWithPassword({\n email: 'example@email.com',\n password: 'example-password',\n})\n```", + "response": "```json\n{\n \"data\": {\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"example@email.com\",\n \"email_confirmed_at\": \"2024-01-01T00:00:00Z\",\n \"phone\": \"\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"app_metadata\": {\n \"provider\": \"email\",\n \"providers\": [\n \"email\"\n ]\n },\n \"user_metadata\": {},\n \"identities\": [\n {\n \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n \"identity_data\": {\n \"email\": \"example@email.com\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"provider\": \"email\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"example@email.com\"\n }\n ],\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\"\n },\n \"session\": {\n \"access_token\": \"\",\n \"token_type\": \"bearer\",\n \"expires_in\": 3600,\n \"expires_at\": 1700000000,\n \"refresh_token\": \"\",\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"example@email.com\",\n \"email_confirmed_at\": \"2024-01-01T00:00:00Z\",\n \"phone\": \"\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"app_metadata\": {\n \"provider\": \"email\",\n \"providers\": [\n \"email\"\n ]\n },\n \"user_metadata\": {},\n \"identities\": [\n {\n \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n \"identity_data\": {\n \"email\": \"example@email.com\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"provider\": \"email\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"example@email.com\"\n }\n ],\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\"\n }\n }\n },\n \"error\": null\n}\n```" + }, + { + "id": "sign-in-with-phone-and-password", + "name": "Sign in with phone and password", + "code": "```js\nconst { data, error } = await supabase.auth.signInWithPassword({\n phone: '+13334445555',\n password: 'some-password',\n})\n```" + }, + { + "id": "handling-errors", + "name": "Handling errors", + "code": "```js\nconst { data, error } = await supabase.auth.signInWithPassword({\n email: 'example@email.com',\n password: 'example-password',\n})\nif (error) {\n console.error(error)\n return\n}\n```", + "description": "Log the full `error` object so fields like `code`, `status`, and `name` aren't hidden. The `error.code` (e.g. `'invalid_credentials'`, `'email_not_confirmed'`) is often more useful for branching than `error.message`, and the full object surfaces both." + } + ] + } + }, + "@supabase/supabase-js.GoTrueClient.signInWithSSO": { + "name": "@supabase/supabase-js.GoTrueClient.signInWithSSO", + "params": [ + { + "name": "params", + "type": { + "type": "union", + "name": "SignInWithSSO", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "captchaToken", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Verification token received when the user completes the captcha on the site." + } + }, + { + "name": "redirectTo", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "A URL to send the user to after they have signed-in." + } + }, + { + "name": "skipBrowserRedirect", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "If set to true, the redirect will not happen on the client side.\nThis parameter is used when you wish to handle the redirect yourself.\nDefaults to false." + } + } + ] + }, + "isOptional": true + }, + { + "name": "providerId", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "UUID of the SSO provider to invoke single-sign on to." + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "domain", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Domain name of the organization for which to invoke single-sign on." + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "captchaToken", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Verification token received when the user completes the captcha on the site." + } + }, + { + "name": "redirectTo", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "A URL to send the user to after they have signed-in." + } + }, + { + "name": "skipBrowserRedirect", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "If set to true, the redirect will not happen on the client side.\nThis parameter is used when you wish to handle the redirect yourself.\nDefaults to false." + } + } + ] + }, + "isOptional": true + } + ] + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "SSOResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "url", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "URL to open in a browser which will complete the sign-in flow by\ntaking the user to the identity provider's authentication flow.\n\nOn browsers you can set the URL to `window.location.href` to take\nthe user to the authentication flow." + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Attempts a single-sign on using an enterprise Identity Provider. A\nsuccessful SSO attempt will redirect the current page to the identity\nprovider authorization page. The redirect URL is implementation and SSO\nprotocol specific.\n\nYou can use it by providing a SSO domain. Typically you can extract this\ndomain by asking users for their email address. If this domain is\nregistered on the Auth instance the redirect will use that organization's\ncurrently active SSO Identity Provider for the login.\n\nIf you have built an organization-specific login page, you can use the\norganization's SSO Identity Provider UUID directly instead.", + "text": "- Before you can call this method you need to [establish a connection](/docs/guides/auth/sso/auth-sso-saml#managing-saml-20-connections) to an identity provider. Use the [CLI commands](/docs/reference/cli/supabase-sso) to do this.\n- If you've associated an email domain to the identity provider, you can use the `domain` property to start a sign-in flow.\n- In case you need to use a different way to start the authentication flow with an identity provider, you can use the `providerId` property. For example:\n - Mapping specific user email addresses with an identity provider.\n - Using different hints to identity the identity provider to be used by the user, like a company-specific page, IP address or other tracking information.", + "examples": [ + { + "id": "sign-in-with-email-domain", + "name": "Sign in with email domain", + "code": "```js\n // You can extract the user's email domain and use it to trigger the\n // authentication flow with the correct identity provider.\n\n const { data, error } = await supabase.auth.signInWithSSO({\n domain: 'company.com'\n })\n\n if (data?.url) {\n // redirect the user to the identity provider's authentication flow\n window.location.href = data.url\n }\n```" + }, + { + "id": "sign-in-with-provider-uuid", + "name": "Sign in with provider UUID", + "code": "```js\n // Useful when you need to map a user's sign in request according\n // to different rules that can't use email domains.\n\n const { data, error } = await supabase.auth.signInWithSSO({\n providerId: '21648a9d-8d5a-4555-a9d1-d6375dc14e92'\n })\n\n if (data?.url) {\n // redirect the user to the identity provider's authentication flow\n window.location.href = data.url\n }\n```" + } + ] + } + }, + "@supabase/supabase-js.GoTrueClient.signInWithWeb3": { + "name": "@supabase/supabase-js.GoTrueClient.signInWithWeb3", + "params": [ + { + "name": "credentials", + "type": { + "type": "union", + "name": "Web3Credentials", + "subTypes": [ + { + "type": "union", + "name": "SolanaWeb3Credentials", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "chain", + "type": { + "type": "literal", + "value": "solana" + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "captchaToken", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Verification token received when the user completes the captcha on the site." + } + }, + { + "name": "signInWithSolana", + "type": { + "type": "nameOnly", + "name": "Partial" + }, + "isOptional": true + }, + { + "name": "url", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "URL to use with the wallet interface. Some wallets do not allow signing a message for URLs different from the current page." + } + } + ] + }, + "isOptional": true + }, + { + "name": "statement", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Optional statement to include in the Sign in with Solana message. Must not include new line characters. Most wallets like Phantom **require specifying a statement!**" + } + }, + { + "name": "wallet", + "type": { + "name": "SolanaWallet", + "type": "object", + "properties": [ + { + "name": "publicKey", + "type": { + "type": "union", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "toBase58", + "type": { + "type": "function", + "params": [], + "ret": { + "type": { + "type": "intrinsic", + "name": "string" + } + } + } + } + ] + }, + { + "type": "literal", + "value": null + } + ] + }, + "isOptional": true + }, + { + "name": "signIn", + "type": { + "type": "function", + "params": [ + { + "name": "inputs", + "type": { + "type": "array", + "elemType": { + "type": "nameOnly", + "name": "SolanaSignInInput" + } + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + { + "type": "nameOnly", + "name": "SolanaSignInOutput" + }, + { + "type": "array", + "elemType": { + "type": "nameOnly", + "name": "SolanaSignInOutput" + } + } + ] + } + } + } + }, + "isOptional": true + }, + { + "name": "signMessage", + "type": { + "type": "function", + "params": [ + { + "name": "message", + "type": { + "type": "nameOnly", + "name": "Uint8Array" + } + }, + { + "name": "encoding", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "utf8" + }, + { + "type": "intrinsic", + "name": "string" + } + ] + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "union", + "subTypes": [ + { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "nameOnly", + "name": "Uint8Array" + } + }, + { + "type": "intrinsic", + "name": "undefined" + } + ] + } + } + }, + "isOptional": true + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Wallet interface to use. If not specified will default to `window.solana`." + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "chain", + "type": { + "type": "literal", + "value": "solana" + } + }, + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Sign in with Solana compatible message. Must include `Issued At`, `URI` and `Version`." + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "captchaToken", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Verification token received when the user completes the captcha on the site." + } + } + ] + }, + "isOptional": true + }, + { + "name": "signature", + "type": { + "type": "nameOnly", + "name": "Uint8Array" + }, + "comment": { + "shortText": "Ed25519 signature of the message." + } + } + ] + } + ] + }, + { + "type": "union", + "name": "EthereumWeb3Credentials", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "chain", + "type": { + "type": "literal", + "value": "ethereum" + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "captchaToken", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Verification token received when the user completes the captcha on the site." + } + }, + { + "name": "signInWithEthereum", + "type": { + "type": "nameOnly", + "name": "Partial" + }, + "isOptional": true + }, + { + "name": "url", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "URL to use with the wallet interface. Some wallets do not allow signing a message for URLs different from the current page." + } + } + ] + }, + "isOptional": true + }, + { + "name": "statement", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Optional statement to include in the Sign in with Ethereum message. Must not include new line characters. Most wallets like Phantom **require specifying a statement!**" + } + }, + { + "name": "wallet", + "type": { + "type": "nameOnly", + "name": "EthereumWallet" + }, + "isOptional": true, + "comment": { + "shortText": "Wallet interface to use. If not specified will default to `window.ethereum`." + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "chain", + "type": { + "type": "literal", + "value": "ethereum" + } + }, + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Sign in with Ethereum compatible message. Must include `Issued At`, `URI` and `Version`." + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "captchaToken", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Verification token received when the user completes the captcha on the site." + } + } + ] + }, + "isOptional": true + }, + { + "name": "signature", + "type": { + "type": "nameOnly", + "name": "Hex" + }, + "comment": { + "shortText": "Ethereum curve (secp256k1) signature of the message." + } + } + ] + } + ] + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "session", + "type": { + "type": "object", + "name": "AuthSession", + "properties": [ + { + "name": "access_token", + "type": "[Circular]", + "comment": { + "shortText": "The access token jwt. It is recommended to set the JWT_EXPIRY to a shorter expiry value." + } + }, + { + "name": "expires_at", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "A timestamp of when the token will expire. Returned when a login is confirmed." + } + }, + { + "name": "expires_in", + "type": "[Circular]", + "comment": { + "shortText": "The number of seconds until the token expires (since it was issued). Returned when a login is confirmed." + } + }, + { + "name": "provider_refresh_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider refresh token. If present, this can be used to refresh the provider_token via the oauth provider's API.\nNot all oauth providers return a provider refresh token. If the provider_refresh_token is missing, please refer to the oauth provider's documentation for information on how to obtain the provider refresh token." + } + }, + { + "name": "provider_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider token. If present, this can be used to make external API requests to the oauth provider used." + } + }, + { + "name": "refresh_token", + "type": "[Circular]", + "comment": { + "shortText": "A one-time used refresh token that never expires." + } + }, + { + "name": "token_type", + "type": "[Circular]" + }, + { + "name": "user", + "type": { + "type": "object", + "name": "AuthUser", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + "comment": { + "shortText": "When using a separate user storage, accessing properties of this object will throw an error." + } + } + ] + } + }, + { + "name": "user", + "type": { + "type": "object", + "name": "AuthUser", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + } + } + ] + } + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "session", + "type": { + "type": "literal", + "value": null + } + }, + { + "name": "user", + "type": { + "type": "literal", + "value": null + } + } + ] + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Signs in a user by verifying a message signed by the user's private key.\nSupports Ethereum (via Sign-In-With-Ethereum) & Solana (Sign-In-With-Solana) standards,\nboth of which derive from the EIP-4361 standard\nWith slight variation on Solana's side.", + "text": "- Uses a Web3 (Ethereum, Solana) wallet to sign a user in.\n- Read up on the [potential for abuse](/docs/guides/auth/auth-web3#potential-for-abuse) before using it.", + "examples": [ + { + "id": "sign-in-with-solana-or-ethereum-window-api", + "name": "Sign in with Solana or Ethereum (Window API)", + "code": "```js\n // uses window.ethereum for the wallet\n const { data, error } = await supabase.auth.signInWithWeb3({\n chain: 'ethereum',\n statement: 'I accept the Terms of Service at https://example.com/tos'\n })\n\n // uses window.solana for the wallet\n const { data, error } = await supabase.auth.signInWithWeb3({\n chain: 'solana',\n statement: 'I accept the Terms of Service at https://example.com/tos'\n })\n```" + }, + { + "id": "sign-in-with-ethereum-message-and-signature", + "name": "Sign in with Ethereum (Message and Signature)", + "code": "```js\n const { data, error } = await supabase.auth.signInWithWeb3({\n chain: 'ethereum',\n message: '',\n signature: '',\n })\n```" + }, + { + "id": "sign-in-with-solana-brave", + "name": "Sign in with Solana (Brave)", + "code": "```js\n const { data, error } = await supabase.auth.signInWithWeb3({\n chain: 'solana',\n statement: 'I accept the Terms of Service at https://example.com/tos',\n wallet: window.braveSolana\n })\n```" + }, + { + "id": "sign-in-with-solana-wallet-adapter", + "name": "Sign in with Solana (Wallet Adapter)", + "code": "```jsx\n function SignInButton() {\n const wallet = useWallet()\n\n return (\n <>\n {wallet.connected ? (\n {\n supabase.auth.signInWithWeb3({\n chain: 'solana',\n statement: 'I accept the Terms of Service at https://example.com/tos',\n wallet,\n })\n }}\n >\n Sign in with Solana\n \n ) : (\n \n )}\n \n )\n}\n\nfunction App() {\n const endpoint = clusterApiUrl('devnet')\n const wallets = useMemo(() => [], [])\n\n return (\n \n \n \n \n \n \n \n )\n}\n```" + } + ] + } + }, + "@supabase/supabase-js.GoTrueClient.signOut": { + "name": "@supabase/supabase-js.GoTrueClient.signOut", + "params": [ + { + "name": "options", + "type": { + "name": "SignOut", + "type": "object", + "properties": [ + { + "name": "scope", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "Determines which sessions should be\nlogged out. Global means all\nsessions by this account. Local\nmeans only this session. Others\nmeans all other sessions except the\ncurrent one. When using others,\nthere is no sign-out event fired on\nthe current session!" + } + } + ] + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "object", + "properties": [ + { + "name": "error", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "nameOnly", + "name": "AuthError" + } + ] + } + } + ] + } + } + }, + "comment": { + "shortText": "Inside a browser context, `signOut()` will remove the logged in user from the browser session and log them out - removing all items from localstorage and then trigger a `\"SIGNED_OUT\"` event.\n\nFor server-side management, you can revoke all refresh tokens for a user by passing a user's JWT through to `auth.api.signOut(JWT: string)`.\nThere is no way to revoke a user's access token jwt until it expires. It is recommended to set a shorter expiry on the jwt for this reason.\n\nIf using `others` scope, no `SIGNED_OUT` event is fired!\n\n**Warning:** the default `scope` is `'global'`. This signs the user out of\n**every device they are currently signed in on**, not just the current\ntab/session. If you only want to sign the user out of the current session\n(the behavior most other auth libraries default to), pass\n`{ scope: 'local' }` explicitly.", + "text": "- In order to use the `signOut()` method, the user needs to be signed in first.\n- By default, `signOut()` uses the **global** scope, which signs out the user\n on every device they are signed in on (not just the current one). Pass\n `{ scope: 'local' }` to only sign out the current session. This is\n usually what apps want on a \"Sign out\" button, especially when users\n sign in from multiple devices and do not expect signing out of one to\n terminate the others.\n- Since Supabase Auth uses JWTs for authentication, the access token JWT will be valid until it's expired. When the user signs out, Supabase revokes the refresh token and deletes the JWT from the client-side. This does not revoke the JWT and it will still be valid until it expires.", + "examples": [ + { + "id": "sign-out-of-every-device-global-default", + "name": "Sign out of every device (global – default)", + "code": "```js\nconst { error } = await supabase.auth.signOut()\n```" + }, + { + "id": "sign-out-only-the-current-session-recommended-for-most-apps", + "name": "Sign out only the current session (recommended for most apps)", + "code": "```js\nconst { error } = await supabase.auth.signOut({ scope: 'local' })\n```" + }, + { + "id": "sign-out-of-all-other-sessions-keep-the-current-one", + "name": "Sign out of all other sessions, keep the current one", + "code": "```js\nconst { error } = await supabase.auth.signOut({ scope: 'others' })\n```" + } + ] + } + }, + "@supabase/supabase-js.GoTrueClient.signUp": { + "name": "@supabase/supabase-js.GoTrueClient.signUp", + "params": [ + { + "name": "credentials", + "type": { + "type": "nameOnly", + "name": "SignUpWithPasswordCredentials" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "session", + "type": { + "type": "union", + "subTypes": [ + { + "type": "object", + "name": "AuthSession", + "properties": [ + { + "name": "access_token", + "type": "[Circular]", + "comment": { + "shortText": "The access token jwt. It is recommended to set the JWT_EXPIRY to a shorter expiry value." + } + }, + { + "name": "expires_at", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "A timestamp of when the token will expire. Returned when a login is confirmed." + } + }, + { + "name": "expires_in", + "type": "[Circular]", + "comment": { + "shortText": "The number of seconds until the token expires (since it was issued). Returned when a login is confirmed." + } + }, + { + "name": "provider_refresh_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider refresh token. If present, this can be used to refresh the provider_token via the oauth provider's API.\nNot all oauth providers return a provider refresh token. If the provider_refresh_token is missing, please refer to the oauth provider's documentation for information on how to obtain the provider refresh token." + } + }, + { + "name": "provider_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider token. If present, this can be used to make external API requests to the oauth provider used." + } + }, + { + "name": "refresh_token", + "type": "[Circular]", + "comment": { + "shortText": "A one-time used refresh token that never expires." + } + }, + { + "name": "token_type", + "type": "[Circular]" + }, + { + "name": "user", + "type": { + "type": "object", + "name": "AuthUser", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + "comment": { + "shortText": "When using a separate user storage, accessing properties of this object will throw an error." + } + } + ] + }, + "[Circular]" + ] + } + }, + { + "name": "user", + "type": { + "type": "union", + "subTypes": [ + { + "type": "object", + "name": "AuthUser", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + "[Circular]" + ] + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "session", + "type": "[Circular]" + }, + { + "name": "user", + "type": "[Circular]" + } + ] + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Creates a new user.\n\nBe aware that if a user account exists in the system you may get back an\nerror message that attempts to hide this information from the user.\nThis method has support for PKCE via email signups. The PKCE flow cannot be used when autoconfirm is enabled.", + "text": "- By default, the user needs to verify their email address before logging in. To turn this off, disable **Confirm email** in [your project](/dashboard/project/_/auth/providers).\n- **Confirm email** determines if users need to confirm their email address after signing up.\n - If **Confirm email** is enabled, a `user` is returned but `session` is null.\n - If **Confirm email** is disabled, both a `user` and a `session` are returned.\n- When the user confirms their email address, they are redirected to the [`SITE_URL`](/docs/guides/auth/redirect-urls#use-wildcards-in-redirect-urls) by default. You can modify your `SITE_URL` or add additional redirect URLs in [your project](/dashboard/project/_/auth/url-configuration).\n- If signUp() is called for an existing confirmed user:\n - When both **Confirm email** and **Confirm phone** (even when phone provider is disabled) are enabled in [your project](/dashboard/project/_/auth/providers), an obfuscated/fake user object is returned.\n - When either **Confirm email** or **Confirm phone** (even when phone provider is disabled) is disabled, the error message, `User already registered` is returned.\n- To fetch the currently logged-in user, refer to [`getUser()`](/docs/reference/javascript/auth-getuser).", + "examples": [ + { + "id": "sign-up-with-an-email-and-password", + "name": "Sign up with an email and password", + "code": "```js\nconst { data, error } = await supabase.auth.signUp({\n email: 'example@email.com',\n password: 'example-password',\n})\n```", + "response": "```json\n// Some fields may be null if \"confirm email\" is enabled.\n{\n \"data\": {\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"example@email.com\",\n \"email_confirmed_at\": \"2024-01-01T00:00:00Z\",\n \"phone\": \"\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"app_metadata\": {\n \"provider\": \"email\",\n \"providers\": [\n \"email\"\n ]\n },\n \"user_metadata\": {},\n \"identities\": [\n {\n \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n \"identity_data\": {\n \"email\": \"example@email.com\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"provider\": \"email\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"example@email.com\"\n }\n ],\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\"\n },\n \"session\": {\n \"access_token\": \"\",\n \"token_type\": \"bearer\",\n \"expires_in\": 3600,\n \"expires_at\": 1700000000,\n \"refresh_token\": \"\",\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"example@email.com\",\n \"email_confirmed_at\": \"2024-01-01T00:00:00Z\",\n \"phone\": \"\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"app_metadata\": {\n \"provider\": \"email\",\n \"providers\": [\n \"email\"\n ]\n },\n \"user_metadata\": {},\n \"identities\": [\n {\n \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n \"identity_data\": {\n \"email\": \"example@email.com\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"provider\": \"email\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"example@email.com\"\n }\n ],\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\"\n }\n }\n },\n \"error\": null\n}\n```" + }, + { + "id": "sign-up-with-a-phone-number-and-password-sms", + "name": "Sign up with a phone number and password (SMS)", + "code": "```js\nconst { data, error } = await supabase.auth.signUp({\n phone: '123456789',\n password: 'example-password',\n options: {\n channel: 'sms'\n }\n})\n```" + }, + { + "id": "sign-up-with-a-phone-number-and-password-whatsapp", + "name": "Sign up with a phone number and password (whatsapp)", + "code": "```js\nconst { data, error } = await supabase.auth.signUp({\n phone: '123456789',\n password: 'example-password',\n options: {\n channel: 'whatsapp'\n }\n})\n```", + "description": "The user will be sent a WhatsApp message which contains a OTP. By default, a given user can only request a OTP once every 60 seconds. Note that a user will need to have a valid WhatsApp account that is linked to Twilio in order to use this feature." + }, + { + "id": "sign-up-with-additional-user-metadata", + "name": "Sign up with additional user metadata", + "code": "```js\nconst { data, error } = await supabase.auth.signUp(\n {\n email: 'example@email.com',\n password: 'example-password',\n options: {\n data: {\n first_name: 'John',\n age: 27,\n }\n }\n }\n)\n```" + }, + { + "id": "sign-up-with-a-redirect-url", + "name": "Sign up with a redirect URL", + "code": "```js\nconst { data, error } = await supabase.auth.signUp(\n {\n email: 'example@email.com',\n password: 'example-password',\n options: {\n emailRedirectTo: 'https://example.com/welcome'\n }\n }\n)\n```", + "description": "- See [redirect URLs and wildcards](/docs/guides/auth/redirect-urls#use-wildcards-in-redirect-urls) to add additional redirect URLs to your project." + } + ] + } + }, + "@supabase/supabase-js.GoTrueClient.startAutoRefresh": { + "name": "@supabase/supabase-js.GoTrueClient.startAutoRefresh", + "params": [], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "intrinsic", + "name": "void" + } + } + }, + "comment": { + "shortText": "Starts an auto-refresh process in the background. The session is checked\nevery few seconds. Close to the time of expiration a process is started to\nrefresh the session. If refreshing fails it will be retried for as long as\nnecessary.\n\nIf you set the GoTrueClientOptions#autoRefreshToken you don't need\nto call this function, it will be called for you.\n\nOn browsers the refresh process works only when the tab/window is in the\nforeground to conserve resources as well as prevent race conditions and\nflooding auth with requests. If you call this method any managed\nvisibility change callback will be removed and you must manage visibility\nchanges on your own.\n\nOn non-browser platforms the refresh process works *continuously* in the\nbackground, which may not be desirable. You should hook into your\nplatform's foreground indication mechanism and call these methods\nappropriately to conserve resources.\n\n#stopAutoRefresh", + "text": "- Only useful in non-browser environments such as React Native or Electron.\n- The Supabase Auth library automatically starts and stops proactively refreshing the session when a tab is focused or not.\n- On non-browser platforms, such as mobile or desktop apps built with web technologies, the library is not able to effectively determine whether the application is _focused_ or not.\n- To give this hint to the application, you should be calling this method when the app is in focus and calling `supabase.auth.stopAutoRefresh()` when it's out of focus.", + "examples": [ + { + "id": "start-and-stop-auto-refresh-in-react-native", + "name": "Start and stop auto refresh in React Native", + "code": "```js\nimport { AppState } from 'react-native'\n\n// make sure you register this only once!\nAppState.addEventListener('change', (state) => {\n if (state === 'active') {\n supabase.auth.startAutoRefresh()\n } else {\n supabase.auth.stopAutoRefresh()\n }\n})\n```" + } + ] + } + }, + "@supabase/supabase-js.GoTrueClient.stopAutoRefresh": { + "name": "@supabase/supabase-js.GoTrueClient.stopAutoRefresh", + "params": [], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "intrinsic", + "name": "void" + } + } + }, + "comment": { + "shortText": "Stops an active auto refresh process running in the background (if any).\n\nIf you call this method any managed visibility change callback will be\nremoved and you must manage visibility changes on your own.\n\nSee #startAutoRefresh for more details.", + "text": "- Only useful in non-browser environments such as React Native or Electron.\n- The Supabase Auth library automatically starts and stops proactively refreshing the session when a tab is focused or not.\n- On non-browser platforms, such as mobile or desktop apps built with web technologies, the library is not able to effectively determine whether the application is _focused_ or not.\n- When your application goes in the background or out of focus, call this method to stop the proactive refreshing of the session.", + "examples": [ + { + "id": "start-and-stop-auto-refresh-in-react-native", + "name": "Start and stop auto refresh in React Native", + "code": "```js\nimport { AppState } from 'react-native'\n\n// make sure you register this only once!\nAppState.addEventListener('change', (state) => {\n if (state === 'active') {\n supabase.auth.startAutoRefresh()\n } else {\n supabase.auth.stopAutoRefresh()\n }\n})\n```" + } + ] + } + }, + "@supabase/supabase-js.GoTrueClient.unlinkIdentity": { + "name": "@supabase/supabase-js.GoTrueClient.unlinkIdentity", + "params": [ + { + "name": "identity", + "type": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data" + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "literal", + "value": null + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Unlinks an identity from a user by deleting it. The user will no longer be able to sign in with that identity once it's unlinked.", + "text": "- The **Enable Manual Linking** option must be enabled from your [project's authentication settings](/dashboard/project/_/auth/providers).\n- The user needs to be signed in to call `unlinkIdentity()`.\n- The user must have at least 2 identities in order to unlink an identity.\n- The identity to be unlinked must belong to the user.", + "examples": [ + { + "id": "unlink-an-identity", + "name": "Unlink an identity", + "code": "```js\n// retrieve all identities linked to a user\nconst identities = await supabase.auth.getUserIdentities()\n\n// find the google identity\nconst googleIdentity = identities.find(\n identity => identity.provider === 'google'\n)\n\n// unlink the google identity\nconst { error } = await supabase.auth.unlinkIdentity(googleIdentity)\n```" + } + ] + } + }, + "@supabase/supabase-js.GoTrueClient.updateUser": { + "name": "@supabase/supabase-js.GoTrueClient.updateUser", + "params": [ + { + "name": "attributes", + "type": { + "type": "object", + "name": "UserAttributes", + "properties": [ + { + "name": "current_password", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The user's current password\n\nThis is only ever present when the user is resetting\ntheir password and GOTRUE_SECURITY_UPDATE_PASSWORD_REQUIRE_CURRENT_PASSWORD is true." + } + }, + { + "name": "data", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "A custom data object to store the user's metadata. This maps to the `auth.users.raw_user_meta_data` column.\n\nThe `data` should be a JSON object that includes user-specific info, such as their first and last name." + } + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The user's email." + } + }, + { + "name": "nonce", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The nonce sent for reauthentication if the user's password is to be updated.\n\nCall reauthenticate() to obtain the nonce first." + } + }, + { + "name": "password", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The user's password." + } + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The user's phone." + } + } + ] + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "emailRedirectTo", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + } + ] + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "UserResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "user", + "type": { + "type": "object", + "name": "AuthUser", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "user", + "type": "[Circular]" + } + ] + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Updates user data for a logged in user.", + "text": "- In order to use the `updateUser()` method, the user needs to be signed in first.\n- By default, email updates sends a confirmation link to both the user's current and new email.\nTo only send a confirmation link to the user's new email, disable **Secure email change** in your project's [email auth provider settings](/dashboard/project/_/auth/providers).", + "examples": [ + { + "id": "update-the-email-for-an-authenticated-user", + "name": "Update the email for an authenticated user", + "code": "```js\nconst { data, error } = await supabase.auth.updateUser({\n email: 'new@email.com'\n})\n```", + "description": "Sends a \"Confirm Email Change\" email to the new address. If **Secure Email Change** is enabled (default), confirmation is also required from the **old email** before the change is applied. To skip dual confirmation and apply the change after only the new email is verified, disable **Secure Email Change** in the [Email Auth Provider settings](/dashboard/project/_/auth/providers?provider=Email).", + "response": "```json\n{\n \"data\": {\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"example@email.com\",\n \"email_confirmed_at\": \"2024-01-01T00:00:00Z\",\n \"phone\": \"\",\n \"confirmed_at\": \"2024-01-01T00:00:00Z\",\n \"new_email\": \"new@email.com\",\n \"email_change_sent_at\": \"2024-01-01T00:00:00Z\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"app_metadata\": {\n \"provider\": \"email\",\n \"providers\": [\n \"email\"\n ]\n },\n \"user_metadata\": {\n \"email\": \"example@email.com\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"identities\": [\n {\n \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n \"identity_data\": {\n \"email\": \"example@email.com\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"provider\": \"email\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"example@email.com\"\n }\n ],\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"is_anonymous\": false\n }\n },\n \"error\": null\n}\n```" + }, + { + "id": "update-the-phone-number-for-an-authenticated-user", + "name": "Update the phone number for an authenticated user", + "code": "```js\nconst { data, error } = await supabase.auth.updateUser({\n phone: '123456789'\n})\n```", + "description": "Sends a one-time password (OTP) to the new phone number." + }, + { + "id": "update-the-password-for-an-authenticated-user", + "name": "Update the password for an authenticated user", + "code": "```js\nconst { data, error } = await supabase.auth.updateUser({\n password: 'new password'\n})\n```" + }, + { + "id": "update-the-user-s-metadata", + "name": "Update the user's metadata", + "code": "```js\nconst { data, error } = await supabase.auth.updateUser({\n data: { hello: 'world' }\n})\n```", + "description": "Updates the user's custom metadata.\n\n**Note**: The `data` field maps to the `auth.users.raw_user_meta_data` column in your Supabase database. When calling `getUser()`, the data will be available as `user.user_metadata`." + }, + { + "id": "update-the-user-s-password-with-a-nonce", + "name": "Update the user's password with a nonce", + "code": "```js\nconst { data, error } = await supabase.auth.updateUser({\n password: 'new password',\n nonce: '123456'\n})\n```", + "description": "If **Secure password change** is enabled in your [project's email provider settings](/dashboard/project/_/auth/providers), updating the user's password would require a nonce if the user **hasn't recently signed in**. The nonce is sent to the user's email or phone number. A user is deemed recently signed in if the session was created in the last 24 hours." + } + ] + } + }, + "@supabase/supabase-js.GoTrueClient.verifyOtp": { + "name": "@supabase/supabase-js.GoTrueClient.verifyOtp", + "params": [ + { + "name": "params", + "type": { + "type": "union", + "name": "VerifyOtpParams", + "subTypes": [ + { + "type": "object", + "name": "VerifyMobileOtpParams", + "properties": [ + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "captchaToken", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Verification token received when the user completes the captcha on the site." + } + }, + { + "name": "redirectTo", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "A URL to send the user to after they are confirmed." + } + } + ] + }, + "isOptional": true + }, + { + "name": "phone", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The user's phone number." + } + }, + { + "name": "token", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The otp sent to the user's phone number." + } + }, + { + "name": "type", + "type": { + "type": "union", + "name": "MobileOtpType", + "subTypes": [ + { + "type": "literal", + "value": "sms" + }, + { + "type": "literal", + "value": "phone_change" + }, + null + ] + }, + "comment": { + "shortText": "The user's verification type." + } + } + ] + }, + { + "type": "object", + "name": "VerifyEmailOtpParams", + "properties": [ + { + "name": "email", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The user's email address." + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "captchaToken", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Verification token received when the user completes the captcha on the site." + } + }, + { + "name": "redirectTo", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "A URL to send the user to after they are confirmed." + } + } + ] + }, + "isOptional": true + }, + { + "name": "token", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The otp sent to the user's email address." + } + }, + { + "name": "type", + "type": { + "type": "union", + "name": "EmailOtpType", + "subTypes": [ + { + "type": "literal", + "value": "signup" + }, + { + "type": "literal", + "value": "invite" + }, + { + "type": "literal", + "value": "magiclink" + }, + { + "type": "literal", + "value": "recovery" + }, + { + "type": "literal", + "value": "email_change" + }, + { + "type": "literal", + "value": "email" + }, + null + ] + }, + "comment": { + "shortText": "The user's verification type." + } + } + ] + }, + { + "type": "object", + "name": "VerifyTokenHashParams", + "properties": [ + { + "name": "token_hash", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The token hash used in an email link" + } + }, + { + "name": "type", + "type": { + "type": "union", + "name": "EmailOtpType", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + null + ] + }, + "comment": { + "shortText": "The user's verification type." + } + } + ] + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "session", + "type": { + "type": "union", + "subTypes": [ + { + "type": "object", + "name": "AuthSession", + "properties": [ + { + "name": "access_token", + "type": "[Circular]", + "comment": { + "shortText": "The access token jwt. It is recommended to set the JWT_EXPIRY to a shorter expiry value." + } + }, + { + "name": "expires_at", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "A timestamp of when the token will expire. Returned when a login is confirmed." + } + }, + { + "name": "expires_in", + "type": "[Circular]", + "comment": { + "shortText": "The number of seconds until the token expires (since it was issued). Returned when a login is confirmed." + } + }, + { + "name": "provider_refresh_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider refresh token. If present, this can be used to refresh the provider_token via the oauth provider's API.\nNot all oauth providers return a provider refresh token. If the provider_refresh_token is missing, please refer to the oauth provider's documentation for information on how to obtain the provider refresh token." + } + }, + { + "name": "provider_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider token. If present, this can be used to make external API requests to the oauth provider used." + } + }, + { + "name": "refresh_token", + "type": "[Circular]", + "comment": { + "shortText": "A one-time used refresh token that never expires." + } + }, + { + "name": "token_type", + "type": "[Circular]" + }, + { + "name": "user", + "type": { + "type": "object", + "name": "AuthUser", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + "comment": { + "shortText": "When using a separate user storage, accessing properties of this object will throw an error." + } + } + ] + }, + "[Circular]" + ] + } + }, + { + "name": "user", + "type": { + "type": "union", + "subTypes": [ + { + "type": "object", + "name": "AuthUser", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + "[Circular]" + ] + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "session", + "type": "[Circular]" + }, + { + "name": "user", + "type": "[Circular]" + } + ] + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Log in a user given a User supplied OTP or TokenHash received through mobile or email.", + "text": "- The `verifyOtp` method takes in different verification types.\n- If a phone number is used, the type can either be:\n 1. `sms` – Used when verifying a one-time password (OTP) sent via SMS during sign-up or sign-in.\n 2. `phone_change` – Used when verifying an OTP sent to a new phone number during a phone number update process.\n- If an email address is used, the type can be one of the following (note: `signup` and `magiclink` types are deprecated):\n 1. `email` – Used when verifying an OTP sent to the user's email during sign-up or sign-in.\n 2. `recovery` – Used when verifying an OTP sent for account recovery, typically after a password reset request.\n 3. `invite` – Used when verifying an OTP sent as part of an invitation to join a project or organization.\n 4. `email_change` – Used when verifying an OTP sent to a new email address during an email update process.\n- The verification type used should be determined based on the corresponding auth method called before `verifyOtp` to sign up / sign-in a user.\n- The `TokenHash` is contained in the [email templates](/docs/guides/auth/auth-email-templates) and can be used to sign in. You may wish to use the hash for the PKCE flow for Server Side Auth. Read [the Password-based Auth guide](/docs/guides/auth/passwords) for more details.", + "examples": [ + { + "id": "verify-signup-one-time-password-otp", + "name": "Verify Signup One-Time Password (OTP)", + "code": "```js\nconst { data, error } = await supabase.auth.verifyOtp({ email, token, type: 'email'})\n```", + "response": "```json\n{\n \"data\": {\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"example@email.com\",\n \"email_confirmed_at\": \"2024-01-01T00:00:00Z\",\n \"phone\": \"\",\n \"confirmed_at\": \"2024-01-01T00:00:00Z\",\n \"recovery_sent_at\": \"2024-01-01T00:00:00Z\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"app_metadata\": {\n \"provider\": \"email\",\n \"providers\": [\n \"email\"\n ]\n },\n \"user_metadata\": {\n \"email\": \"example@email.com\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"identities\": [\n {\n \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n \"identity_data\": {\n \"email\": \"example@email.com\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"provider\": \"email\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"example@email.com\"\n }\n ],\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"is_anonymous\": false\n },\n \"session\": {\n \"access_token\": \"\",\n \"token_type\": \"bearer\",\n \"expires_in\": 3600,\n \"expires_at\": 1700000000,\n \"refresh_token\": \"\",\n \"user\": {\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"aud\": \"authenticated\",\n \"role\": \"authenticated\",\n \"email\": \"example@email.com\",\n \"email_confirmed_at\": \"2024-01-01T00:00:00Z\",\n \"phone\": \"\",\n \"confirmed_at\": \"2024-01-01T00:00:00Z\",\n \"recovery_sent_at\": \"2024-01-01T00:00:00Z\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"app_metadata\": {\n \"provider\": \"email\",\n \"providers\": [\n \"email\"\n ]\n },\n \"user_metadata\": {\n \"email\": \"example@email.com\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"identities\": [\n {\n \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n \"identity_data\": {\n \"email\": \"example@email.com\",\n \"email_verified\": false,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"provider\": \"email\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"example@email.com\"\n }\n ],\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"is_anonymous\": false\n }\n }\n },\n \"error\": null\n}\n```" + }, + { + "id": "verify-sms-one-time-password-otp", + "name": "Verify SMS One-Time Password (OTP)", + "code": "```js\nconst { data, error } = await supabase.auth.verifyOtp({ phone, token, type: 'sms'})\n```" + }, + { + "id": "verify-email-auth-token-hash", + "name": "Verify Email Auth (Token Hash)", + "code": "```js\nconst { data, error } = await supabase.auth.verifyOtp({ token_hash: tokenHash, type: 'email'})\n```" + } + ] + } + }, + "@supabase/supabase-js.NavigatorLockAcquireTimeoutError.constructor": { + "name": "@supabase/supabase-js.NavigatorLockAcquireTimeoutError.constructor", + "params": [ + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "NavigatorLockAcquireTimeoutError" + } + } + }, + "@supabase/supabase-js.PostgrestBuilder.constructor": { + "name": "@supabase/supabase-js.PostgrestBuilder.constructor", + "params": [ + { + "name": "builder", + "type": { + "type": "object", + "properties": [ + { + "name": "body", + "type": { + "type": "intrinsic", + "name": "unknown" + }, + "isOptional": true + }, + { + "name": "fetch", + "type": { + "type": "function", + "params": [ + { + "name": "input", + "type": { + "type": "union", + "subTypes": [ + { + "type": "nameOnly", + "name": "RequestInfo" + }, + { + "type": "nameOnly", + "name": "URL" + } + ] + } + }, + { + "name": "init", + "type": { + "type": "nameOnly", + "name": "RequestInit" + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "nameOnly", + "name": "Response" + } + } + }, + "comment": { + "shortText": "[MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch)" + } + }, + "isOptional": true + }, + { + "name": "headers", + "type": { + "type": "nameOnly", + "name": "HeadersInit" + } + }, + { + "name": "isMaybeSingle", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "method", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "GET" + }, + { + "type": "literal", + "value": "POST" + }, + { + "type": "literal", + "value": "PATCH" + }, + { + "type": "literal", + "value": "DELETE" + }, + { + "type": "literal", + "value": "HEAD" + } + ] + } + }, + { + "name": "retry", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "schema", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "shouldStripNulls", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "shouldThrowOnError", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "signal", + "type": { + "type": "nameOnly", + "name": "AbortSignal" + }, + "isOptional": true + }, + { + "name": "url", + "type": { + "type": "nameOnly", + "name": "URL" + } + }, + { + "name": "urlLengthLimit", + "type": { + "type": "intrinsic", + "name": "number" + }, + "isOptional": true + } + ] + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestBuilder" + } + }, + "comment": { + "shortText": "Creates a builder configured for a specific PostgREST request.", + "examples": [ + { + "id": "using-supabase-js-recommended", + "name": "Using supabase-js (recommended)", + "code": "```ts\nimport { createClient } from '@supabase/supabase-js'\n\nconst supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key')\nconst { data, error } = await supabase.from('users').select('*')\n```" + }, + { + "id": "standalone-import-for-bundle-sensitive-environments", + "name": "Standalone import for bundle-sensitive environments", + "code": "```ts\nimport { PostgrestQueryBuilder } from '@supabase/postgrest-js'\n\nconst builder = new PostgrestQueryBuilder(\n new URL('https://xyzcompany.supabase.co/rest/v1/users'),\n { headers: new Headers({ apikey: 'your-publishable-key' }) }\n)\n```" + } + ] + } + }, + "@supabase/supabase-js.PostgrestBuilder.overrideTypes": { + "name": "@supabase/supabase-js.PostgrestBuilder.overrideTypes", + "params": [], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestBuilder" + } + }, + "comment": { + "shortText": "Override the type of the returned `data` field in the response.", + "examples": [ + { + "id": "example-1", + "name": "Example 1", + "code": "```typescript\n// Merge with existing types (default behavior)\nconst query = supabase\n .from('users')\n .select()\n .overrideTypes<{ custom_field: string }>()\n\n// Replace existing types completely\nconst replaceQuery = supabase\n .from('users')\n .select()\n .overrideTypes<{ id: number; name: string }, { merge: false }>()\n```" + }, + { + "id": "complete-override-type-of-successful-response", + "name": "Complete Override type of successful response", + "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .overrideTypes, { merge: false }>()\n```", + "response": "```ts\nlet x: typeof data // MyType[]\n```" + }, + { + "id": "complete-override-type-of-object-response", + "name": "Complete Override type of object response", + "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .maybeSingle()\n .overrideTypes()\n```", + "response": "```ts\nlet x: typeof data // MyType | null\n```" + }, + { + "id": "partial-override-type-of-successful-response", + "name": "Partial Override type of successful response", + "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .overrideTypes>()\n```", + "response": "```ts\nlet x: typeof data // Array\n```" + }, + { + "id": "partial-override-type-of-object-response", + "name": "Partial Override type of object response", + "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .maybeSingle()\n .overrideTypes<{ status: \"A\" | \"B\" }>()\n```", + "response": "```ts\nlet x: typeof data // CountryRowProperties & { status: \"A\" | \"B\" } | null\n```" + }, + { + "id": "merge-vs-replace-existing-types", + "name": "Merge vs replace existing types", + "code": "```typescript\n// Merge with existing types (default behavior)\nconst query = supabase\n .from('users')\n .select()\n .overrideTypes<{ custom_field: string }>()\n\n// Replace existing types completely\nconst replaceQuery = supabase\n .from('users')\n .select()\n .overrideTypes<{ id: number; name: string }, { merge: false }>()\n```" + } + ] + } + }, + "@supabase/supabase-js.PostgrestBuilder.retry": { + "name": "@supabase/supabase-js.PostgrestBuilder.retry", + "params": [ + { + "name": "enabled", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "comment": { + "shortText": "Whether to enable retries for this request" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "", + "examples": [ + { + "id": "example-1", + "name": "Example 1", + "code": "```ts\n// Disable retries for a specific query\nconst { data, error } = await supabase\n .from('users')\n .select()\n .retry(false)\n```" + } + ] + } + }, + "@supabase/supabase-js.PostgrestBuilder.returns": { + "name": "@supabase/supabase-js.PostgrestBuilder.returns", + "params": [], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestBuilder" + } + }, + "comment": { + "shortText": "Override the type of the returned `data`." + } + }, + "@supabase/supabase-js.PostgrestBuilder.setHeader": { + "name": "@supabase/supabase-js.PostgrestBuilder.setHeader", + "params": [ + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "HTTP header name" + } + }, + { + "name": "value", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "HTTP header value" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Set an HTTP header on this single PostgREST request, overriding any header\nwith the same name set on the client.\n\nThis is an advanced escape hatch for one-off needs (passing a custom\n`Authorization` for a single query, attaching a tracing header, etc.).\nMost callers do not need it: configure client-wide headers via the\n`headers` option when constructing the client, and authentication via\nSupabase Auth." + } + }, + "@supabase/supabase-js.PostgrestBuilder.stripNulls": { + "name": "@supabase/supabase-js.PostgrestBuilder.stripNulls", + "params": [], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Strip null values from the response data. Properties with `null` values\nwill be omitted from the returned JSON objects.\n\nRequires PostgREST 11.2.0+.\n\nhttps://docs.postgrest.org/en/stable/references/api/resource_representation.html#stripped-nulls", + "examples": [ + { + "id": "with-select", + "name": "With `select()`", + "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .stripNulls()\n```", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text, bio text);\n\ninsert into\n characters (id, name, bio)\nvalues\n (1, 'Luke', null),\n (2, 'Leia', 'Princess of Alderaan');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"Luke\"\n },\n {\n \"id\": 2,\n \"name\": \"Leia\",\n \"bio\": \"Princess of Alderaan\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + } + ] + } + }, + "@supabase/supabase-js.PostgrestBuilder.then": { + "name": "@supabase/supabase-js.PostgrestBuilder.then", + "params": [ + { + "name": "onfulfilled", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "function", + "params": [ + { + "name": "value" + } + ], + "ret": { + "type": { + "type": "union", + "subTypes": [ + { + "type": "nameOnly", + "name": "TResult1" + }, + { + "type": "nameOnly", + "name": "PromiseLike" + } + ] + } + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "The callback to execute when the Promise is resolved." + } + }, + { + "name": "onrejected", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "function", + "params": [ + { + "name": "reason", + "type": { + "type": "intrinsic", + "name": "any" + } + } + ], + "ret": { + "type": { + "type": "union", + "subTypes": [ + { + "type": "nameOnly", + "name": "TResult2" + }, + { + "type": "nameOnly", + "name": "PromiseLike" + } + ] + } + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "The callback to execute when the Promise is rejected." + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "PromiseLike" + } + }, + "comment": { + "shortText": "Attaches callbacks for the resolution and/or rejection of the Promise." + } + }, + "@supabase/supabase-js.PostgrestBuilder.throwOnError": { + "name": "@supabase/supabase-js.PostgrestBuilder.throwOnError", + "params": [], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestBuilder" + } + }, + "comment": { + "shortText": "If there's an error with the query, throwOnError will reject the promise by\nthrowing the error instead of returning it as part of a successful response.\n\nhttps://github.com/supabase/supabase-js/issues/92" + } + }, + "@supabase/supabase-js.PostgrestError.constructor": { + "name": "@supabase/supabase-js.PostgrestError.constructor", + "params": [ + { + "name": "context", + "type": { + "type": "object", + "properties": [ + { + "name": "code", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "details", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "hint", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestError" + } + }, + "comment": { + "shortText": "", + "examples": [ + { + "id": "example-1", + "name": "Example 1", + "code": "```ts\nimport PostgrestError from '@supabase/postgrest-js'\n\nthrow new PostgrestError({\n message: 'Row level security prevented the request',\n details: 'RLS denied the insert',\n hint: 'Check your policies',\n code: 'PGRST301',\n})\n```" + } + ] + } + }, + "@supabase/supabase-js.PostgrestError.toJSON": { + "name": "@supabase/supabase-js.PostgrestError.toJSON", + "params": [], + "ret": { + "type": { + "type": "object", + "properties": [ + { + "name": "code", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "details", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "hint", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + } + } + }, + "@supabase/supabase-js.PostgrestFilterBuilder.constructor": { + "name": "@supabase/supabase-js.PostgrestFilterBuilder.constructor", + "params": [ + { + "name": "builder", + "type": { + "type": "object", + "properties": [ + { + "name": "body", + "type": { + "type": "intrinsic", + "name": "unknown" + }, + "isOptional": true + }, + { + "name": "fetch", + "type": { + "type": "function", + "params": [ + { + "name": "input", + "type": { + "type": "union", + "subTypes": [ + { + "type": "nameOnly", + "name": "RequestInfo" + }, + { + "type": "nameOnly", + "name": "URL" + } + ] + } + }, + { + "name": "init", + "type": { + "type": "nameOnly", + "name": "RequestInit" + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "nameOnly", + "name": "Response" + } + } + }, + "comment": { + "shortText": "[MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch)" + } + }, + "isOptional": true + }, + { + "name": "headers", + "type": { + "type": "nameOnly", + "name": "HeadersInit" + } + }, + { + "name": "isMaybeSingle", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "method", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "GET" + }, + { + "type": "literal", + "value": "POST" + }, + { + "type": "literal", + "value": "PATCH" + }, + { + "type": "literal", + "value": "DELETE" + }, + { + "type": "literal", + "value": "HEAD" + } + ] + } + }, + { + "name": "retry", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "schema", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "shouldStripNulls", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "shouldThrowOnError", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "signal", + "type": { + "type": "nameOnly", + "name": "AbortSignal" + }, + "isOptional": true + }, + { + "name": "url", + "type": { + "type": "nameOnly", + "name": "URL" + } + }, + { + "name": "urlLengthLimit", + "type": { + "type": "intrinsic", + "name": "number" + }, + "isOptional": true + } + ] + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestFilterBuilder" + } + }, + "comment": { + "shortText": "Creates a builder configured for a specific PostgREST request.", + "examples": [ + { + "id": "using-supabase-js-recommended", + "name": "Using supabase-js (recommended)", + "code": "```ts\nimport { createClient } from '@supabase/supabase-js'\n\nconst supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key')\nconst { data, error } = await supabase.from('users').select('*')\n```" + }, + { + "id": "standalone-import-for-bundle-sensitive-environments", + "name": "Standalone import for bundle-sensitive environments", + "code": "```ts\nimport { PostgrestQueryBuilder } from '@supabase/postgrest-js'\n\nconst builder = new PostgrestQueryBuilder(\n new URL('https://xyzcompany.supabase.co/rest/v1/users'),\n { headers: new Headers({ apikey: 'your-publishable-key' }) }\n)\n```" + } + ] + } + }, + "@supabase/supabase-js.PostgrestFilterBuilder.abortSignal": { + "name": "@supabase/supabase-js.PostgrestFilterBuilder.abortSignal", + "params": [ + { + "name": "signal", + "type": { + "type": "nameOnly", + "name": "AbortSignal" + }, + "comment": { + "shortText": "The AbortSignal to use for the fetch request" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Set the AbortSignal for the fetch request.", + "text": "You can use this to set a timeout for the request.", + "examples": [ + { + "id": "aborting-requests-in-flight", + "name": "Aborting requests in-flight", + "code": "```ts\nconst ac = new AbortController()\n\nconst { data, error } = await supabase\n .from('very_big_table')\n .select()\n .abortSignal(ac.signal)\n\n// Abort the request after 100 ms\nsetTimeout(() => ac.abort(), 100)\n```", + "description": "You can use an [`AbortController`](https://developer.mozilla.org/en-US/docs/Web/API/AbortController) to abort requests.\nNote that `status` and `statusText` don't mean anything for aborted requests as the request wasn't fulfilled.", + "response": "```json\n {\n \"error\": {\n \"message\": \"AbortError: The user aborted a request.\",\n \"details\": \"\",\n \"hint\": \"The request was aborted locally via the provided AbortSignal.\",\n \"code\": \"\"\n },\n \"status\": 0,\n \"statusText\": \"\"\n }\n\n```" + }, + { + "id": "set-a-timeout", + "name": "Set a timeout", + "code": "```ts\nconst { data, error } = await supabase\n .from('very_big_table')\n .select()\n .abortSignal(AbortSignal.timeout(1000 /* ms */))\n```", + "response": "```json\n {\n \"error\": {\n \"message\": \"FetchError: The user aborted a request.\",\n \"details\": \"\",\n \"hint\": \"\",\n \"code\": \"\"\n },\n \"status\": 400,\n \"statusText\": \"Bad Request\"\n }\n\n```" + } + ] + } + }, + "@supabase/supabase-js.PostgrestFilterBuilder.containedBy": { + "name": "@supabase/supabase-js.PostgrestFilterBuilder.containedBy", + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + } + }, + { + "name": "value", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "string" + }, + { + "type": "record", + "name": "Record", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "unknown" + } + }, + { + "type": "array", + "elemType": { + "type": "nameOnly", + "name": "Row['ColumnName']" + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "value", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "string" + }, + { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "unknown" + } + }, + { + "type": "record", + "name": "Record", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "unknown" + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + } + ] + }, + "@supabase/supabase-js.PostgrestFilterBuilder.contains": { + "name": "@supabase/supabase-js.PostgrestFilterBuilder.contains", + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + } + }, + { + "name": "value", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "string" + }, + { + "type": "record", + "name": "Record", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "unknown" + } + }, + { + "type": "array", + "elemType": { + "type": "nameOnly", + "name": "Row['ColumnName']" + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "value", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "string" + }, + { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "unknown" + } + }, + { + "type": "record", + "name": "Record", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "unknown" + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + } + ] + }, + "@supabase/supabase-js.PostgrestFilterBuilder.csv": { + "name": "@supabase/supabase-js.PostgrestFilterBuilder.csv", + "params": [], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestBuilder" + } + }, + "comment": { + "shortText": "Return `data` as a string in CSV format.", + "examples": [ + { + "id": "return-data-as-csv", + "name": "Return data as CSV", + "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .csv()\n```", + "description": "By default, the data is returned in JSON format, but can also be returned as Comma Separated Values.", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" + }, + "response": "```json\n{\n \"data\": \"id,name\\n1,Luke\\n2,Leia\\n3,Han\",\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + } + ] + } + }, + "@supabase/supabase-js.PostgrestFilterBuilder.eq": { + "name": "@supabase/supabase-js.PostgrestFilterBuilder.eq", + "params": [ + { + "name": "column", + "comment": { + "shortText": "The column to filter on" + } + }, + { + "name": "value", + "comment": { + "shortText": "The value to filter with" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Match only rows where `column` is equal to `value`.\n\nTo check if the value of `column` is NULL, you should use `.is()` instead.", + "examples": [ + { + "id": "with-select", + "name": "With `select()`", + "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .eq('name', 'Leia')\n```", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"id\": 2,\n \"name\": \"Leia\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + } + ] + } + }, + "@supabase/supabase-js.PostgrestFilterBuilder.explain": { + "name": "@supabase/supabase-js.PostgrestFilterBuilder.explain", + "params": [ + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "analyze", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "If `true`, the query will be executed and the\nactual run time will be returned" + } + }, + { + "name": "buffers", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "If `true`, include information on buffer usage" + } + }, + { + "name": "format", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "text" + }, + { + "type": "literal", + "value": "json" + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "The format of the output, can be `\"text\"` (default)\nor `\"json\"`" + } + }, + { + "name": "settings", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "If `true`, include information on configuration\nparameters that affect query planning" + } + }, + { + "name": "verbose", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "If `true`, the query identifier will be returned\nand `data` will include the output columns of the query" + } + }, + { + "name": "wal", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "If `true`, include information on WAL record generation" + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Named parameters" + } + } + ], + "ret": { + "type": { + "type": "union", + "subTypes": [ + { + "type": "nameOnly", + "name": "PostgrestBuilder" + }, + { + "type": "nameOnly", + "name": "PostgrestBuilder" + } + ] + } + }, + "comment": { + "shortText": "Return `data` as the EXPLAIN plan for the query.\n\nYou need to enable the\n[db_plan_enabled](https://supabase.com/docs/guides/database/debugging-performance#enabling-explain)\nsetting before using this method.", + "examples": [ + { + "id": "get-the-execution-plan", + "name": "Get the execution plan", + "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .explain()\n```", + "description": "By default, the data is returned in TEXT format, but can also be returned as JSON by using the `format` parameter.", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" + }, + "response": "```js\nAggregate (cost=33.34..33.36 rows=1 width=112)\n -> Limit (cost=0.00..18.33 rows=1000 width=40)\n -> Seq Scan on characters (cost=0.00..22.00 rows=1200 width=40)\n```" + }, + { + "id": "get-the-execution-plan-with-analyze-and-verbose", + "name": "Get the execution plan with analyze and verbose", + "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .explain({analyze:true,verbose:true})\n```", + "description": "By default, the data is returned in TEXT format, but can also be returned as JSON by using the `format` parameter.", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" + }, + "response": "```js\nAggregate (cost=33.34..33.36 rows=1 width=112) (actual time=0.041..0.041 rows=1 loops=1)\n Output: NULL::bigint, count(ROW(characters.id, characters.name)), COALESCE(json_agg(ROW(characters.id, characters.name)), '[]'::json), NULLIF(current_setting('response.headers'::text, true), ''::text), NULLIF(current_setting('response.status'::text, true), ''::text)\n -> Limit (cost=0.00..18.33 rows=1000 width=40) (actual time=0.005..0.006 rows=3 loops=1)\n Output: characters.id, characters.name\n -> Seq Scan on public.characters (cost=0.00..22.00 rows=1200 width=40) (actual time=0.004..0.005 rows=3 loops=1)\n Output: characters.id, characters.name\nQuery Identifier: -4730654291623321173\nPlanning Time: 0.407 ms\nExecution Time: 0.119 ms\n```" + } + ] + } + }, + "@supabase/supabase-js.PostgrestFilterBuilder.filter": { + "name": "@supabase/supabase-js.PostgrestFilterBuilder.filter", + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + } + }, + { + "name": "operator", + "type": { + "type": "union", + "subTypes": [ + { + "type": "nameOnly", + "name": "FilterOperator" + }, + { + "type": "literal", + "value": "not.match" + }, + { + "type": "literal", + "value": "not.eq" + }, + { + "type": "literal", + "value": "not.neq" + }, + { + "type": "literal", + "value": "not.gt" + }, + { + "type": "literal", + "value": "not.gte" + }, + { + "type": "literal", + "value": "not.lt" + }, + { + "type": "literal", + "value": "not.lte" + }, + { + "type": "literal", + "value": "not.like" + }, + { + "type": "literal", + "value": "not.ilike" + }, + { + "type": "literal", + "value": "not.is" + }, + { + "type": "literal", + "value": "not.isdistinct" + }, + { + "type": "literal", + "value": "not.in" + }, + { + "type": "literal", + "value": "not.cs" + }, + { + "type": "literal", + "value": "not.cd" + }, + { + "type": "literal", + "value": "not.sl" + }, + { + "type": "literal", + "value": "not.sr" + }, + { + "type": "literal", + "value": "not.nxl" + }, + { + "type": "literal", + "value": "not.nxr" + }, + { + "type": "literal", + "value": "not.adj" + }, + { + "type": "literal", + "value": "not.ov" + }, + { + "type": "literal", + "value": "not.fts" + }, + { + "type": "literal", + "value": "not.plfts" + }, + { + "type": "literal", + "value": "not.phfts" + }, + { + "type": "literal", + "value": "not.wfts" + }, + { + "type": "literal", + "value": "not.imatch" + } + ] + } + }, + { + "name": "value", + "type": { + "type": "intrinsic", + "name": "unknown" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "operator", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "value", + "type": { + "type": "intrinsic", + "name": "unknown" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + } + ] + }, + "@supabase/supabase-js.PostgrestFilterBuilder.geojson": { + "name": "@supabase/supabase-js.PostgrestFilterBuilder.geojson", + "params": [], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestBuilder" + } + }, + "comment": { + "shortText": "Return `data` as an object in [GeoJSON](https://geojson.org) format." + } + }, + "@supabase/supabase-js.PostgrestFilterBuilder.gt": { + "name": "@supabase/supabase-js.PostgrestFilterBuilder.gt", + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + } + }, + { + "name": "value", + "type": { + "type": "nameOnly", + "name": "Row['ColumnName']" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "value", + "type": { + "type": "intrinsic", + "name": "unknown" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + } + ] + }, + "@supabase/supabase-js.PostgrestFilterBuilder.gte": { + "name": "@supabase/supabase-js.PostgrestFilterBuilder.gte", + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + } + }, + { + "name": "value", + "type": { + "type": "nameOnly", + "name": "Row['ColumnName']" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "value", + "type": { + "type": "intrinsic", + "name": "unknown" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + } + ] + }, + "@supabase/supabase-js.PostgrestFilterBuilder.ilike": { + "name": "@supabase/supabase-js.PostgrestFilterBuilder.ilike", + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + } + }, + { + "name": "pattern", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "pattern", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + } + ] + }, + "@supabase/supabase-js.PostgrestFilterBuilder.ilikeAllOf": { + "name": "@supabase/supabase-js.PostgrestFilterBuilder.ilikeAllOf", + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + } + }, + { + "name": "patterns", + "type": { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "patterns", + "type": { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + } + ] + }, + "@supabase/supabase-js.PostgrestFilterBuilder.ilikeAnyOf": { + "name": "@supabase/supabase-js.PostgrestFilterBuilder.ilikeAnyOf", + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + } + }, + { + "name": "patterns", + "type": { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "patterns", + "type": { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + } + ] + }, + "@supabase/supabase-js.PostgrestFilterBuilder.in": { + "name": "@supabase/supabase-js.PostgrestFilterBuilder.in", + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + }, + "comment": { + "shortText": "The column to filter on" + } + }, + { + "name": "values", + "type": { + "type": "array" + }, + "comment": { + "shortText": "The values array to filter with" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Match only rows where `column` is included in the `values` array.", + "examples": [ + { + "id": "with-select", + "name": "With `select()`", + "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .in('name', ['Leia', 'Han'])\n```", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"id\": 2,\n \"name\": \"Leia\"\n },\n {\n \"id\": 3,\n \"name\": \"Han\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + } + ] + } + }, + "@supabase/supabase-js.PostgrestFilterBuilder.is": { + "name": "@supabase/supabase-js.PostgrestFilterBuilder.is", + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + } + }, + { + "name": "value" + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "value", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "intrinsic", + "name": "boolean" + } + ] + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + } + ] + }, + "@supabase/supabase-js.PostgrestFilterBuilder.isDistinct": { + "name": "@supabase/supabase-js.PostgrestFilterBuilder.isDistinct", + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + }, + "comment": { + "shortText": "The column to filter on" + } + }, + { + "name": "value", + "comment": { + "shortText": "The value to filter with" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Match only rows where `column` IS DISTINCT FROM `value`.\n\nUnlike `.neq()`, this treats `NULL` as a comparable value. Two `NULL` values\nare considered equal (not distinct), and comparing `NULL` with any non-NULL\nvalue returns true (distinct)." + } + }, + "@supabase/supabase-js.PostgrestFilterBuilder.like": { + "name": "@supabase/supabase-js.PostgrestFilterBuilder.like", + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + } + }, + { + "name": "pattern", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "pattern", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + } + ] + }, + "@supabase/supabase-js.PostgrestFilterBuilder.likeAllOf": { + "name": "@supabase/supabase-js.PostgrestFilterBuilder.likeAllOf", + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + } + }, + { + "name": "patterns", + "type": { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "patterns", + "type": { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + } + ] + }, + "@supabase/supabase-js.PostgrestFilterBuilder.likeAnyOf": { + "name": "@supabase/supabase-js.PostgrestFilterBuilder.likeAnyOf", + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + } + }, + { + "name": "patterns", + "type": { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "patterns", + "type": { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + } + ] + }, + "@supabase/supabase-js.PostgrestFilterBuilder.limit": { + "name": "@supabase/supabase-js.PostgrestFilterBuilder.limit", + "params": [ + { + "name": "rows", + "type": { + "type": "intrinsic", + "name": "number" + }, + "comment": { + "shortText": "The maximum number of rows to return" + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "foreignTable", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Deprecated, use `options.referencedTable`\ninstead" + } + }, + { + "name": "referencedTable", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Set this to limit rows of referenced\ntables instead of the parent table" + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Named parameters" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Limit the query result by `rows`.", + "examples": [ + { + "id": "with-select", + "name": "With `select()`", + "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select('name')\n .limit(1)\n```", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"name\": \"Luke\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + }, + { + "id": "on-a-referenced-table", + "name": "On a referenced table", + "code": "```ts\nconst { data, error } = await supabase\n .from('orchestral_sections')\n .select(`\n name,\n instruments (\n name\n )\n `)\n .limit(1, { referencedTable: 'instruments' })\n```", + "data": { + "sql": "```sql\ncreate table\n orchestral_sections (id int8 primary key, name text);\ncreate table\n instruments (\n id int8 primary key,\n section_id int8 not null references orchestral_sections,\n name text\n );\n\ninsert into\n orchestral_sections (id, name)\nvalues\n (1, 'strings');\ninsert into\n instruments (id, section_id, name)\nvalues\n (1, 1, 'harp'),\n (2, 1, 'violin');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"name\": \"strings\",\n \"instruments\": [\n {\n \"name\": \"violin\"\n }\n ]\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + } + ] + } + }, + "@supabase/supabase-js.PostgrestFilterBuilder.lt": { + "name": "@supabase/supabase-js.PostgrestFilterBuilder.lt", + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + } + }, + { + "name": "value", + "type": { + "type": "nameOnly", + "name": "Row['ColumnName']" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "value", + "type": { + "type": "intrinsic", + "name": "unknown" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + } + ] + }, + "@supabase/supabase-js.PostgrestFilterBuilder.lte": { + "name": "@supabase/supabase-js.PostgrestFilterBuilder.lte", + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + } + }, + { + "name": "value", + "type": { + "type": "nameOnly", + "name": "Row['ColumnName']" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "value", + "type": { + "type": "intrinsic", + "name": "unknown" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + } + ] + }, + "@supabase/supabase-js.PostgrestFilterBuilder.match": { + "name": "@supabase/supabase-js.PostgrestFilterBuilder.match", + "params": [ + { + "name": "query", + "type": { + "type": "record", + "name": "Record", + "keyType": { + "type": "nameOnly", + "name": "ColumnName" + }, + "valueType": { + "type": "nameOnly", + "name": "Row['ColumnName']" + } + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "altSignatures": [ + { + "params": [ + { + "name": "query", + "type": { + "type": "record", + "name": "Record", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "unknown" + } + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + } + ] + }, + "@supabase/supabase-js.PostgrestFilterBuilder.maxAffected": { + "name": "@supabase/supabase-js.PostgrestFilterBuilder.maxAffected", + "params": [ + { + "name": "rows", + "type": { + "type": "intrinsic", + "name": "number" + }, + "comment": { + "shortText": "The maximum number of rows that can be affected" + } + } + ], + "comment": { + "shortText": "Set the maximum number of rows that can be affected by the query.\nOnly available in PostgREST v13+ and only works with PATCH and DELETE methods." + } + }, + "@supabase/supabase-js.PostgrestFilterBuilder.maybeSingle": { + "name": "@supabase/supabase-js.PostgrestFilterBuilder.maybeSingle", + "params": [], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestBuilder" + } + }, + "comment": { + "shortText": "Return `data` as a single object instead of an array of objects.\n\nQuery result must be zero or one row (e.g. using `.limit(1)`), otherwise\nthis returns an error.", + "examples": [ + { + "id": "with-select", + "name": "With `select()`", + "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .eq('name', 'Katniss')\n .maybeSingle()\n```", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" + }, + "response": "```json\n{\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + } + ] + } + }, + "@supabase/supabase-js.PostgrestFilterBuilder.neq": { + "name": "@supabase/supabase-js.PostgrestFilterBuilder.neq", + "params": [ + { + "name": "column", + "comment": { + "shortText": "The column to filter on" + } + }, + { + "name": "value", + "comment": { + "shortText": "The value to filter with" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Match only rows where `column` is not equal to `value`.\n\nThis filter does not include rows where `column` is `NULL`. To match null\nvalues, use `.is(column, null)` instead.", + "examples": [ + { + "id": "with-select", + "name": "With `select()`", + "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .neq('name', 'Leia')\n```", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"Luke\"\n },\n {\n \"id\": 3,\n \"name\": \"Han\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + } + ] + } + }, + "@supabase/supabase-js.PostgrestFilterBuilder.not": { + "name": "@supabase/supabase-js.PostgrestFilterBuilder.not", + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + } + }, + { + "name": "operator", + "type": { + "type": "literal", + "value": "is" + } + }, + { + "name": "value", + "type": { + "type": "literal", + "value": null + } + } + ], + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + } + }, + { + "name": "operator", + "type": { + "type": "nameOnly", + "name": "FilterOperator" + } + }, + { + "name": "value", + "type": { + "type": "nameOnly", + "name": "Row['ColumnName']" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + }, + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "operator", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "value", + "type": { + "type": "intrinsic", + "name": "unknown" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + } + ] + }, + "@supabase/supabase-js.PostgrestFilterBuilder.notIn": { + "name": "@supabase/supabase-js.PostgrestFilterBuilder.notIn", + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + }, + "comment": { + "shortText": "The column to filter on" + } + }, + { + "name": "values", + "type": { + "type": "array" + }, + "comment": { + "shortText": "The values array to filter with" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Match only rows where `column` is NOT included in the `values` array." + } + }, + "@supabase/supabase-js.PostgrestFilterBuilder.or": { + "name": "@supabase/supabase-js.PostgrestFilterBuilder.or", + "params": [ + { + "name": "filters", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The filters to use, following PostgREST syntax" + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "foreignTable", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Deprecated, use `referencedTable` instead" + } + }, + { + "name": "referencedTable", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Set this to filter on referenced tables\ninstead of the parent table" + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Named parameters" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Match only rows which satisfy at least one of the filters.\n\nUnlike most filters, `filters` is used as-is and needs to follow [PostgREST\nsyntax](https://postgrest.org/en/stable/api.html#operators). You also need\nto make sure it's properly sanitized.\n\nIt's currently not possible to do an `.or()` filter across multiple tables.", + "text": "or() expects you to use the raw PostgREST syntax for the filter names and values.\n\n```ts\n.or('id.in.(5,6,7), arraycol.cs.{\"a\",\"b\"}') // Use `()` for `in` filter, `{}` for array values and `cs` for `contains()`.\n.or('id.in.(5,6,7), arraycol.cd.{\"a\",\"b\"}') // Use `cd` for `containedBy()`\n```", + "examples": [ + { + "id": "with-select", + "name": "With `select()`", + "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select('name')\n .or('id.eq.2,name.eq.Han')\n```", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"name\": \"Leia\"\n },\n {\n \"name\": \"Han\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + }, + { + "id": "use-or-with-and", + "name": "Use `or` with `and`", + "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select('name')\n .or('id.gt.3,and(id.eq.1,name.eq.Luke)')\n```", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"name\": \"Luke\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + }, + { + "id": "use-or-on-referenced-tables", + "name": "Use `or` on referenced tables", + "code": "```ts\nconst { data, error } = await supabase\n .from('orchestral_sections')\n .select(`\n name,\n instruments!inner (\n name\n )\n `)\n .or('section_id.eq.1,name.eq.guzheng', { referencedTable: 'instruments' })\n```", + "data": { + "sql": "```sql\ncreate table\n orchestral_sections (id int8 primary key, name text);\ncreate table\n instruments (\n id int8 primary key,\n section_id int8 not null references orchestral_sections,\n name text\n );\n\ninsert into\n orchestral_sections (id, name)\nvalues\n (1, 'strings'),\n (2, 'woodwinds');\ninsert into\n instruments (id, section_id, name)\nvalues\n (1, 2, 'flute'),\n (2, 1, 'violin');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"name\": \"strings\",\n \"instruments\": [\n {\n \"name\": \"violin\"\n }\n ]\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + } + ] + } + }, + "@supabase/supabase-js.PostgrestFilterBuilder.order": { + "name": "@supabase/supabase-js.PostgrestFilterBuilder.order", + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "ascending", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "nullsFirst", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "referencedTable", + "type": { + "type": "intrinsic", + "name": "undefined" + }, + "isOptional": true + } + ] + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "ascending", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "nullsFirst", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "referencedTable", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + } + ] + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + }, + { + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "ascending", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "foreignTable", + "type": { + "type": "intrinsic", + "name": "undefined" + }, + "isOptional": true + }, + { + "name": "nullsFirst", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + } + ] + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + }, + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "ascending", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "foreignTable", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "nullsFirst", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + } + ] + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + } + ] + }, + "@supabase/supabase-js.PostgrestFilterBuilder.overlaps": { + "name": "@supabase/supabase-js.PostgrestFilterBuilder.overlaps", + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + } + }, + { + "name": "value", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "string" + }, + { + "type": "array", + "elemType": { + "type": "nameOnly", + "name": "Row['ColumnName']" + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "value", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "string" + }, + { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "unknown" + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + } + ] + }, + "@supabase/supabase-js.PostgrestFilterBuilder.overrideTypes": { + "name": "@supabase/supabase-js.PostgrestFilterBuilder.overrideTypes", + "params": [], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestBuilder" + } + }, + "comment": { + "shortText": "Override the type of the returned `data` field in the response.", + "examples": [ + { + "id": "example-1", + "name": "Example 1", + "code": "```typescript\n// Merge with existing types (default behavior)\nconst query = supabase\n .from('users')\n .select()\n .overrideTypes<{ custom_field: string }>()\n\n// Replace existing types completely\nconst replaceQuery = supabase\n .from('users')\n .select()\n .overrideTypes<{ id: number; name: string }, { merge: false }>()\n```" + }, + { + "id": "complete-override-type-of-successful-response", + "name": "Complete Override type of successful response", + "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .overrideTypes, { merge: false }>()\n```", + "response": "```ts\nlet x: typeof data // MyType[]\n```" + }, + { + "id": "complete-override-type-of-object-response", + "name": "Complete Override type of object response", + "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .maybeSingle()\n .overrideTypes()\n```", + "response": "```ts\nlet x: typeof data // MyType | null\n```" + }, + { + "id": "partial-override-type-of-successful-response", + "name": "Partial Override type of successful response", + "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .overrideTypes>()\n```", + "response": "```ts\nlet x: typeof data // Array\n```" + }, + { + "id": "partial-override-type-of-object-response", + "name": "Partial Override type of object response", + "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .maybeSingle()\n .overrideTypes<{ status: \"A\" | \"B\" }>()\n```", + "response": "```ts\nlet x: typeof data // CountryRowProperties & { status: \"A\" | \"B\" } | null\n```" + }, + { + "id": "merge-vs-replace-existing-types", + "name": "Merge vs replace existing types", + "code": "```typescript\n// Merge with existing types (default behavior)\nconst query = supabase\n .from('users')\n .select()\n .overrideTypes<{ custom_field: string }>()\n\n// Replace existing types completely\nconst replaceQuery = supabase\n .from('users')\n .select()\n .overrideTypes<{ id: number; name: string }, { merge: false }>()\n```" + } + ] + } + }, + "@supabase/supabase-js.PostgrestFilterBuilder.range": { + "name": "@supabase/supabase-js.PostgrestFilterBuilder.range", + "params": [ + { + "name": "from", + "type": { + "type": "intrinsic", + "name": "number" + }, + "comment": { + "shortText": "The starting index from which to limit the result" + } + }, + { + "name": "to", + "type": { + "type": "intrinsic", + "name": "number" + }, + "comment": { + "shortText": "The last index to which to limit the result" + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "foreignTable", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Deprecated, use `options.referencedTable`\ninstead" + } + }, + { + "name": "referencedTable", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Set this to limit rows of referenced\ntables instead of the parent table" + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Named parameters" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Limit the query result by starting at an offset `from` and ending at the offset `to`.\nOnly records within this range are returned.\nThis respects the query order and if there is no order clause the range could behave unexpectedly.\nThe `from` and `to` values are 0-based and inclusive: `range(1, 3)` will include the second, third\nand fourth rows of the query.", + "examples": [ + { + "id": "with-select", + "name": "With `select()`", + "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select('name')\n .range(0, 1)\n```", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"name\": \"Luke\"\n },\n {\n \"name\": \"Leia\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + } + ] + } + }, + "@supabase/supabase-js.PostgrestFilterBuilder.rangeAdjacent": { + "name": "@supabase/supabase-js.PostgrestFilterBuilder.rangeAdjacent", + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + } + }, + { + "name": "range", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "range", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + } + ] + }, + "@supabase/supabase-js.PostgrestFilterBuilder.rangeGt": { + "name": "@supabase/supabase-js.PostgrestFilterBuilder.rangeGt", + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + } + }, + { + "name": "range", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "range", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + } + ] + }, + "@supabase/supabase-js.PostgrestFilterBuilder.rangeGte": { + "name": "@supabase/supabase-js.PostgrestFilterBuilder.rangeGte", + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + } + }, + { + "name": "range", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "range", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + } + ] + }, + "@supabase/supabase-js.PostgrestFilterBuilder.rangeLt": { + "name": "@supabase/supabase-js.PostgrestFilterBuilder.rangeLt", + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + } + }, + { + "name": "range", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "range", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + } + ] + }, + "@supabase/supabase-js.PostgrestFilterBuilder.rangeLte": { + "name": "@supabase/supabase-js.PostgrestFilterBuilder.rangeLte", + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + } + }, + { + "name": "range", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "range", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + } + ] + }, + "@supabase/supabase-js.PostgrestFilterBuilder.regexIMatch": { + "name": "@supabase/supabase-js.PostgrestFilterBuilder.regexIMatch", + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + } + }, + { + "name": "pattern", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "pattern", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + } + ] + }, + "@supabase/supabase-js.PostgrestFilterBuilder.regexMatch": { + "name": "@supabase/supabase-js.PostgrestFilterBuilder.regexMatch", + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + } + }, + { + "name": "pattern", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "pattern", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + } + ] + }, + "@supabase/supabase-js.PostgrestFilterBuilder.retry": { + "name": "@supabase/supabase-js.PostgrestFilterBuilder.retry", + "params": [ + { + "name": "enabled", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "comment": { + "shortText": "Whether to enable retries for this request" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "", + "examples": [ + { + "id": "example-1", + "name": "Example 1", + "code": "```ts\n// Disable retries for a specific query\nconst { data, error } = await supabase\n .from('users')\n .select()\n .retry(false)\n```" + } + ] + } + }, + "@supabase/supabase-js.PostgrestFilterBuilder.returns": { + "name": "@supabase/supabase-js.PostgrestFilterBuilder.returns", + "params": [], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestTransformBuilder" + } + }, + "comment": { + "shortText": "Override the type of the returned `data`.", + "text": "- Deprecated: use overrideTypes method instead", + "examples": [ + { + "id": "override-type-of-successful-response", + "name": "Override type of successful response", + "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .returns>()\n```", + "response": "```js\nlet x: typeof data // MyType[]\n```" + }, + { + "id": "override-type-of-object-response", + "name": "Override type of object response", + "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .maybeSingle()\n .returns()\n```", + "response": "```js\nlet x: typeof data // MyType | null\n```" + } + ] + } + }, + "@supabase/supabase-js.PostgrestFilterBuilder.rollback": { + "name": "@supabase/supabase-js.PostgrestFilterBuilder.rollback", + "params": [], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Dry-run this request: execute the query but discard the changes.\n\nServer-side, PostgREST runs the query inside a transaction and rolls it back\ninstead of committing. The response still contains the data that *would* have\nbeen returned — `RETURNING` clauses execute and RLS, triggers, and constraints\nare all evaluated — but no row is actually inserted, updated, or deleted.\n\nThis affects only the single request it is chained to. The JS caller has no\nhandle on the transaction: supabase-js does not group multiple queries into\none transaction. For multi-statement transactional logic, use a database\nfunction (`supabase.rpc(...)`).\n\nSets the `Prefer: tx=rollback` header. See PostgREST's docs on transaction\npreferences for the underlying mechanism.", + "examples": [ + { + "id": "validate-an-insert-without-persisting", + "name": "Validate an insert without persisting", + "code": "```ts\nconst { data, error } = await supabase\n .from('countries')\n .insert({ name: 'France' })\n .select()\n .rollback()\n// `data` shows what would have been inserted; nothing is saved.\n```" + } + ] + } + }, + "@supabase/supabase-js.PostgrestFilterBuilder.select": { + "name": "@supabase/supabase-js.PostgrestFilterBuilder.select", + "params": [ + { + "name": "columns", + "type": { + "type": "nameOnly", + "name": "Query" + }, + "isOptional": true, + "comment": { + "shortText": "The columns to retrieve, separated by commas" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestFilterBuilder" + } + }, + "comment": { + "shortText": "Perform a SELECT on the query result.\n\nBy default, `.insert()`, `.update()`, `.upsert()`, and `.delete()` do not\nreturn modified rows. By calling this method, modified rows are returned in\n`data`.", + "examples": [ + { + "id": "with-upsert", + "name": "With `upsert()`", + "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .upsert({ id: 1, name: 'Han Solo' })\n .select()\n```", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Han');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"Han Solo\"\n }\n ],\n \"status\": 201,\n \"statusText\": \"Created\"\n}\n```" + } + ] + } + }, + "@supabase/supabase-js.PostgrestFilterBuilder.setHeader": { + "name": "@supabase/supabase-js.PostgrestFilterBuilder.setHeader", + "params": [ + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "HTTP header name" + } + }, + { + "name": "value", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "HTTP header value" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Set an HTTP header on this single PostgREST request, overriding any header\nwith the same name set on the client.\n\nThis is an advanced escape hatch for one-off needs (passing a custom\n`Authorization` for a single query, attaching a tracing header, etc.).\nMost callers do not need it: configure client-wide headers via the\n`headers` option when constructing the client, and authentication via\nSupabase Auth." + } + }, + "@supabase/supabase-js.PostgrestFilterBuilder.single": { + "name": "@supabase/supabase-js.PostgrestFilterBuilder.single", + "params": [], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestBuilder" + } + }, + "comment": { + "shortText": "Return `data` as a single object instead of an array of objects.\n\nQuery result must be one row (e.g. using `.limit(1)`), otherwise this\nreturns an error.", + "examples": [ + { + "id": "with-select", + "name": "With `select()`", + "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select('name')\n .limit(1)\n .single()\n```", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" + }, + "response": "```json\n{\n \"data\": {\n \"name\": \"Luke\"\n },\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + } + ] + } + }, + "@supabase/supabase-js.PostgrestFilterBuilder.stripNulls": { + "name": "@supabase/supabase-js.PostgrestFilterBuilder.stripNulls", + "params": [], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Strip null values from the response data. Properties with `null` values\nwill be omitted from the returned JSON objects.\n\nRequires PostgREST 11.2.0+.\n\nhttps://docs.postgrest.org/en/stable/references/api/resource_representation.html#stripped-nulls", + "examples": [ + { + "id": "with-select", + "name": "With `select()`", + "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .stripNulls()\n```", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text, bio text);\n\ninsert into\n characters (id, name, bio)\nvalues\n (1, 'Luke', null),\n (2, 'Leia', 'Princess of Alderaan');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"Luke\"\n },\n {\n \"id\": 2,\n \"name\": \"Leia\",\n \"bio\": \"Princess of Alderaan\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + } + ] + } + }, + "@supabase/supabase-js.PostgrestFilterBuilder.textSearch": { + "name": "@supabase/supabase-js.PostgrestFilterBuilder.textSearch", + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + } + }, + { + "name": "query", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "config", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "type", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "plain" + }, + { + "type": "literal", + "value": "phrase" + }, + { + "type": "literal", + "value": "websearch" + } + ] + }, + "isOptional": true + } + ] + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "query", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "config", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "type", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "plain" + }, + { + "type": "literal", + "value": "phrase" + }, + { + "type": "literal", + "value": "websearch" + } + ] + }, + "isOptional": true + } + ] + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + } + ] + }, + "@supabase/supabase-js.PostgrestFilterBuilder.then": { + "name": "@supabase/supabase-js.PostgrestFilterBuilder.then", + "params": [ + { + "name": "onfulfilled", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "function", + "params": [ + { + "name": "value" + } + ], + "ret": { + "type": { + "type": "union", + "subTypes": [ + { + "type": "nameOnly", + "name": "TResult1" + }, + { + "type": "nameOnly", + "name": "PromiseLike" + } + ] + } + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "The callback to execute when the Promise is resolved." + } + }, + { + "name": "onrejected", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "function", + "params": [ + { + "name": "reason", + "type": { + "type": "intrinsic", + "name": "any" + } + } + ], + "ret": { + "type": { + "type": "union", + "subTypes": [ + { + "type": "nameOnly", + "name": "TResult2" + }, + { + "type": "nameOnly", + "name": "PromiseLike" + } + ] + } + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "The callback to execute when the Promise is rejected." + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "PromiseLike" + } + }, + "comment": { + "shortText": "Attaches callbacks for the resolution and/or rejection of the Promise." + } + }, + "@supabase/supabase-js.PostgrestFilterBuilder.throwOnError": { + "name": "@supabase/supabase-js.PostgrestFilterBuilder.throwOnError", + "params": [], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestFilterBuilder" + } + }, + "comment": { + "shortText": "If there's an error with the query, throwOnError will reject the promise by\nthrowing the error instead of returning it as part of a successful response.\n\nhttps://github.com/supabase/supabase-js/issues/92" + } + }, + "@supabase/supabase-js.PostgrestQueryBuilder.constructor": { + "name": "@supabase/supabase-js.PostgrestQueryBuilder.constructor", + "params": [ + { + "name": "url", + "type": { + "type": "nameOnly", + "name": "URL" + }, + "comment": { + "shortText": "The URL for the query" + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "fetch", + "type": { + "type": "function", + "params": [ + { + "name": "input", + "type": { + "type": "union", + "subTypes": [ + { + "type": "nameOnly", + "name": "RequestInfo" + }, + { + "type": "nameOnly", + "name": "URL" + } + ] + } + }, + { + "name": "init", + "type": { + "type": "nameOnly", + "name": "RequestInit" + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "nameOnly", + "name": "Response" + } + } + }, + "comment": { + "shortText": "[MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch)" + } + }, + "isOptional": true, + "comment": { + "shortText": "Custom fetch implementation" + } + }, + { + "name": "headers", + "type": { + "type": "nameOnly", + "name": "HeadersInit" + }, + "isOptional": true, + "comment": { + "shortText": "Custom headers" + } + }, + { + "name": "retry", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "Enable automatic retries for transient errors (default: true)" + } + }, + { + "name": "schema", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Postgres schema to use" + } + }, + { + "name": "urlLengthLimit", + "type": { + "type": "intrinsic", + "name": "number" + }, + "isOptional": true, + "comment": { + "shortText": "Maximum URL length before warning" + } + } + ] + }, + "comment": { + "shortText": "Named parameters" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestQueryBuilder" + } + }, + "comment": { + "shortText": "Creates a query builder scoped to a Postgres table or view.", + "examples": [ + { + "id": "using-supabase-js-recommended", + "name": "Using supabase-js (recommended)", + "code": "```ts\nimport { createClient } from '@supabase/supabase-js'\n\nconst supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key')\nconst { data, error } = await supabase.from('users').select('*')\n```" + }, + { + "id": "standalone-import-for-bundle-sensitive-environments", + "name": "Standalone import for bundle-sensitive environments", + "code": "```ts\nimport { PostgrestQueryBuilder } from '@supabase/postgrest-js'\n\nconst query = new PostgrestQueryBuilder(\n new URL('https://xyzcompany.supabase.co/rest/v1/users'),\n { headers: { apikey: 'your-publishable-key' }, retry: true }\n)\n```" + } + ] + } + }, + "@supabase/supabase-js.PostgrestQueryBuilder.delete": { + "name": "@supabase/supabase-js.PostgrestQueryBuilder.delete", + "params": [ + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "count", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "exact" + }, + null, + { + "type": "literal", + "value": "planned" + }, + { + "type": "literal", + "value": "estimated" + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Count algorithm to use to count deleted rows.\n\n`\"exact\"`: Exact but slow count algorithm. Performs a `COUNT(*)` under the\nhood.\n\n`\"planned\"`: Approximated but fast count algorithm. Uses the Postgres\nstatistics under the hood.\n\n`\"estimated\"`: Uses exact count for low numbers and planned count for high\nnumbers." + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Named parameters" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestFilterBuilder" + } + }, + "comment": { + "shortText": "Perform a DELETE on the table or view.\n\nBy default, deleted rows are not returned. To return it, chain the call\nwith `.select()` after filters.", + "text": "- `delete()` should always be combined with [filters](/docs/reference/javascript/using-filters) to target the item(s) you wish to delete.\n- If you use `delete()` with filters and you have\n [RLS](/docs/learn/auth-deep-dive/auth-row-level-security) enabled, only\n rows visible through `SELECT` policies are deleted. Note that by default\n no rows are visible, so you need at least one `SELECT`/`ALL` policy that\n makes the rows visible.\n- When using `delete().in()`, specify an array of values to target multiple rows with a single query. This is particularly useful for batch deleting entries that share common criteria, such as deleting users by their IDs. Ensure that the array you provide accurately represents all records you intend to delete to avoid unintended data removal.", + "examples": [ + { + "id": "delete-a-single-record", + "name": "Delete a single record", + "code": "```ts\nconst response = await supabase\n .from('countries')\n .delete()\n .eq('id', 1)\n```", + "data": { + "sql": "```sql\ncreate table\n countries (id int8 primary key, name text);\n\ninsert into\n countries (id, name)\nvalues\n (1, 'Mordor');\n```" + }, + "response": "```json\n{\n \"status\": 204,\n \"statusText\": \"No Content\"\n}\n```" + }, + { + "id": "handling-errors", + "name": "Handling errors", + "code": "```js\nconst { error } = await supabase.from('countries').delete().eq('id', 1)\nif (error) console.error(error)\n```", + "description": "`error.hint` from Postgres often contains the actionable fix (e.g. `\"Grant the required privileges to the current role with: GRANT DELETE ON public.countries TO anon;\"` for a `42501` permission-denied error). Log the full `error` object so it isn't hidden behind `error.message`." + }, + { + "id": "delete-a-record-and-return-it", + "name": "Delete a record and return it", + "code": "```ts\nconst { data, error } = await supabase\n .from('countries')\n .delete()\n .eq('id', 1)\n .select()\n```", + "data": { + "sql": "```sql\ncreate table\n countries (id int8 primary key, name text);\n\ninsert into\n countries (id, name)\nvalues\n (1, 'Mordor');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"Mordor\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + }, + { + "id": "delete-multiple-records", + "name": "Delete multiple records", + "code": "```ts\nconst response = await supabase\n .from('countries')\n .delete()\n .in('id', [1, 2, 3])\n```", + "data": { + "sql": "```sql\ncreate table\n countries (id int8 primary key, name text);\n\ninsert into\n countries (id, name)\nvalues\n (1, 'Rohan'), (2, 'The Shire'), (3, 'Mordor');\n```" + }, + "response": "```json\n{\n \"status\": 204,\n \"statusText\": \"No Content\"\n}\n```" + } + ] + } + }, + "@supabase/supabase-js.PostgrestQueryBuilder.insert": { + "name": "@supabase/supabase-js.PostgrestQueryBuilder.insert", + "params": [ + { + "name": "values", + "type": { + "type": "union", + "subTypes": [ + { + "type": "nameOnly", + "name": "RejectExcessProperties" + }, + { + "type": "array", + "elemType": { + "type": "nameOnly", + "name": "RejectExcessProperties" + } + } + ] + }, + "comment": { + "shortText": "The values to insert. Pass an object to insert a single row\nor an array to insert multiple rows." + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "count", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "exact" + }, + null, + { + "type": "literal", + "value": "planned" + }, + { + "type": "literal", + "value": "estimated" + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Count algorithm to use to count inserted rows.\n\n`\"exact\"`: Exact but slow count algorithm. Performs a `COUNT(*)` under the\nhood.\n\n`\"planned\"`: Approximated but fast count algorithm. Uses the Postgres\nstatistics under the hood.\n\n`\"estimated\"`: Uses exact count for low numbers and planned count for high\nnumbers." + } + }, + { + "name": "defaultToNull", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "Make missing fields default to `null`.\nOtherwise, use the default value for the column. Only applies for bulk\ninserts." + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Named parameters" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestFilterBuilder" + } + }, + "comment": { + "shortText": "Perform an INSERT into the table or view.\n\nBy default, inserted rows are not returned. To return it, chain the call\nwith `.select()`.", + "examples": [ + { + "id": "create-a-record", + "name": "Create a record", + "code": "```ts\nconst { error } = await supabase\n .from('countries')\n .insert({ id: 1, name: 'Mordor' })\n```", + "data": { + "sql": "```sql\ncreate table\n countries (id int8 primary key, name text);\n```" + }, + "response": "```json\n{\n \"status\": 201,\n \"statusText\": \"Created\"\n}\n```" + }, + { + "id": "handling-errors", + "name": "Handling errors", + "code": "```js\nconst { error } = await supabase.from('countries').insert({ id: 1, name: 'Mordor' })\nif (error) console.error(error)\n```", + "description": "`error.hint` from Postgres often contains the actionable fix (e.g. `\"Grant the required privileges to the current role with: GRANT INSERT ON public.countries TO anon;\"` for a `42501` permission-denied error). Log the full `error` object so it isn't hidden behind `error.message`." + }, + { + "id": "create-a-record-and-return-it", + "name": "Create a record and return it", + "code": "```ts\nconst { data, error } = await supabase\n .from('countries')\n .insert({ id: 1, name: 'Mordor' })\n .select()\n```", + "data": { + "sql": "```sql\ncreate table\n countries (id int8 primary key, name text);\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"Mordor\"\n }\n ],\n \"status\": 201,\n \"statusText\": \"Created\"\n}\n```" + }, + { + "id": "bulk-create", + "name": "Bulk create", + "code": "```ts\nconst { error } = await supabase\n .from('countries')\n .insert([\n { id: 1, name: 'Mordor' },\n { id: 1, name: 'The Shire' },\n ])\n```", + "description": "A bulk create operation is handled in a single transaction.\nIf any of the inserts fail, none of the rows are inserted.", + "data": { + "sql": "```sql\ncreate table\n countries (id int8 primary key, name text);\n```" + }, + "response": "```json\n{\n \"error\": {\n \"code\": \"23505\",\n \"details\": \"Key (id)=(1) already exists.\",\n \"hint\": null,\n \"message\": \"duplicate key value violates unique constraint \\\"countries_pkey\\\"\"\n },\n \"status\": 409,\n \"statusText\": \"Conflict\"\n}\n```" + } + ] + } + }, + "@supabase/supabase-js.PostgrestQueryBuilder.select": { + "name": "@supabase/supabase-js.PostgrestQueryBuilder.select", + "params": [ + { + "name": "columns", + "type": { + "type": "nameOnly", + "name": "Query" + }, + "isOptional": true, + "comment": { + "shortText": "The columns to retrieve, separated by commas. Columns can be renamed when returned with `customName:columnName`" + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "count", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "exact" + }, + null, + { + "type": "literal", + "value": "planned" + }, + { + "type": "literal", + "value": "estimated" + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Count algorithm to use to count rows in the table or view.\n\n`\"exact\"`: Exact but slow count algorithm. Performs a `COUNT(*)` under the\nhood.\n\n`\"planned\"`: Approximated but fast count algorithm. Uses the Postgres\nstatistics under the hood.\n\n`\"estimated\"`: Uses exact count for low numbers and planned count for high\nnumbers." + } + }, + { + "name": "head", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "When set to `true`, `data` will not be returned.\nUseful if you only need the count." + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Named parameters" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestFilterBuilder" + } + }, + "comment": { + "shortText": "Perform a SELECT query on the table or view.", + "text": "When using `count` with `.range()` or `.limit()`, the returned `count` is the total number of rows\nthat match your filters, not the number of rows in the current page. Use this to build pagination UI.\n\n- By default, Supabase projects return a maximum of 1,000 rows. This setting can be changed in your project's [API settings](/dashboard/project/_/settings/api). It's recommended that you keep it low to limit the payload size of accidental or malicious requests. You can use `range()` queries to paginate through your data.\n- `select()` can be combined with [Filters](/docs/reference/javascript/using-filters)\n- `select()` can be combined with [Modifiers](/docs/reference/javascript/using-modifiers)\n- `apikey` is a reserved keyword if you're using the [Supabase Platform](/docs/guides/platform) and [should be avoided as a column name](https://github.com/supabase/supabase/issues/5465). *", + "examples": [ + { + "id": "getting-your-data", + "name": "Getting your data", + "code": "```js\nconst { data, error } = await supabase\n .from('characters')\n .select()\n```", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Harry'),\n (2, 'Frodo'),\n (3, 'Katniss');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"Harry\"\n },\n {\n \"id\": 2,\n \"name\": \"Frodo\"\n },\n {\n \"id\": 3,\n \"name\": \"Katniss\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + }, + { + "id": "handling-errors", + "name": "Handling errors", + "code": "```js\nconst { data, error } = await supabase.from('characters').select()\nif (error) {\n // Logs the full error: message, code, details, and hint.\n console.error(error)\n return\n}\n```", + "description": "The most useful field on a Postgres error is usually `hint` — when the database knows the fix, it puts the literal SQL there. For example, a permission-denied error (`code: '42501'`) arrives with a `hint` like `\"Grant the required privileges to the current role with: GRANT SELECT ON public.characters TO anon;\"`. Log the full `error` object so the hint isn't hidden behind `error.message`.", + "response": "```json\n{\n \"error\": {\n \"code\": \"42501\",\n \"details\": null,\n \"hint\": \"Grant the required privileges to the current role with: GRANT SELECT ON public.characters TO anon;\",\n \"message\": \"permission denied for table characters\"\n },\n \"status\": 401,\n \"statusText\": \"Unauthorized\"\n}\n```" + }, + { + "id": "selecting-specific-columns", + "name": "Selecting specific columns", + "code": "```js\nconst { data, error } = await supabase\n .from('characters')\n .select('name')\n```", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Frodo'),\n (2, 'Harry'),\n (3, 'Katniss');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"name\": \"Frodo\"\n },\n {\n \"name\": \"Harry\"\n },\n {\n \"name\": \"Katniss\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + }, + { + "id": "query-referenced-tables", + "name": "Query referenced tables", + "code": "```js\nconst { data, error } = await supabase\n .from('orchestral_sections')\n .select(`\n name,\n instruments (\n name\n )\n `)\n```", + "description": "If your database has foreign key relationships, you can query related tables too.", + "data": { + "sql": "```sql\ncreate table\n orchestral_sections (id int8 primary key, name text);\ncreate table\n instruments (\n id int8 primary key,\n section_id int8 not null references orchestral_sections,\n name text\n );\n\ninsert into\n orchestral_sections (id, name)\nvalues\n (1, 'strings'),\n (2, 'woodwinds');\ninsert into\n instruments (id, section_id, name)\nvalues\n (1, 2, 'flute'),\n (2, 1, 'violin');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"name\": \"strings\",\n \"instruments\": [\n {\n \"name\": \"violin\"\n }\n ]\n },\n {\n \"name\": \"woodwinds\",\n \"instruments\": [\n {\n \"name\": \"flute\"\n }\n ]\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + }, + { + "id": "query-referenced-tables-with-spaces-in-their-names", + "name": "Query referenced tables with spaces in their names", + "code": "```js\nconst { data, error } = await supabase\n .from('orchestral sections')\n .select(`\n name,\n \"musical instruments\" (\n name\n )\n `)\n```", + "description": "If your table name contains spaces, you must use double quotes in the `select` statement to reference the table.", + "data": { + "sql": "```sql\ncreate table\n \"orchestral sections\" (id int8 primary key, name text);\ncreate table\n \"musical instruments\" (\n id int8 primary key,\n section_id int8 not null references \"orchestral sections\",\n name text\n );\n\ninsert into\n \"orchestral sections\" (id, name)\nvalues\n (1, 'strings'),\n (2, 'woodwinds');\ninsert into\n \"musical instruments\" (id, section_id, name)\nvalues\n (1, 2, 'flute'),\n (2, 1, 'violin');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"name\": \"strings\",\n \"musical instruments\": [\n {\n \"name\": \"violin\"\n }\n ]\n },\n {\n \"name\": \"woodwinds\",\n \"musical instruments\": [\n {\n \"name\": \"flute\"\n }\n ]\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + }, + { + "id": "query-referenced-tables-through-a-join-table", + "name": "Query referenced tables through a join table", + "code": "```ts\nconst { data, error } = await supabase\n .from('users')\n .select(`\n name,\n teams (\n name\n )\n `)\n\n```", + "description": "If you're in a situation where your tables are **NOT** directly\nrelated, but instead are joined by a _join table_, you can still use\nthe `select()` method to query the related data. The join table needs\nto have the foreign keys as part of its composite primary key.", + "data": { + "sql": "```sql\ncreate table\n users (\n id int8 primary key,\n name text\n );\ncreate table\n teams (\n id int8 primary key,\n name text\n );\n-- join table\ncreate table\n users_teams (\n user_id int8 not null references users,\n team_id int8 not null references teams,\n -- both foreign keys must be part of a composite primary key\n primary key (user_id, team_id)\n );\n\ninsert into\n users (id, name)\nvalues\n (1, 'Kiran'),\n (2, 'Evan');\ninsert into\n teams (id, name)\nvalues\n (1, 'Green'),\n (2, 'Blue');\ninsert into\n users_teams (user_id, team_id)\nvalues\n (1, 1),\n (1, 2),\n (2, 2);\n```" + }, + "response": "```json\n {\n \"data\": [\n {\n \"name\": \"Kiran\",\n \"teams\": [\n {\n \"name\": \"Green\"\n },\n {\n \"name\": \"Blue\"\n }\n ]\n },\n {\n \"name\": \"Evan\",\n \"teams\": [\n {\n \"name\": \"Blue\"\n }\n ]\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n }\n\n```" + }, + { + "id": "query-the-same-referenced-table-multiple-times", + "name": "Query the same referenced table multiple times", + "code": "```ts\nconst { data, error } = await supabase\n .from('messages')\n .select(`\n content,\n from:sender_id(name),\n to:receiver_id(name)\n `)\n\n// To infer types, use the name of the table (in this case `users`) and\n// the name of the foreign key constraint.\nconst { data, error } = await supabase\n .from('messages')\n .select(`\n content,\n from:users!messages_sender_id_fkey(name),\n to:users!messages_receiver_id_fkey(name)\n `)\n```", + "description": "If you need to query the same referenced table twice, use the name of the\njoined column to identify which join to use. You can also give each\ncolumn an alias.", + "data": { + "sql": "```sql\n create table\n users (id int8 primary key, name text);\n\n create table\n messages (\n sender_id int8 not null references users,\n receiver_id int8 not null references users,\n content text\n );\n\n insert into\n users (id, name)\n values\n (1, 'Kiran'),\n (2, 'Evan');\n\n insert into\n messages (sender_id, receiver_id, content)\n values\n (1, 2, '👋');\n ```\n```\n\n@exampleResponse Query the same referenced table multiple times\n```json\n{\n \"data\": [\n {\n \"content\": \"👋\",\n \"from\": {\n \"name\": \"Kiran\"\n },\n \"to\": {\n \"name\": \"Evan\"\n }\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```\n\n@exampleDescription Query nested foreign tables through a join table\nYou can use the result of a joined table to gather data in\nanother foreign table. With multiple references to the same foreign\ntable you must specify the column on which to conduct the join.\n\n@example Query nested foreign tables through a join table\n```ts\n const { data, error } = await supabase\n .from('games')\n .select(`\n game_id:id,\n away_team:teams!games_away_team_fkey (\n users (\n id,\n name\n )\n )\n `)\n\n```\n\n@exampleSql Query nested foreign tables through a join table\n```sql\n```sql\ncreate table\n users (\n id int8 primary key,\n name text\n );\ncreate table\n teams (\n id int8 primary key,\n name text\n );\n-- join table\ncreate table\n users_teams (\n user_id int8 not null references users,\n team_id int8 not null references teams,\n\n primary key (user_id, team_id)\n );\ncreate table\n games (\n id int8 primary key,\n home_team int8 not null references teams,\n away_team int8 not null references teams,\n name text\n );\n\ninsert into users (id, name)\nvalues\n (1, 'Kiran'),\n (2, 'Evan');\ninsert into\n teams (id, name)\nvalues\n (1, 'Green'),\n (2, 'Blue');\ninsert into\n users_teams (user_id, team_id)\nvalues\n (1, 1),\n (1, 2),\n (2, 2);\ninsert into\n games (id, home_team, away_team, name)\nvalues\n (1, 1, 2, 'Green vs Blue'),\n (2, 2, 1, 'Blue vs Green');\n```" + } + }, + { + "id": "filtering-through-referenced-tables", + "name": "Filtering through referenced tables", + "code": "```ts\nconst { data, error } = await supabase\n .from('instruments')\n .select('name, orchestral_sections(*)')\n .eq('orchestral_sections.name', 'percussion')\n```", + "description": "If the filter on a referenced table's column is not satisfied, the referenced\ntable returns `[]` or `null` but the parent table is not filtered out.\nIf you want to filter out the parent table rows, use the `!inner` hint", + "data": { + "sql": "```sql\ncreate table\n orchestral_sections (id int8 primary key, name text);\ncreate table\n instruments (\n id int8 primary key,\n section_id int8 not null references orchestral_sections,\n name text\n );\n\ninsert into\n orchestral_sections (id, name)\nvalues\n (1, 'strings'),\n (2, 'woodwinds');\ninsert into\n instruments (id, section_id, name)\nvalues\n (1, 2, 'flute'),\n (2, 1, 'violin');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"name\": \"flute\",\n \"orchestral_sections\": null\n },\n {\n \"name\": \"violin\",\n \"orchestral_sections\": null\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + }, + { + "id": "querying-referenced-table-with-count", + "name": "Querying referenced table with count", + "code": "```ts\nconst { data, error } = await supabase\n .from('orchestral_sections')\n .select(`*, instruments(count)`)\n```", + "description": "You can get the number of rows in a related table by using the\n**count** property.", + "data": { + "sql": "```sql\ncreate table orchestral_sections (\n \"id\" \"uuid\" primary key default \"extensions\".\"uuid_generate_v4\"() not null,\n \"name\" text\n);\n\ncreate table characters (\n \"id\" \"uuid\" primary key default \"extensions\".\"uuid_generate_v4\"() not null,\n \"name\" text,\n \"section_id\" \"uuid\" references public.orchestral_sections on delete cascade\n);\n\nwith section as (\n insert into orchestral_sections (name)\n values ('strings') returning id\n)\ninsert into instruments (name, section_id) values\n('violin', (select id from section)),\n('viola', (select id from section)),\n('cello', (select id from section)),\n('double bass', (select id from section));\n```" + }, + "response": "```json\n[\n {\n \"id\": \"693694e7-d993-4360-a6d7-6294e325d9b6\",\n \"name\": \"strings\",\n \"instruments\": [\n {\n \"count\": 4\n }\n ]\n }\n]\n```" + }, + { + "id": "querying-with-count-option", + "name": "Querying with count option", + "code": "```ts\nconst { count, error } = await supabase\n .from('characters')\n .select('*', { count: 'exact', head: true })\n```", + "description": "You can get the number of rows by using the\n[count](/docs/reference/javascript/select#parameters) option.", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" + }, + "response": "```json\n{\n \"count\": 3,\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + }, + { + "id": "querying-json-data", + "name": "Querying JSON data", + "code": "```ts\nconst { data, error } = await supabase\n .from('users')\n .select(`\n id, name,\n address->city\n `)\n```", + "description": "You can select and filter data inside of\n[JSON](/docs/guides/database/json) columns. Postgres offers some\n[operators](/docs/guides/database/json#query-the-jsonb-data) for\nquerying JSON data.", + "data": { + "sql": "```sql\ncreate table\n users (\n id int8 primary key,\n name text,\n address jsonb\n );\n\ninsert into\n users (id, name, address)\nvalues\n (1, 'Frodo', '{\"city\":\"Hobbiton\"}');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"Frodo\",\n \"city\": \"Hobbiton\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + }, + { + "id": "querying-referenced-table-with-inner-join", + "name": "Querying referenced table with inner join", + "code": "```ts\nconst { data, error } = await supabase\n .from('instruments')\n .select('name, orchestral_sections!inner(name)')\n .eq('orchestral_sections.name', 'woodwinds')\n .limit(1)\n```", + "description": "If you don't want to return the referenced table contents, you can leave the parenthesis empty.\nLike `.select('name, orchestral_sections!inner()')`.", + "data": { + "sql": "```sql\ncreate table orchestral_sections (\n \"id\" \"uuid\" primary key default \"extensions\".\"uuid_generate_v4\"() not null,\n \"name\" text\n);\n\ncreate table instruments (\n \"id\" \"uuid\" primary key default \"extensions\".\"uuid_generate_v4\"() not null,\n \"name\" text,\n \"section_id\" \"uuid\" references public.orchestral_sections on delete cascade\n);\n\nwith section as (\n insert into orchestral_sections (name)\n values ('woodwinds') returning id\n)\ninsert into instruments (name, section_id) values\n('flute', (select id from section)),\n('clarinet', (select id from section)),\n('bassoon', (select id from section)),\n('piccolo', (select id from section));\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"name\": \"flute\",\n \"orchestral_sections\": {\"name\": \"woodwinds\"}\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + }, + { + "id": "switching-schemas-per-query", + "name": "Switching schemas per query", + "code": "```ts\nconst { data, error } = await supabase\n .schema('myschema')\n .from('mytable')\n .select()\n```", + "description": "In addition to setting the schema during initialization, you can also switch schemas on a per-query basis.\nMake sure you've set up your [database privileges and API settings](/docs/guides/api/using-custom-schemas).", + "data": { + "sql": "```sql\ncreate schema myschema;\n\ncreate table myschema.mytable (\n id uuid primary key default gen_random_uuid(),\n data text\n);\n\ninsert into myschema.mytable (data) values ('mydata');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"id\": \"4162e008-27b0-4c0f-82dc-ccaeee9a624d\",\n \"data\": \"mydata\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + } + ] + } + }, + "@supabase/supabase-js.PostgrestQueryBuilder.update": { + "name": "@supabase/supabase-js.PostgrestQueryBuilder.update", + "params": [ + { + "name": "values", + "type": { + "type": "nameOnly", + "name": "RejectExcessProperties" + }, + "comment": { + "shortText": "The values to update with" + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "count", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "exact" + }, + null, + { + "type": "literal", + "value": "planned" + }, + { + "type": "literal", + "value": "estimated" + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Count algorithm to use to count updated rows.\n\n`\"exact\"`: Exact but slow count algorithm. Performs a `COUNT(*)` under the\nhood.\n\n`\"planned\"`: Approximated but fast count algorithm. Uses the Postgres\nstatistics under the hood.\n\n`\"estimated\"`: Uses exact count for low numbers and planned count for high\nnumbers." + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Named parameters" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestFilterBuilder" + } + }, + "comment": { + "shortText": "Perform an UPDATE on the table or view.\n\nBy default, updated rows are not returned. To return it, chain the call\nwith `.select()` after filters.", + "text": "- `update()` should always be combined with [Filters](/docs/reference/javascript/using-filters) to target the item(s) you wish to update.", + "examples": [ + { + "id": "updating-your-data", + "name": "Updating your data", + "code": "```ts\nconst { error } = await supabase\n .from('instruments')\n .update({ name: 'piano' })\n .eq('id', 1)\n```", + "data": { + "sql": "```sql\ncreate table\n instruments (id int8 primary key, name text);\n\ninsert into\n instruments (id, name)\nvalues\n (1, 'harpsichord');\n```" + }, + "response": "```json\n{\n \"status\": 204,\n \"statusText\": \"No Content\"\n}\n```" + }, + { + "id": "handling-errors", + "name": "Handling errors", + "code": "```js\nconst { error } = await supabase.from('instruments').update({ name: 'piano' }).eq('id', 1)\nif (error) console.error(error)\n```", + "description": "`error.hint` from Postgres often contains the actionable fix (e.g. `\"Grant the required privileges to the current role with: GRANT UPDATE ON public.instruments TO anon;\"` for a `42501` permission-denied error). Log the full `error` object so it isn't hidden behind `error.message`." + }, + { + "id": "update-a-record-and-return-it", + "name": "Update a record and return it", + "code": "```ts\nconst { data, error } = await supabase\n .from('instruments')\n .update({ name: 'piano' })\n .eq('id', 1)\n .select()\n```", + "data": { + "sql": "```sql\ncreate table\n instruments (id int8 primary key, name text);\n\ninsert into\n instruments (id, name)\nvalues\n (1, 'harpsichord');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"piano\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + }, + { + "id": "updating-json-data", + "name": "Updating JSON data", + "code": "```ts\nconst { data, error } = await supabase\n .from('users')\n .update({\n address: {\n street: 'Melrose Place',\n postcode: 90210\n }\n })\n .eq('address->postcode', 90210)\n .select()\n```", + "description": "Postgres offers some\n[operators](/docs/guides/database/json#query-the-jsonb-data) for\nworking with JSON data. Currently, it is only possible to update the entire JSON document.", + "data": { + "sql": "```sql\ncreate table\n users (\n id int8 primary key,\n name text,\n address jsonb\n );\n\ninsert into\n users (id, name, address)\nvalues\n (1, 'Michael', '{ \"postcode\": 90210 }');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"Michael\",\n \"address\": {\n \"street\": \"Melrose Place\",\n \"postcode\": 90210\n }\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + } + ] + } + }, + "@supabase/supabase-js.PostgrestQueryBuilder.upsert": { + "name": "@supabase/supabase-js.PostgrestQueryBuilder.upsert", + "params": [ + { + "name": "values", + "type": { + "type": "union", + "subTypes": [ + { + "type": "nameOnly", + "name": "RejectExcessProperties" + }, + { + "type": "array", + "elemType": { + "type": "nameOnly", + "name": "RejectExcessProperties" + } + } + ] + }, + "comment": { + "shortText": "The values to upsert with. Pass an object to upsert a\nsingle row or an array to upsert multiple rows." + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "count", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "exact" + }, + null, + { + "type": "literal", + "value": "planned" + }, + { + "type": "literal", + "value": "estimated" + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Count algorithm to use to count upserted rows.\n\n`\"exact\"`: Exact but slow count algorithm. Performs a `COUNT(*)` under the\nhood.\n\n`\"planned\"`: Approximated but fast count algorithm. Uses the Postgres\nstatistics under the hood.\n\n`\"estimated\"`: Uses exact count for low numbers and planned count for high\nnumbers." + } + }, + { + "name": "defaultToNull", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "Make missing fields default to `null`.\nOtherwise, use the default value for the column. This only applies when\ninserting new rows, not when merging with existing rows under\n`ignoreDuplicates: false`. This also only applies when doing bulk upserts." + } + }, + { + "name": "ignoreDuplicates", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "If `true`, duplicate rows are ignored. If\n`false`, duplicate rows are merged with existing rows." + } + }, + { + "name": "onConflict", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Comma-separated UNIQUE column(s) to specify how\nduplicate rows are determined. Two rows are duplicates if all the\n`onConflict` columns are equal." + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Named parameters" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestFilterBuilder" + } + }, + "comment": { + "shortText": "Perform an UPSERT on the table or view. Depending on the column(s) passed\nto `onConflict`, `.upsert()` allows you to perform the equivalent of\n`.insert()` if a row with the corresponding `onConflict` columns doesn't\nexist, or if it does exist, perform an alternative action depending on\n`ignoreDuplicates`.\n\nBy default, upserted rows are not returned. To return it, chain the call\nwith `.select()`.", + "text": "- Primary keys must be included in `values` to use upsert.", + "examples": [ + { + "id": "upsert-a-single-row-using-a-unique-key", + "name": "Upsert a single row using a unique key", + "code": "```ts\n// Upserting a single row, overwriting based on the 'username' unique column\nconst { data, error } = await supabase\n .from('users')\n .upsert({ username: 'supabot' }, { onConflict: 'username' })\n\n// Example response:\n// {\n// data: [\n// { id: 4, message: 'bar', username: 'supabot' }\n// ],\n// error: null\n// }\n```" + }, + { + "id": "upsert-with-conflict-resolution-and-exact-row-counting", + "name": "Upsert with conflict resolution and exact row counting", + "code": "```ts\n// Upserting and returning exact count\nconst { data, error, count } = await supabase\n .from('users')\n .upsert(\n {\n id: 3,\n message: 'foo',\n username: 'supabot'\n },\n {\n onConflict: 'username',\n count: 'exact'\n }\n )\n\n// Example response:\n// {\n// data: [\n// {\n// id: 42,\n// handle: \"saoirse\",\n// display_name: \"Saoirse\"\n// }\n// ],\n// count: 1,\n// error: null\n// }\n```" + }, + { + "id": "upsert-your-data", + "name": "Upsert your data", + "code": "```ts\nconst { data, error } = await supabase\n .from('instruments')\n .upsert({ id: 1, name: 'piano' })\n .select()\n```", + "data": { + "sql": "```sql\ncreate table\n instruments (id int8 primary key, name text);\n\ninsert into\n instruments (id, name)\nvalues\n (1, 'harpsichord');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"piano\"\n }\n ],\n \"status\": 201,\n \"statusText\": \"Created\"\n}\n```" + }, + { + "id": "handling-errors", + "name": "Handling errors", + "code": "```js\nconst { data, error } = await supabase.from('instruments').upsert({ id: 1, name: 'piano' }).select()\nif (error) console.error(error)\n```", + "description": "`error.hint` from Postgres often contains the actionable fix (e.g. `\"Grant the required privileges to the current role with: GRANT INSERT, UPDATE ON public.instruments TO anon;\"` for a `42501` permission-denied error). Log the full `error` object so it isn't hidden behind `error.message`." + }, + { + "id": "bulk-upsert-your-data", + "name": "Bulk Upsert your data", + "code": "```ts\nconst { data, error } = await supabase\n .from('instruments')\n .upsert([\n { id: 1, name: 'piano' },\n { id: 2, name: 'harp' },\n ])\n .select()\n```", + "data": { + "sql": "```sql\ncreate table\n instruments (id int8 primary key, name text);\n\ninsert into\n instruments (id, name)\nvalues\n (1, 'harpsichord');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"piano\"\n },\n {\n \"id\": 2,\n \"name\": \"harp\"\n }\n ],\n \"status\": 201,\n \"statusText\": \"Created\"\n}\n```" + }, + { + "id": "upserting-into-tables-with-constraints", + "name": "Upserting into tables with constraints", + "code": "```ts\nconst { data, error } = await supabase\n .from('users')\n .upsert({ id: 42, handle: 'saoirse', display_name: 'Saoirse' })\n .select()\n```", + "description": "In the following query, `upsert()` implicitly uses the `id`\n(primary key) column to determine conflicts. If there is no existing\nrow with the same `id`, `upsert()` inserts a new row, which\nwill fail in this case as there is already a row with `handle` `\"saoirse\"`.\nUsing the `onConflict` option, you can instruct `upsert()` to use\nanother column with a unique constraint to determine conflicts.", + "data": { + "sql": "```sql\ncreate table\n users (\n id int8 generated by default as identity primary key,\n handle text not null unique,\n display_name text\n );\n\ninsert into\n users (id, handle, display_name)\nvalues\n (1, 'saoirse', null);\n```" + }, + "response": "```json\n{\n \"error\": {\n \"code\": \"23505\",\n \"details\": \"Key (handle)=(saoirse) already exists.\",\n \"hint\": null,\n \"message\": \"duplicate key value violates unique constraint \\\"users_handle_key\\\"\"\n },\n \"status\": 409,\n \"statusText\": \"Conflict\"\n}\n```" + } + ] + } + }, + "@supabase/supabase-js.PostgrestTransformBuilder.constructor": { + "name": "@supabase/supabase-js.PostgrestTransformBuilder.constructor", + "params": [ + { + "name": "builder", + "type": { + "type": "object", + "properties": [ + { + "name": "body", + "type": { + "type": "intrinsic", + "name": "unknown" + }, + "isOptional": true + }, + { + "name": "fetch", + "type": { + "type": "function", + "params": [ + { + "name": "input", + "type": { + "type": "union", + "subTypes": [ + { + "type": "nameOnly", + "name": "RequestInfo" + }, + { + "type": "nameOnly", + "name": "URL" + } + ] + } + }, + { + "name": "init", + "type": { + "type": "nameOnly", + "name": "RequestInit" + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "nameOnly", + "name": "Response" + } + } + }, + "comment": { + "shortText": "[MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch)" + } + }, + "isOptional": true + }, + { + "name": "headers", + "type": { + "type": "nameOnly", + "name": "HeadersInit" + } + }, + { + "name": "isMaybeSingle", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "method", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "GET" + }, + { + "type": "literal", + "value": "POST" + }, + { + "type": "literal", + "value": "PATCH" + }, + { + "type": "literal", + "value": "DELETE" + }, + { + "type": "literal", + "value": "HEAD" + } + ] + } + }, + { + "name": "retry", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "schema", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "shouldStripNulls", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "shouldThrowOnError", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "signal", + "type": { + "type": "nameOnly", + "name": "AbortSignal" + }, + "isOptional": true + }, + { + "name": "url", + "type": { + "type": "nameOnly", + "name": "URL" + } + }, + { + "name": "urlLengthLimit", + "type": { + "type": "intrinsic", + "name": "number" + }, + "isOptional": true + } + ] + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestTransformBuilder" + } + }, + "comment": { + "shortText": "Creates a builder configured for a specific PostgREST request.", + "examples": [ + { + "id": "using-supabase-js-recommended", + "name": "Using supabase-js (recommended)", + "code": "```ts\nimport { createClient } from '@supabase/supabase-js'\n\nconst supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key')\nconst { data, error } = await supabase.from('users').select('*')\n```" + }, + { + "id": "standalone-import-for-bundle-sensitive-environments", + "name": "Standalone import for bundle-sensitive environments", + "code": "```ts\nimport { PostgrestQueryBuilder } from '@supabase/postgrest-js'\n\nconst builder = new PostgrestQueryBuilder(\n new URL('https://xyzcompany.supabase.co/rest/v1/users'),\n { headers: new Headers({ apikey: 'your-publishable-key' }) }\n)\n```" + } + ] + } + }, + "@supabase/supabase-js.PostgrestTransformBuilder.abortSignal": { + "name": "@supabase/supabase-js.PostgrestTransformBuilder.abortSignal", + "params": [ + { + "name": "signal", + "type": { + "type": "nameOnly", + "name": "AbortSignal" + }, + "comment": { + "shortText": "The AbortSignal to use for the fetch request" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Set the AbortSignal for the fetch request.", + "text": "You can use this to set a timeout for the request.", + "examples": [ + { + "id": "aborting-requests-in-flight", + "name": "Aborting requests in-flight", + "code": "```ts\nconst ac = new AbortController()\n\nconst { data, error } = await supabase\n .from('very_big_table')\n .select()\n .abortSignal(ac.signal)\n\n// Abort the request after 100 ms\nsetTimeout(() => ac.abort(), 100)\n```", + "description": "You can use an [`AbortController`](https://developer.mozilla.org/en-US/docs/Web/API/AbortController) to abort requests.\nNote that `status` and `statusText` don't mean anything for aborted requests as the request wasn't fulfilled.", + "response": "```json\n {\n \"error\": {\n \"message\": \"AbortError: The user aborted a request.\",\n \"details\": \"\",\n \"hint\": \"The request was aborted locally via the provided AbortSignal.\",\n \"code\": \"\"\n },\n \"status\": 0,\n \"statusText\": \"\"\n }\n\n```" + }, + { + "id": "set-a-timeout", + "name": "Set a timeout", + "code": "```ts\nconst { data, error } = await supabase\n .from('very_big_table')\n .select()\n .abortSignal(AbortSignal.timeout(1000 /* ms */))\n```", + "response": "```json\n {\n \"error\": {\n \"message\": \"FetchError: The user aborted a request.\",\n \"details\": \"\",\n \"hint\": \"\",\n \"code\": \"\"\n },\n \"status\": 400,\n \"statusText\": \"Bad Request\"\n }\n\n```" + } + ] + } + }, + "@supabase/supabase-js.PostgrestTransformBuilder.csv": { + "name": "@supabase/supabase-js.PostgrestTransformBuilder.csv", + "params": [], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestBuilder" + } + }, + "comment": { + "shortText": "Return `data` as a string in CSV format.", + "examples": [ + { + "id": "return-data-as-csv", + "name": "Return data as CSV", + "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .csv()\n```", + "description": "By default, the data is returned in JSON format, but can also be returned as Comma Separated Values.", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" + }, + "response": "```json\n{\n \"data\": \"id,name\\n1,Luke\\n2,Leia\\n3,Han\",\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + } + ] + } + }, + "@supabase/supabase-js.PostgrestTransformBuilder.explain": { + "name": "@supabase/supabase-js.PostgrestTransformBuilder.explain", + "params": [ + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "analyze", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "If `true`, the query will be executed and the\nactual run time will be returned" + } + }, + { + "name": "buffers", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "If `true`, include information on buffer usage" + } + }, + { + "name": "format", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "text" + }, + { + "type": "literal", + "value": "json" + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "The format of the output, can be `\"text\"` (default)\nor `\"json\"`" + } + }, + { + "name": "settings", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "If `true`, include information on configuration\nparameters that affect query planning" + } + }, + { + "name": "verbose", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "If `true`, the query identifier will be returned\nand `data` will include the output columns of the query" + } + }, + { + "name": "wal", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "If `true`, include information on WAL record generation" + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Named parameters" + } + } + ], + "ret": { + "type": { + "type": "union", + "subTypes": [ + { + "type": "nameOnly", + "name": "PostgrestBuilder" + }, + { + "type": "nameOnly", + "name": "PostgrestBuilder" + } + ] + } + }, + "comment": { + "shortText": "Return `data` as the EXPLAIN plan for the query.\n\nYou need to enable the\n[db_plan_enabled](https://supabase.com/docs/guides/database/debugging-performance#enabling-explain)\nsetting before using this method.", + "examples": [ + { + "id": "get-the-execution-plan", + "name": "Get the execution plan", + "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .explain()\n```", + "description": "By default, the data is returned in TEXT format, but can also be returned as JSON by using the `format` parameter.", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" + }, + "response": "```js\nAggregate (cost=33.34..33.36 rows=1 width=112)\n -> Limit (cost=0.00..18.33 rows=1000 width=40)\n -> Seq Scan on characters (cost=0.00..22.00 rows=1200 width=40)\n```" + }, + { + "id": "get-the-execution-plan-with-analyze-and-verbose", + "name": "Get the execution plan with analyze and verbose", + "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .explain({analyze:true,verbose:true})\n```", + "description": "By default, the data is returned in TEXT format, but can also be returned as JSON by using the `format` parameter.", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" + }, + "response": "```js\nAggregate (cost=33.34..33.36 rows=1 width=112) (actual time=0.041..0.041 rows=1 loops=1)\n Output: NULL::bigint, count(ROW(characters.id, characters.name)), COALESCE(json_agg(ROW(characters.id, characters.name)), '[]'::json), NULLIF(current_setting('response.headers'::text, true), ''::text), NULLIF(current_setting('response.status'::text, true), ''::text)\n -> Limit (cost=0.00..18.33 rows=1000 width=40) (actual time=0.005..0.006 rows=3 loops=1)\n Output: characters.id, characters.name\n -> Seq Scan on public.characters (cost=0.00..22.00 rows=1200 width=40) (actual time=0.004..0.005 rows=3 loops=1)\n Output: characters.id, characters.name\nQuery Identifier: -4730654291623321173\nPlanning Time: 0.407 ms\nExecution Time: 0.119 ms\n```" + } + ] + } + }, + "@supabase/supabase-js.PostgrestTransformBuilder.geojson": { + "name": "@supabase/supabase-js.PostgrestTransformBuilder.geojson", + "params": [], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestBuilder" + } + }, + "comment": { + "shortText": "Return `data` as an object in [GeoJSON](https://geojson.org) format." + } + }, + "@supabase/supabase-js.PostgrestTransformBuilder.limit": { + "name": "@supabase/supabase-js.PostgrestTransformBuilder.limit", + "params": [ + { + "name": "rows", + "type": { + "type": "intrinsic", + "name": "number" + }, + "comment": { + "shortText": "The maximum number of rows to return" + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "foreignTable", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Deprecated, use `options.referencedTable`\ninstead" + } + }, + { + "name": "referencedTable", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Set this to limit rows of referenced\ntables instead of the parent table" + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Named parameters" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Limit the query result by `rows`.", + "examples": [ + { + "id": "with-select", + "name": "With `select()`", + "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select('name')\n .limit(1)\n```", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"name\": \"Luke\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + }, + { + "id": "on-a-referenced-table", + "name": "On a referenced table", + "code": "```ts\nconst { data, error } = await supabase\n .from('orchestral_sections')\n .select(`\n name,\n instruments (\n name\n )\n `)\n .limit(1, { referencedTable: 'instruments' })\n```", + "data": { + "sql": "```sql\ncreate table\n orchestral_sections (id int8 primary key, name text);\ncreate table\n instruments (\n id int8 primary key,\n section_id int8 not null references orchestral_sections,\n name text\n );\n\ninsert into\n orchestral_sections (id, name)\nvalues\n (1, 'strings');\ninsert into\n instruments (id, section_id, name)\nvalues\n (1, 1, 'harp'),\n (2, 1, 'violin');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"name\": \"strings\",\n \"instruments\": [\n {\n \"name\": \"violin\"\n }\n ]\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + } + ] + } + }, + "@supabase/supabase-js.PostgrestTransformBuilder.maxAffected": { + "name": "@supabase/supabase-js.PostgrestTransformBuilder.maxAffected", + "params": [ + { + "name": "rows", + "type": { + "type": "intrinsic", + "name": "number" + }, + "comment": { + "shortText": "The maximum number of rows that can be affected" + } + } + ], + "comment": { + "shortText": "Set the maximum number of rows that can be affected by the query.\nOnly available in PostgREST v13+ and only works with PATCH and DELETE methods." + } + }, + "@supabase/supabase-js.PostgrestTransformBuilder.maybeSingle": { + "name": "@supabase/supabase-js.PostgrestTransformBuilder.maybeSingle", + "params": [], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestBuilder" + } + }, + "comment": { + "shortText": "Return `data` as a single object instead of an array of objects.\n\nQuery result must be zero or one row (e.g. using `.limit(1)`), otherwise\nthis returns an error.", + "examples": [ + { + "id": "with-select", + "name": "With `select()`", + "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .eq('name', 'Katniss')\n .maybeSingle()\n```", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" + }, + "response": "```json\n{\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + } + ] + } + }, + "@supabase/supabase-js.PostgrestTransformBuilder.order": { + "name": "@supabase/supabase-js.PostgrestTransformBuilder.order", + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "ascending", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "nullsFirst", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "referencedTable", + "type": { + "type": "intrinsic", + "name": "undefined" + }, + "isOptional": true + } + ] + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "ascending", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "nullsFirst", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "referencedTable", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + } + ] + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + }, + { + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "ascending", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "foreignTable", + "type": { + "type": "intrinsic", + "name": "undefined" + }, + "isOptional": true + }, + { + "name": "nullsFirst", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + } + ] + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + }, + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "ascending", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "foreignTable", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "nullsFirst", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + } + ] + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + } + } + ] + }, + "@supabase/supabase-js.PostgrestTransformBuilder.overrideTypes": { + "name": "@supabase/supabase-js.PostgrestTransformBuilder.overrideTypes", + "params": [], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestBuilder" + } + }, + "comment": { + "shortText": "Override the type of the returned `data` field in the response.", + "examples": [ + { + "id": "example-1", + "name": "Example 1", + "code": "```typescript\n// Merge with existing types (default behavior)\nconst query = supabase\n .from('users')\n .select()\n .overrideTypes<{ custom_field: string }>()\n\n// Replace existing types completely\nconst replaceQuery = supabase\n .from('users')\n .select()\n .overrideTypes<{ id: number; name: string }, { merge: false }>()\n```" + }, + { + "id": "complete-override-type-of-successful-response", + "name": "Complete Override type of successful response", + "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .overrideTypes, { merge: false }>()\n```", + "response": "```ts\nlet x: typeof data // MyType[]\n```" + }, + { + "id": "complete-override-type-of-object-response", + "name": "Complete Override type of object response", + "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .maybeSingle()\n .overrideTypes()\n```", + "response": "```ts\nlet x: typeof data // MyType | null\n```" + }, + { + "id": "partial-override-type-of-successful-response", + "name": "Partial Override type of successful response", + "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .overrideTypes>()\n```", + "response": "```ts\nlet x: typeof data // Array\n```" + }, + { + "id": "partial-override-type-of-object-response", + "name": "Partial Override type of object response", + "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .maybeSingle()\n .overrideTypes<{ status: \"A\" | \"B\" }>()\n```", + "response": "```ts\nlet x: typeof data // CountryRowProperties & { status: \"A\" | \"B\" } | null\n```" + }, + { + "id": "merge-vs-replace-existing-types", + "name": "Merge vs replace existing types", + "code": "```typescript\n// Merge with existing types (default behavior)\nconst query = supabase\n .from('users')\n .select()\n .overrideTypes<{ custom_field: string }>()\n\n// Replace existing types completely\nconst replaceQuery = supabase\n .from('users')\n .select()\n .overrideTypes<{ id: number; name: string }, { merge: false }>()\n```" + } + ] + } + }, + "@supabase/supabase-js.PostgrestTransformBuilder.range": { + "name": "@supabase/supabase-js.PostgrestTransformBuilder.range", + "params": [ + { + "name": "from", + "type": { + "type": "intrinsic", + "name": "number" + }, + "comment": { + "shortText": "The starting index from which to limit the result" + } + }, + { + "name": "to", + "type": { + "type": "intrinsic", + "name": "number" + }, + "comment": { + "shortText": "The last index to which to limit the result" + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "foreignTable", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Deprecated, use `options.referencedTable`\ninstead" + } + }, + { + "name": "referencedTable", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Set this to limit rows of referenced\ntables instead of the parent table" + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Named parameters" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Limit the query result by starting at an offset `from` and ending at the offset `to`.\nOnly records within this range are returned.\nThis respects the query order and if there is no order clause the range could behave unexpectedly.\nThe `from` and `to` values are 0-based and inclusive: `range(1, 3)` will include the second, third\nand fourth rows of the query.", + "examples": [ + { + "id": "with-select", + "name": "With `select()`", + "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select('name')\n .range(0, 1)\n```", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"name\": \"Luke\"\n },\n {\n \"name\": \"Leia\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + } + ] + } + }, + "@supabase/supabase-js.PostgrestTransformBuilder.retry": { + "name": "@supabase/supabase-js.PostgrestTransformBuilder.retry", + "params": [ + { + "name": "enabled", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "comment": { + "shortText": "Whether to enable retries for this request" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "", + "examples": [ + { + "id": "example-1", + "name": "Example 1", + "code": "```ts\n// Disable retries for a specific query\nconst { data, error } = await supabase\n .from('users')\n .select()\n .retry(false)\n```" + } + ] + } + }, + "@supabase/supabase-js.PostgrestTransformBuilder.returns": { + "name": "@supabase/supabase-js.PostgrestTransformBuilder.returns", + "params": [], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestTransformBuilder" + } + }, + "comment": { + "shortText": "Override the type of the returned `data`.", + "text": "- Deprecated: use overrideTypes method instead", + "examples": [ + { + "id": "override-type-of-successful-response", + "name": "Override type of successful response", + "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .returns>()\n```", + "response": "```js\nlet x: typeof data // MyType[]\n```" + }, + { + "id": "override-type-of-object-response", + "name": "Override type of object response", + "code": "```ts\nconst { data } = await supabase\n .from('countries')\n .select()\n .maybeSingle()\n .returns()\n```", + "response": "```js\nlet x: typeof data // MyType | null\n```" + } + ] + } + }, + "@supabase/supabase-js.PostgrestTransformBuilder.rollback": { + "name": "@supabase/supabase-js.PostgrestTransformBuilder.rollback", + "params": [], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Dry-run this request: execute the query but discard the changes.\n\nServer-side, PostgREST runs the query inside a transaction and rolls it back\ninstead of committing. The response still contains the data that *would* have\nbeen returned — `RETURNING` clauses execute and RLS, triggers, and constraints\nare all evaluated — but no row is actually inserted, updated, or deleted.\n\nThis affects only the single request it is chained to. The JS caller has no\nhandle on the transaction: supabase-js does not group multiple queries into\none transaction. For multi-statement transactional logic, use a database\nfunction (`supabase.rpc(...)`).\n\nSets the `Prefer: tx=rollback` header. See PostgREST's docs on transaction\npreferences for the underlying mechanism.", + "examples": [ + { + "id": "validate-an-insert-without-persisting", + "name": "Validate an insert without persisting", + "code": "```ts\nconst { data, error } = await supabase\n .from('countries')\n .insert({ name: 'France' })\n .select()\n .rollback()\n// `data` shows what would have been inserted; nothing is saved.\n```" + } + ] + } + }, + "@supabase/supabase-js.PostgrestTransformBuilder.select": { + "name": "@supabase/supabase-js.PostgrestTransformBuilder.select", + "params": [ + { + "name": "columns", + "type": { + "type": "nameOnly", + "name": "Query" + }, + "isOptional": true, + "comment": { + "shortText": "The columns to retrieve, separated by commas" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestFilterBuilder" + } + }, + "comment": { + "shortText": "Perform a SELECT on the query result.\n\nBy default, `.insert()`, `.update()`, `.upsert()`, and `.delete()` do not\nreturn modified rows. By calling this method, modified rows are returned in\n`data`.", + "examples": [ + { + "id": "with-upsert", + "name": "With `upsert()`", + "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .upsert({ id: 1, name: 'Han Solo' })\n .select()\n```", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Han');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"Han Solo\"\n }\n ],\n \"status\": 201,\n \"statusText\": \"Created\"\n}\n```" + } + ] + } + }, + "@supabase/supabase-js.PostgrestTransformBuilder.setHeader": { + "name": "@supabase/supabase-js.PostgrestTransformBuilder.setHeader", + "params": [ + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "HTTP header name" + } + }, + { + "name": "value", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "HTTP header value" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Set an HTTP header on this single PostgREST request, overriding any header\nwith the same name set on the client.\n\nThis is an advanced escape hatch for one-off needs (passing a custom\n`Authorization` for a single query, attaching a tracing header, etc.).\nMost callers do not need it: configure client-wide headers via the\n`headers` option when constructing the client, and authentication via\nSupabase Auth." + } + }, + "@supabase/supabase-js.PostgrestTransformBuilder.single": { + "name": "@supabase/supabase-js.PostgrestTransformBuilder.single", + "params": [], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestBuilder" + } + }, + "comment": { + "shortText": "Return `data` as a single object instead of an array of objects.\n\nQuery result must be one row (e.g. using `.limit(1)`), otherwise this\nreturns an error.", + "examples": [ + { + "id": "with-select", + "name": "With `select()`", + "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select('name')\n .limit(1)\n .single()\n```", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text);\n\ninsert into\n characters (id, name)\nvalues\n (1, 'Luke'),\n (2, 'Leia'),\n (3, 'Han');\n```" + }, + "response": "```json\n{\n \"data\": {\n \"name\": \"Luke\"\n },\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + } + ] + } + }, + "@supabase/supabase-js.PostgrestTransformBuilder.stripNulls": { + "name": "@supabase/supabase-js.PostgrestTransformBuilder.stripNulls", + "params": [], + "ret": { + "type": { + "type": "intrinsic", + "name": "this" + } + }, + "comment": { + "shortText": "Strip null values from the response data. Properties with `null` values\nwill be omitted from the returned JSON objects.\n\nRequires PostgREST 11.2.0+.\n\nhttps://docs.postgrest.org/en/stable/references/api/resource_representation.html#stripped-nulls", + "examples": [ + { + "id": "with-select", + "name": "With `select()`", + "code": "```ts\nconst { data, error } = await supabase\n .from('characters')\n .select()\n .stripNulls()\n```", + "data": { + "sql": "```sql\ncreate table\n characters (id int8 primary key, name text, bio text);\n\ninsert into\n characters (id, name, bio)\nvalues\n (1, 'Luke', null),\n (2, 'Leia', 'Princess of Alderaan');\n```" + }, + "response": "```json\n{\n \"data\": [\n {\n \"id\": 1,\n \"name\": \"Luke\"\n },\n {\n \"id\": 2,\n \"name\": \"Leia\",\n \"bio\": \"Princess of Alderaan\"\n }\n ],\n \"status\": 200,\n \"statusText\": \"OK\"\n}\n```" + } + ] + } + }, + "@supabase/supabase-js.PostgrestTransformBuilder.then": { + "name": "@supabase/supabase-js.PostgrestTransformBuilder.then", + "params": [ + { + "name": "onfulfilled", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "function", + "params": [ + { + "name": "value" + } + ], + "ret": { + "type": { + "type": "union", + "subTypes": [ + { + "type": "nameOnly", + "name": "TResult1" + }, + { + "type": "nameOnly", + "name": "PromiseLike" + } + ] + } + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "The callback to execute when the Promise is resolved." + } + }, + { + "name": "onrejected", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "function", + "params": [ + { + "name": "reason", + "type": { + "type": "intrinsic", + "name": "any" + } + } + ], + "ret": { + "type": { + "type": "union", + "subTypes": [ + { + "type": "nameOnly", + "name": "TResult2" + }, + { + "type": "nameOnly", + "name": "PromiseLike" + } + ] + } + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "The callback to execute when the Promise is rejected." + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "PromiseLike" + } + }, + "comment": { + "shortText": "Attaches callbacks for the resolution and/or rejection of the Promise." + } + }, + "@supabase/supabase-js.PostgrestTransformBuilder.throwOnError": { + "name": "@supabase/supabase-js.PostgrestTransformBuilder.throwOnError", + "params": [], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestTransformBuilder" + } + }, + "comment": { + "shortText": "If there's an error with the query, throwOnError will reject the promise by\nthrowing the error instead of returning it as part of a successful response.\n\nhttps://github.com/supabase/supabase-js/issues/92" + } + }, + "@supabase/supabase-js.RealtimeChannel.constructor": { + "name": "@supabase/supabase-js.RealtimeChannel.constructor", + "params": [ + { + "name": "topic", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Topic name can be any string." + } + }, + { + "name": "params", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "name": "RealtimeChannelOptions", + "type": "object", + "properties": [ + { + "name": "config", + "type": { + "type": "object", + "properties": [ + { + "name": "broadcast", + "type": { + "type": "object", + "properties": [ + { + "name": "ack", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "replay", + "type": { + "type": "nameOnly", + "name": "ReplayOption" + }, + "isOptional": true + }, + { + "name": "self", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "self option enables client to receive message it broadcast\nack option instructs server to acknowledge that broadcast message was received\nreplay option instructs server to replay broadcast messages" + } + }, + { + "name": "presence", + "type": { + "type": "object", + "properties": [ + { + "name": "enabled", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "key", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "key option is used to track presence payload across clients" + } + }, + { + "name": "private", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "defines if the channel is private or not and if RLS policies will be used to check data" + } + } + ] + } + } + ] + } + ] + } + }, + { + "name": "socket", + "type": { + "type": "nameOnly", + "name": "RealtimeClient" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "RealtimeChannel" + } + }, + "comment": { + "shortText": "Creates a channel that can broadcast messages, sync presence, and listen to Postgres changes.\n\nThe topic determines which realtime stream you are subscribing to. Config options let you\nenable acknowledgement for broadcasts, presence tracking, or private channels.", + "examples": [ + { + "id": "using-supabase-js-recommended", + "name": "Using supabase-js (recommended)", + "code": "```ts\nimport { createClient } from '@supabase/supabase-js'\n\nconst supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key')\nconst channel = supabase.channel('room1')\nchannel\n .on('broadcast', { event: 'cursor-pos' }, (payload) => console.log(payload))\n .subscribe()\n```" + }, + { + "id": "standalone-import-for-bundle-sensitive-environments", + "name": "Standalone import for bundle-sensitive environments", + "code": "```ts\nimport RealtimeClient from '@supabase/realtime-js'\n\nconst client = new RealtimeClient('https://xyzcompany.supabase.co/realtime/v1', {\n params: { apikey: 'your-publishable-key' },\n})\nconst channel = new RealtimeChannel('realtime:public:messages', { config: {} }, client)\n```" + } + ] + } + }, + "@supabase/supabase-js.RealtimeChannel.copyBindings": { + "name": "@supabase/supabase-js.RealtimeChannel.copyBindings", + "params": [ + { + "name": "other", + "type": { + "type": "nameOnly", + "name": "RealtimeChannel" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + } + }, + "@supabase/supabase-js.RealtimeChannel.httpSend": { + "name": "@supabase/supabase-js.RealtimeChannel.httpSend", + "params": [ + { + "name": "event", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The name of the broadcast event" + } + }, + { + "name": "payload", + "type": { + "type": "intrinsic", + "name": "any" + }, + "comment": { + "shortText": "Payload to be sent (required)" + } + }, + { + "name": "opts", + "type": { + "type": "object", + "properties": [ + { + "name": "timeout", + "type": { + "type": "intrinsic", + "name": "number" + }, + "isOptional": true + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Options including timeout" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "success", + "type": { + "type": "literal", + "value": true + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "error", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "status", + "type": { + "type": "intrinsic", + "name": "number" + } + }, + { + "name": "success", + "type": { + "type": "literal", + "value": false + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Sends a broadcast message explicitly via REST API.\n\nThis method always uses the REST API endpoint regardless of WebSocket connection state.\nUseful when you want to guarantee REST delivery or when gradually migrating from implicit REST fallback.\n\nPayloads that are `ArrayBuffer` or `ArrayBufferView` (e.g. `Uint8Array`) are sent as\n`application/octet-stream`; all other payloads are JSON-encoded." + } + }, + "@supabase/supabase-js.RealtimeChannel.on": { + "name": "@supabase/supabase-js.RealtimeChannel.on", + "params": [ + { + "name": "type", + "type": { + "type": "literal", + "value": "presence" + } + }, + { + "name": "filter", + "type": { + "type": "object", + "properties": [ + { + "name": "event", + "type": { + "type": "literal", + "value": "sync" + } + } + ] + } + }, + { + "name": "callback", + "type": { + "type": "function", + "params": [], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + } + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "RealtimeChannel" + } + }, + "comment": { + "shortText": "Creates an event handler that listens to changes." + }, + "altSignatures": [ + { + "params": [ + { + "name": "type", + "type": { + "type": "literal", + "value": "presence" + } + }, + { + "name": "filter", + "type": { + "type": "object", + "properties": [ + { + "name": "event", + "type": { + "type": "literal", + "value": "join" + } + } + ] + } + }, + { + "name": "callback", + "type": { + "type": "function", + "params": [ + { + "name": "payload", + "type": { + "name": "RealtimePresenceJoinPayload", + "type": "object", + "properties": [ + { + "name": "currentPresences", + "type": { + "type": "array", + "elemType": { + "type": "nameOnly", + "name": "Presence" + } + } + }, + { + "name": "event" + }, + { + "name": "key", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "newPresences", + "type": { + "type": "array", + "elemType": { + "type": "nameOnly", + "name": "Presence" + } + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + } + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "RealtimeChannel" + } + } + }, + { + "params": [ + { + "name": "type", + "type": { + "type": "literal", + "value": "presence" + } + }, + { + "name": "filter", + "type": { + "type": "object", + "properties": [ + { + "name": "event", + "type": { + "type": "literal", + "value": "leave" + } + } + ] + } + }, + { + "name": "callback", + "type": { + "type": "function", + "params": [ + { + "name": "payload", + "type": { + "name": "RealtimePresenceLeavePayload", + "type": "object", + "properties": [ + { + "name": "currentPresences", + "type": { + "type": "array", + "elemType": { + "type": "nameOnly", + "name": "Presence" + } + } + }, + { + "name": "event" + }, + { + "name": "key", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "leftPresences", + "type": { + "type": "array", + "elemType": { + "type": "nameOnly", + "name": "Presence" + } + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + } + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "RealtimeChannel" + } + } + }, + { + "params": [ + { + "name": "type", + "type": { + "type": "literal", + "value": "presence" + } + }, + { + "name": "filter", + "type": { + "type": "object", + "properties": [ + { + "name": "event", + "type": { + "type": "literal", + "value": "*" + } + } + ] + } + }, + { + "name": "callback", + "type": { + "type": "function", + "params": [ + { + "name": "payload", + "type": { + "type": "union", + "subTypes": [ + { + "name": "RealtimePresenceJoinPayload", + "type": "object", + "properties": [ + { + "name": "currentPresences", + "type": { + "type": "array", + "elemType": { + "type": "nameOnly", + "name": "Presence" + } + } + }, + { + "name": "event" + }, + { + "name": "key", + "type": "[Circular]" + }, + { + "name": "newPresences", + "type": { + "type": "array", + "elemType": { + "type": "nameOnly", + "name": "Presence" + } + } + } + ] + }, + { + "name": "RealtimePresenceLeavePayload", + "type": "object", + "properties": [ + { + "name": "currentPresences", + "type": { + "type": "array", + "elemType": { + "type": "nameOnly", + "name": "Presence" + } + } + }, + { + "name": "event" + }, + { + "name": "key", + "type": "[Circular]" + }, + { + "name": "leftPresences", + "type": { + "type": "array", + "elemType": { + "type": "nameOnly", + "name": "Presence" + } + } + } + ] + } + ] + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + } + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "RealtimeChannel" + } + } + }, + { + "params": [ + { + "name": "type", + "type": { + "type": "literal", + "value": "postgres_changes" + } + }, + { + "name": "filter", + "type": { + "name": "RealtimePostgresChangesFilter", + "type": "object", + "properties": [ + { + "name": "event", + "type": { + "type": "literal", + "value": "*" + }, + "comment": { + "shortText": "The type of database change to listen to." + } + }, + { + "name": "filter", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Receive database changes when filter is matched." + } + }, + { + "name": "schema", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The database schema to listen to." + } + }, + { + "name": "table", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "The database table to listen to." + } + } + ] + } + }, + { + "name": "callback", + "type": { + "type": "function", + "params": [ + { + "name": "payload", + "type": { + "type": "union", + "name": "RealtimePostgresChangesPayload", + "subTypes": [ + { + "type": "nameOnly", + "name": "RealtimePostgresInsertPayload" + }, + { + "type": "nameOnly", + "name": "RealtimePostgresUpdatePayload" + }, + { + "type": "nameOnly", + "name": "RealtimePostgresDeletePayload" + } + ] + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + } + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "RealtimeChannel" + } + } + }, + { + "params": [ + { + "name": "type", + "type": { + "type": "literal", + "value": "postgres_changes" + } + }, + { + "name": "filter", + "type": { + "name": "RealtimePostgresChangesFilter", + "type": "object", + "properties": [ + { + "name": "event", + "type": { + "type": "literal", + "value": "INSERT" + }, + "comment": { + "shortText": "The type of database change to listen to." + } + }, + { + "name": "filter", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Receive database changes when filter is matched." + } + }, + { + "name": "schema", + "type": "[Circular]", + "comment": { + "shortText": "The database schema to listen to." + } + }, + { + "name": "table", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The database table to listen to." + } + } + ] + } + }, + { + "name": "callback", + "type": { + "type": "function", + "params": [ + { + "name": "payload", + "type": { + "type": "nameOnly", + "name": "RealtimePostgresInsertPayload" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + } + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "RealtimeChannel" + } + } + }, + { + "params": [ + { + "name": "type", + "type": { + "type": "literal", + "value": "postgres_changes" + } + }, + { + "name": "filter", + "type": { + "name": "RealtimePostgresChangesFilter", + "type": "object", + "properties": [ + { + "name": "event", + "type": { + "type": "literal", + "value": "UPDATE" + }, + "comment": { + "shortText": "The type of database change to listen to." + } + }, + { + "name": "filter", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Receive database changes when filter is matched." + } + }, + { + "name": "schema", + "type": "[Circular]", + "comment": { + "shortText": "The database schema to listen to." + } + }, + { + "name": "table", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The database table to listen to." + } + } + ] + } + }, + { + "name": "callback", + "type": { + "type": "function", + "params": [ + { + "name": "payload", + "type": { + "type": "nameOnly", + "name": "RealtimePostgresUpdatePayload" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + } + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "RealtimeChannel" + } + } + }, + { + "params": [ + { + "name": "type", + "type": { + "type": "literal", + "value": "postgres_changes" + } + }, + { + "name": "filter", + "type": { + "name": "RealtimePostgresChangesFilter", + "type": "object", + "properties": [ + { + "name": "event", + "type": { + "type": "literal", + "value": "DELETE" + }, + "comment": { + "shortText": "The type of database change to listen to." + } + }, + { + "name": "filter", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Receive database changes when filter is matched." + } + }, + { + "name": "schema", + "type": "[Circular]", + "comment": { + "shortText": "The database schema to listen to." + } + }, + { + "name": "table", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The database table to listen to." + } + } + ] + } + }, + { + "name": "callback", + "type": { + "type": "function", + "params": [ + { + "name": "payload", + "type": { + "type": "nameOnly", + "name": "RealtimePostgresDeletePayload" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + } + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "RealtimeChannel" + } + } + }, + { + "params": [ + { + "name": "type", + "type": { + "type": "literal", + "value": "postgres_changes" + } + }, + { + "name": "filter", + "type": { + "name": "RealtimePostgresChangesFilter", + "type": "object", + "properties": [ + { + "name": "event", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "DELETE" + }, + { + "type": "literal", + "value": "*" + }, + { + "type": "literal", + "value": "INSERT" + }, + { + "type": "literal", + "value": "UPDATE" + } + ] + }, + "comment": { + "shortText": "The type of database change to listen to." + } + }, + { + "name": "filter", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Receive database changes when filter is matched." + } + }, + { + "name": "schema", + "type": "[Circular]", + "comment": { + "shortText": "The database schema to listen to." + } + }, + { + "name": "table", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The database table to listen to." + } + } + ] + } + }, + { + "name": "callback", + "type": { + "type": "function", + "params": [ + { + "name": "payload", + "type": { + "type": "union", + "name": "RealtimePostgresChangesPayload", + "subTypes": [ + { + "type": "nameOnly", + "name": "RealtimePostgresInsertPayload" + }, + { + "type": "nameOnly", + "name": "RealtimePostgresUpdatePayload" + }, + { + "type": "nameOnly", + "name": "RealtimePostgresDeletePayload" + } + ] + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + } + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "RealtimeChannel" + } + } + }, + { + "params": [ + { + "name": "type", + "type": { + "type": "literal", + "value": "broadcast" + }, + "comment": { + "shortText": "One of \"broadcast\", \"presence\", or \"postgres_changes\"." + } + }, + { + "name": "filter", + "type": { + "type": "object", + "properties": [ + { + "name": "event", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + }, + "comment": { + "shortText": "Custom object specific to the Realtime feature detailing which payloads to receive." + } + }, + { + "name": "callback", + "type": { + "type": "function", + "params": [ + { + "name": "payload", + "type": { + "type": "object", + "properties": [ + { + "name": "event", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "meta", + "type": { + "type": "object", + "properties": [ + { + "name": "id", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "replayed", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + } + ] + }, + "isOptional": true + }, + { + "name": "type", + "type": { + "type": "literal", + "value": "broadcast" + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + } + }, + "comment": { + "shortText": "Function to be invoked when event handler is triggered." + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "RealtimeChannel" + } + } + }, + { + "params": [ + { + "name": "type", + "type": { + "type": "literal", + "value": "broadcast" + } + }, + { + "name": "filter", + "type": { + "type": "object", + "properties": [ + { + "name": "event", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + } + }, + { + "name": "callback", + "type": { + "type": "function", + "params": [ + { + "name": "payload", + "type": { + "type": "object", + "properties": [ + { + "name": "event", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "meta", + "type": { + "type": "object", + "properties": [ + { + "name": "id", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "replayed", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + } + ] + }, + "isOptional": true + }, + { + "name": "payload", + "type": { + "type": "nameOnly", + "name": "T" + } + }, + { + "name": "type", + "type": { + "type": "literal", + "value": "broadcast" + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + } + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "RealtimeChannel" + } + } + }, + { + "params": [ + { + "name": "type", + "type": { + "type": "literal", + "value": "broadcast" + } + }, + { + "name": "filter", + "type": { + "type": "object", + "properties": [ + { + "name": "event", + "type": { + "type": "literal", + "value": "*", + "name": "ALL" + } + } + ] + } + }, + { + "name": "callback", + "type": { + "type": "function", + "params": [ + { + "name": "payload", + "type": { + "type": "object", + "properties": [ + { + "name": "event", + "type": "[Circular]" + }, + { + "name": "payload", + "type": { + "type": "nameOnly", + "name": "RealtimeBroadcastPayload" + } + }, + { + "name": "type", + "type": { + "type": "literal", + "value": "broadcast" + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + } + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "RealtimeChannel" + } + } + }, + { + "params": [ + { + "name": "type", + "type": { + "type": "literal", + "value": "broadcast" + } + }, + { + "name": "filter", + "type": { + "type": "object", + "properties": [ + { + "name": "event", + "type": { + "type": "literal", + "value": "INSERT", + "name": "INSERT" + } + } + ] + } + }, + { + "name": "callback", + "type": { + "type": "function", + "params": [ + { + "name": "payload", + "type": { + "type": "object", + "properties": [ + { + "name": "event", + "type": "[Circular]" + }, + { + "name": "payload", + "type": { + "type": "nameOnly", + "name": "RealtimeBroadcastInsertPayload" + } + }, + { + "name": "type", + "type": { + "type": "literal", + "value": "broadcast" + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + } + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "RealtimeChannel" + } + } + }, + { + "params": [ + { + "name": "type", + "type": { + "type": "literal", + "value": "broadcast" + } + }, + { + "name": "filter", + "type": { + "type": "object", + "properties": [ + { + "name": "event", + "type": { + "type": "literal", + "value": "UPDATE", + "name": "UPDATE" + } + } + ] + } + }, + { + "name": "callback", + "type": { + "type": "function", + "params": [ + { + "name": "payload", + "type": { + "type": "object", + "properties": [ + { + "name": "event", + "type": "[Circular]" + }, + { + "name": "payload", + "type": { + "type": "nameOnly", + "name": "RealtimeBroadcastUpdatePayload" + } + }, + { + "name": "type", + "type": { + "type": "literal", + "value": "broadcast" + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + } + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "RealtimeChannel" + } + } + }, + { + "params": [ + { + "name": "type", + "type": { + "type": "literal", + "value": "broadcast" + } + }, + { + "name": "filter", + "type": { + "type": "object", + "properties": [ + { + "name": "event", + "type": { + "type": "literal", + "value": "DELETE", + "name": "DELETE" + } + } + ] + } + }, + { + "name": "callback", + "type": { + "type": "function", + "params": [ + { + "name": "payload", + "type": { + "type": "object", + "properties": [ + { + "name": "event", + "type": "[Circular]" + }, + { + "name": "payload", + "type": { + "type": "nameOnly", + "name": "RealtimeBroadcastDeletePayload" + } + }, + { + "name": "type", + "type": { + "type": "literal", + "value": "broadcast" + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + } + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "RealtimeChannel" + } + } + }, + { + "params": [ + { + "name": "type", + "type": { + "type": "literal", + "value": "system" + } + }, + { + "name": "filter" + }, + { + "name": "callback", + "type": { + "type": "function", + "params": [ + { + "name": "payload", + "type": { + "type": "intrinsic", + "name": "any" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + } + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "RealtimeChannel" + } + } + } + ] + }, + "@supabase/supabase-js.RealtimeChannel.presenceState": { + "name": "@supabase/supabase-js.RealtimeChannel.presenceState", + "params": [], + "ret": { + "type": { + "name": "RealtimePresenceState", + "type": "index signature", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "array", + "elemType": { + "type": "nameOnly", + "name": "Presence" + } + } + } + }, + "comment": { + "shortText": "Returns the current presence state for this channel.\n\nThe shape is a map keyed by presence key (for example a user id) where each entry contains the\ntracked metadata for that user." + } + }, + "@supabase/supabase-js.RealtimeChannel.send": { + "name": "@supabase/supabase-js.RealtimeChannel.send", + "params": [ + { + "name": "args", + "type": { + "type": "object", + "properties": [ + { + "name": "event", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The name of the event being sent" + } + }, + { + "name": "payload", + "type": { + "type": "intrinsic", + "name": "any" + }, + "isOptional": true, + "comment": { + "shortText": "Payload to be sent" + } + }, + { + "name": "type", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "broadcast" + }, + { + "type": "literal", + "value": "presence" + }, + { + "type": "literal", + "value": "postgres_changes" + } + ] + }, + "comment": { + "shortText": "The type of event to send" + } + } + ] + }, + "comment": { + "shortText": "Arguments to send to channel" + } + }, + { + "name": "opts", + "type": { + "type": "index signature", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "any" + } + }, + "isOptional": true, + "comment": { + "shortText": "Options to be used during the send process" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "RealtimeChannelSendResponse", + "subTypes": [ + { + "type": "literal", + "value": "ok" + }, + { + "type": "literal", + "value": "timed out" + }, + { + "type": "literal", + "value": "error" + }, + null + ] + } + } + }, + "comment": { + "shortText": "Sends a message into the channel.", + "text": "- When using REST you don't need to subscribe to the channel\n- REST calls are only available from 2.37.0 onwards\n- If you create a channel only to send a REST broadcast, remove it from\n the client when the send completes", + "examples": [ + { + "id": "send-a-message-via-websocket", + "name": "Send a message via websocket", + "code": "```js\nconst channel = supabase.channel('room1')\n\nchannel.subscribe((status) => {\n if (status === 'SUBSCRIBED') {\n channel.send({\n type: 'broadcast',\n event: 'cursor-pos',\n payload: { x: Math.random(), y: Math.random() },\n })\n }\n})\n```", + "response": "```js\nok | timed out | error\n```" + }, + { + "id": "send-a-message-via-rest", + "name": "Send a message via REST", + "code": "```js\nconst channel = supabase.channel('room1')\n\ntry {\n await channel.httpSend('cursor-pos', { x: Math.random(), y: Math.random() })\n} finally {\n await supabase.removeChannel(channel)\n}\n```" + } + ] + } + }, + "@supabase/supabase-js.RealtimeChannel.subscribe": { + "name": "@supabase/supabase-js.RealtimeChannel.subscribe", + "params": [ + { + "name": "callback", + "type": { + "type": "function", + "params": [ + { + "name": "status", + "type": { + "type": "nameOnly", + "name": "REALTIME_SUBSCRIBE_STATES" + } + }, + { + "name": "err", + "type": { + "type": "nameOnly", + "name": "Error" + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + } + }, + "isOptional": true + }, + { + "name": "timeout", + "type": { + "type": "intrinsic", + "name": "number" + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "RealtimeChannel" + } + }, + "comment": { + "shortText": "Subscribe registers your client with the server.\n\nThe optional `callback` receives a `status` and, on failure, an `err` argument.\nLog the full `err` so its `cause`, `name`, and any structured fields aren't hidden\nbehind `err.message`.", + "examples": [ + { + "id": "handling-errors", + "name": "Handling errors", + "code": "```js\nsupabase.channel('room1').subscribe((status, err) => {\n if (status === 'CHANNEL_ERROR' || status === 'TIMED_OUT') {\n // Log the full error: its `cause` often holds the underlying reason.\n console.error(status, err)\n }\n})\n```" + } + ] + } + }, + "@supabase/supabase-js.RealtimeChannel.teardown": { + "name": "@supabase/supabase-js.RealtimeChannel.teardown", + "params": [], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + }, + "comment": { + "shortText": "Destroys and stops related timers." + } + }, + "@supabase/supabase-js.RealtimeChannel.track": { + "name": "@supabase/supabase-js.RealtimeChannel.track", + "params": [ + { + "name": "payload", + "type": { + "type": "index signature", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "any" + } + } + }, + { + "name": "opts", + "type": { + "type": "index signature", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "any" + } + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "RealtimeChannelSendResponse", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]", + null + ] + } + } + }, + "comment": { + "shortText": "Sends the supplied payload to the presence tracker so other subscribers can see that this\nclient is online. Use `untrack` to stop broadcasting presence for the same key." + } + }, + "@supabase/supabase-js.RealtimeChannel.unsubscribe": { + "name": "@supabase/supabase-js.RealtimeChannel.unsubscribe", + "params": [ + { + "name": "timeout", + "type": { + "type": "intrinsic", + "name": "number" + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "RealtimeChannelSendResponse", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]", + null + ] + } + } + }, + "comment": { + "shortText": "Leaves the channel.\n\nUnsubscribes from server events, and instructs channel to terminate on server.\nTriggers onClose() hooks.\n\nTo receive leave acknowledgements, use the a `receive` hook to bind to the server ack, ie:\nchannel.unsubscribe().receive(\"ok\", () => alert(\"left!\") )" + } + }, + "@supabase/supabase-js.RealtimeChannel.untrack": { + "name": "@supabase/supabase-js.RealtimeChannel.untrack", + "params": [ + { + "name": "opts", + "type": { + "type": "index signature", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "any" + } + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "RealtimeChannelSendResponse", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]", + null + ] + } + } + }, + "comment": { + "shortText": "Removes the current presence state for this client." + } + }, + "@supabase/supabase-js.RealtimeChannel.updateJoinPayload": { + "name": "@supabase/supabase-js.RealtimeChannel.updateJoinPayload", + "params": [ + { + "name": "payload", + "type": { + "type": "record", + "name": "Record", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "any" + } + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + }, + "comment": { + "shortText": "Updates the payload that will be sent the next time the channel joins (reconnects).\nUseful for rotating access tokens or updating config without re-creating the channel." + } + }, + "@supabase/supabase-js.RealtimeClient.constructor": { + "name": "@supabase/supabase-js.RealtimeClient.constructor", + "params": [ + { + "name": "endPoint", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The string WebSocket endpoint, ie, \"ws://example.com/socket\", \"wss://example.com\", \"/socket\" (inherited host & protocol)" + } + }, + { + "name": "options", + "type": { + "name": "RealtimeClientOptions", + "type": "object", + "properties": [ + { + "name": "accessToken", + "type": { + "type": "function", + "params": [], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "string" + }, + { + "type": "literal", + "value": null + } + ] + } + } + } + }, + "isOptional": true + }, + { + "name": "decode", + "type": { + "type": "nameOnly", + "name": "Decode" + }, + "isOptional": true + }, + { + "name": "disconnectOnEmptyChannelsAfterMs", + "type": { + "type": "intrinsic", + "name": "number" + }, + "isOptional": true + }, + { + "name": "encode", + "type": { + "type": "nameOnly", + "name": "Encode" + }, + "isOptional": true + }, + { + "name": "fetch", + "type": { + "type": "nameOnly", + "name": "Fetch" + }, + "isOptional": true + }, + { + "name": "headers", + "type": { + "type": "index signature", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "string" + } + }, + "isOptional": true + }, + { + "name": "heartbeatCallback", + "type": { + "type": "function", + "params": [ + { + "name": "status", + "type": { + "type": "nameOnly", + "name": "HeartbeatStatus" + } + }, + { + "name": "latency", + "type": { + "type": "intrinsic", + "name": "number" + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + } + }, + "isOptional": true + }, + { + "name": "heartbeatIntervalMs", + "type": { + "type": "intrinsic", + "name": "number" + }, + "isOptional": true + }, + { + "name": "log_level", + "type": { + "type": "nameOnly", + "name": "LogLevel" + }, + "isOptional": true + }, + { + "name": "logger", + "type": { + "type": "function", + "params": [ + { + "name": "kind", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "msg", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "data", + "type": { + "type": "intrinsic", + "name": "any" + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + } + }, + "isOptional": true + }, + { + "name": "logLevel", + "type": { + "type": "nameOnly", + "name": "LogLevel" + }, + "isOptional": true + }, + { + "name": "params", + "type": { + "type": "index signature", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "any" + } + }, + "isOptional": true + }, + { + "name": "reconnectAfterMs", + "type": { + "type": "function", + "params": [ + { + "name": "tries", + "type": { + "type": "intrinsic", + "name": "number" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "number" + } + } + }, + "isOptional": true + }, + { + "name": "sessionStorage", + "type": { + "type": "nameOnly", + "name": "Storage" + }, + "isOptional": true, + "comment": { + "shortText": "Storage compatible object used by the underlying socket for longpoll fallback history.\nProvide a custom implementation in environments where reading `globalThis.sessionStorage`\nthrows (sandboxed iframes, in-app webviews, \"block third-party storage\" privacy modes).\nDefaults to `globalThis.sessionStorage` when accessible, otherwise an in-memory store." + } + }, + { + "name": "timeout", + "type": { + "type": "intrinsic", + "name": "number" + }, + "isOptional": true + }, + { + "name": "transport", + "type": { + "type": "object", + "name": "WebSocketLikeConstructor", + "properties": [] + }, + "isOptional": true + }, + { + "name": "vsn", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "worker", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "workerUrl", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + } + ] + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "RealtimeClient" + } + }, + "comment": { + "shortText": "Initializes the Socket.", + "examples": [ + { + "id": "using-supabase-js-recommended", + "name": "Using supabase-js (recommended)", + "code": "```ts\nimport { createClient } from '@supabase/supabase-js'\n\nconst supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key')\nconst channel = supabase.channel('room1')\nchannel\n .on('broadcast', { event: 'cursor-pos' }, (payload) => console.log(payload))\n .subscribe()\n```" + }, + { + "id": "standalone-import-for-bundle-sensitive-environments", + "name": "Standalone import for bundle-sensitive environments", + "code": "```ts\nimport RealtimeClient from '@supabase/realtime-js'\n\nconst client = new RealtimeClient('https://xyzcompany.supabase.co/realtime/v1', {\n params: { apikey: 'your-publishable-key' },\n})\nclient.connect()\n```" + } + ] + } + }, + "@supabase/supabase-js.RealtimeClient.channel": { + "name": "@supabase/supabase-js.RealtimeClient.channel", + "params": [ + { + "name": "topic", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "params", + "type": { + "name": "RealtimeChannelOptions", + "type": "object", + "properties": [ + { + "name": "config", + "type": { + "type": "object", + "properties": [ + { + "name": "broadcast", + "type": { + "type": "object", + "properties": [ + { + "name": "ack", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "replay", + "type": { + "type": "nameOnly", + "name": "ReplayOption" + }, + "isOptional": true + }, + { + "name": "self", + "type": "[Circular]", + "isOptional": true + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "self option enables client to receive message it broadcast\nack option instructs server to acknowledge that broadcast message was received\nreplay option instructs server to replay broadcast messages" + } + }, + { + "name": "presence", + "type": { + "type": "object", + "properties": [ + { + "name": "enabled", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "key", + "type": "[Circular]", + "isOptional": true + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "key option is used to track presence payload across clients" + } + }, + { + "name": "private", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "defines if the channel is private or not and if RLS policies will be used to check data" + } + } + ] + } + } + ] + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "RealtimeChannel" + } + }, + "comment": { + "shortText": "Creates (or reuses) a RealtimeChannel for the provided topic.\n\nTopics are automatically prefixed with `realtime:` to match the Realtime service.\nIf a channel with the same topic already exists it will be returned instead of creating\na duplicate connection." + } + }, + "@supabase/supabase-js.RealtimeClient.connect": { + "name": "@supabase/supabase-js.RealtimeClient.connect", + "params": [], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + }, + "comment": { + "shortText": "Connects the socket, unless already connected." + } + }, + "@supabase/supabase-js.RealtimeClient.connectionState": { + "name": "@supabase/supabase-js.RealtimeClient.connectionState", + "params": [], + "ret": { + "type": { + "type": "nameOnly", + "name": "ConnectionState" + } + }, + "comment": { + "shortText": "Returns the current state of the socket." + } + }, + "@supabase/supabase-js.RealtimeClient.disconnect": { + "name": "@supabase/supabase-js.RealtimeClient.disconnect", + "params": [ + { + "name": "code", + "type": { + "type": "intrinsic", + "name": "number" + }, + "isOptional": true, + "comment": { + "shortText": "A numeric status code to send on disconnect." + } + }, + { + "name": "reason", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "A custom reason for the disconnect." + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "timeout" + }, + { + "type": "literal", + "value": "ok" + } + ] + } + } + }, + "comment": { + "shortText": "Disconnects the socket." + } + }, + "@supabase/supabase-js.RealtimeClient.endpointURL": { + "name": "@supabase/supabase-js.RealtimeClient.endpointURL", + "params": [], + "ret": { + "type": { + "type": "intrinsic", + "name": "string" + } + }, + "comment": { + "shortText": "Returns the URL of the websocket." + } + }, + "@supabase/supabase-js.RealtimeClient.getChannels": { + "name": "@supabase/supabase-js.RealtimeClient.getChannels", + "params": [], + "ret": { + "type": { + "type": "array", + "elemType": { + "type": "nameOnly", + "name": "RealtimeChannel" + } + } + }, + "comment": { + "shortText": "Returns all created channels" + } + }, + "@supabase/supabase-js.RealtimeClient.isConnected": { + "name": "@supabase/supabase-js.RealtimeClient.isConnected", + "params": [], + "ret": { + "type": { + "type": "intrinsic", + "name": "boolean" + } + }, + "comment": { + "shortText": "Returns `true` is the connection is open." + } + }, + "@supabase/supabase-js.RealtimeClient.isConnecting": { + "name": "@supabase/supabase-js.RealtimeClient.isConnecting", + "params": [], + "ret": { + "type": { + "type": "intrinsic", + "name": "boolean" + } + }, + "comment": { + "shortText": "Returns `true` if the connection is currently connecting." + } + }, + "@supabase/supabase-js.RealtimeClient.isDisconnecting": { + "name": "@supabase/supabase-js.RealtimeClient.isDisconnecting", + "params": [], + "ret": { + "type": { + "type": "intrinsic", + "name": "boolean" + } + }, + "comment": { + "shortText": "Returns `true` if the connection is currently disconnecting." + } + }, + "@supabase/supabase-js.RealtimeClient.log": { + "name": "@supabase/supabase-js.RealtimeClient.log", + "params": [ + { + "name": "kind", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "msg", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "data", + "type": { + "type": "intrinsic", + "name": "any" + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + }, + "comment": { + "shortText": "Logs the message.\n\nFor customized logging, `this.logger` can be overridden in Client constructor." + } + }, + "@supabase/supabase-js.RealtimeClient.onHeartbeat": { + "name": "@supabase/supabase-js.RealtimeClient.onHeartbeat", + "params": [ + { + "name": "callback", + "type": { + "type": "nameOnly", + "name": "HeartbeatCallback" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + }, + "comment": { + "shortText": "Sets a callback that receives lifecycle events for internal heartbeat messages.\nUseful for instrumenting connection health (e.g. sent/ok/timeout/disconnected)." + } + }, + "@supabase/supabase-js.RealtimeClient.push": { + "name": "@supabase/supabase-js.RealtimeClient.push", + "params": [ + { + "name": "data", + "type": { + "name": "RealtimeMessage", + "type": "object", + "properties": [ + { + "name": "event", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "join_ref", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "payload", + "type": { + "type": "intrinsic", + "name": "any" + } + }, + { + "name": "ref", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "topic", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + }, + "comment": { + "shortText": "Push out a message if the socket is connected.\n\nIf the socket is not connected, the message gets enqueued within a local buffer, and sent out when a connection is next established." + } + }, + "@supabase/supabase-js.RealtimeClient.removeAllChannels": { + "name": "@supabase/supabase-js.RealtimeClient.removeAllChannels", + "params": [], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "array", + "elemType": { + "type": "union", + "name": "RealtimeRemoveChannelResponse", + "subTypes": [ + { + "type": "literal", + "value": "ok" + }, + { + "type": "literal", + "value": "timed out" + }, + { + "type": "literal", + "value": "error" + }, + null + ] + } + } + } + }, + "comment": { + "shortText": "Unsubscribes, removes and tears down all channels" + } + }, + "@supabase/supabase-js.RealtimeClient.removeChannel": { + "name": "@supabase/supabase-js.RealtimeClient.removeChannel", + "params": [ + { + "name": "channel", + "type": { + "type": "nameOnly", + "name": "RealtimeChannel" + }, + "comment": { + "shortText": "A RealtimeChannel instance" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "RealtimeRemoveChannelResponse", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]", + null + ] + } + } + }, + "comment": { + "shortText": "Unsubscribes, removes and tears down a single channel" + } + }, + "@supabase/supabase-js.RealtimeClient.sendHeartbeat": { + "name": "@supabase/supabase-js.RealtimeClient.sendHeartbeat", + "params": [], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "intrinsic", + "name": "void" + } + } + }, + "comment": { + "shortText": "Sends a heartbeat message if the socket is connected." + } + }, + "@supabase/supabase-js.RealtimeClient.setAuth": { + "name": "@supabase/supabase-js.RealtimeClient.setAuth", + "params": [ + { + "name": "token", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "intrinsic", + "name": "string" + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "A JWT string to override the token set on the client." + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "intrinsic", + "name": "void" + } + } + }, + "comment": { + "shortText": "Sets the JWT access token used for channel subscription authorization and Realtime RLS.\n\nIf param is null it will use the `accessToken` callback function or the token set on the client.\n\nOn callback used, it will set the value of the token internal to the client.\n\nWhen a token is explicitly provided, it will be preserved across channel operations\n(including removeChannel and resubscribe). The `accessToken` callback will not be\ninvoked until `setAuth()` is called without arguments.", + "examples": [ + { + "id": "example-1", + "name": "Example 1", + "code": "```ts\nSetting the authorization header\n// Use a manual token (preserved across resubscribes, ignores accessToken callback)\nclient.realtime.setAuth('my-custom-jwt')\n\n// Switch back to using the accessToken callback\nclient.realtime.setAuth()\n```" + } + ] + } + }, + "@supabase/supabase-js.RealtimePresence.constructor": { + "name": "@supabase/supabase-js.RealtimePresence.constructor", + "params": [ + { + "name": "channel", + "type": { + "type": "nameOnly", + "name": "RealtimeChannel" + }, + "comment": { + "shortText": "The realtime channel to bind to." + } + }, + { + "name": "opts", + "type": { + "type": "nameOnly", + "name": "RealtimePresenceOptions" + }, + "isOptional": true, + "comment": { + "shortText": "Optional custom event names, e.g. `{ events: { state: 'state', diff: 'diff' } }`." + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "RealtimePresence" + } + }, + "comment": { + "shortText": "Creates a Presence helper that keeps the local presence state in sync with the server.", + "examples": [ + { + "id": "example-for-a-presence-channel", + "name": "Example for a presence channel", + "code": "```ts\nconst presence = new RealtimePresence(channel)\n\nchannel.on('presence', ({ event, key }) => {\n console.log(`Presence ${event} on ${key}`)\n})\n```" + } + ] + } + }, + "@supabase/supabase-js.StorageApiError.constructor": { + "name": "@supabase/supabase-js.StorageApiError.constructor", + "params": [ + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "status", + "type": { + "type": "intrinsic", + "name": "number" + } + }, + { + "name": "statusCode", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "namespace", + "type": { + "type": "nameOnly", + "name": "ErrorNamespace" + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "StorageApiError" + } + } + }, + "@supabase/supabase-js.StorageApiError.toJSON": { + "name": "@supabase/supabase-js.StorageApiError.toJSON", + "params": [], + "ret": { + "type": { + "type": "object", + "properties": [ + { + "name": "message", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "intrinsic", + "name": "number" + } + ] + } + }, + { + "name": "statusCode", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "intrinsic", + "name": "string" + } + ] + } + } + ] + } + } + }, + "@supabase/supabase-js.SupabaseClient.constructor": { + "name": "@supabase/supabase-js.SupabaseClient.constructor", + "params": [ + { + "name": "supabaseUrl", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The unique Supabase URL which is supplied when you create a new project in your project dashboard." + } + }, + { + "name": "supabaseKey", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The unique Supabase Key which is supplied when you create a new project in your project dashboard." + } + }, + { + "name": "options", + "type": { + "name": "SupabaseClientOptions", + "type": "object", + "properties": [ + { + "name": "accessToken", + "type": { + "type": "function", + "params": [], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "string" + }, + { + "type": "literal", + "value": null + } + ] + } + } + } + }, + "isOptional": true, + "comment": { + "shortText": "Optional function for using a third-party authentication system with\nSupabase. The function should return an access token or ID token (JWT) by\nobtaining it from the third-party auth SDK. Note that this\nfunction may be called concurrently and many times. Use memoization and\nlocking techniques if this is not supported by the SDKs.\n\nWhen set, the `auth` namespace of the Supabase client cannot be used.\nCreate another client if you wish to use Supabase Auth and third-party\nauthentications concurrently in the same application." + } + }, + { + "name": "auth", + "type": { + "type": "object", + "properties": [ + { + "name": "autoRefreshToken", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "Automatically refreshes the token for logged-in users. Defaults to true." + } + }, + { + "name": "debug", + "type": { + "type": "nameOnly", + "name": "SupabaseAuthClientOptions['debug']" + }, + "isOptional": true, + "comment": { + "shortText": "If debug messages for authentication client are emitted. Can be used to inspect the behavior of the library." + } + }, + { + "name": "detectSessionInUrl", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "boolean" + }, + { + "type": "function", + "params": [ + { + "name": "url", + "type": { + "type": "nameOnly", + "name": "URL" + } + }, + { + "name": "params", + "type": { + "type": "index signature", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "string" + } + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "boolean" + } + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Detect a session from the URL. Used for OAuth login callbacks. Defaults to true.\n\nCan be set to a function to provide custom logic for determining if a URL contains\na Supabase auth callback. The function receives the current URL and parsed parameters,\nand should return true if the URL should be processed as a Supabase auth callback.\n\nThis is useful when your app uses other OAuth providers (e.g., Facebook Login) that\nalso return access_token in the URL fragment, which would otherwise be incorrectly\nintercepted by Supabase Auth.", + "examples": [ + { + "id": "with-custom-detection-logic", + "name": "With custom detection logic", + "code": "```ts\ndetectSessionInUrl: (url, params) => {\n // Ignore Facebook OAuth redirects\n if (url.pathname === '/facebook/redirect') return false\n // Use default detection for other URLs\n return Boolean(params.access_token || params.error_description)\n}\n```" + } + ] + } + }, + { + "name": "experimental", + "type": { + "type": "nameOnly", + "name": "SupabaseAuthClientOptions['experimental']" + }, + "isOptional": true, + "comment": { + "shortText": "Opt-in flags for experimental features. These APIs may change without\nnotice and are disabled by default.", + "tags": [ + { + "tag": "experimental", + "text": "" + } + ] + } + }, + { + "name": "flowType", + "type": { + "type": "nameOnly", + "name": "SupabaseAuthClientOptions['flowType']" + }, + "isOptional": true, + "comment": { + "shortText": "OAuth flow to use - defaults to implicit flow. PKCE is recommended for mobile and server-side applications." + } + }, + { + "name": "lock", + "type": { + "type": "nameOnly", + "name": "SupabaseAuthClientOptions['lock']" + }, + "isOptional": true, + "comment": { + "shortText": "Provide your own locking mechanism based on the environment. By default\nthe auth client coordinates refreshes itself and the server resolves\ncross-tab races. Passing a custom `lock` opts into a legacy path that\nwraps every auth operation in your supplied lock." + } + }, + { + "name": "lockAcquireTimeout", + "type": { + "type": "nameOnly", + "name": "SupabaseAuthClientOptions['lockAcquireTimeout']" + }, + "isOptional": true, + "comment": { + "shortText": "Maximum time in milliseconds to wait for acquiring the custom lock\nsupplied via `lock`. Only consulted when a custom `lock` is passed." + } + }, + { + "name": "persistSession", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "Whether to persist a logged-in session to storage. Defaults to true." + } + }, + { + "name": "skipAutoInitialize", + "type": { + "type": "nameOnly", + "name": "SupabaseAuthClientOptions['skipAutoInitialize']" + }, + "isOptional": true, + "comment": { + "shortText": "If true, skips automatic initialization in the auth client constructor.\nUseful for SSR contexts where initialization timing must be controlled to\nprevent race conditions with HTTP response generation." + } + }, + { + "name": "storage", + "type": { + "type": "nameOnly", + "name": "SupabaseAuthClientOptions['storage']" + }, + "isOptional": true, + "comment": { + "shortText": "A storage provider. Used to store the logged-in session." + } + }, + { + "name": "storageKey", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Optional key name used for storing tokens in local storage." + } + }, + { + "name": "throwOnError", + "type": { + "type": "nameOnly", + "name": "SupabaseAuthClientOptions['throwOnError']" + }, + "isOptional": true, + "comment": { + "shortText": "If there is an error with the query, throwOnError will reject the promise by\nthrowing the error instead of returning it as part of a successful response." + } + }, + { + "name": "userStorage", + "type": { + "type": "nameOnly", + "name": "SupabaseAuthClientOptions['userStorage']" + }, + "isOptional": true, + "comment": { + "shortText": "A storage provider to store the user profile separately from the session.\nUseful when you need to store the session information in cookies,\nwithout bloating the data with the redundant user object.", + "tags": [ + { + "tag": "experimental", + "text": "" + } + ] + } + } + ] + }, + "isOptional": true + }, + { + "name": "db", + "type": { + "type": "object", + "properties": [ + { + "name": "schema", + "type": { + "type": "nameOnly", + "name": "@supabase/supabase-js.default.SchemaName" + }, + "isOptional": true + }, + { + "name": "timeout", + "type": { + "type": "intrinsic", + "name": "number" + }, + "isOptional": true, + "comment": { + "shortText": "Optional timeout in milliseconds for PostgREST requests.\nWhen set, requests will automatically abort after this duration to prevent indefinite hangs.", + "examples": [ + { + "id": "with-timeout", + "name": "With timeout", + "code": "```ts\nconst supabase = createClient(url, key, {\n db: { timeout: 30000 } // 30 second timeout\n})\n```" + } + ] + } + }, + { + "name": "urlLengthLimit", + "type": { + "type": "intrinsic", + "name": "number" + }, + "isOptional": true, + "comment": { + "shortText": "Maximum URL length in characters before warnings/errors are triggered.\nDefaults to 8000 characters. Used to provide helpful hints when URLs\nexceed server limits.", + "examples": [ + { + "id": "with-custom-url-length-limit", + "name": "With custom URL length limit", + "code": "```ts\nconst supabase = createClient(url, key, {\n db: { urlLengthLimit: 10000 } // Custom limit\n})\n```" + } + ] + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "The Postgres schema which your tables belong to. Must be on the list of exposed schemas in Supabase. Defaults to `public`." + } + }, + { + "name": "global", + "type": { + "type": "object", + "properties": [ + { + "name": "fetch", + "type": { + "type": "nameOnly", + "name": "Fetch" + }, + "isOptional": true, + "comment": { + "shortText": "A custom `fetch` implementation." + } + }, + { + "name": "headers", + "type": { + "type": "record", + "name": "Record", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "string" + } + }, + "isOptional": true, + "comment": { + "shortText": "Optional headers for initializing the client." + } + } + ] + }, + "isOptional": true + }, + { + "name": "realtime", + "type": { + "name": "RealtimeClientOptions", + "type": "object", + "properties": [ + { + "name": "accessToken", + "type": { + "type": "function", + "params": [], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + } + } + } + }, + "isOptional": true + }, + { + "name": "decode", + "type": { + "type": "nameOnly", + "name": "Decode" + }, + "isOptional": true + }, + { + "name": "disconnectOnEmptyChannelsAfterMs", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "encode", + "type": { + "type": "nameOnly", + "name": "Encode" + }, + "isOptional": true + }, + { + "name": "fetch", + "type": { + "type": "nameOnly", + "name": "Fetch" + }, + "isOptional": true + }, + { + "name": "headers", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "heartbeatCallback", + "type": { + "type": "function", + "params": [ + { + "name": "status", + "type": { + "type": "nameOnly", + "name": "HeartbeatStatus" + } + }, + { + "name": "latency", + "type": "[Circular]", + "isOptional": true + } + ], + "ret": { + "type": "[Circular]" + } + }, + "isOptional": true + }, + { + "name": "heartbeatIntervalMs", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "log_level", + "type": { + "type": "nameOnly", + "name": "LogLevel" + }, + "isOptional": true + }, + { + "name": "logger", + "type": { + "type": "function", + "params": [ + { + "name": "kind", + "type": "[Circular]" + }, + { + "name": "msg", + "type": "[Circular]" + }, + { + "name": "data", + "type": "[Circular]", + "isOptional": true + } + ], + "ret": { + "type": "[Circular]" + } + }, + "isOptional": true + }, + { + "name": "logLevel", + "type": { + "type": "nameOnly", + "name": "LogLevel" + }, + "isOptional": true + }, + { + "name": "params", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "reconnectAfterMs", + "type": { + "type": "function", + "params": [ + { + "name": "tries", + "type": "[Circular]" + } + ], + "ret": { + "type": "[Circular]" + } + }, + "isOptional": true + }, + { + "name": "sessionStorage", + "type": { + "type": "nameOnly", + "name": "Storage" + }, + "isOptional": true, + "comment": { + "shortText": "Storage compatible object used by the underlying socket for longpoll fallback history.\nProvide a custom implementation in environments where reading `globalThis.sessionStorage`\nthrows (sandboxed iframes, in-app webviews, \"block third-party storage\" privacy modes).\nDefaults to `globalThis.sessionStorage` when accessible, otherwise an in-memory store." + } + }, + { + "name": "timeout", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "transport", + "type": { + "type": "object", + "name": "WebSocketLikeConstructor", + "properties": [] + }, + "isOptional": true + }, + { + "name": "vsn", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "worker", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "workerUrl", + "type": "[Circular]", + "isOptional": true + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Options passed to the realtime-js instance" + } + }, + { + "name": "storage", + "type": { + "type": "nameOnly", + "name": "StorageClientOptions" + }, + "isOptional": true + }, + { + "name": "tracePropagation", + "type": { + "type": "union", + "subTypes": [ + { + "type": "object", + "name": "TracePropagationOptions", + "properties": [ + { + "name": "enabled", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "Enable trace propagation. Disabled by default.\n\nWhen enabled, automatically detects and propagates active trace context\nfrom the OpenTelemetry API to outgoing Supabase requests. Trace context\nis only propagated to Supabase domains (`*.supabase.co`, `*.supabase.in`,\n`localhost`) for security — third-party hosts never receive trace headers.", + "examples": [ + { + "id": "example-1", + "name": "Example 1", + "code": "```ts\nconst supabase = createClient(url, key, {\n tracePropagation: { enabled: true },\n})\n```" + } + ] + } + }, + { + "name": "respectSamplingDecision", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "Respect upstream sampling decisions.\n\nWhen true (the default), trace context is not propagated if the upstream\ntrace indicates non-sampling (sampled flag = `0` in the `traceparent`\nheader). This avoids overhead when traces are being recorded but dropped.\n\nSet to `false` to always propagate, regardless of the sampling decision\n— useful when you want every Supabase request tagged with a `trace_id`\nfor log correlation, even if the trace itself will not be exported.", + "examples": [ + { + "id": "always-propagate-ignore-sampling", + "name": "Always propagate, ignore sampling", + "code": "```ts\nconst supabase = createClient(url, key, {\n tracePropagation: { enabled: true, respectSamplingDecision: false },\n})\n```" + } + ] + } + } + ] + }, + { + "type": "intrinsic", + "name": "boolean" + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Enable OpenTelemetry / W3C trace context propagation to Supabase services.\n\nDisabled by default. Pass `true` for the common case (auto-detect an\nactive OpenTelemetry context and inject `traceparent` / `tracestate` /\n`baggage` headers) or an object for fine-grained control.\n\nRequires `@opentelemetry/api` to be installed in your application; if\nnot present, the SDK silently no-ops. Trace headers are only attached\nto requests targeting Supabase domains, so third-party hosts called\nthrough a custom `fetch` are never tagged.\n\nThe resulting `trace_id` appears in Supabase logs (API Gateway, Edge\nFunctions), letting you correlate client-side spans with server-side\nlog entries — including logs forwarded via Log Drains.", + "examples": [ + { + "id": "shorthand-opt-in-with-defaults", + "name": "Shorthand — opt in with defaults", + "code": "```ts\nimport { createClient } from '@supabase/supabase-js'\n\nconst supabase = createClient(url, key, { tracePropagation: true })\n```" + }, + { + "id": "with-an-active-opentelemetry-span", + "name": "With an active OpenTelemetry span", + "code": "```ts\nimport { createClient } from '@supabase/supabase-js'\nimport { trace } from '@opentelemetry/api'\n\nconst supabase = createClient(url, key, { tracePropagation: true })\nconst tracer = trace.getTracer('my-app')\n\nawait tracer.startActiveSpan('fetch-users', async (span) => {\n // Request carries the active trace context.\n const { data, error } = await supabase.from('users').select('*')\n span.end()\n})\n```" + }, + { + "id": "advanced-always-propagate-even-for-non-sampled-traces", + "name": "Advanced — always propagate, even for non-sampled traces", + "code": "```ts\nconst supabase = createClient(url, key, {\n tracePropagation: { enabled: true, respectSamplingDecision: false },\n})\n```" + } + ] + } + } + ] + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "SupabaseClient" + } + }, + "comment": { + "shortText": "Create a new client for use in the browser.", + "examples": [ + { + "id": "creating-a-client", + "name": "Creating a client", + "code": "```js\nimport { createClient } from '@supabase/supabase-js'\n\n// Create a single supabase client for interacting with your database\nconst supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key')\n```" + }, + { + "id": "with-a-custom-domain", + "name": "With a custom domain", + "code": "```js\nimport { createClient } from '@supabase/supabase-js'\n\n// Use a custom domain as the supabase URL\nconst supabase = createClient('https://my-custom-domain.com', 'your-publishable-key')\n```" + }, + { + "id": "with-additional-parameters", + "name": "With additional parameters", + "code": "```js\nimport { createClient } from '@supabase/supabase-js'\n\nconst 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}\nconst supabase = createClient(\"https://xyzcompany.supabase.co\", \"your-publishable-key\", options)\n```" + }, + { + "id": "with-custom-schemas", + "name": "With custom schemas", + "code": "```js\nimport { createClient } from '@supabase/supabase-js'\n\nconst supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key', {\n // Provide a custom schema. Defaults to \"public\".\n db: { schema: 'other_schema' }\n})\n```", + "description": "By default the API server points to the `public` schema. You can enable other database schemas within the Dashboard.\nGo to [Settings > API > Exposed schemas](/dashboard/project/_/settings/api) and add the schema which you want to expose to the API.\n\nNote: 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." + }, + { + "id": "custom-fetch-implementation", + "name": "Custom fetch implementation", + "code": "```js\nimport { createClient } from '@supabase/supabase-js'\n\nconst supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key', {\n global: { fetch: fetch.bind(globalThis) }\n})\n```", + "description": "`supabase-js` uses the [`cross-fetch`](https://www.npmjs.com/package/cross-fetch) library to make HTTP requests,\nbut an alternative `fetch` implementation can be provided as an option.\nThis is most useful in environments where `cross-fetch` is not compatible (for instance Cloudflare Workers)." + }, + { + "id": "react-native-options-with-asyncstorage", + "name": "React Native options with AsyncStorage", + "code": "```js\nimport 'react-native-url-polyfill/auto'\nimport { createClient } from '@supabase/supabase-js'\nimport AsyncStorage from \"@react-native-async-storage/async-storage\";\n\nconst 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```", + "description": "For React Native we recommend using `AsyncStorage` as the storage implementation for Supabase Auth." + }, + { + "id": "react-native-options-with-expo-securestore", + "name": "React Native options with Expo SecureStore", + "code": "```ts\nimport 'react-native-url-polyfill/auto'\nimport { createClient } from '@supabase/supabase-js'\nimport AsyncStorage from '@react-native-async-storage/async-storage';\nimport * as SecureStore from 'expo-secure-store';\nimport * as aesjs from 'aes-js';\nimport '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.\nclass 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\nconst 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```", + "description": "If you wish to encrypt the user's session information, you can use `aes-js` and store the encryption key in Expo SecureStore.\nThe `aes-js` library, a reputable JavaScript-only implementation of the AES encryption algorithm in CTR mode.\nA new 256-bit encryption key is generated using the `react-native-get-random-values` library.\nThis key is stored inside Expo's SecureStore, while the value is encrypted and placed inside AsyncStorage.\n\nPlease 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." + }, + { + "id": "with-a-database-query", + "name": "With a database query", + "code": "```ts\nimport { createClient } from '@supabase/supabase-js'\n\nconst supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key')\n\nconst { data } = await supabase.from('profiles').select('*')\n```" + }, + { + "id": "with-opentelemetry-tracing", + "name": "With OpenTelemetry tracing", + "code": "```ts\nimport { createClient } from '@supabase/supabase-js'\nimport { trace } from '@opentelemetry/api'\n\nconst supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key', {\n tracePropagation: true,\n})\n\nconst tracer = trace.getTracer('my-app')\n\nawait 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```", + "description": "Opt in to W3C trace context propagation so the `trace_id` from your\nclient-side spans is attached to Supabase requests and appears in API\nGateway and Edge Function logs. Requires `@opentelemetry/api` to be\ninstalled in your application. See [Tracing with the JS SDK](https://supabase.com/docs/guides/telemetry/client-side-tracing)." + } + ] + } + }, + "@supabase/supabase-js.SupabaseClient.channel": { + "name": "@supabase/supabase-js.SupabaseClient.channel", + "params": [ + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The name of the Realtime channel." + } + }, + { + "name": "opts", + "type": { + "name": "RealtimeChannelOptions", + "type": "object", + "properties": [ + { + "name": "config", + "type": { + "type": "object", + "properties": [ + { + "name": "broadcast", + "type": { + "type": "object", + "properties": [ + { + "name": "ack", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "replay", + "type": { + "type": "nameOnly", + "name": "ReplayOption" + }, + "isOptional": true + }, + { + "name": "self", + "type": "[Circular]", + "isOptional": true + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "self option enables client to receive message it broadcast\nack option instructs server to acknowledge that broadcast message was received\nreplay option instructs server to replay broadcast messages" + } + }, + { + "name": "presence", + "type": { + "type": "object", + "properties": [ + { + "name": "enabled", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "key", + "type": "[Circular]", + "isOptional": true + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "key option is used to track presence payload across clients" + } + }, + { + "name": "private", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "defines if the channel is private or not and if RLS policies will be used to check data" + } + } + ] + } + } + ] + }, + "comment": { + "shortText": "The options to pass to the Realtime channel." + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "RealtimeChannel" + } + }, + "comment": { + "shortText": "Creates a Realtime channel with Broadcast, Presence, and Postgres Changes." + } + }, + "@supabase/supabase-js.SupabaseClient.from": { + "name": "@supabase/supabase-js.SupabaseClient.from", + "params": [ + { + "name": "relation", + "type": { + "type": "nameOnly", + "name": "TableName" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestQueryBuilder" + } + }, + "comment": { + "shortText": "Perform a query on a table or a view." + }, + "altSignatures": [ + { + "params": [ + { + "name": "relation", + "type": { + "type": "nameOnly", + "name": "ViewName" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestQueryBuilder" + } + } + } + ] + }, + "@supabase/supabase-js.SupabaseClient.getChannels": { + "name": "@supabase/supabase-js.SupabaseClient.getChannels", + "params": [], + "ret": { + "type": { + "type": "array", + "elemType": { + "type": "nameOnly", + "name": "RealtimeChannel" + } + } + }, + "comment": { + "shortText": "Returns all Realtime channels.", + "examples": [ + { + "id": "get-all-channels", + "name": "Get all channels", + "code": "```js\nconst channels = supabase.getChannels()\n```" + } + ] + } + }, + "@supabase/supabase-js.SupabaseClient.removeAllChannels": { + "name": "@supabase/supabase-js.SupabaseClient.removeAllChannels", + "params": [], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "array", + "elemType": { + "type": "union", + "name": "RealtimeRemoveChannelResponse", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]", + null + ] + } + } + } + }, + "comment": { + "shortText": "Unsubscribes and removes all Realtime channels from Realtime client.", + "text": "- 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.", + "examples": [ + { + "id": "remove-all-channels", + "name": "Remove all channels", + "code": "```js\nsupabase.removeAllChannels()\n```" + } + ] + } + }, + "@supabase/supabase-js.SupabaseClient.removeChannel": { + "name": "@supabase/supabase-js.SupabaseClient.removeChannel", + "params": [ + { + "name": "channel", + "type": { + "type": "nameOnly", + "name": "RealtimeChannel" + }, + "comment": { + "shortText": "The name of the Realtime channel." + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "RealtimeRemoveChannelResponse", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]", + null + ] + } + } + }, + "comment": { + "shortText": "Unsubscribes and removes Realtime channel from Realtime client.", + "text": "- 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.", + "examples": [ + { + "id": "removes-a-channel", + "name": "Removes a channel", + "code": "```js\nsupabase.removeChannel(myChannel)\n```" + } + ] + } + }, + "@supabase/supabase-js.SupabaseClient.rpc": { + "name": "@supabase/supabase-js.SupabaseClient.rpc", + "params": [ + { + "name": "fn", + "type": { + "type": "nameOnly", + "name": "FnName" + }, + "comment": { + "shortText": "The function name to call" + } + }, + { + "name": "args", + "type": { + "type": "nameOnly", + "name": "Args" + }, + "comment": { + "shortText": "The arguments to pass to the function call" + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "count", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "exact" + }, + { + "type": "literal", + "value": "planned" + }, + { + "type": "literal", + "value": "estimated" + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Count algorithm to use to count rows returned by the\nfunction. Only applicable for [set-returning\nfunctions](https://www.postgresql.org/docs/current/functions-srf.html).\n\n`\"exact\"`: Exact but slow count algorithm. Performs a `COUNT(*)` under the\nhood.\n\n`\"planned\"`: Approximated but fast count algorithm. Uses the Postgres\nstatistics under the hood.\n\n`\"estimated\"`: Uses exact count for low numbers and planned count for high\nnumbers." + } + }, + { + "name": "get", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "When set to `true`, the function will be called with\nread-only access mode." + } + }, + { + "name": "head", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "When set to `true`, `data` will not be returned.\nUseful if you only need the count." + } + } + ] + }, + "comment": { + "shortText": "Named parameters" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestFilterBuilder" + } + }, + "comment": { + "shortText": "Perform a function call." + } + }, + "@supabase/supabase-js.SupabaseClient.schema": { + "name": "@supabase/supabase-js.SupabaseClient.schema", + "params": [ + { + "name": "schema", + "type": { + "type": "nameOnly", + "name": "DynamicSchema" + }, + "comment": { + "shortText": "The schema to query" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestClient" + } + }, + "comment": { + "shortText": "Select a schema to query or perform an function (rpc) call.\n\nThe schema needs to be on the list of exposed schemas inside Supabase." + } + }, + "@supabase/supabase-js.WebSocketFactory.getWebSocketConstructor": { + "name": "@supabase/supabase-js.WebSocketFactory.getWebSocketConstructor", + "params": [], + "ret": { + "type": { + "type": "function", + "params": [ + { + "name": "url", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "string" + }, + { + "type": "nameOnly", + "name": "URL" + } + ] + } + }, + { + "name": "protocols", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "string" + }, + { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + } + ] + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "WebSocket" + } + } + } + }, + "comment": { + "shortText": "Returns the best available WebSocket constructor for the current runtime.", + "examples": [ + { + "id": "example-with-error-handling", + "name": "Example with error handling", + "code": "```ts\ntry {\n const WS = WebSocketFactory.getWebSocketConstructor()\n const socket = new WS('wss://example.com/socket')\n} catch (error) {\n console.error('WebSocket not available in this environment.', error)\n}\n```" + } + ] + } + }, + "@supabase/supabase-js.WebSocketFactory.isWebSocketSupported": { + "name": "@supabase/supabase-js.WebSocketFactory.isWebSocketSupported", + "params": [], + "ret": { + "type": { + "type": "intrinsic", + "name": "boolean" + } + }, + "comment": { + "shortText": "Detects whether the runtime can establish WebSocket connections.", + "examples": [ + { + "id": "example-in-a-node-js-script", + "name": "Example in a Node.js script", + "code": "```ts\nif (!WebSocketFactory.isWebSocketSupported()) {\n console.error('WebSockets are required for this script.')\n process.exitCode = 1\n}\n```" + } + ] + } + }, + "@supabase/supabase-js.AuthOAuthServerApi.approveAuthorization": { + "name": "@supabase/supabase-js.AuthOAuthServerApi.approveAuthorization", + "params": [ + { + "name": "authorizationId", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The authorization ID to approve" + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "skipBrowserRedirect", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "If false (default), automatically redirects the browser to the OAuth client. If true, returns the redirect_url without automatic redirect (useful for custom handling)." + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Optional parameters" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthOAuthConsentResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "name": "OAuthRedirect", + "type": "object", + "properties": [ + { + "name": "redirect_url", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Complete redirect URL with authorization code and state parameters (e.g., \"https://app.com/callback?code=xxx&state=yyy\")" + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Approves an OAuth authorization request.\nOnly relevant when the OAuth 2.1 server is enabled in Supabase Auth.\n\nAfter approval, the user's consent is stored and an authorization code is generated.\nThe response contains a complete redirect URL with the authorization code and state." + } + }, + "@supabase/supabase-js.AuthOAuthServerApi.denyAuthorization": { + "name": "@supabase/supabase-js.AuthOAuthServerApi.denyAuthorization", + "params": [ + { + "name": "authorizationId", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The authorization ID to deny" + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "skipBrowserRedirect", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "If false (default), automatically redirects the browser to the OAuth client. If true, returns the redirect_url without automatic redirect (useful for custom handling)." + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Optional parameters" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthOAuthConsentResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "name": "OAuthRedirect", + "type": "object", + "properties": [ + { + "name": "redirect_url", + "type": "[Circular]", + "comment": { + "shortText": "Complete redirect URL with authorization code and state parameters (e.g., \"https://app.com/callback?code=xxx&state=yyy\")" + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Denies an OAuth authorization request.\nOnly relevant when the OAuth 2.1 server is enabled in Supabase Auth.\n\nAfter denial, the response contains a redirect URL with an OAuth error\n(access_denied) to inform the OAuth client that the user rejected the request." + } + }, + "@supabase/supabase-js.AuthOAuthServerApi.getAuthorizationDetails": { + "name": "@supabase/supabase-js.AuthOAuthServerApi.getAuthorizationDetails", + "params": [ + { + "name": "authorizationId", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The authorization ID from the authorization request" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthOAuthAuthorizationDetailsResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "union", + "subTypes": [ + { + "name": "OAuthAuthorizationDetails", + "type": "object", + "properties": [ + { + "name": "authorization_id", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The authorization ID used to approve or deny the request" + } + }, + { + "name": "client", + "type": { + "name": "OAuthAuthorizationClient", + "type": "object", + "properties": [ + { + "name": "id", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Unique identifier for the OAuth client (UUID)" + } + }, + { + "name": "logo_uri", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "URI of the OAuth client's logo" + } + }, + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Human-readable name of the OAuth client" + } + }, + { + "name": "uri", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "URI of the OAuth client's website" + } + } + ] + }, + "comment": { + "shortText": "OAuth client requesting authorization" + } + }, + { + "name": "redirect_uri", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The OAuth client's registered redirect URI (base URI without query parameters)" + } + }, + { + "name": "scope", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Space-separated list of requested scopes (e.g., \"openid profile email\")" + } + }, + { + "name": "user", + "type": { + "type": "object", + "properties": [ + { + "name": "email", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "User email" + } + }, + { + "name": "id", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "User ID (UUID)" + } + } + ] + }, + "comment": { + "shortText": "User object associated with the authorization" + } + } + ] + }, + { + "name": "OAuthRedirect", + "type": "object", + "properties": [ + { + "name": "redirect_url", + "type": "[Circular]", + "comment": { + "shortText": "Complete redirect URL with authorization code and state parameters (e.g., \"https://app.com/callback?code=xxx&state=yyy\")" + } + } + ] + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Retrieves details about an OAuth authorization request.\nUsed to display consent information to the user.\nOnly relevant when the OAuth 2.1 server is enabled in Supabase Auth.\n\nThis method returns one of two response types:\n- `OAuthAuthorizationDetails`: User needs to consent - show consent page with client info\n- `OAuthRedirect`: User already consented - redirect immediately to the OAuth client\n\nUse type narrowing to distinguish between the responses:\n```typescript\nif ('authorization_id' in data) {\n // Show consent page\n} else {\n // Redirect to data.redirect_url\n}\n```" + } + }, + "@supabase/supabase-js.AuthOAuthServerApi.listGrants": { + "name": "@supabase/supabase-js.AuthOAuthServerApi.listGrants", + "params": [], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthOAuthGrantsResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "array", + "elemType": { + "name": "OAuthGrant", + "type": "object", + "properties": [ + { + "name": "client", + "type": { + "name": "OAuthAuthorizationClient", + "type": "object", + "properties": [ + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "Unique identifier for the OAuth client (UUID)" + } + }, + { + "name": "logo_uri", + "type": "[Circular]", + "comment": { + "shortText": "URI of the OAuth client's logo" + } + }, + { + "name": "name", + "type": "[Circular]", + "comment": { + "shortText": "Human-readable name of the OAuth client" + } + }, + { + "name": "uri", + "type": "[Circular]", + "comment": { + "shortText": "URI of the OAuth client's website" + } + } + ] + }, + "comment": { + "shortText": "OAuth client information" + } + }, + { + "name": "granted_at", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Timestamp when the grant was created (ISO 8601 date-time)" + } + }, + { + "name": "scopes", + "type": { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + }, + "comment": { + "shortText": "Array of scopes granted to this client" + } + } + ] + } + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Lists all OAuth grants that the authenticated user has authorized.\nOnly relevant when the OAuth 2.1 server is enabled in Supabase Auth." + } + }, + "@supabase/supabase-js.AuthOAuthServerApi.revokeGrant": { + "name": "@supabase/supabase-js.AuthOAuthServerApi.revokeGrant", + "params": [ + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "clientId", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The OAuth client identifier (UUID) to revoke access for" + } + } + ] + }, + "comment": { + "shortText": "Revocation options" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthOAuthRevokeGrantResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data" + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Revokes a user's OAuth grant for a specific client.\nOnly relevant when the OAuth 2.1 server is enabled in Supabase Auth.\n\nRevocation marks consent as revoked, deletes active sessions for that OAuth client,\nand invalidates associated refresh tokens." + } + }, + "@supabase/supabase-js.AuthPasskeyApi.delete": { + "name": "@supabase/supabase-js.AuthPasskeyApi.delete", + "params": [ + { + "name": "params", + "type": { + "name": "PasskeyDeleteParams", + "type": "object", + "properties": [ + { + "name": "passkeyId", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "UUID of the passkey to delete" + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthPasskeyDeleteResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "literal", + "value": null + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Deletes a passkey for the currently signed-in user." + } + }, + "@supabase/supabase-js.AuthPasskeyApi.list": { + "name": "@supabase/supabase-js.AuthPasskeyApi.list", + "params": [], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthPasskeyListResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "array", + "elemType": { + "name": "PasskeyListItem", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "friendly_name", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "id", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "last_used_at", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + } + ] + } + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Lists all passkeys registered for the currently signed-in user." + } + }, + "@supabase/supabase-js.AuthPasskeyApi.startAuthentication": { + "name": "@supabase/supabase-js.AuthPasskeyApi.startAuthentication", + "params": [ + { + "name": "params", + "type": { + "name": "StartPasskeyAuthenticationParams", + "type": "object", + "properties": [ + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "captchaToken", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + } + ] + }, + "isOptional": true + } + ] + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthPasskeyAuthenticationOptionsResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "name": "PasskeyAuthenticationOptionsResponse", + "type": "object", + "properties": [ + { + "name": "challenge_id", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "expires_at", + "type": { + "type": "intrinsic", + "name": "number" + } + }, + { + "name": "options", + "type": { + "type": "nameOnly", + "name": "ServerCredentialRequestOptions" + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Starts the passkey authentication ceremony. Fetches an authentication\nchallenge and credential request options from the server. Used as the\nfirst step of a two-step sign-in flow when the caller wants to handle\n`navigator.credentials.get()` themselves." + } + }, + "@supabase/supabase-js.AuthPasskeyApi.startRegistration": { + "name": "@supabase/supabase-js.AuthPasskeyApi.startRegistration", + "params": [], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthPasskeyRegistrationOptionsResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "name": "PasskeyRegistrationOptionsResponse", + "type": "object", + "properties": [ + { + "name": "challenge_id", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "expires_at", + "type": { + "type": "intrinsic", + "name": "number" + } + }, + { + "name": "options", + "type": { + "type": "nameOnly", + "name": "ServerCredentialCreationOptions" + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Starts the passkey registration ceremony. Fetches a registration challenge\nand credential creation options from the server. Used as the first step of\na two-step registration flow when the caller wants to handle\n`navigator.credentials.create()` themselves." + } + }, + "@supabase/supabase-js.AuthPasskeyApi.update": { + "name": "@supabase/supabase-js.AuthPasskeyApi.update", + "params": [ + { + "name": "params", + "type": { + "name": "PasskeyUpdateParams", + "type": "object", + "properties": [ + { + "name": "friendlyName", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "New friendly name (max 120 chars)" + } + }, + { + "name": "passkeyId", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "UUID of the passkey to update" + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthPasskeyUpdateResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "name": "PasskeyListItem", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "last_used_at", + "type": "[Circular]", + "isOptional": true + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Updates a passkey's friendly name." + } + }, + "@supabase/supabase-js.AuthPasskeyApi.verifyAuthentication": { + "name": "@supabase/supabase-js.AuthPasskeyApi.verifyAuthentication", + "params": [ + { + "name": "params", + "type": { + "name": "VerifyPasskeyAuthenticationParams", + "type": "object", + "properties": [ + { + "name": "challengeId", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Challenge ID from startAuthentication" + } + }, + { + "name": "credential", + "type": { + "type": "nameOnly", + "name": "ServerCredentialResponse" + }, + "comment": { + "shortText": "Serialized credential from navigator.credentials.get()" + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthPasskeyAuthenticationVerifyResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "session", + "type": { + "type": "union", + "subTypes": [ + { + "type": "object", + "name": "AuthSession", + "properties": [ + { + "name": "access_token", + "type": "[Circular]", + "comment": { + "shortText": "The access token jwt. It is recommended to set the JWT_EXPIRY to a shorter expiry value." + } + }, + { + "name": "expires_at", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "A timestamp of when the token will expire. Returned when a login is confirmed." + } + }, + { + "name": "expires_in", + "type": "[Circular]", + "comment": { + "shortText": "The number of seconds until the token expires (since it was issued). Returned when a login is confirmed." + } + }, + { + "name": "provider_refresh_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider refresh token. If present, this can be used to refresh the provider_token via the oauth provider's API.\nNot all oauth providers return a provider refresh token. If the provider_refresh_token is missing, please refer to the oauth provider's documentation for information on how to obtain the provider refresh token." + } + }, + { + "name": "provider_token", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "The oauth provider token. If present, this can be used to make external API requests to the oauth provider used." + } + }, + { + "name": "refresh_token", + "type": "[Circular]", + "comment": { + "shortText": "A one-time used refresh token that never expires." + } + }, + { + "name": "token_type", + "type": "[Circular]" + }, + { + "name": "user", + "type": { + "type": "object", + "name": "AuthUser", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + "comment": { + "shortText": "When using a separate user storage, accessing properties of this object will throw an error." + } + } + ] + }, + "[Circular]" + ] + } + }, + { + "name": "user", + "type": { + "type": "union", + "subTypes": [ + { + "type": "object", + "name": "AuthUser", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + "[Circular]" + ] + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Verifies a passkey authentication credential against a previously issued\nchallenge. Used as the second step of a two-step sign-in flow." + } + }, + "@supabase/supabase-js.AuthPasskeyApi.verifyRegistration": { + "name": "@supabase/supabase-js.AuthPasskeyApi.verifyRegistration", + "params": [ + { + "name": "params", + "type": { + "name": "VerifyPasskeyRegistrationParams", + "type": "object", + "properties": [ + { + "name": "challengeId", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Challenge ID from startRegistration" + } + }, + { + "name": "credential", + "type": { + "type": "nameOnly", + "name": "ServerCredentialResponse" + }, + "comment": { + "shortText": "Serialized credential from navigator.credentials.create()" + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthPasskeyRegistrationVerifyResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "name": "PasskeyMetadata", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Verifies a passkey registration credential against a previously issued\nchallenge. Used as the second step of a two-step registration flow." + } + }, + "@supabase/supabase-js.GoTrueAdminCustomProvidersApi.createProvider": { + "name": "@supabase/supabase-js.GoTrueAdminCustomProvidersApi.createProvider", + "params": [ + { + "name": "params", + "type": { + "name": "CreateCustomProviderParams", + "type": "object", + "properties": [ + { + "name": "acceptable_client_ids", + "type": { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + }, + "isOptional": true, + "comment": { + "shortText": "Additional client IDs accepted during token validation" + } + }, + { + "name": "attribute_mapping", + "type": { + "type": "record", + "name": "Record", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "any" + } + }, + "isOptional": true, + "comment": { + "shortText": "Mapping of provider attributes to Supabase user attributes" + } + }, + { + "name": "authorization_params", + "type": { + "type": "record", + "name": "Record", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "string" + } + }, + "isOptional": true, + "comment": { + "shortText": "Additional parameters sent with the authorization request" + } + }, + { + "name": "authorization_url", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "OAuth2 authorization URL" + } + }, + { + "name": "client_id", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "OAuth client ID" + } + }, + { + "name": "client_secret", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "OAuth client secret (write-only, not returned in responses)" + } + }, + { + "name": "discovery_url", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "OIDC discovery URL" + } + }, + { + "name": "email_optional", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "Whether email is optional for this provider" + } + }, + { + "name": "enabled", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "Whether the provider is enabled" + } + }, + { + "name": "identifier", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Provider identifier (e.g. `custom:mycompany`)" + } + }, + { + "name": "issuer", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "OIDC issuer URL" + } + }, + { + "name": "jwks_uri", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "JWKS URI for token verification" + } + }, + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Human-readable name" + } + }, + { + "name": "pkce_enabled", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "Whether PKCE is enabled" + } + }, + { + "name": "provider_type", + "type": { + "type": "union", + "name": "CustomProviderType", + "subTypes": [ + { + "type": "literal", + "value": "oauth2" + }, + { + "type": "literal", + "value": "oidc" + } + ] + }, + "comment": { + "shortText": "Provider type" + } + }, + { + "name": "scopes", + "type": { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + }, + "isOptional": true, + "comment": { + "shortText": "OAuth scopes requested during authorization" + } + }, + { + "name": "skip_nonce_check", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "Whether to skip nonce check (OIDC)" + } + }, + { + "name": "token_url", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "OAuth2 token URL" + } + }, + { + "name": "userinfo_url", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "OAuth2 userinfo URL" + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "CustomProviderResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "name": "CustomOAuthProvider", + "type": "object", + "properties": [ + { + "name": "acceptable_client_ids", + "type": { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + }, + "isOptional": true, + "comment": { + "shortText": "Additional client IDs accepted during token validation" + } + }, + { + "name": "attribute_mapping", + "type": { + "type": "record", + "name": "Record", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "any" + } + }, + "isOptional": true, + "comment": { + "shortText": "Mapping of provider attributes to Supabase user attributes" + } + }, + { + "name": "authorization_params", + "type": { + "type": "record", + "name": "Record", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "string" + } + }, + "isOptional": true, + "comment": { + "shortText": "Additional parameters sent with the authorization request" + } + }, + { + "name": "authorization_url", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "OAuth2 authorization URL" + } + }, + { + "name": "client_id", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "OAuth client ID" + } + }, + { + "name": "created_at", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Timestamp when the provider was created" + } + }, + { + "name": "discovery_document", + "type": { + "type": "union", + "subTypes": [ + { + "name": "OIDCDiscoveryDocument", + "type": "object", + "properties": [ + { + "name": "authorization_endpoint", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "URL of the authorization endpoint" + } + }, + { + "name": "issuer", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The issuer identifier" + } + }, + { + "name": "jwks_uri", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "URL of the JSON Web Key Set" + } + }, + { + "name": "revocation_endpoint", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "URL of the revocation endpoint" + } + }, + { + "name": "supported_id_token_signing_algs", + "type": { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + }, + "isOptional": true, + "comment": { + "shortText": "List of supported ID token signing algorithms" + } + }, + { + "name": "supported_response_types", + "type": { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + }, + "isOptional": true, + "comment": { + "shortText": "List of supported response types" + } + }, + { + "name": "supported_scopes", + "type": { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + }, + "isOptional": true, + "comment": { + "shortText": "List of supported scopes" + } + }, + { + "name": "supported_subject_types", + "type": { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + }, + "isOptional": true, + "comment": { + "shortText": "List of supported subject types" + } + }, + { + "name": "token_endpoint", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "URL of the token endpoint" + } + }, + { + "name": "userinfo_endpoint", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "URL of the userinfo endpoint" + } + } + ] + }, + { + "type": "literal", + "value": null + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "OIDC discovery document (OIDC providers only)" + } + }, + { + "name": "discovery_url", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "OIDC discovery URL" + } + }, + { + "name": "email_optional", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "Whether email is optional for this provider" + } + }, + { + "name": "enabled", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "Whether the provider is enabled" + } + }, + { + "name": "id", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Unique identifier (UUID)" + } + }, + { + "name": "identifier", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Provider identifier (e.g. `custom:mycompany`)" + } + }, + { + "name": "issuer", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "OIDC issuer URL" + } + }, + { + "name": "jwks_uri", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "JWKS URI for token verification" + } + }, + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Human-readable name" + } + }, + { + "name": "pkce_enabled", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "Whether PKCE is enabled" + } + }, + { + "name": "provider_type", + "type": { + "type": "union", + "name": "CustomProviderType", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Provider type" + } + }, + { + "name": "scopes", + "type": { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + }, + "isOptional": true, + "comment": { + "shortText": "OAuth scopes requested during authorization" + } + }, + { + "name": "skip_nonce_check", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "Whether to skip nonce check (OIDC)" + } + }, + { + "name": "token_url", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "OAuth2 token URL" + } + }, + { + "name": "updated_at", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Timestamp when the provider was last updated" + } + }, + { + "name": "userinfo_url", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "OAuth2 userinfo URL" + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Creates a new custom OIDC/OAuth provider.\n\nFor OIDC providers, the server fetches and validates the OpenID Connect discovery document\nfrom the issuer's well-known endpoint (or the provided `discovery_url`) at creation time.\nThis may return a validation error (`error_code: \"validation_failed\"`) if the discovery\ndocument is unreachable, not valid JSON, missing required fields, or if the issuer\nin the document does not match the expected issuer.\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser." + } + }, + "@supabase/supabase-js.GoTrueAdminCustomProvidersApi.deleteProvider": { + "name": "@supabase/supabase-js.GoTrueAdminCustomProvidersApi.deleteProvider", + "params": [ + { + "name": "identifier", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "literal", + "value": null + } + }, + { + "name": "error", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "nameOnly", + "name": "AuthError" + } + ] + } + } + ] + } + } + }, + "comment": { + "shortText": "Deletes a custom provider.\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser." + } + }, + "@supabase/supabase-js.GoTrueAdminCustomProvidersApi.getProvider": { + "name": "@supabase/supabase-js.GoTrueAdminCustomProvidersApi.getProvider", + "params": [ + { + "name": "identifier", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "CustomProviderResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "name": "CustomOAuthProvider", + "type": "object", + "properties": [ + { + "name": "acceptable_client_ids", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "Additional client IDs accepted during token validation" + } + }, + { + "name": "attribute_mapping", + "type": { + "type": "record", + "name": "Record", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "Mapping of provider attributes to Supabase user attributes" + } + }, + { + "name": "authorization_params", + "type": { + "type": "record", + "name": "Record", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "Additional parameters sent with the authorization request" + } + }, + { + "name": "authorization_url", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "OAuth2 authorization URL" + } + }, + { + "name": "client_id", + "type": "[Circular]", + "comment": { + "shortText": "OAuth client ID" + } + }, + { + "name": "created_at", + "type": "[Circular]", + "comment": { + "shortText": "Timestamp when the provider was created" + } + }, + { + "name": "discovery_document", + "type": { + "type": "union", + "subTypes": [ + { + "name": "OIDCDiscoveryDocument", + "type": "object", + "properties": [ + { + "name": "authorization_endpoint", + "type": "[Circular]", + "comment": { + "shortText": "URL of the authorization endpoint" + } + }, + { + "name": "issuer", + "type": "[Circular]", + "comment": { + "shortText": "The issuer identifier" + } + }, + { + "name": "jwks_uri", + "type": "[Circular]", + "comment": { + "shortText": "URL of the JSON Web Key Set" + } + }, + { + "name": "revocation_endpoint", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "URL of the revocation endpoint" + } + }, + { + "name": "supported_id_token_signing_algs", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "List of supported ID token signing algorithms" + } + }, + { + "name": "supported_response_types", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "List of supported response types" + } + }, + { + "name": "supported_scopes", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "List of supported scopes" + } + }, + { + "name": "supported_subject_types", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "List of supported subject types" + } + }, + { + "name": "token_endpoint", + "type": "[Circular]", + "comment": { + "shortText": "URL of the token endpoint" + } + }, + { + "name": "userinfo_endpoint", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "URL of the userinfo endpoint" + } + } + ] + }, + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "OIDC discovery document (OIDC providers only)" + } + }, + { + "name": "discovery_url", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "OIDC discovery URL" + } + }, + { + "name": "email_optional", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Whether email is optional for this provider" + } + }, + { + "name": "enabled", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Whether the provider is enabled" + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "Unique identifier (UUID)" + } + }, + { + "name": "identifier", + "type": "[Circular]", + "comment": { + "shortText": "Provider identifier (e.g. `custom:mycompany`)" + } + }, + { + "name": "issuer", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "OIDC issuer URL" + } + }, + { + "name": "jwks_uri", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "JWKS URI for token verification" + } + }, + { + "name": "name", + "type": "[Circular]", + "comment": { + "shortText": "Human-readable name" + } + }, + { + "name": "pkce_enabled", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Whether PKCE is enabled" + } + }, + { + "name": "provider_type", + "type": { + "type": "union", + "name": "CustomProviderType", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Provider type" + } + }, + { + "name": "scopes", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "OAuth scopes requested during authorization" + } + }, + { + "name": "skip_nonce_check", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Whether to skip nonce check (OIDC)" + } + }, + { + "name": "token_url", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "OAuth2 token URL" + } + }, + { + "name": "updated_at", + "type": "[Circular]", + "comment": { + "shortText": "Timestamp when the provider was last updated" + } + }, + { + "name": "userinfo_url", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "OAuth2 userinfo URL" + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Gets details of a specific custom provider by identifier.\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser." + } + }, + "@supabase/supabase-js.GoTrueAdminCustomProvidersApi.listProviders": { + "name": "@supabase/supabase-js.GoTrueAdminCustomProvidersApi.listProviders", + "params": [ + { + "name": "params", + "type": { + "name": "ListCustomProvidersParams", + "type": "object", + "properties": [ + { + "name": "type", + "type": { + "type": "union", + "name": "CustomProviderType", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "Filter by provider type" + } + } + ] + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "CustomProviderListResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "providers", + "type": { + "type": "array", + "elemType": { + "name": "CustomOAuthProvider", + "type": "object", + "properties": [ + { + "name": "acceptable_client_ids", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "Additional client IDs accepted during token validation" + } + }, + { + "name": "attribute_mapping", + "type": { + "type": "record", + "name": "Record", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "Mapping of provider attributes to Supabase user attributes" + } + }, + { + "name": "authorization_params", + "type": { + "type": "record", + "name": "Record", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "Additional parameters sent with the authorization request" + } + }, + { + "name": "authorization_url", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "OAuth2 authorization URL" + } + }, + { + "name": "client_id", + "type": "[Circular]", + "comment": { + "shortText": "OAuth client ID" + } + }, + { + "name": "created_at", + "type": "[Circular]", + "comment": { + "shortText": "Timestamp when the provider was created" + } + }, + { + "name": "discovery_document", + "type": { + "type": "union", + "subTypes": [ + { + "name": "OIDCDiscoveryDocument", + "type": "object", + "properties": [ + { + "name": "authorization_endpoint", + "type": "[Circular]", + "comment": { + "shortText": "URL of the authorization endpoint" + } + }, + { + "name": "issuer", + "type": "[Circular]", + "comment": { + "shortText": "The issuer identifier" + } + }, + { + "name": "jwks_uri", + "type": "[Circular]", + "comment": { + "shortText": "URL of the JSON Web Key Set" + } + }, + { + "name": "revocation_endpoint", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "URL of the revocation endpoint" + } + }, + { + "name": "supported_id_token_signing_algs", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "List of supported ID token signing algorithms" + } + }, + { + "name": "supported_response_types", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "List of supported response types" + } + }, + { + "name": "supported_scopes", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "List of supported scopes" + } + }, + { + "name": "supported_subject_types", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "List of supported subject types" + } + }, + { + "name": "token_endpoint", + "type": "[Circular]", + "comment": { + "shortText": "URL of the token endpoint" + } + }, + { + "name": "userinfo_endpoint", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "URL of the userinfo endpoint" + } + } + ] + }, + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "OIDC discovery document (OIDC providers only)" + } + }, + { + "name": "discovery_url", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "OIDC discovery URL" + } + }, + { + "name": "email_optional", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Whether email is optional for this provider" + } + }, + { + "name": "enabled", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Whether the provider is enabled" + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "Unique identifier (UUID)" + } + }, + { + "name": "identifier", + "type": "[Circular]", + "comment": { + "shortText": "Provider identifier (e.g. `custom:mycompany`)" + } + }, + { + "name": "issuer", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "OIDC issuer URL" + } + }, + { + "name": "jwks_uri", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "JWKS URI for token verification" + } + }, + { + "name": "name", + "type": "[Circular]", + "comment": { + "shortText": "Human-readable name" + } + }, + { + "name": "pkce_enabled", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Whether PKCE is enabled" + } + }, + { + "name": "provider_type", + "type": { + "type": "union", + "name": "CustomProviderType", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Provider type" + } + }, + { + "name": "scopes", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "OAuth scopes requested during authorization" + } + }, + { + "name": "skip_nonce_check", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Whether to skip nonce check (OIDC)" + } + }, + { + "name": "token_url", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "OAuth2 token URL" + } + }, + { + "name": "updated_at", + "type": "[Circular]", + "comment": { + "shortText": "Timestamp when the provider was last updated" + } + }, + { + "name": "userinfo_url", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "OAuth2 userinfo URL" + } + } + ] + } + } + } + ] + } + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "providers" + } + ] + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Lists all custom providers with optional type filter.\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser." + } + }, + "@supabase/supabase-js.GoTrueAdminCustomProvidersApi.updateProvider": { + "name": "@supabase/supabase-js.GoTrueAdminCustomProvidersApi.updateProvider", + "params": [ + { + "name": "identifier", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "params", + "type": { + "name": "UpdateCustomProviderParams", + "type": "object", + "properties": [ + { + "name": "acceptable_client_ids", + "type": { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + }, + "isOptional": true, + "comment": { + "shortText": "Additional client IDs accepted during token validation" + } + }, + { + "name": "attribute_mapping", + "type": { + "type": "record", + "name": "Record", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "any" + } + }, + "isOptional": true, + "comment": { + "shortText": "Mapping of provider attributes to Supabase user attributes" + } + }, + { + "name": "authorization_params", + "type": { + "type": "record", + "name": "Record", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "string" + } + }, + "isOptional": true, + "comment": { + "shortText": "Additional parameters sent with the authorization request" + } + }, + { + "name": "authorization_url", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "OAuth2 authorization URL" + } + }, + { + "name": "client_id", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "OAuth client ID" + } + }, + { + "name": "client_secret", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "OAuth client secret (write-only, not returned in responses)" + } + }, + { + "name": "discovery_url", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "OIDC discovery URL" + } + }, + { + "name": "email_optional", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "Whether email is optional for this provider" + } + }, + { + "name": "enabled", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "Whether the provider is enabled" + } + }, + { + "name": "issuer", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "OIDC issuer URL" + } + }, + { + "name": "jwks_uri", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "JWKS URI for token verification" + } + }, + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Human-readable name" + } + }, + { + "name": "pkce_enabled", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "Whether PKCE is enabled" + } + }, + { + "name": "scopes", + "type": { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + }, + "isOptional": true, + "comment": { + "shortText": "OAuth scopes requested during authorization" + } + }, + { + "name": "skip_nonce_check", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "Whether to skip nonce check (OIDC)" + } + }, + { + "name": "token_url", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "OAuth2 token URL" + } + }, + { + "name": "userinfo_url", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "OAuth2 userinfo URL" + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "CustomProviderResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "name": "CustomOAuthProvider", + "type": "object", + "properties": [ + { + "name": "acceptable_client_ids", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "Additional client IDs accepted during token validation" + } + }, + { + "name": "attribute_mapping", + "type": { + "type": "record", + "name": "Record", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "Mapping of provider attributes to Supabase user attributes" + } + }, + { + "name": "authorization_params", + "type": { + "type": "record", + "name": "Record", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "Additional parameters sent with the authorization request" + } + }, + { + "name": "authorization_url", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "OAuth2 authorization URL" + } + }, + { + "name": "client_id", + "type": "[Circular]", + "comment": { + "shortText": "OAuth client ID" + } + }, + { + "name": "created_at", + "type": "[Circular]", + "comment": { + "shortText": "Timestamp when the provider was created" + } + }, + { + "name": "discovery_document", + "type": { + "type": "union", + "subTypes": [ + { + "name": "OIDCDiscoveryDocument", + "type": "object", + "properties": [ + { + "name": "authorization_endpoint", + "type": "[Circular]", + "comment": { + "shortText": "URL of the authorization endpoint" + } + }, + { + "name": "issuer", + "type": "[Circular]", + "comment": { + "shortText": "The issuer identifier" + } + }, + { + "name": "jwks_uri", + "type": "[Circular]", + "comment": { + "shortText": "URL of the JSON Web Key Set" + } + }, + { + "name": "revocation_endpoint", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "URL of the revocation endpoint" + } + }, + { + "name": "supported_id_token_signing_algs", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "List of supported ID token signing algorithms" + } + }, + { + "name": "supported_response_types", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "List of supported response types" + } + }, + { + "name": "supported_scopes", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "List of supported scopes" + } + }, + { + "name": "supported_subject_types", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "List of supported subject types" + } + }, + { + "name": "token_endpoint", + "type": "[Circular]", + "comment": { + "shortText": "URL of the token endpoint" + } + }, + { + "name": "userinfo_endpoint", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "URL of the userinfo endpoint" + } + } + ] + }, + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "OIDC discovery document (OIDC providers only)" + } + }, + { + "name": "discovery_url", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "OIDC discovery URL" + } + }, + { + "name": "email_optional", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Whether email is optional for this provider" + } + }, + { + "name": "enabled", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Whether the provider is enabled" + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "Unique identifier (UUID)" + } + }, + { + "name": "identifier", + "type": "[Circular]", + "comment": { + "shortText": "Provider identifier (e.g. `custom:mycompany`)" + } + }, + { + "name": "issuer", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "OIDC issuer URL" + } + }, + { + "name": "jwks_uri", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "JWKS URI for token verification" + } + }, + { + "name": "name", + "type": "[Circular]", + "comment": { + "shortText": "Human-readable name" + } + }, + { + "name": "pkce_enabled", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Whether PKCE is enabled" + } + }, + { + "name": "provider_type", + "type": { + "type": "union", + "name": "CustomProviderType", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Provider type" + } + }, + { + "name": "scopes", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "OAuth scopes requested during authorization" + } + }, + { + "name": "skip_nonce_check", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Whether to skip nonce check (OIDC)" + } + }, + { + "name": "token_url", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "OAuth2 token URL" + } + }, + { + "name": "updated_at", + "type": "[Circular]", + "comment": { + "shortText": "Timestamp when the provider was last updated" + } + }, + { + "name": "userinfo_url", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "OAuth2 userinfo URL" + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Updates an existing custom provider.\n\nWhen `issuer` or `discovery_url` is changed on an OIDC provider, the server re-fetches and\nvalidates the discovery document before persisting. This may return a validation error\n(`error_code: \"validation_failed\"`) if the discovery document is unreachable, invalid, or\nthe issuer does not match.\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser." + } + }, + "@supabase/supabase-js.GoTrueAdminMFAApi.deleteFactor": { + "name": "@supabase/supabase-js.GoTrueAdminMFAApi.deleteFactor", + "params": [ + { + "name": "params", + "type": { + "name": "AuthMFAAdminDeleteFactorParams", + "type": "object", + "properties": [ + { + "name": "id", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "ID of the MFA factor to delete." + } + }, + { + "name": "userId", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "ID of the user whose factor is being deleted." + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthMFAAdminDeleteFactorResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "id", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "ID of the factor that was successfully deleted." + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Deletes a factor on a user. This will log the user out of all active\nsessions if the deleted factor was verified.", + "examples": [ + { + "id": "delete-a-factor-for-a-user", + "name": "Delete a factor for a user", + "code": "```js\nconst { data, error } = await supabase.auth.admin.mfa.deleteFactor({\n id: '34e770dd-9ff9-416c-87fa-43b31d7ef225',\n userId: 'a89baba7-b1b7-440f-b4bb-91026967f66b',\n})\n```", + "response": "```json\n{\n data: {\n id: '34e770dd-9ff9-416c-87fa-43b31d7ef225'\n },\n error: null\n}\n```" + } + ] + } + }, + "@supabase/supabase-js.GoTrueAdminMFAApi.listFactors": { + "name": "@supabase/supabase-js.GoTrueAdminMFAApi.listFactors", + "params": [ + { + "name": "params", + "type": { + "name": "AuthMFAAdminListFactorsParams", + "type": "object", + "properties": [ + { + "name": "userId", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "ID of the user." + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthMFAAdminListFactorsResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "nameOnly", + "name": "Type" + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "nameOnly", + "name": "Status" + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + }, + "comment": { + "shortText": "All factors attached to the user." + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Lists all factors associated to a user.", + "examples": [ + { + "id": "list-all-factors-for-a-user", + "name": "List all factors for a user", + "code": "```js\nconst { data, error } = await supabase.auth.admin.mfa.listFactors()\n```", + "response": "```json\n{\n data: {\n factors: Factor[\n {\n id: '',\n friendly_name: 'Auth App Factor',\n factor_type: 'totp',\n status: 'verified',\n created_at: '2024-01-01T00:00:00Z',\n updated_at: '2024-01-01T00:00:00Z'\n }\n ]\n },\n error: null\n}\n```" + } + ] + } + }, + "@supabase/supabase-js.GoTrueAdminOAuthApi.createClient": { + "name": "@supabase/supabase-js.GoTrueAdminOAuthApi.createClient", + "params": [ + { + "name": "params", + "type": { + "name": "CreateOAuthClientParams", + "type": "object", + "properties": [ + { + "name": "client_name", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Human-readable name of the OAuth client" + } + }, + { + "name": "client_uri", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "URI of the OAuth client" + } + }, + { + "name": "grant_types", + "type": { + "type": "array", + "elemType": { + "type": "union", + "name": "OAuthClientGrantType", + "subTypes": [ + { + "type": "literal", + "value": "authorization_code" + }, + { + "type": "literal", + "value": "refresh_token" + }, + null + ] + } + }, + "isOptional": true, + "comment": { + "shortText": "Array of allowed grant types (optional, defaults to authorization_code and refresh_token)" + } + }, + { + "name": "redirect_uris", + "type": { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + }, + "comment": { + "shortText": "Array of allowed redirect URIs" + } + }, + { + "name": "response_types", + "type": { + "type": "array", + "elemType": { + "type": "literal", + "value": "code", + "name": "OAuthClientResponseType" + } + }, + "isOptional": true, + "comment": { + "shortText": "Array of allowed response types (optional, defaults to code)" + } + }, + { + "name": "scope", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Scope of the OAuth client" + } + }, + { + "name": "token_endpoint_auth_method", + "type": { + "type": "union", + "name": "OAuthClientTokenEndpointAuthMethod", + "subTypes": [ + { + "type": "literal", + "value": "none" + }, + { + "type": "literal", + "value": "client_secret_basic" + }, + { + "type": "literal", + "value": "client_secret_post" + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Token endpoint authentication method (defaults to server default if not specified)" + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "OAuthClientResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "name": "OAuthClient", + "type": "object", + "properties": [ + { + "name": "client_id", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Unique identifier for the OAuth client" + } + }, + { + "name": "client_name", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Human-readable name of the OAuth client" + } + }, + { + "name": "client_secret", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Client secret (only returned on registration and regeneration)" + } + }, + { + "name": "client_type", + "type": { + "type": "union", + "name": "OAuthClientType", + "subTypes": [ + { + "type": "literal", + "value": "public" + }, + { + "type": "literal", + "value": "confidential" + } + ] + }, + "comment": { + "shortText": "Type of OAuth client" + } + }, + { + "name": "client_uri", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "URI of the OAuth client" + } + }, + { + "name": "created_at", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Timestamp when the client was created" + } + }, + { + "name": "grant_types", + "type": { + "type": "array", + "elemType": { + "type": "union", + "name": "OAuthClientGrantType", + "subTypes": [ + "[Circular]", + "[Circular]", + null + ] + } + }, + "comment": { + "shortText": "Array of allowed grant types" + } + }, + { + "name": "logo_uri", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "URI of the OAuth client's logo" + } + }, + { + "name": "redirect_uris", + "type": { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + }, + "comment": { + "shortText": "Array of allowed redirect URIs" + } + }, + { + "name": "registration_type", + "type": { + "type": "union", + "name": "OAuthClientRegistrationType", + "subTypes": [ + { + "type": "literal", + "value": "dynamic" + }, + { + "type": "literal", + "value": "manual" + } + ] + }, + "comment": { + "shortText": "Registration type of the client" + } + }, + { + "name": "response_types", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "comment": { + "shortText": "Array of allowed response types" + } + }, + { + "name": "scope", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Scope of the OAuth client" + } + }, + { + "name": "token_endpoint_auth_method", + "type": { + "type": "union", + "name": "OAuthClientTokenEndpointAuthMethod", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Token endpoint authentication method" + } + }, + { + "name": "updated_at", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Timestamp when the client was last updated" + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Creates a new OAuth client.\nOnly relevant when the OAuth 2.1 server is enabled in Supabase Auth.\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser." + } + }, + "@supabase/supabase-js.GoTrueAdminOAuthApi.deleteClient": { + "name": "@supabase/supabase-js.GoTrueAdminOAuthApi.deleteClient", + "params": [ + { + "name": "clientId", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "literal", + "value": null + } + }, + { + "name": "error", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "nameOnly", + "name": "AuthError" + } + ] + } + } + ] + } + } + }, + "comment": { + "shortText": "Deletes an OAuth client.\nOnly relevant when the OAuth 2.1 server is enabled in Supabase Auth.\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser." + } + }, + "@supabase/supabase-js.GoTrueAdminOAuthApi.getClient": { + "name": "@supabase/supabase-js.GoTrueAdminOAuthApi.getClient", + "params": [ + { + "name": "clientId", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "OAuthClientResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "name": "OAuthClient", + "type": "object", + "properties": [ + { + "name": "client_id", + "type": "[Circular]", + "comment": { + "shortText": "Unique identifier for the OAuth client" + } + }, + { + "name": "client_name", + "type": "[Circular]", + "comment": { + "shortText": "Human-readable name of the OAuth client" + } + }, + { + "name": "client_secret", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Client secret (only returned on registration and regeneration)" + } + }, + { + "name": "client_type", + "type": { + "type": "union", + "name": "OAuthClientType", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of OAuth client" + } + }, + { + "name": "client_uri", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "URI of the OAuth client" + } + }, + { + "name": "created_at", + "type": "[Circular]", + "comment": { + "shortText": "Timestamp when the client was created" + } + }, + { + "name": "grant_types", + "type": { + "type": "array", + "elemType": { + "type": "union", + "name": "OAuthClientGrantType", + "subTypes": [ + "[Circular]", + "[Circular]", + null + ] + } + }, + "comment": { + "shortText": "Array of allowed grant types" + } + }, + { + "name": "logo_uri", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "URI of the OAuth client's logo" + } + }, + { + "name": "redirect_uris", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "comment": { + "shortText": "Array of allowed redirect URIs" + } + }, + { + "name": "registration_type", + "type": { + "type": "union", + "name": "OAuthClientRegistrationType", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Registration type of the client" + } + }, + { + "name": "response_types", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "comment": { + "shortText": "Array of allowed response types" + } + }, + { + "name": "scope", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Scope of the OAuth client" + } + }, + { + "name": "token_endpoint_auth_method", + "type": { + "type": "union", + "name": "OAuthClientTokenEndpointAuthMethod", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Token endpoint authentication method" + } + }, + { + "name": "updated_at", + "type": "[Circular]", + "comment": { + "shortText": "Timestamp when the client was last updated" + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Gets details of a specific OAuth client.\nOnly relevant when the OAuth 2.1 server is enabled in Supabase Auth.\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser." + } + }, + "@supabase/supabase-js.GoTrueAdminOAuthApi.listClients": { + "name": "@supabase/supabase-js.GoTrueAdminOAuthApi.listClients", + "params": [ + { + "name": "params", + "type": { + "name": "PageParams", + "type": "object", + "properties": [ + { + "name": "page", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The page number" + } + }, + { + "name": "perPage", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Number of items returned per page" + } + } + ] + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "OAuthClientListResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data" + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "clients" + } + ] + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Lists all OAuth clients with optional pagination.\nOnly relevant when the OAuth 2.1 server is enabled in Supabase Auth.\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser." + } + }, + "@supabase/supabase-js.GoTrueAdminOAuthApi.regenerateClientSecret": { + "name": "@supabase/supabase-js.GoTrueAdminOAuthApi.regenerateClientSecret", + "params": [ + { + "name": "clientId", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "OAuthClientResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "name": "OAuthClient", + "type": "object", + "properties": [ + { + "name": "client_id", + "type": "[Circular]", + "comment": { + "shortText": "Unique identifier for the OAuth client" + } + }, + { + "name": "client_name", + "type": "[Circular]", + "comment": { + "shortText": "Human-readable name of the OAuth client" + } + }, + { + "name": "client_secret", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Client secret (only returned on registration and regeneration)" + } + }, + { + "name": "client_type", + "type": { + "type": "union", + "name": "OAuthClientType", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of OAuth client" + } + }, + { + "name": "client_uri", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "URI of the OAuth client" + } + }, + { + "name": "created_at", + "type": "[Circular]", + "comment": { + "shortText": "Timestamp when the client was created" + } + }, + { + "name": "grant_types", + "type": { + "type": "array", + "elemType": { + "type": "union", + "name": "OAuthClientGrantType", + "subTypes": [ + "[Circular]", + "[Circular]", + null + ] + } + }, + "comment": { + "shortText": "Array of allowed grant types" + } + }, + { + "name": "logo_uri", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "URI of the OAuth client's logo" + } + }, + { + "name": "redirect_uris", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "comment": { + "shortText": "Array of allowed redirect URIs" + } + }, + { + "name": "registration_type", + "type": { + "type": "union", + "name": "OAuthClientRegistrationType", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Registration type of the client" + } + }, + { + "name": "response_types", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "comment": { + "shortText": "Array of allowed response types" + } + }, + { + "name": "scope", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Scope of the OAuth client" + } + }, + { + "name": "token_endpoint_auth_method", + "type": { + "type": "union", + "name": "OAuthClientTokenEndpointAuthMethod", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Token endpoint authentication method" + } + }, + { + "name": "updated_at", + "type": "[Circular]", + "comment": { + "shortText": "Timestamp when the client was last updated" + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Regenerates the secret for an OAuth client.\nOnly relevant when the OAuth 2.1 server is enabled in Supabase Auth.\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser." + } + }, + "@supabase/supabase-js.GoTrueAdminOAuthApi.updateClient": { + "name": "@supabase/supabase-js.GoTrueAdminOAuthApi.updateClient", + "params": [ + { + "name": "clientId", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "params", + "type": { + "name": "UpdateOAuthClientParams", + "type": "object", + "properties": [ + { + "name": "client_name", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Human-readable name of the OAuth client" + } + }, + { + "name": "client_uri", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "URI of the OAuth client" + } + }, + { + "name": "grant_types", + "type": { + "type": "array", + "elemType": { + "type": "union", + "name": "OAuthClientGrantType", + "subTypes": [ + "[Circular]", + "[Circular]", + null + ] + } + }, + "isOptional": true, + "comment": { + "shortText": "Array of allowed grant types" + } + }, + { + "name": "logo_uri", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "URI of the OAuth client's logo" + } + }, + { + "name": "redirect_uris", + "type": { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + }, + "isOptional": true, + "comment": { + "shortText": "Array of allowed redirect URIs" + } + }, + { + "name": "token_endpoint_auth_method", + "type": { + "type": "union", + "name": "OAuthClientTokenEndpointAuthMethod", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "Token endpoint authentication method" + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "OAuthClientResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "name": "OAuthClient", + "type": "object", + "properties": [ + { + "name": "client_id", + "type": "[Circular]", + "comment": { + "shortText": "Unique identifier for the OAuth client" + } + }, + { + "name": "client_name", + "type": "[Circular]", + "comment": { + "shortText": "Human-readable name of the OAuth client" + } + }, + { + "name": "client_secret", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Client secret (only returned on registration and regeneration)" + } + }, + { + "name": "client_type", + "type": { + "type": "union", + "name": "OAuthClientType", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of OAuth client" + } + }, + { + "name": "client_uri", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "URI of the OAuth client" + } + }, + { + "name": "created_at", + "type": "[Circular]", + "comment": { + "shortText": "Timestamp when the client was created" + } + }, + { + "name": "grant_types", + "type": { + "type": "array", + "elemType": { + "type": "union", + "name": "OAuthClientGrantType", + "subTypes": [ + "[Circular]", + "[Circular]", + null + ] + } + }, + "comment": { + "shortText": "Array of allowed grant types" + } + }, + { + "name": "logo_uri", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "URI of the OAuth client's logo" + } + }, + { + "name": "redirect_uris", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "comment": { + "shortText": "Array of allowed redirect URIs" + } + }, + { + "name": "registration_type", + "type": { + "type": "union", + "name": "OAuthClientRegistrationType", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Registration type of the client" + } + }, + { + "name": "response_types", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "comment": { + "shortText": "Array of allowed response types" + } + }, + { + "name": "scope", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Scope of the OAuth client" + } + }, + { + "name": "token_endpoint_auth_method", + "type": { + "type": "union", + "name": "OAuthClientTokenEndpointAuthMethod", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Token endpoint authentication method" + } + }, + { + "name": "updated_at", + "type": "[Circular]", + "comment": { + "shortText": "Timestamp when the client was last updated" + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Updates an existing OAuth client.\nOnly relevant when the OAuth 2.1 server is enabled in Supabase Auth.\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser." + } + }, + "@supabase/supabase-js.GoTrueAdminPasskeyApi.deletePasskey": { + "name": "@supabase/supabase-js.GoTrueAdminPasskeyApi.deletePasskey", + "params": [ + { + "name": "params", + "type": { + "name": "AuthPasskeyAdminDeleteParams", + "type": "object", + "properties": [ + { + "name": "passkeyId", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "userId", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthPasskeyDeleteResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Deletes a specific passkey for a specific user.\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser." + } + }, + "@supabase/supabase-js.GoTrueAdminPasskeyApi.listPasskeys": { + "name": "@supabase/supabase-js.GoTrueAdminPasskeyApi.listPasskeys", + "params": [ + { + "name": "params", + "type": { + "name": "AuthPasskeyAdminListParams", + "type": "object", + "properties": [ + { + "name": "userId", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthPasskeyListResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "array", + "elemType": { + "name": "PasskeyListItem", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "last_used_at", + "type": "[Circular]", + "isOptional": true + } + ] + } + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Lists all passkeys registered for a specific user.\n\nThis function should only be called on a server. Never expose your `service_role` key in the browser." + } + }, + "@supabase/supabase-js.GoTrueMFAApi.challenge": { + "name": "@supabase/supabase-js.GoTrueMFAApi.challenge", + "params": [ + { + "name": "params", + "type": { + "type": "nameOnly", + "name": "MFAChallengeParamsBase" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "literal", + "value": null + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "nameOnly", + "name": "AuthMFAChallengeResponseBase" + } + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + } + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Prepares a challenge used to verify that a user has access to a MFA\nfactor.", + "text": "- An [enrolled factor](/docs/reference/javascript/auth-mfa-enroll) is required before creating a challenge.\n- To verify a challenge, see [`mfa.verify()`](/docs/reference/javascript/auth-mfa-verify).\n- A phone factor sends a code to the user upon challenge. The channel defaults to `sms` unless otherwise specified.", + "examples": [ + { + "id": "create-a-challenge-for-a-factor", + "name": "Create a challenge for a factor", + "code": "```js\nconst { data, error } = await supabase.auth.mfa.challenge({\n factorId: '34e770dd-9ff9-416c-87fa-43b31d7ef225'\n})\n```", + "response": "```json\n{\n data: {\n id: '',\n type: 'totp',\n expires_at: 1700000000\n },\n error: null\n}\n```" + }, + { + "id": "create-a-challenge-for-a-phone-factor", + "name": "Create a challenge for a phone factor", + "code": "```js\nconst { data, error } = await supabase.auth.mfa.challenge({\n factorId: '34e770dd-9ff9-416c-87fa-43b31d7ef225',\n})\n```", + "response": "```json\n{\n data: {\n id: '',\n type: 'phone',\n expires_at: 1700000000\n },\n error: null\n}\n```" + }, + { + "id": "create-a-challenge-for-a-phone-factor-whatsapp", + "name": "Create a challenge for a phone factor (WhatsApp)", + "code": "```js\nconst { data, error } = await supabase.auth.mfa.challenge({\n factorId: '34e770dd-9ff9-416c-87fa-43b31d7ef225',\n channel: 'whatsapp',\n})\n```", + "response": "```json\n{\n data: {\n id: '',\n expires_at: 1700000000\n },\n error: null\n}\n```" + } + ] + }, + "altSignatures": [ + { + "params": [ + { + "name": "params", + "type": { + "type": "nameOnly", + "name": "MFAChallengePhoneParams" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "literal", + "value": null + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "nameOnly", + "name": "AuthMFAChallengeResponseBase" + } + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + } + } + ] + } + ] + } + } + } + }, + { + "params": [ + { + "name": "params", + "type": { + "type": "nameOnly", + "name": "MFAChallengeWebauthnParams" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "literal", + "value": null + } + }, + { + "name": "error", + "type": { + "type": "nameOnly", + "name": "AuthError" + } + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data" + }, + { + "name": "error", + "type": { + "type": "literal", + "value": null + } + } + ] + } + ] + } + } + } + }, + { + "params": [ + { + "name": "params", + "type": { + "type": "union", + "name": "MFAChallengeParams", + "subTypes": [ + { + "type": "nameOnly", + "name": "MFAChallengeTOTPParams" + }, + { + "type": "nameOnly", + "name": "MFAChallengePhoneParams" + }, + { + "type": "nameOnly", + "name": "MFAChallengeWebauthnParams" + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthMFAChallengeResponse", + "subTypes": [ + { + "type": "union", + "name": "AuthMFAChallengeTOTPResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data" + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + }, + { + "type": "union", + "name": "AuthMFAChallengePhoneResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data" + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + }, + { + "type": "union", + "name": "AuthMFAChallengeWebauthnResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data" + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + ] + } + } + } + } + ] + }, + "@supabase/supabase-js.GoTrueMFAApi.challengeAndVerify": { + "name": "@supabase/supabase-js.GoTrueMFAApi.challengeAndVerify", + "params": [ + { + "name": "params", + "type": { + "type": "nameOnly", + "name": "MFAChallengeAndVerifyTOTPParams" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthMFAVerifyResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "name": "AuthMFAVerifyResponseData", + "type": "object", + "properties": [ + { + "name": "access_token", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "New access token (JWT) after successful verification." + } + }, + { + "name": "expires_in", + "type": { + "type": "intrinsic", + "name": "number" + }, + "comment": { + "shortText": "Number of seconds in which the access token will expire." + } + }, + { + "name": "refresh_token", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Refresh token you can use to obtain new access tokens when expired." + } + }, + { + "name": "token_type", + "type": { + "type": "literal", + "value": "bearer" + }, + "comment": { + "shortText": "Type of token, always `bearer`." + } + }, + { + "name": "user", + "type": { + "type": "object", + "name": "AuthUser", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + "comment": { + "shortText": "Updated user profile." + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Helper method which creates a challenge and immediately uses the given code to verify against it thereafter. The verification code is\nprovided by the user by entering a code seen in their authenticator app.", + "text": "- Intended for use with only TOTP factors.\n- An [enrolled factor](/docs/reference/javascript/auth-mfa-enroll) is required before invoking `challengeAndVerify()`.\n- Executes [`mfa.challenge()`](/docs/reference/javascript/auth-mfa-challenge) and [`mfa.verify()`](/docs/reference/javascript/auth-mfa-verify) in a single step.", + "examples": [ + { + "id": "create-and-verify-a-challenge-for-a-factor", + "name": "Create and verify a challenge for a factor", + "code": "```js\nconst { data, error } = await supabase.auth.mfa.challengeAndVerify({\n factorId: '34e770dd-9ff9-416c-87fa-43b31d7ef225',\n code: '123456'\n})\n```", + "response": "```json\n{\n data: {\n access_token: '',\n token_type: 'Bearer',\n expires_in: 3600,\n refresh_token: '',\n user: {\n id: '11111111-1111-1111-1111-111111111111',\n aud: 'authenticated',\n role: 'authenticated',\n email: 'example@email.com',\n email_confirmed_at: '2024-01-01T00:00:00Z',\n phone: '',\n confirmation_sent_at: '2024-01-01T00:00:00Z',\n confirmed_at: '2024-01-01T00:00:00Z',\n last_sign_in_at: '2024-01-01T00:00:00Z',\n app_metadata: {\n provider: 'email',\n providers: [\n \"email\",\n ]\n },\n user_metadata: {},\n identities: [\n {\n \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n \"identity_data\": {\n \"email\": \"example@email.com\",\n \"email_verified\": true,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"provider\": \"email\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"email@example.com\"\n },\n ],\n created_at: '2024-01-01T00:00:00Z',\n updated_at: '2024-01-01T00:00:00Z',\n is_anonymous: false,\n factors: [\n \"id\": '',\n \"friendly_name\": 'Important Auth App',\n \"factor_type\": 'totp',\n \"status\": 'verified',\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\"\n ]\n }\n }\n error: null\n}\n```" + } + ] + } + }, + "@supabase/supabase-js.GoTrueMFAApi.enroll": { + "name": "@supabase/supabase-js.GoTrueMFAApi.enroll", + "params": [ + { + "name": "params", + "type": { + "type": "nameOnly", + "name": "MFAEnrollTOTPParams" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthMFAEnrollTOTPResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data" + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Starts the enrollment process for a new Multi-Factor Authentication (MFA)\nfactor. This method creates a new `unverified` factor.\nTo verify a factor, present the QR code or secret to the user and ask them to add it to their\nauthenticator app.\nThe user has to enter the code from their authenticator app to verify it.\n\nUpon verifying a factor, all other sessions are logged out and the current session's authenticator level is promoted to `aal2`.", + "text": "- Use `totp` or `phone` as the `factorType` and use the returned `id` to create a challenge.\n- To create a challenge, see [`mfa.challenge()`](/docs/reference/javascript/auth-mfa-challenge).\n- To verify a challenge, see [`mfa.verify()`](/docs/reference/javascript/auth-mfa-verify).\n- To create and verify a TOTP challenge in a single step, see [`mfa.challengeAndVerify()`](/docs/reference/javascript/auth-mfa-challengeandverify).\n- To generate a QR code for the `totp` secret in Next.js, you can do the following:\n```html\n{data.totp.uri}\n```\n- The `challenge` and `verify` steps are separated when using Phone factors as the user will need time to receive and input the code obtained from the SMS in challenge.", + "examples": [ + { + "id": "enroll-a-time-based-one-time-password-totp-factor", + "name": "Enroll a time-based, one-time password (TOTP) factor", + "code": "```js\nconst { data, error } = await supabase.auth.mfa.enroll({\n factorType: 'totp',\n friendlyName: 'your_friendly_name'\n})\n\n// Use the id to create a challenge.\n// The challenge can be verified by entering the code generated from the authenticator app.\n// The code will be generated upon scanning the qr_code or entering the secret into the authenticator app.\nconst { id, type, totp: { qr_code, secret, uri }, friendly_name } = data\nconst challenge = await supabase.auth.mfa.challenge({ factorId: id });\n```", + "response": "```json\n{\n data: {\n id: '',\n type: 'totp'\n totp: {\n qr_code: '',\n secret: '',\n uri: '',\n }\n friendly_name?: 'Important app'\n },\n error: null\n}\n```" + }, + { + "id": "enroll-a-phone-factor", + "name": "Enroll a Phone Factor", + "code": "```js\nconst { data, error } = await supabase.auth.mfa.enroll({\n factorType: 'phone',\n friendlyName: 'your_friendly_name',\n phone: '+12345678',\n})\n\n// Use the id to create a challenge and send an SMS with a code to the user.\nconst { id, type, friendly_name, phone } = data\n\nconst challenge = await supabase.auth.mfa.challenge({ factorId: id });\n```", + "response": "```json\n{\n data: {\n id: '',\n type: 'phone',\n friendly_name?: 'Important app',\n phone: '+5787123456'\n },\n error: null\n}\n```" + } + ] + }, + "altSignatures": [ + { + "params": [ + { + "name": "params", + "type": { + "type": "nameOnly", + "name": "MFAEnrollPhoneParams" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthMFAEnrollPhoneResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data" + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + } + }, + { + "params": [ + { + "name": "params", + "type": { + "type": "nameOnly", + "name": "MFAEnrollParamsBase" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthMFAEnrollWebauthnResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data" + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + } + }, + { + "params": [ + { + "name": "params", + "type": { + "type": "union", + "name": "MFAEnrollParams", + "subTypes": [ + { + "type": "nameOnly", + "name": "MFAEnrollTOTPParams" + }, + { + "type": "nameOnly", + "name": "MFAEnrollPhoneParams" + }, + { + "type": "nameOnly", + "name": "MFAEnrollWebauthnParams" + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthMFAEnrollResponse", + "subTypes": [ + { + "type": "union", + "name": "AuthMFAEnrollTOTPResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data" + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + }, + { + "type": "union", + "name": "AuthMFAEnrollPhoneResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data" + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + }, + { + "type": "union", + "name": "AuthMFAEnrollWebauthnResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data" + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + ] + } + } + } + } + ] + }, + "@supabase/supabase-js.GoTrueMFAApi.getAuthenticatorAssuranceLevel": { + "name": "@supabase/supabase-js.GoTrueMFAApi.getAuthenticatorAssuranceLevel", + "params": [ + { + "name": "jwt", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Takes in an optional access token JWT. If no JWT is provided, the JWT from the current session is used." + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthMFAGetAuthenticatorAssuranceLevelResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "currentAuthenticationMethods", + "type": { + "type": "union", + "subTypes": [ + { + "type": "array", + "elemType": { + "type": "object", + "name": "AMREntry", + "properties": [ + { + "name": "method", + "type": { + "type": "union", + "name": "AMRMethod", + "subTypes": [ + { + "type": "nameOnly", + "name": "['number']" + }, + null + ] + }, + "comment": { + "shortText": "Authentication method name." + } + }, + { + "name": "timestamp", + "type": "[Circular]", + "comment": { + "shortText": "Timestamp when the method was successfully used. Represents number of\nseconds since 1st January 1970 (UNIX epoch) in UTC." + } + } + ] + } + }, + { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + } + ] + }, + "comment": { + "shortText": "A list of all authentication methods attached to this session. Use\nthe information here to detect the last time a user verified a\nfactor, for example if implementing a step-up scenario.\n\nSupports both RFC-8176 compliant format (string[]) and detailed format (AMREntry[]).\n- String format: ['password', 'otp'] - RFC-8176 compliant\n- Object format: [{ method: 'password', timestamp: 1234567890 }] - includes timestamps" + } + }, + { + "name": "currentLevel", + "type": { + "type": "union", + "subTypes": [ + { + "type": "union", + "name": "AuthenticatorAssuranceLevels", + "subTypes": [ + "[Circular]", + "[Circular]", + null + ] + }, + { + "type": "literal", + "value": null + } + ] + }, + "comment": { + "shortText": "Current AAL level of the session." + } + }, + { + "name": "nextLevel", + "type": { + "type": "union", + "subTypes": [ + { + "type": "union", + "name": "AuthenticatorAssuranceLevels", + "subTypes": [ + "[Circular]", + "[Circular]", + null + ] + }, + { + "type": "literal", + "value": null + } + ] + }, + "comment": { + "shortText": "Next possible AAL level for the session. If the next level is higher\nthan the current one, the user should go through MFA." + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Returns the Authenticator Assurance Level (AAL) for the active session.\n\n- `aal1` (or `null`) means that the user's identity has been verified only\nwith a conventional login (email+password, OTP, magic link, social login,\netc.).\n- `aal2` means that the user's identity has been verified both with a conventional login and at least one MFA factor.\n\nWhen called without a JWT parameter, this method is fairly quick (microseconds)\nand rarely uses the network. When a JWT is provided (useful in server-side\nenvironments like Edge Functions where no session is stored), this method\nwill make a network request to validate the user and fetch their MFA factors.", + "text": "- Authenticator Assurance Level (AAL) is the measure of the strength of an authentication mechanism.\n- In Supabase, having an AAL of `aal1` refers to having the 1st factor of authentication such as an email and password or OAuth sign-in while `aal2` refers to the 2nd factor of authentication such as a time-based, one-time-password (TOTP) or Phone factor.\n- If the user has a verified factor, the `nextLevel` field will return `aal2`, else, it will return `aal1`.\n- An optional `jwt` parameter can be passed to check the AAL level of a specific JWT instead of the current session.", + "examples": [ + { + "id": "get-the-aal-details-of-a-session", + "name": "Get the AAL details of a session", + "code": "```js\nconst { data, error } = await supabase.auth.mfa.getAuthenticatorAssuranceLevel()\nconst { currentLevel, nextLevel, currentAuthenticationMethods } = data\n```", + "response": "```json\n{\n data: {\n currentLevel: 'aal1',\n nextLevel: 'aal2',\n currentAuthenticationMethods: [\n {\n method: 'password',\n timestamp: 1700000000\n }\n ]\n }\n error: null\n}\n```" + }, + { + "id": "get-the-aal-details-for-a-specific-jwt", + "name": "Get the AAL details for a specific JWT", + "code": "```js\nconst { data, error } = await supabase.auth.mfa.getAuthenticatorAssuranceLevel(jwt)\n```" + } + ] + } + }, + "@supabase/supabase-js.GoTrueMFAApi.listFactors": { + "name": "@supabase/supabase-js.GoTrueMFAApi.listFactors", + "params": [], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthMFAListFactorsResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data" + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Returns the list of MFA factors enabled for this user." + } + }, + "@supabase/supabase-js.GoTrueMFAApi.unenroll": { + "name": "@supabase/supabase-js.GoTrueMFAApi.unenroll", + "params": [ + { + "name": "params", + "type": { + "name": "MFAUnenrollParams", + "type": "object", + "properties": [ + { + "name": "factorId", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "ID of the factor being unenrolled." + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthMFAUnenrollResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "type": "object", + "properties": [ + { + "name": "id", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "ID of the factor that was successfully unenrolled." + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Unenroll removes a MFA factor.\nA user has to have an `aal2` authenticator level in order to unenroll a `verified` factor.", + "examples": [ + { + "id": "unenroll-a-factor", + "name": "Unenroll a factor", + "code": "```js\nconst { data, error } = await supabase.auth.mfa.unenroll({\n factorId: '34e770dd-9ff9-416c-87fa-43b31d7ef225',\n})\n```", + "response": "```json\n{\n data: {\n id: ''\n },\n error: null\n}\n```" + } + ] + } + }, + "@supabase/supabase-js.GoTrueMFAApi.verify": { + "name": "@supabase/supabase-js.GoTrueMFAApi.verify", + "params": [ + { + "name": "params", + "type": { + "type": "nameOnly", + "name": "MFAVerifyTOTPParams" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthMFAVerifyResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "name": "AuthMFAVerifyResponseData", + "type": "object", + "properties": [ + { + "name": "access_token", + "type": "[Circular]", + "comment": { + "shortText": "New access token (JWT) after successful verification." + } + }, + { + "name": "expires_in", + "type": "[Circular]", + "comment": { + "shortText": "Number of seconds in which the access token will expire." + } + }, + { + "name": "refresh_token", + "type": "[Circular]", + "comment": { + "shortText": "Refresh token you can use to obtain new access tokens when expired." + } + }, + { + "name": "token_type", + "type": "[Circular]", + "comment": { + "shortText": "Type of token, always `bearer`." + } + }, + { + "name": "user", + "type": { + "type": "object", + "name": "AuthUser", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + "comment": { + "shortText": "Updated user profile." + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + }, + "comment": { + "shortText": "Verifies a code against a challenge. The verification code is\nprovided by the user by entering a code seen in their authenticator app.", + "text": "- To verify a challenge, please [create a challenge](/docs/reference/javascript/auth-mfa-challenge) first.", + "examples": [ + { + "id": "verify-a-challenge-for-a-factor", + "name": "Verify a challenge for a factor", + "code": "```js\nconst { data, error } = await supabase.auth.mfa.verify({\n factorId: '34e770dd-9ff9-416c-87fa-43b31d7ef225',\n challengeId: '4034ae6f-a8ce-4fb5-8ee5-69a5863a7c15',\n code: '123456'\n})\n```", + "response": "```json\n{\n data: {\n access_token: '',\n token_type: 'Bearer',\n expires_in: 3600,\n refresh_token: '',\n user: {\n id: '11111111-1111-1111-1111-111111111111',\n aud: 'authenticated',\n role: 'authenticated',\n email: 'example@email.com',\n email_confirmed_at: '2024-01-01T00:00:00Z',\n phone: '',\n confirmation_sent_at: '2024-01-01T00:00:00Z',\n confirmed_at: '2024-01-01T00:00:00Z',\n last_sign_in_at: '2024-01-01T00:00:00Z',\n app_metadata: {\n provider: 'email',\n providers: [\n \"email\",\n ]\n },\n user_metadata: {},\n identities: [\n {\n \"identity_id\": \"22222222-2222-2222-2222-222222222222\",\n \"id\": \"11111111-1111-1111-1111-111111111111\",\n \"user_id\": \"11111111-1111-1111-1111-111111111111\",\n \"identity_data\": {\n \"email\": \"example@email.com\",\n \"email_verified\": true,\n \"phone_verified\": false,\n \"sub\": \"11111111-1111-1111-1111-111111111111\"\n },\n \"provider\": \"email\",\n \"last_sign_in_at\": \"2024-01-01T00:00:00Z\",\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\",\n \"email\": \"email@example.com\"\n },\n ],\n created_at: '2024-01-01T00:00:00Z',\n updated_at: '2024-01-01T00:00:00Z',\n is_anonymous: false,\n factors: [\n \"id\": '',\n \"friendly_name\": 'Important Auth App',\n \"factor_type\": 'totp',\n \"status\": 'verified',\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\"\n ]\n }\n }\n error: null\n}\n```" + } + ] + }, + "altSignatures": [ + { + "params": [ + { + "name": "params", + "type": { + "type": "nameOnly", + "name": "MFAVerifyPhoneParams" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthMFAVerifyResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "name": "AuthMFAVerifyResponseData", + "type": "object", + "properties": [ + { + "name": "access_token", + "type": "[Circular]", + "comment": { + "shortText": "New access token (JWT) after successful verification." + } + }, + { + "name": "expires_in", + "type": "[Circular]", + "comment": { + "shortText": "Number of seconds in which the access token will expire." + } + }, + { + "name": "refresh_token", + "type": "[Circular]", + "comment": { + "shortText": "Refresh token you can use to obtain new access tokens when expired." + } + }, + { + "name": "token_type", + "type": "[Circular]", + "comment": { + "shortText": "Type of token, always `bearer`." + } + }, + { + "name": "user", + "type": { + "type": "object", + "name": "AuthUser", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + "comment": { + "shortText": "Updated user profile." + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + } + }, + { + "params": [ + { + "name": "params", + "type": { + "type": "nameOnly", + "name": "MFAVerifyWebauthnParams" + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthMFAVerifyResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "name": "AuthMFAVerifyResponseData", + "type": "object", + "properties": [ + { + "name": "access_token", + "type": "[Circular]", + "comment": { + "shortText": "New access token (JWT) after successful verification." + } + }, + { + "name": "expires_in", + "type": "[Circular]", + "comment": { + "shortText": "Number of seconds in which the access token will expire." + } + }, + { + "name": "refresh_token", + "type": "[Circular]", + "comment": { + "shortText": "Refresh token you can use to obtain new access tokens when expired." + } + }, + { + "name": "token_type", + "type": "[Circular]", + "comment": { + "shortText": "Type of token, always `bearer`." + } + }, + { + "name": "user", + "type": { + "type": "object", + "name": "AuthUser", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + "comment": { + "shortText": "Updated user profile." + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + } + }, + { + "params": [ + { + "name": "params", + "type": { + "type": "union", + "name": "MFAVerifyParams", + "subTypes": [ + { + "type": "nameOnly", + "name": "MFAVerifyTOTPParams" + }, + { + "type": "nameOnly", + "name": "MFAVerifyPhoneParams" + }, + { + "type": "nameOnly", + "name": "MFAVerifyWebauthnParams" + } + ] + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "name": "AuthMFAVerifyResponse", + "subTypes": [ + { + "type": "object", + "properties": [ + { + "name": "data", + "type": { + "name": "AuthMFAVerifyResponseData", + "type": "object", + "properties": [ + { + "name": "access_token", + "type": "[Circular]", + "comment": { + "shortText": "New access token (JWT) after successful verification." + } + }, + { + "name": "expires_in", + "type": "[Circular]", + "comment": { + "shortText": "Number of seconds in which the access token will expire." + } + }, + { + "name": "refresh_token", + "type": "[Circular]", + "comment": { + "shortText": "Refresh token you can use to obtain new access tokens when expired." + } + }, + { + "name": "token_type", + "type": "[Circular]", + "comment": { + "shortText": "Type of token, always `bearer`." + } + }, + { + "name": "user", + "type": { + "type": "object", + "name": "AuthUser", + "properties": [ + { + "name": "action_link", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "app_metadata", + "type": { + "type": "object", + "name": "UserAppMetadata", + "properties": [ + { + "name": "provider", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "The first provider that the user used to sign up with." + } + }, + { + "name": "providers", + "type": { + "type": "array", + "elemType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "A list of all providers that the user has linked to their account." + } + } + ] + } + }, + { + "name": "aud", + "type": "[Circular]" + }, + { + "name": "banned_until", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmation_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "deleted_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_change_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "email_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "factors", + "type": { + "type": "array", + "elemType": { + "type": "union", + "subTypes": [ + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + }, + { + "name": "Factor", + "type": "object", + "properties": [ + { + "name": "created_at", + "type": "[Circular]" + }, + { + "name": "factor_type", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "Type of factor. `totp` and `phone` supported with this version" + } + }, + { + "name": "friendly_name", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Friendly name of the factor, useful to disambiguate between multiple factors." + } + }, + { + "name": "id", + "type": "[Circular]", + "comment": { + "shortText": "ID of the factor." + } + }, + { + "name": "last_challenged_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "status", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]", + "[Circular]" + ] + }, + "comment": { + "shortText": "The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`" + } + }, + { + "name": "updated_at", + "type": "[Circular]" + } + ] + } + ] + } + }, + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identities", + "type": { + "type": "array", + "elemType": { + "type": "object", + "name": "UserIdentity", + "properties": [ + { + "name": "created_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "id", + "type": "[Circular]" + }, + { + "name": "identity_data", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "identity_id", + "type": "[Circular]" + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "provider", + "type": "[Circular]" + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_id", + "type": "[Circular]" + } + ] + } + }, + "isOptional": true + }, + { + "name": "invited_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_anonymous", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "is_sso_user", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "last_sign_in_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_email", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "new_phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "phone_confirmed_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "recovery_sent_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "role", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "updated_at", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "user_metadata", + "type": { + "type": "object", + "name": "UserMetadata", + "properties": [] + } + } + ] + }, + "comment": { + "shortText": "Updated user profile." + } + } + ] + } + }, + { + "name": "error", + "type": "[Circular]" + } + ] + }, + { + "type": "object", + "properties": [ + { + "name": "data", + "type": "[Circular]" + }, + { + "name": "error" + } + ] + } + ] + } + } + } + } + ] + }, + "@supabase/supabase-js.WebSocketLike.addEventListener": { + "name": "@supabase/supabase-js.WebSocketLike.addEventListener", + "params": [ + { + "name": "type", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "listener", + "type": { + "type": "nameOnly", + "name": "EventListener" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + }, + "comment": { + "shortText": "Registers an event listener on the socket (compatible with browser WebSocket API)." + } + }, + "@supabase/supabase-js.WebSocketLike.close": { + "name": "@supabase/supabase-js.WebSocketLike.close", + "params": [ + { + "name": "code", + "type": { + "type": "intrinsic", + "name": "number" + }, + "isOptional": true + }, + { + "name": "reason", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + }, + "comment": { + "shortText": "Closes the socket, optionally providing a close code and reason." + } + }, + "@supabase/supabase-js.WebSocketLike.removeEventListener": { + "name": "@supabase/supabase-js.WebSocketLike.removeEventListener", + "params": [ + { + "name": "type", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "listener", + "type": { + "type": "nameOnly", + "name": "EventListener" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + }, + "comment": { + "shortText": "Removes a previously registered event listener." + } + }, + "@supabase/supabase-js.WebSocketLike.send": { + "name": "@supabase/supabase-js.WebSocketLike.send", + "params": [ + { + "name": "data", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "string" + }, + { + "type": "nameOnly", + "name": "ArrayBufferLike" + }, + { + "type": "nameOnly", + "name": "ArrayBufferView" + }, + { + "type": "nameOnly", + "name": "Blob" + } + ] + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + }, + "comment": { + "shortText": "Sends data through the socket using the underlying implementation." + } + }, + "@supabase/supabase-js.WebSocketLikeConstructor.constructor": { + "name": "@supabase/supabase-js.WebSocketLikeConstructor.constructor", + "params": [ + { + "name": "address", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "string" + }, + { + "type": "nameOnly", + "name": "URL" + } + ] + } + }, + { + "name": "subprotocols", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "string" + }, + { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + } + ] + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "object", + "name": "WebSocketLike", + "properties": [ + { + "name": "binaryType", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "bufferedAmount", + "type": { + "type": "intrinsic", + "name": "number" + }, + "isOptional": true + }, + { + "name": "CLOSED", + "type": { + "type": "intrinsic", + "name": "number" + } + }, + { + "name": "CLOSING", + "type": { + "type": "intrinsic", + "name": "number" + } + }, + { + "name": "CONNECTING", + "type": { + "type": "intrinsic", + "name": "number" + } + }, + { + "name": "dispatchEvent", + "type": { + "type": "function", + "params": [ + { + "name": "event", + "type": { + "type": "nameOnly", + "name": "Event" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "boolean" + } + } + }, + "isOptional": true + }, + { + "name": "extensions", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "onclose", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "function", + "params": [ + { + "name": "this", + "type": { + "type": "intrinsic", + "name": "any" + } + }, + { + "name": "ev", + "type": { + "type": "nameOnly", + "name": "CloseEvent" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "any" + } + } + } + ] + } + }, + { + "name": "onerror", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "function", + "params": [ + { + "name": "this", + "type": { + "type": "intrinsic", + "name": "any" + } + }, + { + "name": "ev", + "type": { + "type": "nameOnly", + "name": "Event" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "any" + } + } + } + ] + } + }, + { + "name": "onmessage", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "function", + "params": [ + { + "name": "this", + "type": { + "type": "intrinsic", + "name": "any" + } + }, + { + "name": "ev", + "type": { + "type": "nameOnly", + "name": "MessageEvent" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "any" + } + } + } + ] + } + }, + { + "name": "onopen", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "function", + "params": [ + { + "name": "this", + "type": { + "type": "intrinsic", + "name": "any" + } + }, + { + "name": "ev", + "type": { + "type": "nameOnly", + "name": "Event" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "any" + } + } + } + ] + } + }, + { + "name": "OPEN", + "type": { + "type": "intrinsic", + "name": "number" + } + }, + { + "name": "protocol", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "readyState", + "type": { + "type": "intrinsic", + "name": "number" + } + }, + { + "name": "url", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + } + } + }, + "@supabase/supabase-js.createClient": { + "name": "@supabase/supabase-js.createClient", + "params": [ + { + "name": "supabaseUrl", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "supabaseKey", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "options", + "type": { + "name": "SupabaseClientOptions", + "type": "object", + "properties": [ + { + "name": "accessToken", + "type": { + "type": "function", + "params": [], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + } + } + } + }, + "isOptional": true, + "comment": { + "shortText": "Optional function for using a third-party authentication system with\nSupabase. The function should return an access token or ID token (JWT) by\nobtaining it from the third-party auth SDK. Note that this\nfunction may be called concurrently and many times. Use memoization and\nlocking techniques if this is not supported by the SDKs.\n\nWhen set, the `auth` namespace of the Supabase client cannot be used.\nCreate another client if you wish to use Supabase Auth and third-party\nauthentications concurrently in the same application." + } + }, + { + "name": "auth", + "type": { + "type": "object", + "properties": [ + { + "name": "autoRefreshToken", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Automatically refreshes the token for logged-in users. Defaults to true." + } + }, + { + "name": "debug", + "type": { + "type": "nameOnly", + "name": "SupabaseAuthClientOptions['debug']" + }, + "isOptional": true, + "comment": { + "shortText": "If debug messages for authentication client are emitted. Can be used to inspect the behavior of the library." + } + }, + { + "name": "detectSessionInUrl", + "type": { + "type": "union", + "subTypes": [ + "[Circular]", + { + "type": "function", + "params": [ + { + "name": "url", + "type": { + "type": "nameOnly", + "name": "URL" + } + }, + { + "name": "params", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + } + } + ], + "ret": { + "type": "[Circular]" + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Detect a session from the URL. Used for OAuth login callbacks. Defaults to true.\n\nCan be set to a function to provide custom logic for determining if a URL contains\na Supabase auth callback. The function receives the current URL and parsed parameters,\nand should return true if the URL should be processed as a Supabase auth callback.\n\nThis is useful when your app uses other OAuth providers (e.g., Facebook Login) that\nalso return access_token in the URL fragment, which would otherwise be incorrectly\nintercepted by Supabase Auth.", + "examples": [ + { + "id": "with-custom-detection-logic", + "name": "With custom detection logic", + "code": "```ts\ndetectSessionInUrl: (url, params) => {\n // Ignore Facebook OAuth redirects\n if (url.pathname === '/facebook/redirect') return false\n // Use default detection for other URLs\n return Boolean(params.access_token || params.error_description)\n}\n```" + } + ] + } + }, + { + "name": "experimental", + "type": { + "type": "nameOnly", + "name": "SupabaseAuthClientOptions['experimental']" + }, + "isOptional": true, + "comment": { + "shortText": "Opt-in flags for experimental features. These APIs may change without\nnotice and are disabled by default.", + "tags": [ + { + "tag": "experimental", + "text": "" + } + ] + } + }, + { + "name": "flowType", + "type": { + "type": "nameOnly", + "name": "SupabaseAuthClientOptions['flowType']" + }, + "isOptional": true, + "comment": { + "shortText": "OAuth flow to use - defaults to implicit flow. PKCE is recommended for mobile and server-side applications." + } + }, + { + "name": "lock", + "type": { + "type": "nameOnly", + "name": "SupabaseAuthClientOptions['lock']" + }, + "isOptional": true, + "comment": { + "shortText": "Provide your own locking mechanism based on the environment. By default\nthe auth client coordinates refreshes itself and the server resolves\ncross-tab races. Passing a custom `lock` opts into a legacy path that\nwraps every auth operation in your supplied lock." + } + }, + { + "name": "lockAcquireTimeout", + "type": { + "type": "nameOnly", + "name": "SupabaseAuthClientOptions['lockAcquireTimeout']" + }, + "isOptional": true, + "comment": { + "shortText": "Maximum time in milliseconds to wait for acquiring the custom lock\nsupplied via `lock`. Only consulted when a custom `lock` is passed." + } + }, + { + "name": "persistSession", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Whether to persist a logged-in session to storage. Defaults to true." + } + }, + { + "name": "skipAutoInitialize", + "type": { + "type": "nameOnly", + "name": "SupabaseAuthClientOptions['skipAutoInitialize']" + }, + "isOptional": true, + "comment": { + "shortText": "If true, skips automatic initialization in the auth client constructor.\nUseful for SSR contexts where initialization timing must be controlled to\nprevent race conditions with HTTP response generation." + } + }, + { + "name": "storage", + "type": { + "type": "nameOnly", + "name": "SupabaseAuthClientOptions['storage']" + }, + "isOptional": true, + "comment": { + "shortText": "A storage provider. Used to store the logged-in session." + } + }, + { + "name": "storageKey", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Optional key name used for storing tokens in local storage." + } + }, + { + "name": "throwOnError", + "type": { + "type": "nameOnly", + "name": "SupabaseAuthClientOptions['throwOnError']" + }, + "isOptional": true, + "comment": { + "shortText": "If there is an error with the query, throwOnError will reject the promise by\nthrowing the error instead of returning it as part of a successful response." + } + }, + { + "name": "userStorage", + "type": { + "type": "nameOnly", + "name": "SupabaseAuthClientOptions['userStorage']" + }, + "isOptional": true, + "comment": { + "shortText": "A storage provider to store the user profile separately from the session.\nUseful when you need to store the session information in cookies,\nwithout bloating the data with the redundant user object.", + "tags": [ + { + "tag": "experimental", + "text": "" + } + ] + } + } + ] + }, + "isOptional": true + }, + { + "name": "db", + "type": { + "type": "object", + "properties": [ + { + "name": "schema", + "type": { + "type": "nameOnly", + "name": "SchemaName" + }, + "isOptional": true + }, + { + "name": "timeout", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Optional timeout in milliseconds for PostgREST requests.\nWhen set, requests will automatically abort after this duration to prevent indefinite hangs.", + "examples": [ + { + "id": "with-timeout", + "name": "With timeout", + "code": "```ts\nconst supabase = createClient(url, key, {\n db: { timeout: 30000 } // 30 second timeout\n})\n```" + } + ] + } + }, + { + "name": "urlLengthLimit", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Maximum URL length in characters before warnings/errors are triggered.\nDefaults to 8000 characters. Used to provide helpful hints when URLs\nexceed server limits.", + "examples": [ + { + "id": "with-custom-url-length-limit", + "name": "With custom URL length limit", + "code": "```ts\nconst supabase = createClient(url, key, {\n db: { urlLengthLimit: 10000 } // Custom limit\n})\n```" + } + ] + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "The Postgres schema which your tables belong to. Must be on the list of exposed schemas in Supabase. Defaults to `public`." + } + }, + { + "name": "global", + "type": { + "type": "object", + "properties": [ + { + "name": "fetch", + "type": { + "type": "nameOnly", + "name": "Fetch" + }, + "isOptional": true, + "comment": { + "shortText": "A custom `fetch` implementation." + } + }, + { + "name": "headers", + "type": { + "type": "record", + "name": "Record", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true, + "comment": { + "shortText": "Optional headers for initializing the client." + } + } + ] + }, + "isOptional": true + }, + { + "name": "realtime", + "type": { + "name": "RealtimeClientOptions", + "type": "object", + "properties": [ + { + "name": "accessToken", + "type": { + "type": "function", + "params": [], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "union", + "subTypes": [ + "[Circular]", + "[Circular]" + ] + } + } + } + }, + "isOptional": true + }, + { + "name": "decode", + "type": { + "type": "nameOnly", + "name": "Decode" + }, + "isOptional": true + }, + { + "name": "disconnectOnEmptyChannelsAfterMs", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "encode", + "type": { + "type": "nameOnly", + "name": "Encode" + }, + "isOptional": true + }, + { + "name": "fetch", + "type": { + "type": "nameOnly", + "name": "Fetch" + }, + "isOptional": true + }, + { + "name": "headers", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "heartbeatCallback", + "type": { + "type": "function", + "params": [ + { + "name": "status", + "type": { + "type": "nameOnly", + "name": "HeartbeatStatus" + } + }, + { + "name": "latency", + "type": "[Circular]", + "isOptional": true + } + ], + "ret": { + "type": "[Circular]" + } + }, + "isOptional": true + }, + { + "name": "heartbeatIntervalMs", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "log_level", + "type": { + "type": "nameOnly", + "name": "LogLevel" + }, + "isOptional": true + }, + { + "name": "logger", + "type": { + "type": "function", + "params": [ + { + "name": "kind", + "type": "[Circular]" + }, + { + "name": "msg", + "type": "[Circular]" + }, + { + "name": "data", + "type": "[Circular]", + "isOptional": true + } + ], + "ret": { + "type": "[Circular]" + } + }, + "isOptional": true + }, + { + "name": "logLevel", + "type": { + "type": "nameOnly", + "name": "LogLevel" + }, + "isOptional": true + }, + { + "name": "params", + "type": { + "type": "index signature", + "keyType": "[Circular]", + "valueType": "[Circular]" + }, + "isOptional": true + }, + { + "name": "reconnectAfterMs", + "type": { + "type": "function", + "params": [ + { + "name": "tries", + "type": "[Circular]" + } + ], + "ret": { + "type": "[Circular]" + } + }, + "isOptional": true + }, + { + "name": "sessionStorage", + "type": { + "type": "nameOnly", + "name": "Storage" + }, + "isOptional": true, + "comment": { + "shortText": "Storage compatible object used by the underlying socket for longpoll fallback history.\nProvide a custom implementation in environments where reading `globalThis.sessionStorage`\nthrows (sandboxed iframes, in-app webviews, \"block third-party storage\" privacy modes).\nDefaults to `globalThis.sessionStorage` when accessible, otherwise an in-memory store." + } + }, + { + "name": "timeout", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "transport", + "type": { + "type": "object", + "name": "WebSocketLikeConstructor", + "properties": [] + }, + "isOptional": true + }, + { + "name": "vsn", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "worker", + "type": "[Circular]", + "isOptional": true + }, + { + "name": "workerUrl", + "type": "[Circular]", + "isOptional": true + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Options passed to the realtime-js instance" + } + }, + { + "name": "storage", + "type": { + "type": "nameOnly", + "name": "StorageClientOptions" + }, + "isOptional": true + }, + { + "name": "tracePropagation", + "type": { + "type": "union", + "subTypes": [ + { + "type": "object", + "name": "TracePropagationOptions", + "properties": [ + { + "name": "enabled", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Enable trace propagation. Disabled by default.\n\nWhen enabled, automatically detects and propagates active trace context\nfrom the OpenTelemetry API to outgoing Supabase requests. Trace context\nis only propagated to Supabase domains (`*.supabase.co`, `*.supabase.in`,\n`localhost`) for security — third-party hosts never receive trace headers.", + "examples": [ + { + "id": "example-1", + "name": "Example 1", + "code": "```ts\nconst supabase = createClient(url, key, {\n tracePropagation: { enabled: true },\n})\n```" + } + ] + } + }, + { + "name": "respectSamplingDecision", + "type": "[Circular]", + "isOptional": true, + "comment": { + "shortText": "Respect upstream sampling decisions.\n\nWhen true (the default), trace context is not propagated if the upstream\ntrace indicates non-sampling (sampled flag = `0` in the `traceparent`\nheader). This avoids overhead when traces are being recorded but dropped.\n\nSet to `false` to always propagate, regardless of the sampling decision\n— useful when you want every Supabase request tagged with a `trace_id`\nfor log correlation, even if the trace itself will not be exported.", + "examples": [ + { + "id": "always-propagate-ignore-sampling", + "name": "Always propagate, ignore sampling", + "code": "```ts\nconst supabase = createClient(url, key, {\n tracePropagation: { enabled: true, respectSamplingDecision: false },\n})\n```" + } + ] + } + } + ] + }, + "[Circular]" + ] + }, + "isOptional": true, + "comment": { + "shortText": "Enable OpenTelemetry / W3C trace context propagation to Supabase services.\n\nDisabled by default. Pass `true` for the common case (auto-detect an\nactive OpenTelemetry context and inject `traceparent` / `tracestate` /\n`baggage` headers) or an object for fine-grained control.\n\nRequires `@opentelemetry/api` to be installed in your application; if\nnot present, the SDK silently no-ops. Trace headers are only attached\nto requests targeting Supabase domains, so third-party hosts called\nthrough a custom `fetch` are never tagged.\n\nThe resulting `trace_id` appears in Supabase logs (API Gateway, Edge\nFunctions), letting you correlate client-side spans with server-side\nlog entries — including logs forwarded via Log Drains.", + "examples": [ + { + "id": "shorthand-opt-in-with-defaults", + "name": "Shorthand — opt in with defaults", + "code": "```ts\nimport { createClient } from '@supabase/supabase-js'\n\nconst supabase = createClient(url, key, { tracePropagation: true })\n```" + }, + { + "id": "with-an-active-opentelemetry-span", + "name": "With an active OpenTelemetry span", + "code": "```ts\nimport { createClient } from '@supabase/supabase-js'\nimport { trace } from '@opentelemetry/api'\n\nconst supabase = createClient(url, key, { tracePropagation: true })\nconst tracer = trace.getTracer('my-app')\n\nawait tracer.startActiveSpan('fetch-users', async (span) => {\n // Request carries the active trace context.\n const { data, error } = await supabase.from('users').select('*')\n span.end()\n})\n```" + }, + { + "id": "advanced-always-propagate-even-for-non-sampled-traces", + "name": "Advanced — always propagate, even for non-sampled traces", + "code": "```ts\nconst supabase = createClient(url, key, {\n tracePropagation: { enabled: true, respectSamplingDecision: false },\n})\n```" + } + ] + } + } + ] + }, + "isOptional": true + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "SupabaseClient" + } + }, + "comment": { + "shortText": "Creates a new Supabase Client.", + "examples": [ + { + "id": "creating-a-supabase-client", + "name": "Creating a Supabase client", + "code": "```ts\nimport { createClient } from '@supabase/supabase-js'\n\nconst supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key')\nconst { data, error } = await supabase.from('profiles').select('*')\n```" + } + ] + } + }, + "@supabase/supabase-js.isAuthApiError": { + "name": "@supabase/supabase-js.isAuthApiError", + "params": [ + { + "name": "error", + "type": { + "type": "intrinsic", + "name": "unknown" + } + } + ] + }, + "@supabase/supabase-js.isAuthError": { + "name": "@supabase/supabase-js.isAuthError", + "params": [ + { + "name": "error", + "type": { + "type": "intrinsic", + "name": "unknown" + } + } + ] + }, + "@supabase/supabase-js.isAuthImplicitGrantRedirectError": { + "name": "@supabase/supabase-js.isAuthImplicitGrantRedirectError", + "params": [ + { + "name": "error", + "type": { + "type": "intrinsic", + "name": "any" + } + } + ] + }, + "@supabase/supabase-js.isAuthPKCECodeVerifierMissingError": { + "name": "@supabase/supabase-js.isAuthPKCECodeVerifierMissingError", + "params": [ + { + "name": "error", + "type": { + "type": "intrinsic", + "name": "unknown" + } + } + ] + }, + "@supabase/supabase-js.isAuthRefreshDiscardedError": { + "name": "@supabase/supabase-js.isAuthRefreshDiscardedError", + "params": [ + { + "name": "error", + "type": { + "type": "intrinsic", + "name": "unknown" + } + } + ] + }, + "@supabase/supabase-js.isAuthRetryableFetchError": { + "name": "@supabase/supabase-js.isAuthRetryableFetchError", + "params": [ + { + "name": "error", + "type": { + "type": "intrinsic", + "name": "unknown" + } + } + ] + }, + "@supabase/supabase-js.isAuthSessionMissingError": { + "name": "@supabase/supabase-js.isAuthSessionMissingError", + "params": [ + { + "name": "error", + "type": { + "type": "intrinsic", + "name": "any" + } + } + ] + }, + "@supabase/supabase-js.isAuthWeakPasswordError": { + "name": "@supabase/supabase-js.isAuthWeakPasswordError", + "params": [ + { + "name": "error", + "type": { + "type": "intrinsic", + "name": "unknown" + } + } + ] + }, + "@supabase/supabase-js.navigatorLock": { + "name": "@supabase/supabase-js.navigatorLock", + "params": [ + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Name of the lock to be acquired." + } + }, + { + "name": "acquireTimeout", + "type": { + "type": "intrinsic", + "name": "number" + }, + "comment": { + "shortText": "If negative, no timeout. If 0 an error is thrown if\n the lock can't be acquired without waiting. If positive, the lock acquire\n will time out after so many milliseconds. An error is\n a timeout if it has `isAcquireTimeout` set to true." + } + }, + { + "name": "fn", + "type": { + "type": "function", + "params": [], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "nameOnly", + "name": "R" + } + } + } + }, + "comment": { + "shortText": "The operation to run once the lock is acquired." + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "nameOnly", + "name": "R" + } + } + }, + "comment": { + "shortText": "Implements a global exclusive lock using the Navigator LockManager API. It\nis available on all browsers released after 2022-03-15 with Safari being the\nlast one to release support. If the API is not available, this function will\nthrow. Make sure you check availablility before configuring GoTrueClient.\n\nYou can turn on debugging by setting the `supabase.gotrue-js.locks.debug`\nlocal storage item to `true`.\n\nInternals:\n\nSince the LockManager API does not preserve stack traces for the async\nfunction passed in the `request` method, a trick is used where acquiring the\nlock releases a previously started promise to run the operation in the `fn`\nfunction. The lock waits for that promise to finish (with or without error),\nwhile the function will finally wait for the result anyway." + } + }, + "@supabase/supabase-js.processLock": { + "name": "@supabase/supabase-js.processLock", + "params": [ + { + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "Name of the lock to be acquired." + } + }, + { + "name": "acquireTimeout", + "type": { + "type": "intrinsic", + "name": "number" + }, + "comment": { + "shortText": "If negative, no timeout. If 0 an error is thrown if\n the lock can't be acquired without waiting. If positive, the lock acquire\n will time out after so many milliseconds. An error is\n a timeout if it has `isAcquireTimeout` set to true." + } + }, + { + "name": "fn", + "type": { + "type": "function", + "params": [], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "nameOnly", + "name": "R" + } + } + } + }, + "comment": { + "shortText": "The operation to run once the lock is acquired." + } + } + ], + "ret": { + "type": { + "type": "promise", + "name": "Promise", + "awaited": { + "type": "nameOnly", + "name": "R" + } + } + }, + "comment": { + "shortText": "Implements a global exclusive lock that works only in the current process.\nUseful for environments like React Native or other non-browser\nsingle-process (i.e. no concept of \"tabs\") environments.\n\nUse #navigatorLock in browser environments.", + "examples": [ + { + "id": "example-1", + "name": "Example 1", + "code": "```ts\nawait processLock('migrate', 5000, async () => {\n await runMigration()\n})\n```" + } + ] + } + } + }, + "variables": { + "@supabase/auth-js.AuthAdminApi": { + "name": "@supabase/auth-js.AuthAdminApi", + "isConst": true + }, + "@supabase/auth-js.AuthClient": { + "name": "@supabase/auth-js.AuthClient", + "isConst": true + }, + "@supabase/auth-js.lockInternals": { + "name": "@supabase/auth-js.lockInternals", + "type": { + "type": "object", + "properties": [ + { + "name": "debug", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "comment": { + "shortText": "", + "tags": [ + { + "tag": "experimental", + "text": "" + } + ] + } + } + ] + }, + "comment": { + "shortText": "", + "tags": [ + { + "tag": "experimental", + "text": "" + } + ] + }, + "isConst": true + }, + "@supabase/auth-js.SIGN_OUT_SCOPES": { + "name": "@supabase/auth-js.SIGN_OUT_SCOPES", + "isConst": true + }, + "@supabase/postgrest-js.default": { + "name": "@supabase/postgrest-js.default", + "type": { + "type": "object", + "properties": [ + { + "name": "PostgrestBuilder" + }, + { + "name": "PostgrestClient" + }, + { + "name": "PostgrestError" + }, + { + "name": "PostgrestFilterBuilder" + }, + { + "name": "PostgrestQueryBuilder" + }, + { + "name": "PostgrestTransformBuilder" + } + ] + }, + "isConst": false + }, + "@supabase/realtime-js.REALTIME_CHANNEL_STATES": { + "name": "@supabase/realtime-js.REALTIME_CHANNEL_STATES", + "type": { + "type": "object", + "properties": [ + { + "name": "closed", + "type": { + "type": "literal", + "value": "closed" + } + }, + { + "name": "errored", + "type": { + "type": "literal", + "value": "errored" + } + }, + { + "name": "joined", + "type": { + "type": "literal", + "value": "joined" + } + }, + { + "name": "joining", + "type": { + "type": "literal", + "value": "joining" + } + }, + { + "name": "leaving", + "type": { + "type": "literal", + "value": "leaving" + } + } + ] + }, + "isConst": true + }, + "@supabase/supabase-js.cors.corsHeaders": { + "name": "@supabase/supabase-js.cors.corsHeaders", + "type": { + "type": "record", + "name": "CorsHeaders", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "string" + } + }, + "comment": { + "shortText": "Default CORS headers for Supabase Edge Functions.\n\nIncludes all headers sent by Supabase client libraries and allows all standard HTTP methods.\nUse this for simple CORS configurations with wildcard origin.", + "examples": [ + { + "id": "basic-usage", + "name": "Basic usage", + "code": "```typescript\nimport { corsHeaders } from '@supabase/supabase-js/cors'\n\nDeno.serve(async (req) => {\n if (req.method === 'OPTIONS') {\n return new Response('ok', { headers: corsHeaders })\n }\n\n return new Response(\n JSON.stringify({ data: 'Hello' }),\n { headers: { ...corsHeaders, 'Content-Type': 'application/json' } }\n )\n})\n```" + } + ] + }, + "isConst": true + }, + "@supabase/supabase-js.AuthAdminApi": { + "name": "@supabase/supabase-js.AuthAdminApi", + "isConst": true + }, + "@supabase/supabase-js.AuthClient": { + "name": "@supabase/supabase-js.AuthClient", + "isConst": true + }, + "@supabase/supabase-js.lockInternals": { + "name": "@supabase/supabase-js.lockInternals", + "type": { + "type": "object", + "properties": [ + { + "name": "debug", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "comment": { + "shortText": "", + "tags": [ + { + "tag": "experimental", + "text": "" + } + ] + } + } + ] + }, + "comment": { + "shortText": "", + "tags": [ + { + "tag": "experimental", + "text": "" + } + ] + }, + "isConst": true + }, + "@supabase/supabase-js.REALTIME_CHANNEL_STATES": { + "name": "@supabase/supabase-js.REALTIME_CHANNEL_STATES", + "type": { + "type": "object", + "properties": [ + { + "name": "closed", + "type": { + "type": "literal", + "value": "closed" + } + }, + { + "name": "errored", + "type": { + "type": "literal", + "value": "errored" + } + }, + { + "name": "joined", + "type": { + "type": "literal", + "value": "joined" + } + }, + { + "name": "joining", + "type": { + "type": "literal", + "value": "joining" + } + }, + { + "name": "leaving", + "type": { + "type": "literal", + "value": "leaving" + } + } + ] + }, + "isConst": true + }, + "@supabase/supabase-js.SIGN_OUT_SCOPES": { + "name": "@supabase/supabase-js.SIGN_OUT_SCOPES", + "isConst": true + } + } + } +} \ No newline at end of file diff --git a/apps/docs/scripts/build-reference-content.test.ts b/apps/docs/scripts/build-reference-content.test.ts index 0fa79f9f9a6..deaa4afdd74 100644 --- a/apps/docs/scripts/build-reference-content.test.ts +++ b/apps/docs/scripts/build-reference-content.test.ts @@ -10,6 +10,11 @@ import { collectReferenceContent } from './build-reference-content' * sees. When the supabase-js `make` workflow lands a new release in * `spec/reference/javascript/v2/`, re-run with `--update` to refresh the * baseline as part of the same PR. + * + * Serializes to a JSON string first so vitest's `pretty-format` serializer + * doesn't collapse deep / cyclic structures (typeSpec contains + * self-referencing builder types) into `[Object]` placeholders — which would + * make param renames, signature changes, and JSDoc edits invisible. */ describe('build-reference-content — javascript/v2', () => { it('matches snapshot', async () => { @@ -17,6 +22,15 @@ describe('build-reference-content — javascript/v2', () => { 'javascript', 'v2' ) - expect({ bySlug, flat, sections, functionsList, typeSpec }).toMatchSnapshot() + const seen = new WeakSet() + const breakCycles = (_key: string, value: unknown) => { + if (value && typeof value === 'object') { + if (seen.has(value as object)) return '[Circular]' + seen.add(value as object) + } + return value + } + const json = JSON.stringify({ bySlug, flat, sections, functionsList, typeSpec }, breakCycles, 2) + await expect(json).toMatchFileSnapshot('./__snapshots__/build-reference-content.v2.json') }) }) diff --git a/apps/docs/scripts/llms.ts b/apps/docs/scripts/llms.ts deleted file mode 100644 index 441638c01e9..00000000000 --- a/apps/docs/scripts/llms.ts +++ /dev/null @@ -1,144 +0,0 @@ -import './utils/dotenv.js' -import 'dotenv/config' - -import fs from 'node:fs/promises' -import { fileURLToPath } from 'node:url' - -import { isFeatureEnabled } from '../../../packages/common/enabled-features/index.js' -import { - fetchCliLibReferenceSource, - fetchCSharpLibReferenceSource, - fetchDartLibReferenceSource, - fetchGuideSources, - fetchJsLibReferenceSource, - fetchKtLibReferenceSource, - fetchPythonLibReferenceSource, - fetchSwiftLibReferenceSource, - type SearchSource, -} from './search/sources/index.js' - -interface Source { - title: string - /** - * Path relative to https://supabase.com. No leading slash - */ - relPath: string - fetch: () => Promise - enabled: boolean -} - -const { - sdkCsharp: sdkCsharpEnabled, - sdkDart: sdkDartEnabled, - sdkKotlin: sdkKotlinEnabled, - sdkPython: sdkPythonEnabled, - sdkSwift: sdkSwiftEnabled, -} = isFeatureEnabled(['sdk:csharp', 'sdk:dart', 'sdk:kotlin', 'sdk:python', 'sdk:swift']) - -const SOURCES: Source[] = [ - { - title: 'Supabase Guides', - relPath: 'llms/guides.txt', - fetch: fetchGuideSources, - enabled: true, - }, - { - title: 'Supabase Reference (JavaScript)', - relPath: 'llms/js.txt', - fetch: async () => - (await fetchJsLibReferenceSource()).filter( - (item): item is SearchSource => item !== undefined - ), - enabled: true, - }, - { - title: 'Supabase Reference (Dart)', - relPath: 'llms/dart.txt', - fetch: async () => - (await fetchDartLibReferenceSource()).filter( - (item): item is SearchSource => item !== undefined - ), - enabled: sdkDartEnabled, - }, - { - title: 'Supabase Reference (Swift)', - relPath: 'llms/swift.txt', - fetch: async () => - (await fetchSwiftLibReferenceSource()).filter( - (item): item is SearchSource => item !== undefined - ), - enabled: sdkSwiftEnabled, - }, - { - title: 'Supabase Reference (Kotlin)', - relPath: 'llms/kotlin.txt', - fetch: async () => - (await fetchKtLibReferenceSource()).filter( - (item): item is SearchSource => item !== undefined - ), - enabled: sdkKotlinEnabled, - }, - { - title: 'Supabase Reference (Python)', - relPath: 'llms/python.txt', - fetch: async () => - (await fetchPythonLibReferenceSource()).filter( - (item): item is SearchSource => item !== undefined - ), - enabled: sdkPythonEnabled, - }, - { - title: 'Supabase Reference (C#)', - relPath: 'llms/csharp.txt', - fetch: async () => - (await fetchCSharpLibReferenceSource()).filter( - (item): item is SearchSource => item !== undefined - ), - enabled: sdkCsharpEnabled, - }, - { - title: 'Supabase CLI Reference', - relPath: 'llms/cli.txt', - fetch: async () => - (await fetchCliLibReferenceSource()).filter( - (item): item is SearchSource => item !== undefined - ), - enabled: true, - }, -] - -async function generateLlmsTxt() { - try { - await fs.mkdir('public/llms', { recursive: true }) - - const enabledSources = SOURCES.filter((source) => source.enabled !== false) - - const fetchedSources = await Promise.all( - enabledSources.map(async (sourceDefn) => { - const source = await sourceDefn.fetch() - const sourceText = source - .map((section) => { - section.process() - return section.extractIndexedContent() - }) - .join('\n\n') - return { defn: sourceDefn, text: sourceText } - }) - ) - - await Promise.all( - fetchedSources.map(({ defn, text }) => - fs.writeFile(`public/${defn.relPath}`, `${defn.title}\n\n${text}`) - ) - ) - } catch (err) { - console.error(err) - throw err - } -} - -if (process.argv[1] === fileURLToPath(import.meta.url)) { - generateLlmsTxt() -} - -export { generateLlmsTxt, SOURCES } diff --git a/apps/docs/vitest.config.ts b/apps/docs/vitest.config.ts index 25dac66db18..30c7c2703b9 100644 --- a/apps/docs/vitest.config.ts +++ b/apps/docs/vitest.config.ts @@ -1,12 +1,12 @@ import tsconfigPaths from 'vite-tsconfig-paths' import { defineConfig } from 'vitest/config' -// eslint-disable-next-line no-restricted-exports export default defineConfig({ test: { // Exclude examples from test discovery (does not affect tsconfig scanning) exclude: ['examples/**/*', '**/node_modules/**'], setupFiles: ['vitest.setup.ts'], + globalSetup: ['vitest.globalSetup.ts'], }, // Restrict tsconfig-paths to only use this app's tsconfig plugins: [ diff --git a/apps/docs/vitest.globalSetup.ts b/apps/docs/vitest.globalSetup.ts new file mode 100644 index 00000000000..905ad823385 --- /dev/null +++ b/apps/docs/vitest.globalSetup.ts @@ -0,0 +1,16 @@ +import { cpSync, existsSync } from 'node:fs' +import { join } from 'node:path' + +// Mirrors `pnpm run codegen:examples` so the test suite is self-contained. +// CodeSample.test.ts reads fixtures from apps/docs/examples/_internal/fixtures/, +// which are sourced from the repo-root examples/ directory. Without this, +// `npx vitest`, `pnpm test:local`, or IDE single-test runs all fail with ENOENT +// because they bypass the `pretest` npm lifecycle hook. +export default function setup() { + const source = join(import.meta.dirname, '..', '..', 'examples') + const dest = join(import.meta.dirname, 'examples') + if (!existsSync(source)) { + throw new Error(`Expected repo-root examples directory at ${source}`) + } + cpSync(source, dest, { recursive: true }) +} diff --git a/apps/lite-studio/package.json b/apps/lite-studio/package.json index 54379669df7..b6ebf0e791d 100644 --- a/apps/lite-studio/package.json +++ b/apps/lite-studio/package.json @@ -10,23 +10,23 @@ "clean": "rimraf node_modules tsconfig.tsbuildinfo build .react-router .turbo" }, "dependencies": { - "@react-router/node": "7.13.2", - "@react-router/serve": "7.13.2", + "@react-router/fs-routes": "^7.17.0", + "@react-router/node": "^7.17.0", + "@react-router/serve": "^7.17.0", "isbot": "^5.1.36", "react": "catalog:", "react-dom": "catalog:", - "react-router": "7.13.2", - "@react-router/fs-routes": "^7.4.0", + "react-router": "^7.17.0", "ui": "workspace:*", "ui-patterns": "workspace:*" }, "devDependencies": { - "@react-router/dev": "7.13.2", + "@react-router/dev": "^7.17.0", + "@tailwindcss/vite": "4.2.4", "@types/node": "^22", "@types/react": "catalog:", "@types/react-dom": "catalog:", "config": "workspace:*", - "postcss": "catalog:", "tailwindcss": "catalog:", "tsconfig": "workspace:*", "vite": "^7.3.2", diff --git a/apps/lite-studio/postcss.config.cjs b/apps/lite-studio/postcss.config.cjs deleted file mode 100644 index 29c447cb54b..00000000000 --- a/apps/lite-studio/postcss.config.cjs +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('config/postcss.config') diff --git a/apps/lite-studio/styles/globals.css b/apps/lite-studio/styles/globals.css index 00841bfbe7e..7450b023ad8 100644 --- a/apps/lite-studio/styles/globals.css +++ b/apps/lite-studio/styles/globals.css @@ -31,3 +31,13 @@ body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } + +@layer base { + *, + ::after, + ::before, + ::backdrop, + ::file-selector-button { + border-color: hsl(var(--border-default, currentColor)); + } +} diff --git a/apps/lite-studio/vite.config.ts b/apps/lite-studio/vite.config.ts index 5141c1bbbb7..0c4c883e7e7 100644 --- a/apps/lite-studio/vite.config.ts +++ b/apps/lite-studio/vite.config.ts @@ -1,4 +1,5 @@ import { reactRouter } from '@react-router/dev/vite' +import tailwindcss from '@tailwindcss/vite' import { defineConfig } from 'vite' import tsconfigPaths from 'vite-tsconfig-paths' @@ -8,5 +9,6 @@ export default defineConfig({ tsconfigPaths({ root: '.', }), + tailwindcss(), ], }) diff --git a/apps/studio/.github/eslint-rule-baselines.json b/apps/studio/.github/eslint-rule-baselines.json index 8ce74e19536..37f87aa30ff 100644 --- a/apps/studio/.github/eslint-rule-baselines.json +++ b/apps/studio/.github/eslint-rule-baselines.json @@ -1,9 +1,9 @@ { "rules": { - "react-hooks/exhaustive-deps": 175, + "react-hooks/exhaustive-deps": 174, "import/no-anonymous-default-export": 57, - "@tanstack/query/exhaustive-deps": 12, - "@typescript-eslint/no-explicit-any": 983, + "@tanstack/query/exhaustive-deps": 9, + "@typescript-eslint/no-explicit-any": 968, "no-restricted-imports": 0, "no-restricted-exports": 240, "react/no-unstable-nested-components": 47 @@ -65,7 +65,7 @@ "components/interfaces/SQLEditor/MonacoEditor.tsx": 1, "components/interfaces/SQLEditor/MoveQueryModal.tsx": 1, "components/interfaces/SQLEditor/OngoingQueriesPanel.tsx": 1, - "components/interfaces/SQLEditor/SQLEditor.tsx": 3, + "components/interfaces/SQLEditor/SQLEditor.tsx": 2, "components/interfaces/SQLEditor/UtilityPanel/SavingIndicator.tsx": 1, "components/interfaces/Settings/Addons/CustomDomainSidePanel.tsx": 1, "components/interfaces/Settings/Addons/IPv4SidePanel.tsx": 1, @@ -123,6 +123,7 @@ "hooks/misc/useSchemaQueryState.ts": 1, "hooks/misc/useTrackExperimentExposure.ts": 1, "hooks/misc/useUpgradePrompt.tsx": 1, + "lib/telemetry/track.ts": 1, "pages/forgot-password-mfa.tsx": 1, "pages/integrations/vercel/[slug]/deploy-button/new-project.tsx": 1, "pages/integrations/vercel/install.tsx": 1, @@ -134,7 +135,6 @@ "pages/project/[ref]/settings/jwt/legacy.tsx": 1, "pages/project/[ref]/sql/examples.tsx": 1, "pages/project/[ref]/sql/templates.tsx": 1, - "pages/sign-in-mfa.tsx": 1, "state/role-impersonation-state.tsx": 1, "state/sidebar-manager-state.tsx": 1, "state/table-editor-table.tsx": 1 @@ -199,16 +199,13 @@ "pages/api/v1/projects/[ref]/types/typescript.ts": 1 }, "@tanstack/query/exhaustive-deps": { - "components/interfaces/Reports/SharedAPIReport/SharedAPIReport.constants.ts": 1, "components/interfaces/TableGridEditor/SidePanelEditor/SidePanelEditor.tsx": 1, "components/interfaces/TableGridEditor/SidePanelEditor/SidePanelEditor.utils.tsx": 2, "data/branches/branch-diff-query.ts": 1, "data/database/foreign-key-constraints-query.ts": 1, "data/database/schemas-query.ts": 1, "data/entity-types/entity-types-infinite-query.ts": 1, - "data/tables/tables-query.ts": 2, - "hooks/analytics/useDbQuery.tsx": 1, - "hooks/analytics/useSingleLog.tsx": 1 + "data/tables/tables-query.ts": 2 }, "@typescript-eslint/no-explicit-any": { "components/grid/SupabaseGrid.tsx": 1, @@ -235,7 +232,6 @@ "components/interfaces/Auth/AuthProvidersForm/index.tsx": 7, "components/interfaces/Auth/AuthProvidersFormValidation.tsx": 2, "components/interfaces/Auth/BasicAuthSettingsForm.tsx": 1, - "components/interfaces/Auth/EmailTemplates/EmailTemplates.tsx": 1, "components/interfaces/Auth/Overview/OverviewTable.tsx": 1, "components/interfaces/Auth/Overview/OverviewUsage.constants.ts": 1, "components/interfaces/Auth/PerformanceSettingsForm.tsx": 2, @@ -250,7 +246,7 @@ "components/interfaces/Auth/RedirectUrls/RedirectUrlList.tsx": 1, "components/interfaces/Auth/SessionsAuthSettingsForm/SessionsAuthSettingsForm.tsx": 2, "components/interfaces/Auth/SiteUrl/SiteUrl.tsx": 1, - "components/interfaces/Auth/SmtpForm/SmtpForm.tsx": 3, + "components/interfaces/Auth/SmtpForm/SmtpForm.tsx": 2, "components/interfaces/Auth/Users/UserLogs.tsx": 1, "components/interfaces/Auth/Users/UserPanel.tsx": 1, "components/interfaces/Auth/Users/Users.utils.tsx": 5, @@ -436,11 +432,8 @@ "components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/ForeignKeysManagement/ForeignKeyRow.tsx": 1, "components/interfaces/TableGridEditor/TableDefinition.tsx": 3, "components/interfaces/TableGridEditor/TableEntity.utils.ts": 1, - "components/interfaces/UnifiedLogs/ServiceFlow/components/blocks/PostgresFlowDetail.tsx": 2, - "components/interfaces/UnifiedLogs/ServiceFlow/components/blocks/ResponseCompletedBlock.tsx": 1, - "components/interfaces/UnifiedLogs/ServiceFlow/components/shared/CollapsibleSection.tsx": 4, + "components/interfaces/UnifiedLogs/ServiceFlow/components/PostgresFlowDetail.tsx": 2, "components/interfaces/UnifiedLogs/ServiceFlow/components/shared/FieldWithSeeMore.tsx": 4, - "components/interfaces/UnifiedLogs/ServiceFlow/components/shared/TimelineStep.tsx": 1, "components/interfaces/UnifiedLogs/ServiceFlow/config/fieldHelpers.ts": 3, "components/interfaces/UnifiedLogs/ServiceFlow/types.ts": 10, "components/interfaces/UnifiedLogs/ServiceFlow/utils/storageUtils.ts": 3, @@ -590,7 +583,6 @@ "hooks/misc/withAuth.tsx": 1, "hooks/ui/useClickedOutside.ts": 2, "hooks/ui/useFlag.ts": 1, - "hooks/useStaticEffectEvent.ts": 1, "instrumentation-client.ts": 3, "lib/ai/generate-assistant-response.ts": 2, "lib/ai/model.ts": 2, diff --git a/apps/studio/components/grid/SupabaseGrid.utils.ts b/apps/studio/components/grid/SupabaseGrid.utils.ts index 200fd880e88..2e9fcca862f 100644 --- a/apps/studio/components/grid/SupabaseGrid.utils.ts +++ b/apps/studio/components/grid/SupabaseGrid.utils.ts @@ -24,14 +24,20 @@ import { BASE_PATH } from '@/lib/constants' import { eventMatchesAnyShortcut } from '@/state/shortcuts/matchEvent' import { tableEditorRegistry } from '@/state/shortcuts/registry/table-editor' -export function formatSortURLParams(tableName: string, sort?: string[]): Sort[] { +export function formatSortURLParams( + // Should match the Entity type. + table: { name: string; columns: { name: string }[] }, + sort?: string[] +): Sort[] { if (Array.isArray(sort)) { return compact( sort.map((s) => { const [column, order] = s.split(':') // Reject any possible malformed sort param if (!column || !order) return undefined - else return { table: tableName, column, ascending: order === 'asc' } + // if the sort column name doesn't exist in the table, reject it as well to avoid confusion + if (table.columns.find((c) => c.name === column) === undefined) return undefined + else return { table: table.name, column, ascending: order === 'asc' } }) ) } diff --git a/apps/studio/components/grid/components/footer/Footer.tsx b/apps/studio/components/grid/components/footer/Footer.tsx index 77a81ff1e9f..5ecd561dbd2 100644 --- a/apps/studio/components/grid/components/footer/Footer.tsx +++ b/apps/studio/components/grid/components/footer/Footer.tsx @@ -30,7 +30,7 @@ export const Footer: React.FC = ({ enableForeignRowsQuery = true }: {selectedView === 'data' && } -
+
{(isViewSelected || isTableSelected) && ( { } const exportParams = snap.allRowsSelected - ? ({ type: 'fetch_all', filters, sorts } as const) + ? ({ + type: 'fetch_all', + filters, + sorts, + roleImpersonationState: roleImpersonationState as RoleImpersonationState, + } as const) : ({ type: 'provided_rows', table: snap.table, rows: allRows.filter((x) => snap.selectedRows.has(x.idx)), + roleImpersonationState: roleImpersonationState as RoleImpersonationState, } as const) const { exportCsv, confirmationModal: exportCsvConfirmationModal } = useExportAllRowsAsCsv( diff --git a/apps/studio/components/grid/components/header/sort/SortPopover.tsx b/apps/studio/components/grid/components/header/sort/SortPopover.tsx index 53a344f753d..9562718d236 100644 --- a/apps/studio/components/grid/components/header/sort/SortPopover.tsx +++ b/apps/studio/components/grid/components/header/sort/SortPopover.tsx @@ -13,12 +13,11 @@ export const SortPopover = ({ tableQueriesEnabled }: SortPopoverProps) => { const { urlSorts, onApplySorts } = useTableSort() const snap = useTableEditorTableStateSnapshot() - const tableName = snap.table?.name || '' // Convert string[] to Sort[] const sorts = useMemo(() => { - return tableName && urlSorts ? formatSortURLParams(tableName, urlSorts) : [] - }, [tableName, urlSorts]) + return snap.originalTable && urlSorts ? formatSortURLParams(snap.originalTable, urlSorts) : [] + }, [snap.originalTable, urlSorts]) return ( snap.table?.name || '', [snap]) const sorts = useMemo(() => { - return formatSortURLParams(tableName, urlSorts) - }, [tableName, urlSorts]) + if (!snap.originalTable) return [] + return formatSortURLParams(snap.originalTable, urlSorts) + }, [snap.originalTable, urlSorts]) const onApplySorts = useCallback( (appliedSorts: Sort[]) => { - if (!tableName) { - return console.warn( - '[useTableSort] Table name missing in callback, cannot apply sort correctly.' - ) - } - - const sortsWithTable = appliedSorts.map((sort) => ({ ...sort, table: tableName })) + const sortsWithTable = appliedSorts.map((sort) => ({ ...sort })) const newUrlSorts = sortsToUrlParams(sortsWithTable) setParams((prevParams) => ({ ...prevParams, sort: newUrlSorts })) }, - [snap, setParams] + [setParams] ) /** diff --git a/apps/studio/components/interfaces/Account/AccessTokens/Scoped/ViewTokenSheet.tsx b/apps/studio/components/interfaces/Account/AccessTokens/Scoped/ViewTokenSheet.tsx index 8ca78ea879c..e3a6a51075c 100644 --- a/apps/studio/components/interfaces/Account/AccessTokens/Scoped/ViewTokenSheet.tsx +++ b/apps/studio/components/interfaces/Account/AccessTokens/Scoped/ViewTokenSheet.tsx @@ -231,11 +231,16 @@ export function ViewTokenSheet({ visible, tokenId, onClose }: ViewTokenSheetProp

- {(token?.organization_slugs && - token.organization_slugs.length > 0) || - (token?.project_refs && token.project_refs.length > 0) - ? 'This token has access to specific organizations and projects.' - : 'This token has access to all resources.'} + {token?.scope === 'organization' + ? token.organization_slugs && + token.organization_slugs.length > 0 + ? 'This token has access to specific organizations.' + : 'This token has no accessible organizations.' + : token?.scope === 'project' + ? token.project_refs && token.project_refs.length > 0 + ? 'This token has access to specific projects.' + : 'This token has no accessible projects.' + : 'This token has access to all resources.'}

diff --git a/apps/studio/components/interfaces/ApiAuthorization/ApiAuthorization.Approved.tsx b/apps/studio/components/interfaces/ApiAuthorization/ApiAuthorization.Approved.tsx index b2dd9fe93c5..6a3f0da6607 100644 --- a/apps/studio/components/interfaces/ApiAuthorization/ApiAuthorization.Approved.tsx +++ b/apps/studio/components/interfaces/ApiAuthorization/ApiAuthorization.Approved.tsx @@ -1,8 +1,12 @@ import dayjs from 'dayjs' import type { ReactNode } from 'react' -import { Alert, AlertDescription, AlertTitle, Card, CardContent, CardHeader, CheckIcon } from 'ui' +import { Admonition } from 'ui-patterns' -import { AuthorizeRequesterDetails } from '@/components/interfaces/Organization/OAuthApps/AuthorizeRequesterDetails' +import { + AuthorizeRequesterDetails, + RequesterLogo, +} from '@/components/interfaces/Organization/OAuthApps/AuthorizeRequesterDetails' +import { InterstitialLayout, LogoPair, SupabaseLogo } from '@/components/layouts/InterstitialLayout' import type { ApiAuthorizationResponse } from '@/data/api-authorization/api-authorization-query' import type { Organization } from '@/types' @@ -15,31 +19,36 @@ export function ApiAuthorizationApprovedScreen({ requester, organization, }: ApiAuthorizationApprovedScreenProps): ReactNode { + const organizationName = organization?.name ?? 'Unknown' + return ( - - Authorize API access for {requester.name} - - - - This authorization request has been approved - -

- {requester.name} has been approved access to the organization " - {organization?.name ?? 'Unknown'}" and all of its projects for the following scopes: -

- -

- Approved on: {dayjs(requester.approved_at).format('DD MMM YYYY HH:mm:ss (ZZ)')} -

-
-
-
-
+ } + right={} + /> + } + title={requester.name} + description="is authorized for Supabase" + > +
+ + +

+ Approved on {dayjs(requester.approved_at).format('DD MMM YYYY HH:mm:ss (ZZ)')}. +

+
+
) } diff --git a/apps/studio/components/interfaces/ApiAuthorization/ApiAuthorization.Error.tsx b/apps/studio/components/interfaces/ApiAuthorization/ApiAuthorization.Error.tsx index f52235cc76f..4a1f5cfe1c9 100644 --- a/apps/studio/components/interfaces/ApiAuthorization/ApiAuthorization.Error.tsx +++ b/apps/studio/components/interfaces/ApiAuthorization/ApiAuthorization.Error.tsx @@ -1,6 +1,9 @@ +import Link from 'next/link' import type { ReactNode } from 'react' -import { Alert, AlertDescription, AlertTitle, Card, CardContent, CardHeader, WarningIcon } from 'ui' +import { Button } from 'ui' +import { Admonition } from 'ui-patterns' +import { InterstitialLayout, SupabaseLogo } from '@/components/layouts/InterstitialLayout' import type { ResourceError } from '@/data/api-authorization/api-authorization-query' export interface ApiAuthorizationErrorScreenProps { @@ -11,18 +14,23 @@ export function ApiAuthorizationErrorScreen({ error, }: ApiAuthorizationErrorScreenProps): ReactNode { return ( - - Authorize API access - - - - Failed to fetch details for API authorization request - -

Please retry your authorization request from the requesting app

- {error &&

Error: {error?.message}

} -
-
-
-
+ } title="Unable to load authorization"> +
+ + Retry the authorization request from the requesting app. + {error && ( + Error: {error.message} + )} + + } + /> + +
+
) } diff --git a/apps/studio/components/interfaces/ApiAuthorization/ApiAuthorization.Form.tsx b/apps/studio/components/interfaces/ApiAuthorization/ApiAuthorization.Form.tsx index ddbff61db74..f22b2601c19 100644 --- a/apps/studio/components/interfaces/ApiAuthorization/ApiAuthorization.Form.tsx +++ b/apps/studio/components/interfaces/ApiAuthorization/ApiAuthorization.Form.tsx @@ -1,34 +1,28 @@ import dayjs from 'dayjs' -import Link from 'next/link' -import { useMemo, type ReactNode } from 'react' +import { type ReactNode } from 'react' import type { UseFormReturn } from 'react-hook-form' import { - Alert, - AlertDescription, - AlertTitle, Button, - Card, - CardContent, - CardFooter, - CardHeader, Form, FormControl, FormField, FormItem, + FormMessage, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, - WarningIcon, } from 'ui' -import { ShimmeringLoader } from 'ui-patterns' -import { FormLayout } from 'ui-patterns/form/Layout/FormLayout' +import { Admonition, ShimmeringLoader } from 'ui-patterns' import type { ApprovalState, IApprovalFormSchema } from './ApiAuthorization.Schema' -import { AuthorizeRequesterDetails } from '@/components/interfaces/Organization/OAuthApps/AuthorizeRequesterDetails' +import { + AuthorizeRequesterDetails, + RequesterLogo, +} from '@/components/interfaces/Organization/OAuthApps/AuthorizeRequesterDetails' +import { InterstitialLayout, LogoPair, SupabaseLogo } from '@/components/layouts/InterstitialLayout' import type { ApiAuthorizationResponse } from '@/data/api-authorization/api-authorization-query' -import { BASE_PATH } from '@/lib/constants' import type { Organization, ResponseError } from '@/types' type OrganizationsState_Loading = { @@ -53,13 +47,22 @@ type OrganizationsState_Success = { organizations: Array } -type OrganizationsState = +export type OrganizationsState = | OrganizationsState_Loading | OrganizationsState_Error | OrganizationsState_Empty | OrganizationsState_NotMember | OrganizationsState_Success +function isExternalRedirectUrl(url: string): boolean { + try { + const { hostname } = new URL(url) + return hostname !== 'localhost' && hostname !== '127.0.0.1' && hostname !== '::1' + } catch { + return false + } +} + export interface ApiAuthorizationMainViewProps { approvalState: ApprovalState form: UseFormReturn @@ -79,89 +82,87 @@ export function ApiAuthorizationMainView({ onApprove, onDecline, }: ApiAuthorizationMainViewProps): ReactNode { - const isMcpClient = requester.registration_type === 'dynamic' const isExpired = dayjs().isAfter(dayjs(requester.expires_at)) + const showReadyContent = !isExpired && organizations._tag === 'success' + const redirectUrl = requester.redirect_uri ?? requester.website + const externalRedirectUrl = isExternalRedirectUrl(redirectUrl) ? redirectUrl : undefined return ( - - {isMcpClient && } - - {isExpired && } - {organizations._tag === 'loading' && } - {organizations._tag === 'error' && } - {organizations._tag === 'empty' && } - {organizations._tag === 'not_member' && } - {organizations._tag === 'success' && ( - } + right={} /> - )} - - - ) -} - -interface FormShellProps { - title: string - children: ReactNode -} - -function FormShell({ title, children }: FormShellProps): ReactNode { - return ( - - {title} - {children} - - ) -} - -function McpNotice(): ReactNode { - return ( - - - MCP Client Connection - - This is an MCP (Model Context Protocol) client designed to connect with AI applications. - Please ensure you trust this application before granting access to your organization's data. - - + } + title={`Authorize ${requester.name}`} + description="This application wants to access your Supabase account" + > +
+ Authorize API access for {requester.name} +
+ {isExpired ? ( + + ) : ( + <> + {organizations._tag === 'loading' && } + {organizations._tag === 'error' && ( + + )} + {organizations._tag === 'empty' && } + {organizations._tag === 'not_member' && } + {organizations._tag === 'success' && ( + + )} + {showReadyContent && ( + <> + + + + )} + + )} +
+
+ ) } function ExpiredNotice(): ReactNode { return ( - - - This authorization request is expired - - Please retry your authorization request from the requesting app - - + ) } function OrganizationsLoader(): ReactNode { return ( -
- - -
+
+

+ Organization +

+ +
) } @@ -171,40 +172,38 @@ interface OrganizationsErrorNoticeProps { function OrganizationsErrorNotice({ error }: OrganizationsErrorNoticeProps): ReactNode { return ( - - - There was an error loading your organizations - - Please try again. If the problem persists, contact support. - {error &&

Error: {error.message}

} -
-
+ + Please try again. If the problem persists, contact support. + {error && ( + Error: {error.message} + )} + + } + /> ) } function OrganizationsEmptyState(): ReactNode { return ( - - - Organization is needed for installing an integration - - Your account isn't associated with any organizations. To use this integration, it must be - installed within an organization. You'll be redirected to create an organization first. - - + ) } function NotMemberOfOrganizationNotice(): ReactNode { return ( - - - Organization is needed for installing an integration - - Your account is not a member of the pre-selected organization. To use this integration, it - must be installed within an organization your account is associated with. - - + ) } @@ -228,40 +227,47 @@ function OrganizationSelector({ ( - - - - { + field.onChange(value) + form.trigger('selectedOrgSlug') + }} + > + - - - - - {organizations.map((organization) => ( - - {organization.name} - - ))} - - - - + + + + {organizations.map((organization) => ( + + {organization.name} + + ))} + + + + )} /> @@ -270,87 +276,45 @@ function OrganizationSelector({ } interface FormFooterProps { - disabled?: boolean approvalState: ApprovalState requester: ApiAuthorizationResponse - organizations: OrganizationsState + redirectUrl?: string onDecline: () => void onApprove: () => void } function FormFooter({ - disabled = false, approvalState, requester, - organizations, + redirectUrl, onDecline, onApprove, }: FormFooterProps): ReactNode { - const showApprovalButton = organizations._tag === 'success' || organizations._tag === 'not_member' - return ( - +
+ - {organizations._tag === 'loading' && ( - Authorize {requester.name} + {redirectUrl && ( +
+

+ Authorizing will redirect you to {redirectUrl} +

+
)} - {organizations._tag === 'empty' && } - {showApprovalButton && ( - - )} - - ) -} - -interface LoadingApprovalButtonProps { - children: ReactNode -} - -function LoadingApprovalButton({ children }: LoadingApprovalButtonProps): ReactNode { - return -} - -function createReturnToSearchParam(): string | null { - if (typeof window === 'undefined') { - return null - } - - const basePath = BASE_PATH - - let pathname = basePath ? location.pathname.replace(basePath, '') : location.pathname - if (location.search) { - pathname += location.search - } - - return pathname -} - -function CreateOrganizationLink(): ReactNode { - const searchParamString = useMemo(function createSearchParams() { - const searchParams = new URLSearchParams() - const returnTo = createReturnToSearchParam() - if (returnTo) { - searchParams.set('returnTo', returnTo) - } - return searchParams.toString() - }, []) - - return ( - +
) } @@ -368,7 +332,14 @@ function ApprovalButton({ onApprove, }: ApprovalButtonProps): ReactNode { return ( - ) diff --git a/apps/studio/components/interfaces/ApiAuthorization/ApiAuthorization.Loading.tsx b/apps/studio/components/interfaces/ApiAuthorization/ApiAuthorization.Loading.tsx index 89e6c6ff0a2..a28e51b7e20 100644 --- a/apps/studio/components/interfaces/ApiAuthorization/ApiAuthorization.Loading.tsx +++ b/apps/studio/components/interfaces/ApiAuthorization/ApiAuthorization.Loading.tsx @@ -1,28 +1,40 @@ import type { ReactNode } from 'react' -import { Card, CardContent, CardHeader } from 'ui' +import { Card, CardContent } from 'ui' import { ShimmeringLoader } from 'ui-patterns' +import { InterstitialLayout, SupabaseLogo } from '@/components/layouts/InterstitialLayout' + export function ApiAuthorizationLoadingScreen(): ReactNode { return ( - - Authorize API access - + } + title={} + description={} + > +
Loading... -
- - +
+ + + +
+ + +
+
+
+ + + + + + +
+ + +
- -
- - -
- -
- - -
- - +
+ ) } diff --git a/apps/studio/components/interfaces/ApiAuthorization/ApiAuthorization.Valid.tsx b/apps/studio/components/interfaces/ApiAuthorization/ApiAuthorization.Valid.tsx index 8f6ebdf5517..cb85776418a 100644 --- a/apps/studio/components/interfaces/ApiAuthorization/ApiAuthorization.Valid.tsx +++ b/apps/studio/components/interfaces/ApiAuthorization/ApiAuthorization.Valid.tsx @@ -1,4 +1,5 @@ import { zodResolver } from '@hookform/resolvers/zod' +import Head from 'next/head' import { useEffect, useEffectEvent, useMemo, useState, type ReactNode } from 'react' import { useForm, type UseFormReturn } from 'react-hook-form' import { toast } from 'sonner' @@ -16,6 +17,7 @@ import { useApiAuthorizationApproveMutation } from '@/data/api-authorization/api import { useApiAuthorizationDeclineMutation } from '@/data/api-authorization/api-authorization-decline-mutation' import { useApiAuthorizationQuery } from '@/data/api-authorization/api-authorization-query' import { useOrganizationsQuery } from '@/data/organizations/organizations-query' +import { buildStudioPageTitle } from '@/lib/page-title' import type { Organization } from '@/types' function getMatchingOrganization( @@ -45,16 +47,19 @@ function preselectOrganizationSlug({ } } -function useOrganizationsState(organization_slug: string | undefined) { +function useOrganizationsState(organization_slug: string | undefined, enabled = true) { const { data: organizations, isPending: isLoadingOrganizations, isError: isErrorOrganizations, error: organizationsError, - } = useOrganizationsQuery() + } = useOrganizationsQuery({ enabled }) const organizationsState = useMemo( function calculateOrganizationsState() { + if (!enabled) { + return { _tag: 'loading' as const } + } if (isLoadingOrganizations) { return { _tag: 'loading' as const } } @@ -73,6 +78,7 @@ function useOrganizationsState(organization_slug: string | undefined) { return { _tag: 'success' as const, organizations } }, [ + enabled, isLoadingOrganizations, isErrorOrganizations, organizationsError, @@ -179,28 +185,47 @@ export function ApiAuthorizationValidScreen({ return } + const effectiveRequester = requester + const effectiveOrganizationsState = organizationsState + const effectiveOrganizationSlug = organization_slug + const effectiveApprovalState = approvalState + const pageTitle = effectiveRequester + ? buildStudioPageTitle({ section: `Authorize ${effectiveRequester.name}`, brand: 'Supabase' }) + : undefined + + if (!effectiveRequester) return null + if (isApproved) { const approvedOrganization = - organizationsState._tag === 'success' - ? organizationsState.organizations.find( - (org) => org.slug === requester.approved_organization_slug + effectiveOrganizationsState._tag === 'success' + ? effectiveOrganizationsState.organizations.find( + (org) => org.slug === effectiveRequester.approved_organization_slug ) : undefined return ( - + <> + {pageTitle && {pageTitle}} + + ) } return ( - + <> + {pageTitle && {pageTitle}} + + ) } diff --git a/apps/studio/components/interfaces/ApiAuthorization/ApiAuthorization.tsx b/apps/studio/components/interfaces/ApiAuthorization/ApiAuthorization.tsx index 43ff848e09d..7e710d72e68 100644 --- a/apps/studio/components/interfaces/ApiAuthorization/ApiAuthorization.tsx +++ b/apps/studio/components/interfaces/ApiAuthorization/ApiAuthorization.tsx @@ -12,8 +12,7 @@ export function ApiAuthorizationScreen({ organization_slug, navigate, }: ApiAuthorizationScreenProps) { - const valid = !!auth_id - if (!valid) { + if (!auth_id) { return } diff --git a/apps/studio/components/interfaces/App/CommandMenu/ApiKeys.tsx b/apps/studio/components/interfaces/App/CommandMenu/ApiKeys.tsx index d223aa14c4b..82fe7b2cbb2 100644 --- a/apps/studio/components/interfaces/App/CommandMenu/ApiKeys.tsx +++ b/apps/studio/components/interfaces/App/CommandMenu/ApiKeys.tsx @@ -15,7 +15,7 @@ import { import { COMMAND_MENU_SECTIONS } from './CommandMenu.utils' import { orderCommandSectionsByPriority } from './ordering' -import { getKeys, useAPIKeysQuery } from '@/data/api-keys/api-keys-query' +import { useAPIKeys } from '@/data/api-keys/api-keys-query' import { useAsyncCheckPermissions } from '@/hooks/misc/useCheckPermissions' import { useSelectedProjectQuery } from '@/hooks/misc/useSelectedProject' @@ -31,13 +31,13 @@ export function useApiKeysCommands() { const { can: canReadAPIKeys } = useAsyncCheckPermissions(PermissionAction.SECRETS_READ, '*') - const { data: apiKeys } = useAPIKeysQuery( + const { data: apiKeysData } = useAPIKeys( { projectRef: project?.ref, reveal: true }, { enabled: canReadAPIKeys } ) const commands = useMemo(() => { const { anonKey, serviceKey, publishableKey, allSecretKeys } = canReadAPIKeys - ? getKeys(apiKeys) + ? (apiKeysData ?? {}) : {} return [ @@ -127,7 +127,7 @@ export function useApiKeysCommands() { icon: () => , }, ].filter(Boolean) as ICommand[] - }, [apiKeys, canReadAPIKeys, project, ref, resetCommandMenu, setIsOpen]) + }, [canReadAPIKeys, apiKeysData, project, ref, resetCommandMenu, setIsOpen]) useRegisterPage( API_KEYS_PAGE_NAME, diff --git a/apps/studio/components/interfaces/App/FeaturePreview/FeaturePreviewModal.tsx b/apps/studio/components/interfaces/App/FeaturePreview/FeaturePreviewModal.tsx index 857a10a90a4..cf38d45a091 100644 --- a/apps/studio/components/interfaces/App/FeaturePreview/FeaturePreviewModal.tsx +++ b/apps/studio/components/interfaces/App/FeaturePreview/FeaturePreviewModal.tsx @@ -25,8 +25,8 @@ import { import { AdvisorRulesPreview } from './AdvisorRulesPreview' import { CLSPreview } from './CLSPreview' import { useFeaturePreviewContext, useFeaturePreviewModal } from './FeaturePreviewContext' +import { IntegrationsLayoutPreview } from './IntegrationsLayoutPreview' import { JitDbAccessPreview } from './JitDbAccessPreview' -import { MarketplacePreview } from './MarketplacePreview' import { PgDeltaDiffPreview } from './PgDeltaDiffPreview' import { PlatformWebhooksPreview } from './PlatformWebhooksPreview' import { RLSTesterPreview } from './RLSTesterPreview' @@ -47,7 +47,7 @@ const FEATURE_PREVIEW_KEY_TO_CONTENT: { [LOCAL_STORAGE_KEYS.UI_PREVIEW_PLATFORM_WEBHOOKS]: , [LOCAL_STORAGE_KEYS.UI_PREVIEW_JIT_DB_ACCESS]: , [LOCAL_STORAGE_KEYS.UI_PREVIEW_RLS_TESTER]: , - [LOCAL_STORAGE_KEYS.UI_PREVIEW_MARKETPLACE]: , + [LOCAL_STORAGE_KEYS.UI_PREVIEW_MARKETPLACE]: , } export const FeaturePreviewModal = () => { @@ -152,7 +152,7 @@ export const FeaturePreviewModal = () => {
-
+

{selectedFeature?.name}

diff --git a/apps/studio/components/interfaces/App/FeaturePreview/IntegrationsLayoutPreview.tsx b/apps/studio/components/interfaces/App/FeaturePreview/IntegrationsLayoutPreview.tsx new file mode 100644 index 00000000000..55c42690c66 --- /dev/null +++ b/apps/studio/components/interfaces/App/FeaturePreview/IntegrationsLayoutPreview.tsx @@ -0,0 +1,7 @@ +export const IntegrationsLayoutPreview = () => ( +
+

+ Browse and install integrations from a new layout with improved filtering and search. +

+
+) diff --git a/apps/studio/components/interfaces/App/FeaturePreview/MarketplacePreview.tsx b/apps/studio/components/interfaces/App/FeaturePreview/MarketplacePreview.tsx deleted file mode 100644 index a701e82504f..00000000000 --- a/apps/studio/components/interfaces/App/FeaturePreview/MarketplacePreview.tsx +++ /dev/null @@ -1,12 +0,0 @@ -export const MarketplacePreview = () => ( -
-

- Browse and install integrations from a new Marketplace layout with improved filtering and - search. -

-

- This preview is on by default for internal teammates and select integration partners. Turn it - off to fall back to the previous Integrations layout at any time. -

-
-) diff --git a/apps/studio/components/interfaces/App/FeaturePreview/useFeaturePreviews.ts b/apps/studio/components/interfaces/App/FeaturePreview/useFeaturePreviews.ts index f3d40b8a6cf..060b22c01fd 100644 --- a/apps/studio/components/interfaces/App/FeaturePreview/useFeaturePreviews.ts +++ b/apps/studio/components/interfaces/App/FeaturePreview/useFeaturePreviews.ts @@ -86,7 +86,7 @@ export const useFeaturePreviews = (): FeaturePreview[] => { }, { key: LOCAL_STORAGE_KEYS.UI_PREVIEW_MARKETPLACE, - name: 'Marketplace', + name: 'Integrations layout', discussionsUrl: undefined, enabled: true, isNew: true, diff --git a/apps/studio/components/interfaces/Auth/EmailTemplates/TemplateEditor.tsx b/apps/studio/components/interfaces/Auth/EmailTemplates/TemplateEditor.tsx index 51a24452e5e..be691be50fc 100644 --- a/apps/studio/components/interfaces/Auth/EmailTemplates/TemplateEditor.tsx +++ b/apps/studio/components/interfaces/Auth/EmailTemplates/TemplateEditor.tsx @@ -27,7 +27,7 @@ import type { AuthTemplate } from './EmailTemplates.types' import { hasCustomEmailSender } from './EmailTemplates.utils' import { ResetTemplateDialog } from './ResetTemplateDialog' import { SpamValidation } from './SpamValidation' -import { PreventNavigationOnUnsavedChanges } from '@/components/ui-patterns/Dialogs/PreventNavigationOnUnsavedChanges' +import { DiscardChangesConfirmationDialog } from '@/components/ui-patterns/Dialogs/DiscardChangesConfirmationDialog' import { ButtonTooltip } from '@/components/ui/ButtonTooltip' import { CodeEditor } from '@/components/ui/CodeEditor/CodeEditor' import { InlineLink } from '@/components/ui/InlineLink' @@ -37,6 +37,7 @@ import { useAuthConfigQuery } from '@/data/auth/auth-config-query' import { useAuthConfigUpdateMutation } from '@/data/auth/auth-config-update-mutation' import { useValidateSpamMutation, ValidateSpamResponse } from '@/data/auth/validate-spam-mutation' import { useAsyncCheckPermissions } from '@/hooks/misc/useCheckPermissions' +import { usePreventNavigationOnUnsavedChanges } from '@/hooks/ui/usePreventNavigationOnUnsavedChanges' import { DOCS_URL } from '@/lib/constants' interface TemplateEditorProps { @@ -270,6 +271,11 @@ export const TemplateEditor = ({ template, isReadOnly = false }: TemplateEditorP if (!canEdit) setActiveView('preview') }, [canEdit]) + const { handleCancelNavigation, handleConfirmNavigation, shouldConfirmNavigation } = + usePreventNavigationOnUnsavedChanges({ + hasChanges, + }) + return (
@@ -466,7 +472,11 @@ export const TemplateEditor = ({ template, isReadOnly = false }: TemplateEditorP )}
- + ) } diff --git a/apps/studio/components/interfaces/Billing/Payment/PaymentMethods/NewPaymentMethodElement.tsx b/apps/studio/components/interfaces/Billing/Payment/PaymentMethods/NewPaymentMethodElement.tsx index 6c6abcc3d92..5990e93691b 100644 --- a/apps/studio/components/interfaces/Billing/Payment/PaymentMethods/NewPaymentMethodElement.tsx +++ b/apps/studio/components/interfaces/Billing/Payment/PaymentMethods/NewPaymentMethodElement.tsx @@ -12,7 +12,7 @@ import { type SetupIntent, } from '@stripe/stripe-js' import { Form } from '@ui/components/shadcn/ui/form' -import { Check, ChevronsUpDown } from 'lucide-react' +import { Check, ChevronsUpDown, HelpCircle } from 'lucide-react' import { forwardRef, useEffect, useId, useImperativeHandle, useMemo, useRef, useState } from 'react' import { useForm } from 'react-hook-form' import { toast } from 'sonner' @@ -34,6 +34,9 @@ import { Popover, PopoverContent, PopoverTrigger, + Tooltip, + TooltipContent, + TooltipTrigger, } from 'ui' import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout' import { z } from 'zod' @@ -345,6 +348,20 @@ export const NewPaymentMethodElement = forwardRef( + + + + + + Check this only if you need a tax ID (e.g. US EIN, VAT, GST) on your invoice. You’ll + be asked to enter it, and it’ll appear on a compliant business invoice. If you don’t + have a tax ID, or don’t need one shown, leave this unchecked. You’ll still receive a + receipt. + +
)} diff --git a/apps/studio/components/interfaces/BranchManagement/Overview.tsx b/apps/studio/components/interfaces/BranchManagement/Overview.tsx index bec2163e23b..2ea963c738f 100644 --- a/apps/studio/components/interfaces/BranchManagement/Overview.tsx +++ b/apps/studio/components/interfaces/BranchManagement/Overview.tsx @@ -365,7 +365,7 @@ const PreviewBranchActions = ({ <> { e.stopPropagation() setShowConfirmRetriggersModal(true) @@ -379,9 +379,7 @@ const PreviewBranchActions = ({ side: 'left', text: !canUpdateBranches ? `You need additional permissions to ${branch.git_branch ? 'resync' : 'rebase'} branches` - : !isBranchActiveHealthy - ? `Branch is still initializing. Please wait for it to become healthy before ${branch.git_branch ? 'resyncing' : 'rebasing'}.` - : undefined, + : undefined, }, }} > @@ -409,46 +407,43 @@ const PreviewBranchActions = ({ > Reset branch + { + e.stopPropagation() + setShowBranchModeSwitch(true) + }} + onClick={(e) => { + e.stopPropagation() + setShowBranchModeSwitch(true) + }} + tooltip={{ + content: { + side: 'left', + text: !isBranchActiveHealthy + ? 'Branch is still initializing. Please wait for it to become healthy before switching.' + : !branch.persistent && !hasAccessToPersistentBranching + ? 'Upgrade your plan to access persistent branches' + : undefined, + }, + }} + > + {branch.persistent ? ( + <> + Switch to preview + + ) : ( + <> + Switch to persistent + + )} + )} - {!branch.deletion_scheduled_at && ( - { - e.stopPropagation() - setShowBranchModeSwitch(true) - }} - onClick={(e) => { - e.stopPropagation() - setShowBranchModeSwitch(true) - }} - tooltip={{ - content: { - side: 'left', - text: !isBranchActiveHealthy - ? 'Branch is still initializing. Please wait for it to become healthy before switching.' - : !branch.persistent && !hasAccessToPersistentBranching - ? 'Upgrade your plan to access persistent branches' - : undefined, - }, - }} - > - {branch.persistent ? ( - <> - Switch to preview - - ) : ( - <> - Switch to persistent - - )} - - )} - {/* Create PR if applicable */} {branch.git_branch && branch.pr_number === undefined && ( @@ -581,12 +576,27 @@ const PreviewBranchActions = ({ // Actions for main (production) branch const MainBranchActions = ({ branch, repo }: { branch: Branch; repo: string }) => { - const { ref: projectRef } = useParams() + const { project_ref: branchRef, parent_project_ref: projectRef } = branch + const { can: canUpdateBranches } = useAsyncCheckPermissions( PermissionAction.UPDATE, 'preview_branches' ) + const { mutate: branchPushMutate, isPending: isRetriggering } = useBranchPushMutation({ + onSuccess() { + toast.success('Success! Please allow a few minutes for the branch to update.') + setShowConfirmRetriggersModal(false) + }, + onError: (data) => { + toast.error(`Failed to trigger workflow: ${data.message}`) + }, + }) const [showEditBranchModal, setShowEditBranchModal] = useState(false) + const [showConfirmRetriggersModal, setShowConfirmRetriggersModal] = useState(false) + + const onRetriggerBranch = () => { + branchPushMutate({ branchRef, projectRef }) + } return ( <> @@ -611,6 +621,30 @@ const MainBranchActions = ({ branch, repo }: { branch: Branch; repo: string }) = Edit Branch )} + {branch.git_branch ? ( + { + e.stopPropagation() + setShowConfirmRetriggersModal(true) + }} + onClick={(e) => { + e.stopPropagation() + setShowConfirmRetriggersModal(true) + }} + tooltip={{ + content: { + side: 'left', + text: !canUpdateBranches + ? `You need additional permissions to resync branches` + : undefined, + }, + }} + > + Resync branch + + ) : null} @@ -619,6 +653,19 @@ const MainBranchActions = ({ branch, repo }: { branch: Branch; repo: string }) = visible={showEditBranchModal} onClose={() => setShowEditBranchModal(false)} /> + setShowConfirmRetriggersModal(false)} + onConfirm={onRetriggerBranch} + > +

+ This will re-run all steps of the workflow based on the latest git branch state. +

+
) } diff --git a/apps/studio/components/interfaces/Connect/Connect.constants.ts b/apps/studio/components/interfaces/Connect/Connect.constants.ts index 07854fdfb18..6b71f1e8229 100644 --- a/apps/studio/components/interfaces/Connect/Connect.constants.ts +++ b/apps/studio/components/interfaces/Connect/Connect.constants.ts @@ -109,7 +109,7 @@ export const FRAMEWORKS: ConnectionType[] = [ }, { key: 'remix', - label: 'Remix', + label: 'React Router', icon: 'remix', guideLink: `${DOCS_URL}/guides/auth/server-side/creating-a-client?framework=remix&environment=remix-loader`, children: [ diff --git a/apps/studio/components/interfaces/Connect/content/remix/supabasejs/content.tsx b/apps/studio/components/interfaces/Connect/content/remix/supabasejs/content.tsx index 58ab3a1a907..8f65ce355d2 100644 --- a/apps/studio/components/interfaces/Connect/content/remix/supabasejs/content.tsx +++ b/apps/studio/components/interfaces/Connect/content/remix/supabasejs/content.tsx @@ -44,7 +44,7 @@ export function createClient(request: Request) { const supabase = createServerClient( process.env.VITE_SUPABASE_URL!, - process.env.VITE_${projectKeys.publishableKey ? 'SUPABASE_PUBLISHABLE_KEY' : 'SUPABASE_ANON_KEY'};, + process.env.VITE_${projectKeys.publishableKey ? 'SUPABASE_PUBLISHABLE_KEY' : 'SUPABASE_ANON_KEY'}!, { cookies: { getAll() { diff --git a/apps/studio/components/interfaces/ConnectSheet/Connect.constants.ts b/apps/studio/components/interfaces/ConnectSheet/Connect.constants.ts index b1f9f1a6d50..2d7673555a0 100644 --- a/apps/studio/components/interfaces/ConnectSheet/Connect.constants.ts +++ b/apps/studio/components/interfaces/ConnectSheet/Connect.constants.ts @@ -109,7 +109,7 @@ export const FRAMEWORKS: ConnectionType[] = [ }, { key: 'remix', - label: 'Remix', + label: 'React Router', icon: 'remix', guideLink: `${DOCS_URL}/guides/auth/server-side/creating-a-client?framework=remix&environment=remix-loader`, children: [ diff --git a/apps/studio/components/interfaces/ConnectSheet/ConnectSheet.tsx b/apps/studio/components/interfaces/ConnectSheet/ConnectSheet.tsx index 01e5a58f318..994371b3b29 100644 --- a/apps/studio/components/interfaces/ConnectSheet/ConnectSheet.tsx +++ b/apps/studio/components/interfaces/ConnectSheet/ConnectSheet.tsx @@ -12,7 +12,7 @@ import { useAvailableConnectModes } from './useAvailableConnectModes' import { useConnectSheetParams } from './useConnectSheetParams' import { useConnectSheetShortcut } from './useConnectSheetShortcut' import { useConnectState } from './useConnectState' -import { getKeys, useAPIKeysQuery } from '@/data/api-keys/api-keys-query' +import { useAPIKeys } from '@/data/api-keys/api-keys-query' import { useProjectApiUrl } from '@/data/config/project-endpoint-query' import { useAsyncCheckPermissions } from '@/hooks/misc/useCheckPermissions' import { useTrack } from '@/lib/telemetry/track' @@ -159,18 +159,16 @@ export const ConnectSheet = () => { PermissionAction.READ, 'service_api_keys' ) - const { data: apiKeys } = useAPIKeysQuery({ projectRef }, { enabled: canReadAPIKeys }) - const { anonKey, publishableKey } = canReadAPIKeys - ? getKeys(apiKeys) - : { anonKey: null, publishableKey: null } + const { data: apiKeysData } = useAPIKeys({ projectRef }, { enabled: canReadAPIKeys }) const projectKeys: ProjectKeys = useMemo(() => { + const { anonKey, publishableKey } = apiKeysData ?? {} return { apiUrl: endpoint, anonKey: anonKey?.api_key ?? null, publishableKey: publishableKey?.api_key ?? null, } - }, [endpoint, anonKey?.api_key, publishableKey?.api_key]) + }, [endpoint, apiKeysData]) const availableModes = useMemo( () => schema.modes.filter((m) => availableModeIds.includes(m.id)), diff --git a/apps/studio/components/interfaces/ConnectSheet/ConnectStepsSection.tsx b/apps/studio/components/interfaces/ConnectSheet/ConnectStepsSection.tsx index 7c0265a7a7e..6f7670270f4 100644 --- a/apps/studio/components/interfaces/ConnectSheet/ConnectStepsSection.tsx +++ b/apps/studio/components/interfaces/ConnectSheet/ConnectStepsSection.tsx @@ -190,6 +190,8 @@ export function ConnectStepsSection({ steps, state, projectKeys }: ConnectStepsS !ipv4Addon && (state.connectionMethod === 'direct' || (state.connectionMethod === 'transaction' && !state.useSharedPooler)) + const showSessionPoolerNotice = + deploymentMode.isPlatform && state.mode === 'direct' && state.connectionMethod === 'session' const showSelfHostedMcpNotice = deploymentMode.isSelfHosted && state.mode === 'mcp' @@ -200,8 +202,6 @@ export function ConnectStepsSection({ steps, state, projectKeys }: ConnectStepsS

Connect your app

- - {showIpv4AddonNotice && ( )} + {showSessionPoolerNotice && ( + + )} + {showSelfHostedMcpNotice && ( )} + +
{steps.map((step, index) => ( { }) }) +describe('buildConnectionStringWithPassword', () => { + test('returns the original string when input or password is empty', () => { + const uri = `postgresql://postgres:${PASSWORD_PLACEHOLDER}@localhost:5432/postgres` + + expect(buildConnectionStringWithPassword('', 'password')).toBe('') + expect(buildConnectionStringWithPassword(uri, '')).toBe(uri) + }) + + test('replaces every password placeholder with the encoded password', () => { + const uri = `postgresql://postgres:${PASSWORD_PLACEHOLDER}@localhost:5432/postgres?password=${PASSWORD_PLACEHOLDER}` + + expect(buildConnectionStringWithPassword(uri, 'p@ss/word#1')).toBe( + 'postgresql://postgres:p%40ss%2Fword%231@localhost:5432/postgres?password=p%40ss%2Fword%231' + ) + }) +}) + describe('resolveConnectionString', () => { const pooler = { transactionShared: 'tx-shared', diff --git a/apps/studio/components/interfaces/ConnectSheet/ConnectionString.utils.ts b/apps/studio/components/interfaces/ConnectSheet/ConnectionString.utils.ts index 96c07fa8851..16c3e900447 100644 --- a/apps/studio/components/interfaces/ConnectSheet/ConnectionString.utils.ts +++ b/apps/studio/components/interfaces/ConnectSheet/ConnectionString.utils.ts @@ -92,6 +92,23 @@ export const buildSafeConnectionString = ( return `postgresql://${params.user}:${PASSWORD_PLACEHOLDER}@${params.host}:${params.port}/${params.database}${search}` } +export const buildConnectionStringWithPassword = ( + connectionString: string, + password: string +): string => { + if (!connectionString || !password) return connectionString + + const encodedPassword = (() => { + try { + return encodeURIComponent(password) + } catch { + return password + } + })() + + return connectionString.split(PASSWORD_PLACEHOLDER).join(encodedPassword) +} + export const buildConnectionParameters = (params: ConnectionParams) => [ { key: 'host', value: params.host }, { key: 'port', value: params.port }, diff --git a/apps/studio/components/interfaces/ConnectSheet/CopyPromptAdmonition.test.ts b/apps/studio/components/interfaces/ConnectSheet/CopyPromptAdmonition.test.ts new file mode 100644 index 00000000000..49f7bacfa52 --- /dev/null +++ b/apps/studio/components/interfaces/ConnectSheet/CopyPromptAdmonition.test.ts @@ -0,0 +1,31 @@ +import { describe, expect, test } from 'vitest' + +import { buildConnectPrompt } from './CopyPromptAdmonition' + +describe('buildConnectPrompt', () => { + test('uses redacted copy values instead of temporarily visible passwords', () => { + const container = document.createElement('div') + container.innerHTML = ` +
+
+
+
postgresql://postgres:temporary-password@db.example.supabase.co:5432/postgres
+
+
+
+ ` + + const prompt = buildConnectPrompt(container) + + expect(prompt).toContain( + 'postgresql://postgres:[YOUR-PASSWORD]@db.example.supabase.co:5432/postgres' + ) + expect(prompt).not.toContain('temporary-password') + }) +}) diff --git a/apps/studio/components/interfaces/ConnectSheet/CopyPromptAdmonition.tsx b/apps/studio/components/interfaces/ConnectSheet/CopyPromptAdmonition.tsx index 9c70466cd78..e4fb94dc9f0 100644 --- a/apps/studio/components/interfaces/ConnectSheet/CopyPromptAdmonition.tsx +++ b/apps/studio/components/interfaces/ConnectSheet/CopyPromptAdmonition.tsx @@ -8,117 +8,124 @@ interface CopyPromptAdmonitionProps { stepsContainerRef: RefObject } -export function CopyPromptAdmonition({ stepsContainerRef }: CopyPromptAdmonitionProps) { - const normalizeTextLines = (value: string) => { - return value - .split('\n') - .map((line) => line.trim()) - .filter(Boolean) - .join('\n') - } +const normalizeTextLines = (value: string) => { + return value + .split('\n') + .map((line) => line.trim()) + .filter(Boolean) + .join('\n') +} - const getStepTextContent = (contentElement: HTMLElement) => { - const clone = contentElement.cloneNode(true) as HTMLElement - clone - .querySelectorAll('pre, button, svg, input, textarea, select, [aria-hidden="true"]') - .forEach((element) => { - element.remove() - }) - - clone.querySelectorAll('p, div').forEach((el) => { - el.appendChild(document.createTextNode('\n')) +const getStepTextContent = (contentElement: HTMLElement) => { + const clone = contentElement.cloneNode(true) as HTMLElement + clone + .querySelectorAll('pre, button, svg, input, textarea, select, [aria-hidden="true"]') + .forEach((element) => { + element.remove() }) - const text = clone.textContent ?? '' - return normalizeTextLines(text) + clone.querySelectorAll('p, div').forEach((el) => { + el.appendChild(document.createTextNode('\n')) + }) + + const text = clone.textContent ?? '' + return normalizeTextLines(text) +} + +const getStepCodeSnippets = (contentElement: HTMLElement) => { + const snippets: Array<{ label: string; snippet: string }> = [] + const seen = new Set() + + const addSnippet = (label: string, snippet: string) => { + if (!snippet || seen.has(snippet)) return + seen.add(snippet) + snippets.push({ label, snippet }) } - const getStepCodeSnippets = (contentElement: HTMLElement) => { - const snippets: Array<{ label: string; snippet: string }> = [] - const seen = new Set() + const getSnippet = (element: Element) => { + const copyValueElement = element.closest('[data-connect-copy-value]') as HTMLElement | null + return copyValueElement?.dataset.connectCopyValue?.trim() || element.textContent?.trim() + } - const addSnippet = (label: string, snippet: string) => { - if (!snippet || seen.has(snippet)) return - seen.add(snippet) - snippets.push({ label, snippet }) + const tabContents = Array.from( + contentElement.querySelectorAll('[data-connect-tab-content]') + ) as HTMLElement[] + + tabContents.forEach((tabContent) => { + const label = tabContent.getAttribute('data-tab-label') || 'Code' + const tabSnippets = Array.from(tabContent.querySelectorAll('pre')) + .map(getSnippet) + .filter((snippet): snippet is string => Boolean(snippet)) + + if (tabSnippets.length === 0) { + const inlineSnippets = Array.from(tabContent.querySelectorAll('code')) + .filter((code) => !code.closest('pre') && code.closest('.font-mono')) + .map((code) => code.textContent?.trim()) + .filter((snippet): snippet is string => Boolean(snippet)) + inlineSnippets.forEach((snippet, index) => { + const inlineLabel = inlineSnippets.length > 1 ? `${label} (part ${index + 1})` : label + addSnippet(inlineLabel, snippet) + }) + return } - const tabContents = Array.from( - contentElement.querySelectorAll('[data-connect-tab-content]') - ) as HTMLElement[] - - tabContents.forEach((tabContent) => { - const label = tabContent.getAttribute('data-tab-label') || 'Code' - const tabSnippets = Array.from(tabContent.querySelectorAll('pre')) - .map((pre) => pre.textContent?.trim()) - .filter((snippet): snippet is string => Boolean(snippet)) - - if (tabSnippets.length === 0) { - const inlineSnippets = Array.from(tabContent.querySelectorAll('code')) - .filter((code) => !code.closest('pre') && code.closest('.font-mono')) - .map((code) => code.textContent?.trim()) - .filter((snippet): snippet is string => Boolean(snippet)) - inlineSnippets.forEach((snippet, index) => { - const inlineLabel = inlineSnippets.length > 1 ? `${label} (part ${index + 1})` : label - addSnippet(inlineLabel, snippet) - }) - return - } - - tabSnippets.forEach((snippet, index) => { - const tabLabel = tabSnippets.length > 1 ? `${label} (part ${index + 1})` : label - addSnippet(tabLabel, snippet) - }) + tabSnippets.forEach((snippet, index) => { + const tabLabel = tabSnippets.length > 1 ? `${label} (part ${index + 1})` : label + addSnippet(tabLabel, snippet) }) + }) - contentElement.querySelectorAll('pre').forEach((pre) => { - if (pre.closest('[data-connect-tab-content]')) return - const snippet = pre.textContent?.trim() - if (snippet) addSnippet('Code', snippet) + contentElement.querySelectorAll('pre').forEach((pre) => { + if (pre.closest('[data-connect-tab-content]')) return + const snippet = getSnippet(pre) + if (snippet) addSnippet('Code', snippet) + }) + + contentElement.querySelectorAll('code').forEach((code) => { + if (code.closest('pre')) return + if (code.closest('[data-connect-tab-content]')) return + if (!code.closest('.font-mono')) return + const snippet = code.textContent?.trim() + if (snippet) addSnippet('Code', snippet) + }) + + return snippets +} + +export const buildConnectPrompt = (stepsContainer: HTMLElement | null) => { + const stepElements = stepsContainer?.querySelectorAll('[data-connect-step]') + if (!stepElements?.length) return '' + + const promptContent = Array.from(stepElements) + .map((stepElement, index) => { + const title = stepElement.getAttribute('data-step-title') ?? `Step ${index + 1}` + const description = stepElement.getAttribute('data-step-description') ?? '' + const contentElement = stepElement.querySelector('[data-step-content]') as HTMLElement | null + + const details = contentElement ? getStepTextContent(contentElement) : '' + const codeSnippets = contentElement ? getStepCodeSnippets(contentElement) : [] + + const sections = [ + `${index + 1}. ${title}`, + description, + details ? `Details:\n${details}` : null, + codeSnippets.length + ? `Code:\n${codeSnippets + .map(({ label, snippet }) => `File: ${label}\n\`\`\`\n${snippet}\n\`\`\``) + .join('\n\n')}` + : null, + ].filter(Boolean) + + return sections.join('\n') }) + .join('\n\n') - contentElement.querySelectorAll('code').forEach((code) => { - if (code.closest('pre')) return - if (code.closest('[data-connect-tab-content]')) return - if (!code.closest('.font-mono')) return - const snippet = code.textContent?.trim() - if (snippet) addSnippet('Code', snippet) - }) - - return snippets - } + return promptContent +} +export function CopyPromptAdmonition({ stepsContainerRef }: CopyPromptAdmonitionProps) { const handleCopyPrompt = () => { - const stepElements = stepsContainerRef.current?.querySelectorAll('[data-connect-step]') - if (!stepElements?.length) return '' - - const promptContent = Array.from(stepElements) - .map((stepElement, index) => { - const title = stepElement.getAttribute('data-step-title') ?? `Step ${index + 1}` - const description = stepElement.getAttribute('data-step-description') ?? '' - const contentElement = stepElement.querySelector( - '[data-step-content]' - ) as HTMLElement | null - - const details = contentElement ? getStepTextContent(contentElement) : '' - const codeSnippets = contentElement ? getStepCodeSnippets(contentElement) : [] - - const sections = [ - `${index + 1}. ${title}`, - description, - details ? `Details:\n${details}` : null, - codeSnippets.length - ? `Code:\n${codeSnippets - .map(({ label, snippet }) => `File: ${label}\n\`\`\`\n${snippet}\n\`\`\``) - .join('\n\n')}` - : null, - ].filter(Boolean) - - return sections.join('\n') - }) - .join('\n\n') - - return promptContent + return buildConnectPrompt(stepsContainerRef.current) } return ( diff --git a/apps/studio/components/interfaces/ConnectSheet/content/remix/supabasejs/content.tsx b/apps/studio/components/interfaces/ConnectSheet/content/remix/supabasejs/content.tsx index 3b3786fae13..d2eada2353e 100644 --- a/apps/studio/components/interfaces/ConnectSheet/content/remix/supabasejs/content.tsx +++ b/apps/studio/components/interfaces/ConnectSheet/content/remix/supabasejs/content.tsx @@ -30,7 +30,7 @@ export function createClient(request: Request) { const supabase = createServerClient( process.env.VITE_SUPABASE_URL!, - process.env.VITE_${projectKeys.publishableKey ? 'SUPABASE_PUBLISHABLE_KEY' : 'SUPABASE_ANON_KEY'}, + process.env.VITE_${projectKeys.publishableKey ? 'SUPABASE_PUBLISHABLE_KEY' : 'SUPABASE_ANON_KEY'}!, { cookies: { getAll() { diff --git a/apps/studio/components/interfaces/ConnectSheet/content/steps/direct-connection/content.tsx b/apps/studio/components/interfaces/ConnectSheet/content/steps/direct-connection/content.tsx index 7cfe723a089..60402805e54 100644 --- a/apps/studio/components/interfaces/ConnectSheet/content/steps/direct-connection/content.tsx +++ b/apps/studio/components/interfaces/ConnectSheet/content/steps/direct-connection/content.tsx @@ -1,16 +1,14 @@ import { useParams } from 'common' -import { useMemo } from 'react' +import { Check, KeyRound } from 'lucide-react' +import { useMemo, useState } from 'react' import { Badge } from 'ui' import { CodeBlock } from 'ui-patterns/CodeBlock' import { GenericSkeletonLoader } from 'ui-patterns/ShimmeringLoader' import { buildConnectionStringPooler, getConnectionStrings } from '../../../DatabaseSettings.utils' -import { IPv4StatusPanel, type IPv4Status } from './IPv4StatusPanel' import { getAddons } from '@/components/interfaces/Billing/Subscription/Subscription.utils' import { DATABASE_CONNECTION_TYPES, - IPV4_ADDON_TEXT, - PGBOUNCER_ENABLED_BUT_NO_IPV4_ADDON_TEXT, type ConnectionStringMethod, type DatabaseConnectionType, } from '@/components/interfaces/ConnectSheet/Connect.constants' @@ -22,11 +20,13 @@ import type { import { ConnectionParameters } from '@/components/interfaces/ConnectSheet/ConnectionParameters' import { buildConnectionParameters, + buildConnectionStringWithPassword, buildSafeConnectionString, parseConnectionParams, PASSWORD_PLACEHOLDER, resolveConnectionString, } from '@/components/interfaces/ConnectSheet/ConnectionString.utils' +import { ResetDbPasswordDialog } from '@/components/interfaces/Settings/Database/DatabaseSettings/ResetDbPasswordDialog' import { usePgbouncerConfigQuery } from '@/data/database/pgbouncer-config-query' import { useSupavisorConfigurationQuery } from '@/data/database/supavisor-configuration-query' import { useReadReplicasQuery } from '@/data/read-replicas/replicas-query' @@ -143,9 +143,9 @@ const CONNECTION_METHOD_TO_TELEMETRY: Record< */ function DirectConnectionContent({ state, deploymentMode }: StepContentProps) { const track = useTrack() - const { ref: projectRef } = useParams() const { hasAccess: hasDedicatedPooler } = useCheckEntitlements('dedicated_pooler') const isHighAvailability = useIsHighAvailability() + const [temporaryDatabasePassword, setTemporaryDatabasePassword] = useState('') const connectionSource = state.connectionSource const connectionType = (state.connectionType as DatabaseConnectionType) ?? 'uri' @@ -155,8 +155,6 @@ function DirectConnectionContent({ state, deploymentMode }: StepContentProps) { const connectionStrings = useConnectionStringDatabases(deploymentMode) const connectionStringPooler: ConnectionStringPooler | undefined = connectionStrings[connectionSource as keyof typeof connectionStrings] - const hasIPv4Addon = connectionStringPooler?.ipv4SupportedForDedicatedPooler ?? false - // Determine which connection string to use const resolvedConnectionString = useMemo( () => @@ -178,7 +176,7 @@ function DirectConnectionContent({ state, deploymentMode }: StepContentProps) { [resolvedConnectionString, connectionParams] ) - const connectionString = useMemo(() => { + const redactedConnectionString = useMemo(() => { switch (connectionType) { case 'psql': return buildPsqlCommand(connectionParams) @@ -192,6 +190,19 @@ function DirectConnectionContent({ state, deploymentMode }: StepContentProps) { } }, [connectionType, connectionParams, safeConnectionString]) + const connectionString = useMemo(() => { + if (!temporaryDatabasePassword) return redactedConnectionString + + if (connectionType === 'psql') { + return `psql "${buildConnectionStringWithPassword( + safeConnectionString, + temporaryDatabasePassword + )}"` + } + + return buildConnectionStringWithPassword(redactedConnectionString, temporaryDatabasePassword) + }, [connectionType, redactedConnectionString, safeConnectionString, temporaryDatabasePassword]) + const trackCopy = () => { const typeConfig = DATABASE_CONNECTION_TYPES.find((t) => t.id === connectionType) track('connection_string_copied', { @@ -211,57 +222,6 @@ function DirectConnectionContent({ state, deploymentMode }: StepContentProps) { ) } - const sharedPoolerPreferred = !hasDedicatedPooler - const ipv4AddOnUrl = { - text: 'IPv4 add-on', - url: `/project/${projectRef}/settings/addons?panel=ipv4`, - } - const ipv4SettingsUrl = { - text: 'IPv4 settings', - url: `/project/${projectRef}/settings/addons?panel=ipv4`, - } - const poolerSettingsUrl = { - text: 'Pooler settings', - url: `/project/${projectRef}/database/settings#connection-pooling`, - } - const buttonLinks = !hasIPv4Addon - ? [ipv4AddOnUrl, ...(sharedPoolerPreferred ? [poolerSettingsUrl] : [])] - : [ipv4SettingsUrl, ...(sharedPoolerPreferred ? [poolerSettingsUrl] : [])] - - let ipv4Status: IPv4Status - if (connectionMethod === 'direct') { - ipv4Status = { - type: !hasIPv4Addon ? 'error' : 'success', - title: !hasIPv4Addon ? 'Not IPv4 compatible' : 'IPv4 compatible', - description: - !sharedPoolerPreferred && !hasIPv4Addon - ? PGBOUNCER_ENABLED_BUT_NO_IPV4_ADDON_TEXT - : sharedPoolerPreferred - ? 'Use Session Pooler if on a IPv4 network or purchase IPv4 add-on' - : IPV4_ADDON_TEXT, - links: buttonLinks, - } - } else if (connectionMethod === 'transaction') { - const isUsingSharedPooler = useSharedPooler || !hasDedicatedPooler - ipv4Status = { - type: !isUsingSharedPooler && !hasIPv4Addon ? 'error' : 'success', - title: !isUsingSharedPooler && !hasIPv4Addon ? 'Not IPv4 compatible' : 'IPv4 compatible', - description: - !isUsingSharedPooler && !hasIPv4Addon - ? PGBOUNCER_ENABLED_BUT_NO_IPV4_ADDON_TEXT - : isUsingSharedPooler - ? 'Transaction pooler connections are IPv4 proxied for free.' - : IPV4_ADDON_TEXT, - links: !isUsingSharedPooler ? buttonLinks : undefined, - } - } else { - ipv4Status = { - type: 'success', - title: 'IPv4 compatible', - description: 'Session pooler connections are IPv4 proxied for free', - } - } - const poolerBadge = connectionMethod === 'transaction' ? useSharedPooler || !hasDedicatedPooler @@ -280,16 +240,39 @@ function DirectConnectionContent({ state, deploymentMode }: StepContentProps) { {poolerBadge}
)} - - {connectionString} - +
+
+ + {connectionString} + +
+ {deploymentMode.isPlatform && ( +
+
+ {temporaryDatabasePassword ? ( + + + New password shown until refresh. + + ) : ( + 'Forgot your database password?' + )} +
+ } + onPasswordReset={setTemporaryDatabasePassword} + /> +
+ )} +
{showSelfHostedDirectNotice && (

Manually{' '} @@ -304,15 +287,6 @@ function DirectConnectionContent({ state, deploymentMode }: StepContentProps) { for self-hosted Supabase.

)} - {deploymentMode.isPlatform && projectRef && !isHighAvailability && ( -
- -
- )} { const { ref } = useParams() const { can: canReadAPIKeys } = useAsyncCheckPermissions(PermissionAction.SECRETS_READ, '*') - const { data: apiKeys } = useAPIKeysQuery( - { projectRef: ref, reveal: true }, + const { data: apiKeyData } = useAPIKeys( + { + projectRef: ref, + reveal: true, + }, { enabled: canReadAPIKeys } ) - - const { serviceKey, secretKey } = getKeys(apiKeys) + const { serviceKey, secretKey } = apiKeyData ?? {} const apiKey = secretKey?.api_key ?? serviceKey?.api_key ?? '[YOUR API KEY]' const functionType = useWatch({ control: form.control, name: 'function_type' }) diff --git a/apps/studio/components/interfaces/Database/Indexes/CreateIndexSidePanel.tsx b/apps/studio/components/interfaces/Database/Indexes/CreateIndexSidePanel.tsx index 270350ebba9..88f897611dc 100644 --- a/apps/studio/components/interfaces/Database/Indexes/CreateIndexSidePanel.tsx +++ b/apps/studio/components/interfaces/Database/Indexes/CreateIndexSidePanel.tsx @@ -1,6 +1,8 @@ +import { zodResolver } from '@hookform/resolvers/zod' import { Check, ChevronsUpDown, Loader2 } from 'lucide-react' import Link from 'next/link' import { Fragment, useEffect, useMemo, useState } from 'react' +import { useForm, useWatch } from 'react-hook-form' import { toast } from 'sonner' import { Button, @@ -11,6 +13,9 @@ import { CommandInput, CommandItem, CommandList, + Form, + FormControl, + FormField, Popover, PopoverContent, PopoverTrigger, @@ -20,7 +25,13 @@ import { SelectSeparator, SelectTrigger, SelectValue, - SidePanel, + Separator, + Sheet, + SheetContent, + SheetFooter, + SheetHeader, + SheetSection, + SheetTitle, } from 'ui' import { Admonition } from 'ui-patterns' import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout' @@ -32,6 +43,7 @@ import { MultiSelectorTrigger, } from 'ui-patterns/multi-select' import { ShimmeringLoader } from 'ui-patterns/ShimmeringLoader' +import * as z from 'zod' import { INDEX_TYPES } from './Indexes.constants' import CodeEditor from '@/components/ui/CodeEditor/CodeEditor' @@ -48,14 +60,39 @@ interface CreateIndexSidePanelProps { onClose: () => void } +const formSchema = z.object({ + schema: z.string().min(1, 'Please provide a name for your schema'), + table: z.string().min(1, 'Please provide a name for your table'), + columns: z + .array(z.string()) + .min(1, 'Please select at least one column') + .max(32, 'You can select up to 32 columns'), + type: z.string().min(1, 'Please select an index type'), +}) + +type FormSchema = z.infer + export const CreateIndexSidePanel = ({ visible, onClose }: CreateIndexSidePanelProps) => { const { data: project } = useSelectedProjectQuery() const isOrioleDb = useIsOrioleDb() - const [selectedSchema, setSelectedSchema] = useState('public') - const [selectedEntity, setSelectedEntity] = useState(undefined) - const [selectedColumns, setSelectedColumns] = useState([]) - const [selectedIndexType, setSelectedIndexType] = useState(INDEX_TYPES[0].value) + const form = useForm({ + resolver: zodResolver(formSchema), + defaultValues: { + schema: 'public', + table: '', + columns: [], + type: INDEX_TYPES[0].value, + }, + }) + + const formId = 'schema-form' + + const selectedSchema = useWatch({ name: 'schema', control: form.control }) + const selectedEntity = useWatch({ name: 'table', control: form.control }) + const selectedColumns = useWatch({ name: 'columns', control: form.control }) ?? [] + const selectedIndexType = useWatch({ name: 'type', control: form.control }) + const [schemaDropdownOpen, setSchemaDropdownOpen] = useState(false) const [tableDropdownOpen, setTableDropdownOpen] = useState(false) const [schemaSearchTerm, setSchemaSearchTerm] = useState('') @@ -98,13 +135,6 @@ export const CreateIndexSidePanel = ({ visible, onClose }: CreateIndexSidePanelP setSearchTerm(value) } - function handleSchemaSelect(schema: string) { - setSelectedSchema(schema) - setSearchTerm('') - setSchemaSearchTerm('') - setSchemaDropdownOpen(false) - } - const columns = tableColumns?.[0]?.columns ?? [] const columnOptions = columns .filter((column): column is NonNullable => column !== null) @@ -121,44 +151,14 @@ CREATE INDEX ON "${selectedSchema}"."${selectedEntity}" USING ${selectedIndexTyp .join(', ')}); `.trim() - const onSaveIndex = () => { - if (!project) return console.error('Project is required') - if (!selectedEntity) return console.error('Entity is required') - - createIndex({ - projectRef: project.ref, - connectionString: project.connectionString, - payload: { - schema: selectedSchema, - entity: selectedEntity, - type: selectedIndexType, - columns: selectedColumns, - }, - }) - } - + const { reset } = form useEffect(() => { if (visible) { - setSelectedSchema('public') - setSelectedEntity('') - setSelectedColumns([]) - setSelectedIndexType(INDEX_TYPES[0].value) + reset() setSchemaSearchTerm('') setSearchTerm('') } - }, [visible]) - - useEffect(() => { - setSelectedEntity('') - setSelectedColumns([]) - setSelectedIndexType(INDEX_TYPES[0].value) - setSearchTerm('') - }, [selectedSchema]) - - useEffect(() => { - setSelectedColumns([]) - setSelectedIndexType(INDEX_TYPES[0].value) - }, [selectedEntity]) + }, [visible, reset]) useEffect(() => { if (!schemaDropdownOpen) setSchemaSearchTerm('') @@ -166,272 +166,405 @@ CREATE INDEX ON "${selectedSchema}"."${selectedEntity}" USING ${selectedIndexTyp const isSelectEntityDisabled = entityTypes.length === 0 && searchTerm.trim().length === 0 + function onSubmit(values: z.infer) { + if (!project) return console.error('Project is required') + if (!selectedEntity) return console.error('Entity is required') + + createIndex({ + projectRef: project.ref, + connectionString: project.connectionString, + payload: { + schema: values.schema, + entity: values.table, + type: values.type, + columns: values.columns, + }, + }) + } + return ( - onSaveIndex()} - loading={isExecuting} - confirmText="Create index" - > -
- - - - - - - - - - 7 && 'max-h-[210px]! overflow-y-auto')} - onWheel={(event) => event.stopPropagation()} - > - No schemas found - - {(schemas ?? []).map((schema) => ( - { - handleSchemaSelect(schema.name) - }} - onClick={() => { - handleSchemaSelect(schema.name) - }} - > - {schema.name} - {selectedSchema === schema.name && ( - - )} - - ))} - - - - - - - - onClose()}> + + + Create new index + +
+ - - - - - - {/* [Terry] shouldFilter context: - https://github.com/pacocoursey/cmdk/issues/267#issuecomment-2252717107 */} - - - 7 && 'max-h-[210px]! overflow-y-auto')} - onWheel={(event) => event.stopPropagation()} + + ( + + + + + + + + + + 7 && 'max-h-[210px]! overflow-y-auto' + )} + onWheel={(event) => event.stopPropagation()} + > + No schemas found + + {(schemas ?? []).map((schema) => ( + { + field.onChange(schema.name) + form.setValue('table', '') + form.setValue('columns', []) + form.setValue('type', INDEX_TYPES[0].value) + setSearchTerm('') + }} + > + + {schema.name} + + ))} + + + + + + + + )} + /> + + + + + + ( + - - {isLoadingEntities ? ( -
- - Loading... + + + + + + + {/* [Terry] shouldFilter context: + https://github.com/pacocoursey/cmdk/issues/267#issuecomment-2252717107 */} + + + 7 && 'max-h-[210px]! overflow-y-auto' + )} + onWheel={(event) => event.stopPropagation()} + > + + {isLoadingEntities ? ( +
+ + Loading... +
+ ) : ( + 'No tables found' + )} +
+ + {entityTypes.map((entity) => ( + { + field.onChange(entity.name) + setTableDropdownOpen(false) + form.setValue('columns', []) + form.setValue('type', INDEX_TYPES[0].value) + }} + > + + {entity.name} + + ))} + +
+
+
+
+
+ + )} + /> + + + + + {selectedEntity && ( + + ( + + {isLoadingTableColumns && } + {isSuccessTableColumns && ( +
+ + + + + {columnOptions.map((option) => ( + + {option.name} + + ))} + + +
- ) : ( - 'No tables found' )} - - - {entityTypes.map((entity) => ( - { - setSelectedEntity(entity.name) - setTableDropdownOpen(false) - }} - onClick={() => { - setSelectedEntity(entity.name) - setTableDropdownOpen(false) - }} - > - {entity.name} - {selectedEntity === entity.name && ( - - )} - - ))} - - - - - -
- - {selectedEntity && ( - - {isLoadingTableColumns && } - {isSuccessTableColumns && ( - - - - - {columnOptions.map((option) => ( - - {option.name} - - ))} - - - - )} - - )} - - - {selectedColumns.length > 0 && ( - <> - - - - - - {isOrioleDb && ( - - {/* [Joshen Oriole] Hook up proper docs URL */} - - - )} - - - -
-

Preview of SQL statement

- -
-
-
-
- + )} /> -
-
- - )} -
- +
+ )} + + + + {selectedColumns.length > 0 && ( + <> + + ( + <> + + + + + + + {isOrioleDb && ( + + {/* [Joshen Oriole] Hook up proper docs URL */} + + + )} + + )} + /> + + + + +
+

Preview of SQL statement

+ +
+
+
+
+ +
+
+ + )} + + + + + + +
+ ) } diff --git a/apps/studio/components/interfaces/Database/Replication/DeleteDestination.tsx b/apps/studio/components/interfaces/Database/Replication/DeleteDestination.tsx index 2489f405355..0fddb5a6b18 100644 --- a/apps/studio/components/interfaces/Database/Replication/DeleteDestination.tsx +++ b/apps/studio/components/interfaces/Database/Replication/DeleteDestination.tsx @@ -24,7 +24,7 @@ export const DeleteDestination = ({ confirmLabel={isLoading ? 'Deleting...' : `Delete destination`} confirmPlaceholder="Type in name of destination" confirmString={name ?? 'Unknown'} - text={`This will delete the destination "${name}"`} + text={`This will delete the destination "${name}".`} alert={{ title: 'You cannot recover this destination once deleted.' }} onCancel={() => setVisible(!visible)} onConfirm={onDelete} diff --git a/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/AdvancedSettings.tsx b/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/AdvancedSettings.tsx index 3f909475df8..cba27702b7a 100644 --- a/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/AdvancedSettings.tsx +++ b/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/AdvancedSettings.tsx @@ -43,7 +43,7 @@ export const AdvancedSettings = ({
Advanced settings - Optional performance tuning + Optional settings to control the pipeline in more depth
@@ -165,7 +165,7 @@ export const AdvancedSettings = ({ + + + )} + /> + + ( + + + + + + )} + /> + + ( + + + + + + )} + /> + + ( + + + + + + )} + /> + + ( + + + + + + )} + /> +
+ +
+

Authentication

+

+ Use the RSA private key whose public key is registered on the Snowflake user. +

+
+ +
+ ( + + +