Merge branch 'master' into feat/ai-sql-editor

This commit is contained in:
Greg Richardson committed 2023-07-19 14:01:35 -06:00
commit 82d1055eb5
1175 files changed
+54746 -15140

No files matched your search

+4 -1
View File
@@ -125,9 +125,12 @@ apps/new-docs/*
# UI tokens
packages/ui/tokens/**/*.json
# UI Storybook build
packages/ui/storybook-static
# For self-hosted logs: https://github.com/supabase/supabase/blob/86e3ab20abfdb9c3e666334d3d2f8efeef9ccf2c/docker/docker-compose-logging.yml#L101
gcloud.json
# sitemaps
# apps/www/public/*.xml
# apps/docs/public/*.xml
# apps/docs/public/*.xml
+5 -5
View File
@@ -69,11 +69,11 @@ To contribute code to [Supabase](https://supabase.com), you must fork the [Supab
Then visit, and edit, any of the following sites:
| Site | Directory | Scope name | Description | Local development server |
| ---------------------------------------------- | ------------ | ---------- | ------------------------------------ | -------------------------- |
| [supabase.com](https://supabase.com) | `/apps/www` | www | The main website | http://localhost:3000 |
| [app.supabase.com](https://app.supabase.com) | `/studio` | studio | Studio dashboard | http://localhost:8082 |
| [supabase.com/docs](https://supabase.com/docs) | `/apps/docs` | docs | Guides and Reference (Next.js based) | http://localhost:3001/docs |
| Site | Directory | Scope name | Description | Local development server |
| -------------------------------------------------------- | ------------ | ---------- | ------------------------------------ | -------------------------- |
| [supabase.com](https://supabase.com) | `/apps/www` | www | The main website | http://localhost:3000 |
| [supabase.com/dashboard](https://supabase.com/dashboard) | `/studio` | studio | Studio dashboard | http://localhost:8082 |
| [supabase.com/docs](https://supabase.com/docs) | `/apps/docs` | docs | Guides and Reference (Next.js based) | http://localhost:3001/docs |
#### Running sites individually
+3 -3
View File
@@ -40,7 +40,7 @@ To see how to Contribute, visit [Getting Started](./DEVELOPERS.md)
## Status
- [x] Alpha: We are testing Supabase with a closed set of customers
- [x] Public Alpha: Anyone can sign up over at [app.supabase.com](https://app.supabase.com). But go easy on us, there are a few kinks
- [x] Public Alpha: Anyone can sign up over at [supabase.com/dashboard](https://supabase.com/dashboard). But go easy on us, there are a few kinks
- [x] Public Beta: Stable enough for most non-enterprise use-cases
- [ ] Public: General Availability [[status](https://supabase.com/docs/guides/getting-started/features#feature-status)]
@@ -56,7 +56,7 @@ Supabase is a combination of open source tools. We’re building the features of
**Architecture**
Supabase is a [hosted platform](https://app.supabase.com). You can sign up and start using Supabase without installing anything.
Supabase is a [hosted platform](https://supabase.com/dashboard). You can sign up and start using Supabase without installing anything.
You can also [self-host](https://supabase.com/docs/guides/hosting/overview) and [develop locally](https://supabase.com/docs/guides/local-development).
![Architecture](https://github.com/supabase/supabase/blob/master/apps/docs/public/img/supabase-architecture.png)
@@ -67,7 +67,7 @@ You can also [self-host](https://supabase.com/docs/guides/hosting/overview) and
- [pg_graphql](http://github.com/supabase/pg_graphql/) a PostgreSQL extension that exposes a GraphQL API
- [Storage](https://github.com/supabase/storage-api) provides a RESTful interface for managing Files stored in S3, using Postgres to manage permissions.
- [postgres-meta](https://github.com/supabase/postgres-meta) is a RESTful API for managing your Postgres, allowing you to fetch tables, add roles, and run queries, etc.
- [GoTrue](https://github.com/netlify/gotrue) is an SWT based API for managing users and issuing SWT tokens.
- [GoTrue](https://github.com/supabase/gotrue) is an JWT based API for managing users and issuing JWT tokens.
- [Kong](https://github.com/Kong/kong) is a cloud-native API gateway.
#### Client libraries
+19 -15
View File
@@ -3,14 +3,25 @@ import React, { useState } from 'react'
import { GlassPanel, IconLink, IconX, Input } from 'ui'
import extensions from '../data/extensions.json'
type extension = {
type Extension = {
name: string
comment: string
tags: string[]
link?: string
link: string
}
function getUniqueTags(json: extension[]) {
type LinkTarget = React.ComponentProps<'a'>['target']
function getLinkTarget(link: string): LinkTarget {
// Link is relative, open in the same tab
if (link.startsWith('/')) {
return '_self'
}
// Link is external, open in a new tab
return '_blank'
}
function getUniqueTags(json: Extension[]): string[] {
const tags = []
for (const item of json) {
if (item.tags) {
@@ -21,12 +32,12 @@ function getUniqueTags(json: extension[]) {
}
export default function Extensions() {
const [searchTerm, setSearchTerm] = useState('')
const [filters, setFilters] = useState([])
const [searchTerm, setSearchTerm] = useState<string>('')
const [filters, setFilters] = useState<string[]>([])
const tags = getUniqueTags(extensions)
function handleChecked(tag) {
function handleChecked(tag: string) {
if (filters.includes(tag)) {
setFilters(filters.filter((x) => x !== tag))
} else {
@@ -94,15 +105,8 @@ export default function Extensions() {
filters.length === 0 ? x : x.tags.some((item) => filters.includes(item))
)
.map((extension) => (
<Link
passHref
href={`${
extension.link
? `/guides/database/extensions/${extension.name}`
: '/guides/database/extensions#full-list-of-extensions'
}`}
>
<a target={`${extension.link ? '_blank' : '_self'}`} className="no-underline">
<Link passHref href={extension.link}>
<a target={getLinkTarget(extension.link)} className="no-underline">
<GlassPanel title={extension.name} background={false} key={extension.name}>
<p className="mt-4">
{extension.comment.charAt(0).toUpperCase() + extension.comment.slice(1)}
+8
View File
@@ -85,6 +85,14 @@ const Frameworks = () => {
},
href: '/guides/with-vue-3',
},
{
name: 'refine',
logo: {
light: '/docs/img/icons/refine-icon.svg',
dark: '/docs/img/icons/refine-icon.svg',
},
href: '/guides/getting-started/tutorials/with-refine',
},
]
return (
<div className="grid md:grid-cols-12 gap-4 not-prose">
+8 -3
View File
@@ -48,6 +48,11 @@ const HomePageCover = (props) => {
icon: '/docs/img/icons/nuxt-icon',
href: '/guides/getting-started/quickstarts/nuxtjs',
},
{
tooltip: 'refine',
icon: '/docs/img/icons/refine-icon',
href: '/guides/getting-started/quickstarts/refine',
},
]
const GettingStarted = () => (
@@ -72,7 +77,7 @@ const HomePageCover = (props) => {
Discover how to set up a database to an app making queries in just a few minutes.
</p>
</div>
<div className="flex flex-wrap md:grid md:grid-cols-4 2xl:grid-cols-7 gap-2 sm:gap-3">
<div className="flex flex-wrap md:grid md:grid-cols-4 2xl:grid-cols-8 gap-2 sm:gap-3">
{frameworks.map((framework, i) => (
<Link key={i} href={framework.href} passHref>
<a className="no-underline">
@@ -93,7 +98,7 @@ const HomePageCover = (props) => {
return (
<div className="w-full bg-scale-100 border-b prose dark:prose-dar max-w-none mb-16 md:mb-12 xl:mb-0">
<div className="max-w-7xl px-5 mx-auto py-8 sm:pb-16 sm:pt-12 xl:pt-16 flex flex-col xl:flex-row justify-between gap-12 xl:gap-12">
<div className="flex flex-col sm:flex-row gap-4 sm:gap-8 items-start sm:items-center w-full max-w-xl">
<div className="flex flex-col sm:flex-row gap-4 sm:gap-8 items-start sm:items-center w-full max-w-xl xl:max-w-[33rem]">
<DocsCoverLogo />
<div className="flex flex-col">
<h1 className="m-0 mb-3 text-2xl sm:text-3xl">{props.meta?.title}</h1>
@@ -103,7 +108,7 @@ const HomePageCover = (props) => {
</p>
</div>
</div>
<div className="w-full xl:max-w-[365px] 2xl:max-w-[608px] -mb-40">
<div className="w-full xl:max-w-[375px] 2xl:max-w-[620px] -mb-40">
<GettingStarted />
</div>
</div>
+3 -3
View File
@@ -12,7 +12,7 @@ Your database will be available in less than a minute.
**Finding your credentials:**
You can find your project credentials inside the project [settings](https://app.supabase.com/project/_/settings/), including:
You can find your project credentials inside the project [settings](https://supabase.com/dashboard/project/_/settings/), including:
- [Database credentials](https://app.supabase.com/project/_/settings/database): connection strings and connection pooler details.
- [API credentials](https://app.supabase.com/project/_/settings/database): your serverless API URL and `anon` / `service_role` keys.
- [Database credentials](https://supabase.com/dashboard/project/_/settings/database): connection strings and connection pooler details.
- [API credentials](https://supabase.com/dashboard/project/_/settings/database): your serverless API URL and `anon` / `service_role` keys.
+3 -3
View File
@@ -8,7 +8,7 @@ Before we start building we're going to set up our Database and API. This is as
### Create a project
1. [Create a new project](https://app.supabase.com) in the Supabase Dashboard.
1. [Create a new project](https://supabase.com/dashboard) in the Supabase Dashboard.
1. Enter your project details.
1. Wait for the new database to launch.
@@ -24,7 +24,7 @@ Now we are going to set up the database schema. We can use the "User Management
>
<TabPanel id="dashboard" label="Dashboard">
1. Go to the [SQL Editor](https://app.supabase.com/project/_/sql) page in the Dashboard.
1. Go to the [SQL Editor](https://supabase.com/dashboard/project/_/sql) page in the Dashboard.
2. Click **User Management Starter**.
3. Click **Run**.
@@ -41,5 +41,5 @@ Now we are going to set up the database schema. We can use the "User Management
Now that you've created some database tables, you are ready to insert data using the auto-generated API.
We just need to get the Project URL and `anon` key from the API settings.
1. Go to the [API Settings](https://app.supabase.com/project/_/settings/api) page in the Dashboard.
1. Go to the [API Settings](https://supabase.com/dashboard/project/_/settings/api) page in the Dashboard.
1. Find your Project `URL`, `anon`, and `service_role` keys on this page.
@@ -1,6 +1,6 @@
- Go to your [Supabase Project Dashboard](https://app.supabase.com)
- Go to your [Supabase Project Dashboard](https://supabase.com/dashboard)
- In the left sidebar, click the `Authentication` icon (near the top)
- Click on [`Providers`](https://app.supabase.com/project/_/auth/providers) under the Configuration section
- Click on [`Providers`](https://supabase.com/dashboard/project/_/auth/providers) under the Configuration section
- Click on **{props.provider}** from the accordion list to expand and turn **{props.provider} Enabled** to ON
- Enter your **{props.provider} Client ID** and **{props.provider} Client Secret** saved in the previous step
- Click `Save`
@@ -2,7 +2,7 @@ The next step requires a callback URL, which looks like this:
`https://<project-ref>.supabase.co/auth/v1/callback`
- Go to your [Supabase Project Dashboard](https://app.supabase.com)
- Go to your [Supabase Project Dashboard](https://supabase.com/dashboard)
- Click on the `Authentication` icon in the left sidebar
- Click on [`Providers`](https://app.supabase.com/project/_/auth/providers) under the Configuration section
- Click on [`Providers`](https://supabase.com/dashboard/project/_/auth/providers) under the Configuration section
- Click on **{props.provider}** from the accordion list to expand and you'll find your **Redirect URL**, you can click `Copy` to copy it to the clipboard
@@ -7,7 +7,7 @@ triggers. Note that it is not sufficient to delete the objects from the
`storage.objects` table because that would orphan and leak the actual storage objects in
the S3 backend. Instead, invoke the storage API within Postgres via the `http` extension.
Enable the [http extension for the `extensions` schema](https://app.supabase.com/project/_/database/extensions) in the Dashboard.
Enable the [http extension for the `extensions` schema](https://supabase.com/dashboard/project/_/database/extensions) in the Dashboard.
Then, define the following SQL functions in the SQL Editor to delete
storage objects via the API:
@@ -1,3 +1,5 @@
import { products } from 'shared-data'
type HomeMenuIcon = {
width?: number
height?: number
@@ -50,7 +52,7 @@ export function IconMenuAuth({ width = 16, height = 16 }: HomeMenuIcon) {
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M3.494 9.975h5m-5 0v2h5v-2m-5 0v-2h5v2M10 5V3a2 2 0 1 0-4 0v2m6.473 0v9h-9V5h9Z"
d={products.authentication.icon[16]}
stroke="currentColor"
strokeMiterlimit="10"
strokeLinejoin="bevel"
@@ -107,7 +109,7 @@ export function IconMenuDatabase({ width = 16, height = 16 }: HomeMenuIcon) {
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M3.502 6h8.996v4H3.502V6ZM3 10.002h10v4H3v-4ZM3 2h10v4H3V2Z"
d={products.database.icon[16]}
stroke="currentColor"
strokeMiterlimit="10"
strokeLinejoin="bevel"
@@ -145,7 +147,7 @@ export function IconMenuEdgeFunctions({ width = 16, height = 16 }: HomeMenuIcon)
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M1.857 11.36a7 7 0 0 1 9.41-9.551M4.774 14.212a7 7 0 0 0 9.41-9.497m-8.812 7.845a2 2 0 1 1-4 0 2 2 0 0 1 4 0Zm9.296-9.13a2 2 0 1 1-4 0 2 2 0 0 1 4 0ZM12.5 8a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Z"
d={products.functions.icon[16]}
stroke="currentColor"
strokeMiterlimit="10"
strokeLinejoin="bevel"
@@ -297,7 +299,7 @@ export function IconMenuRealtime({ width = 16, height = 16 }: HomeMenuIcon) {
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M5.362.984v2.35m-1.866.144L1.365 1.282m2.052 3.92H1.052m8.023 9.653L4.557 4.523 15 9.115l-4.748 1.182-1.177 4.558Z"
d={products.realtime.icon[16]}
stroke="currentColor"
strokeMiterlimit="10"
strokeLinejoin="bevel"
@@ -354,7 +356,7 @@ export function IconMenuStorage({ width = 16, height = 16 }: HomeMenuIcon) {
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M13 7.616V5.6l-3.618-3.6H3v4.03m9.964-.447L9.38 2v3.584h3.584ZM1.974 6v8h12V7.509h-7.59l-1.533-1.51H1.974Z"
d={products.storage.icon[16]}
stroke="currentColor"
strokeMiterlimit="10"
strokeLinejoin="bevel"
@@ -373,7 +375,7 @@ export function IconMenuAI({ width = 16, height = 16 }: HomeMenuIcon) {
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M7.99886 7.63216V14.4892M7.99886 7.63216L14.0488 4.11804M7.99886 7.63216L1.94922 4.11819M1.94922 4.11819V8.32332M1.94922 4.11819V4.08217L5.57319 1.97717M14.049 8.36007V4.08217L10.4251 1.97717M11.8165 12.4072L7.99913 14.6245L4.18177 12.4072"
d={products.vector.icon[16]}
stroke="currentColor"
strokeMiterlimit="10"
strokeLinecap="round"
@@ -218,6 +218,7 @@ export const gettingstarted: NavMenuConstant = {
{ name: 'SvelteKit', url: '/guides/getting-started/quickstarts/sveltekit' },
{ name: 'SolidJS', url: '/guides/getting-started/quickstarts/solidjs' },
{ name: 'Vue', url: '/guides/getting-started/quickstarts/vue' },
{ name: 'refine', url: '/guides/getting-started/quickstarts/refine' },
],
},
{
@@ -259,6 +260,10 @@ export const gettingstarted: NavMenuConstant = {
name: 'SvelteKit',
url: '/guides/getting-started/tutorials/with-sveltekit',
},
{
name: 'refine',
url: '/guides/getting-started/tutorials/with-refine',
},
],
},
{
@@ -349,6 +354,11 @@ export const SocialLoginItems = [
icon: '/docs/img/icons/discord-icon',
url: '/guides/auth/social-login/auth-discord',
},
{
name: 'Kakao',
icon: '/docs/img/icons/kakao-icon',
url: '/guides/auth/social-login/auth-kakao',
},
{
name: 'Keycloak',
icon: '/docs/img/icons/keycloak-icon',
@@ -750,6 +760,7 @@ export const functions: NavMenuConstant = {
name: 'Connecting directly to Postgres',
url: '/guides/functions/connect-to-postgres',
},
{ name: 'Testing your Edge Functions', url: '/guides/functions/unit-test' },
{ name: 'Troubleshooting', url: '/guides/functions/troubleshooting' },
],
},
@@ -803,10 +814,6 @@ export const realtime: NavMenuConstant = {
name: 'Concepts',
url: '/guides/realtime/concepts',
},
{
name: 'Quickstart',
url: '/guides/realtime/quickstart',
},
{
name: 'Features',
url: undefined,
@@ -903,7 +910,7 @@ export const ai: NavMenuConstant = {
{ name: 'Managing indexes', url: '/guides/ai/managing-indexes' },
{ name: 'Vector columns', url: '/guides/ai/vector-columns' },
{ name: 'Engineering for scale', url: '/guides/ai/engineering-for-scale' },
{ name: 'Choosing instance type', url: '/guides/ai/choosing-instance-type' },
{ name: 'Choosing Compute Add-on', url: '/guides/ai/choosing-compute-addon' },
],
},
{
@@ -1182,6 +1189,20 @@ export const integrations: NavMenuConstant = {
url: '/guides/integrations',
items: [
{ name: 'Overview', url: '/guides/integrations/integrations' },
{
name: 'OAuth Apps (Beta)',
url: undefined,
items: [
{
name: 'Publish an OAuth App',
url: '/guides/integrations/oauth-apps/publish-an-oauth-app',
},
{
name: 'Authorize an OAuth App',
url: '/guides/integrations/oauth-apps/authorize-an-oauth-app',
},
],
},
{
name: 'Auth',
url: undefined,
@@ -114,7 +114,13 @@ const RefFunctionSection: React.FC<IRefFunctionSection> = (props) => {
>
{item.examples &&
item.examples.map((example, exampleIndex) => {
const exampleString = ''
const exampleString =
'' +
(example.code &&
example.code
.trim()
.replace(/^```.*/, '')
.replace(/```$/, ''))
const codeBlockLang = example?.code?.startsWith('```js')
? 'js'
@@ -133,7 +139,6 @@ const RefFunctionSection: React.FC<IRefFunctionSection> = (props) => {
// // Create a single supabase client for interacting with your database
// const supabase = createClient('https://xyzcompany.supabase.co', 'public-anon-key')
// `
const currentExampleId = example.id
const staticExample = item.examples[exampleIndex]
const response = staticExample.response
@@ -152,15 +157,7 @@ const RefFunctionSection: React.FC<IRefFunctionSection> = (props) => {
language={codeBlockLang}
hideLineNumbers={true}
>
{exampleString +
(example.code &&
example.code
.replace(/```/g, '')
.replace('js', '')
.replace('ts', '')
.replace('dart', '')
.replace('c#', '')
.replace('kotlin', ''))}
{exampleString}
</CodeBlock>
{((tables && tables.length > 0) || sql) && (
+10
View File
@@ -79,6 +79,16 @@ const authProviders = [
selfHosted: true,
authType: 'social',
},
{
name: 'Kakao',
logo: '/docs/img/icons/kakao-icon',
href: '/guides/auth/social-login/auth-kakao',
official: true,
supporter: 'Supabase',
platform: true,
selfHosted: true,
authType: 'social',
},
{
name: 'Keycloak',
logo: '/docs/img/icons/keycloak-icon',
+137 -183
View File
@@ -3,460 +3,414 @@
"name": "address_standardizer",
"comment": "Used to parse an address into constituent elements. Generally used to support geocoding address normalization step.",
"tags": ["Utility"],
"link": "http://supabase.com/docs/guides/extensions/etc/etc/etc"
},
{
"name": "address_standardizer-3",
"comment": "Used to parse an address into constituent elements. Generally used to support geocoding address normalization step.",
"tags": ["Utility"]
"link": "https://postgis.net/docs/manual-2.5/Address_Standardizer.html"
},
{
"name": "address_standardizer_data_us",
"comment": "Address Standardizer US dataset example",
"tags": ["Dataset"]
},
{
"name": "address_standardizer_data_us-3",
"comment": "Address Standardizer US dataset example",
"tags": ["Dataset"]
},
{
"name": "adminpack",
"comment": "administrative functions for PostgreSQL",
"tags": ["Admin", "Utility"]
"tags": ["Dataset"],
"link": "https://postgis.net/docs/manual-2.5/Address_Standardizer.html"
},
{
"name": "amcheck",
"comment": "functions for verifying relation integrity",
"tags": ["Admin", "Utility"]
"tags": ["Admin", "Utility"],
"link": "https://www.postgresql.org/docs/current/amcheck.html"
},
{
"name": "autoinc",
"comment": "functions for autoincrementing fields",
"tags": ["Utility"]
"tags": ["Utility"],
"link": "https://www.postgresql.org/docs/current/contrib-spi.html#id-1.11.7.50.6"
},
{
"name": "bloom",
"comment": "bloom access method - signature file based index",
"tags": ["Index"]
"tags": ["Index"],
"link": "https://www.postgresql.org/docs/current/bloom.html"
},
{
"name": "btree_gin",
"comment": "support for indexing common datatypes in GIN",
"tags": ["Index"]
"tags": ["Index"],
"link": "https://www.postgresql.org/docs/current/btree-gin.html"
},
{
"name": "btree_gist",
"comment": "support for indexing common datatypes in GiST",
"tags": ["Index"]
"tags": ["Index"],
"link": "https://www.postgresql.org/docs/current/btree-gist.html"
},
{
"name": "citext",
"comment": "data type for case-insensitive character strings",
"tags": ["Data Type"]
"tags": ["Data Type"],
"link": "https://www.postgresql.org/docs/current/citext.html"
},
{
"name": "cube",
"comment": "data type for multidimensional cubes",
"tags": ["Data Type"]
"tags": ["Data Type"],
"link": "https://www.postgresql.org/docs/current/cube.html"
},
{
"name": "dblink",
"comment": "connect to other PostgreSQL databases from within a database",
"tags": ["Admin", "Utility"]
"tags": ["Admin", "Utility"],
"link": "https://www.postgresql.org/docs/current/contrib-dblink-function.html"
},
{
"name": "dict_int",
"comment": "text search dictionary template for integers",
"tags": ["Search"]
"tags": ["Search"],
"link": "https://www.postgresql.org/docs/current/dict-int.html"
},
{
"name": "dict_xsyn",
"comment": "text search dictionary template for extended synonym processing",
"tags": ["Search"]
"tags": ["Search"],
"link": "https://www.postgresql.org/docs/current/dict-xsyn.html"
},
{
"name": "earthdistance",
"comment": "calculate great-circle distances on the surface of the Earth",
"tags": ["Geo", "Utility"]
},
{
"name": "file_fdw",
"comment": "foreign-data wrapper for flat file access",
"tags": ["Admin", "Utility"]
"tags": ["Geo", "Utility"],
"link": "https://www.postgresql.org/docs/current/earthdistance.html"
},
{
"name": "fuzzystrmatch",
"comment": "determine similarities and distance between strings",
"tags": ["Search"]
"tags": ["Search"],
"link": "https://www.postgresql.org/docs/current/fuzzystrmatch.html"
},
{
"name": "hstore",
"comment": "data type for storing sets of (key, value) pairs",
"tags": ["Data Type"]
"tags": ["Data Type"],
"link": "https://www.postgresql.org/docs/current/hstore.html"
},
{
"name": "hypopg",
"comment": "Hypothetical indexes for PostgreSQL",
"link": "https://supabase.com/docs/guides/database/extensions/hypopg",
"tags": ["Admin", "Index"]
"tags": ["Admin", "Index"],
"link": "/guides/database/extensions/hypopg"
},
{
"name": "http",
"comment": "HTTP client for PostgreSQL, allows web page retrieval inside the database.",
"link": "https://supabase.com/docs/guides/database/extensions/http",
"tags": ["Utility"]
"tags": ["Utility"],
"link": "/guides/database/extensions/http"
},
{
"name": "insert_username",
"comment": "functions for tracking who changed a table",
"tags": ["Audit", "Utility"]
"tags": ["Audit", "Utility"],
"link": "https://www.postgresql.org/docs/current/contrib-spi.html#id-1.11.7.50.7"
},
{
"name": "old_snapshot",
"comment": "utilities in support of old_snapshot_threshold",
"tags": ["Admin", "Utility"]
},
{
"name": "intagg",
"comment": "integer aggregator and enumerator (obsolete)",
"tags": ["Utility"]
"tags": ["Admin", "Utility"],
"link": "https://www.postgresql.org/docs/current/oldsnapshot.html"
},
{
"name": "intarray",
"comment": "functions, operators, and index support for 1-D arrays of integers",
"tags": ["Utility"]
"tags": ["Utility"],
"link": "https://www.postgresql.org/docs/current/intarray.html"
},
{
"name": "isn",
"comment": "data types for international product numbering standards",
"tags": ["Data Type"]
"tags": ["Data Type"],
"link": "https://www.postgresql.org/docs/current/isn.html"
},
{
"name": "lo",
"comment": "Large Object maintenance",
"tags": ["Data Type"]
"tags": ["Data Type"],
"link": "https://www.postgresql.org/docs/current/lo.html"
},
{
"name": "ltree",
"comment": "data type for hierarchical tree-like structures",
"tags": ["Data Type"]
"tags": ["Data Type"],
"link": "https://www.postgresql.org/docs/current/ltree.html"
},
{
"name": "moddatetime",
"comment": "functions for tracking last modification time",
"tags": ["Audit", "Utility"]
},
{
"name": "pageinspect",
"comment": "inspect the contents of database pages at a low level",
"tags": ["Admin", "Utility"]
},
{
"name": "pg_buffercache",
"comment": "examine the shared buffer cache",
"tags": ["Admin", "Utility"]
"tags": ["Audit", "Utility"],
"link": "https://www.postgresql.org/docs/current/contrib-spi.html#id-1.11.7.50.8"
},
{
"name": "pg_cron",
"comment": "Job scheduler for PostgreSQL",
"link": "https://supabase.com/docs/guides/database/extensions/pgcron",
"tags": ["Utility"]
"tags": ["Utility"],
"link": "/guides/database/extensions/pg_cron"
},
{
"name": "pg_freespacemap",
"comment": "examine the free space map (FSM)",
"tags": ["Admin", "Utility"]
"tags": ["Admin", "Utility"],
"link": "https://www.postgresql.org/docs/current/pgfreespacemap.html"
},
{
"name": "pg_graphql",
"comment": "pg_graphql: GraphQL support",
"link": "https://supabase.com/docs/guides/database/extensions/pg_graphql",
"tags": ["Utility"]
"tags": ["Utility"],
"link": "/guides/database/extensions/pg_graphql"
},
{
"name": "pg_hashids",
"comment": "pg_hashids",
"link": "https://supabase.com/docs/guides/database/extensions/pg_hashids",
"tags": ["Utility"]
"tags": ["Utility"],
"link": "/guides/database/extensions/pg_hashids"
},
{
"name": "pg_jsonschema",
"comment": "pg_jsonschema",
"link": "https://supabase.com/docs/guides/database/extensions/pg_jsonschema",
"tags": ["Utility"]
"tags": ["Utility"],
"link": "/guides/database/extensions/pg_jsonschema"
},
{
"name": "pg_net",
"comment": "Async HTTP",
"link": "https://supabase.com/docs/guides/database/extensions/pgnet",
"tags": ["Utility", "Notifications"]
"tags": ["Utility", "Notifications"],
"link": "/guides/database/extensions/pg_net"
},
{
"name": "pg_prewarm",
"comment": "prewarm relation data",
"tags": ["Admin", "Utility"]
"tags": ["Admin", "Utility"],
"link": "https://www.postgresql.org/docs/current/pgprewarm.html"
},
{
"name": "pg_stat_monitor",
"comment": "The pg_stat_monitor is a PostgreSQL Query Performance Monitoring tool, based on PostgreSQL contrib module pg_stat_statements. pg_stat_monitor provides aggregated statistics, client information, plan details including plan, and histogram information.",
"link": "https://supabase.com/docs/guides/database/extensions/pg_stat_monitor",
"tags": ["Utility"]
"tags": ["Utility"],
"link": "/guides/database/extensions/pg_stat_monitor"
},
{
"name": "pg_stat_statements",
"comment": "track execution statistics of all SQL statements executed",
"link": "https://supabase.com/docs/guides/database/extensions/pg_stat_statements",
"tags": ["Admin", "Utility"]
"tags": ["Admin", "Utility"],
"link": "/guides/database/extensions/pg_stat_statements"
},
{
"name": "pg_surgery",
"comment": "extension to perform surgery on a damaged relation",
"tags": ["Admin", "Utility"]
"tags": ["Admin", "Utility"],
"link": "https://www.postgresql.org/docs/current/pgsurgery.html"
},
{
"name": "pg_trgm",
"comment": "text similarity measurement and index searching based on trigrams",
"tags": ["Search"]
},
{
"name": "pg_visibility",
"comment": "examine the visibility map (VM) and page-level visibility info",
"tags": ["Admin", "Utility"]
"tags": ["Search"],
"link": "https://www.postgresql.org/docs/current/pgtrgm.html"
},
{
"name": "pgaudit",
"comment": "provides auditing functionality",
"link": "https://supabase.com/docs/guides/database/extensions/pgaudit",
"tags": ["Audit", "Utility"]
"tags": ["Audit", "Utility"],
"link": "/guides/database/extensions/pgaudit"
},
{
"name": "pg_walinspect",
"comment": "functions to inspect contents of PostgreSQL Write-Ahead Log",
"tags": ["Admin", "Utility"]
"tags": ["Admin", "Utility"],
"link": "https://www.postgresql.org/docs/current/pgwalinspect.html"
},
{
"name": "pgcrypto",
"comment": "cryptographic functions",
"tags": ["Utility", "Cryptography"]
"tags": ["Utility", "Cryptography"],
"link": "https://www.postgresql.org/docs/current/pgcrypto.html"
},
{
"name": "pgjwt",
"comment": "JSON Web Token API for Postgresql",
"link": "https://supabase.com/docs/guides/database/extensions/pgjwt",
"tags": ["Utility", "Cryptography"]
"tags": ["Utility", "Cryptography"],
"link": "/guides/database/extensions/pgjwt"
},
{
"name": "pgroonga",
"comment": "Super fast and all languages supported full text search index based on Groonga",
"link": "https://supabase.com/docs/guides/database/extensions/pgroonga",
"tags": ["Search"]
"tags": ["Search"],
"link": "/guides/database/extensions/pgroonga"
},
{
"name": "pgroonga_database",
"comment": "PGroonga database management module",
"tags": ["Admin"]
"tags": ["Admin"],
"link": "https://pgroonga.github.io/reference/modules/pgroonga-database.html"
},
{
"name": "pgrouting",
"comment": "pgRouting Extension",
"link": "https://supabase.com/docs/guides/database/extensions/pgrouting",
"tags": ["Geo", "Utility"]
"tags": ["Geo", "Utility"],
"link": "/guides/database/extensions/pgrouting"
},
{
"name": "pgrowlocks",
"comment": "show row-level locking information",
"tags": ["Admin", "Utility"]
"tags": ["Admin", "Utility"],
"link": "https://www.postgresql.org/docs/current/pgrowlocks.html"
},
{
"name": "pgsodium",
"comment": "Postgres extension for libsodium functions",
"link": "https://supabase.com/docs/guides/database/extensions/pgsodium",
"tags": ["Utility", "Cryptography"]
"tags": ["Utility", "Cryptography"],
"link": "/guides/database/extensions/pgsodium"
},
{
"name": "pgstattuple",
"comment": "show tuple-level statistics",
"tags": ["Admin", "Utility"]
"tags": ["Admin", "Utility"],
"link": "https://www.postgresql.org/docs/current/pgstattuple.html"
},
{
"name": "pgtap",
"comment": "Unit testing for PostgreSQL",
"link": "https://supabase.com/docs/guides/database/extensions/pgtap",
"tags": ["Utility", "Testing"]
"tags": ["Utility", "Testing"],
"link": "/guides/database/extensions/pgtap"
},
{
"name": "plcoffee",
"comment": "PL/CoffeeScript (v8) trusted procedural language",
"tags": ["Language"]
"tags": ["Language"],
"link": "https://github.com/plv8/plv8/blob/master/doc/plv8.md#coffeescript-extension"
},
{
"name": "pljava",
"comment": "PL/Java procedural language (https://tada.github.io/pljava/)",
"tags": ["Language"]
"tags": ["Language"],
"link": "https://tada.github.io/pljava/"
},
{
"name": "plls",
"comment": "PL/LiveScript (v8) trusted procedural language",
"tags": ["Language"]
"tags": ["Language"],
"link": "https://github.com/plv8/plv8/blob/master/doc/plv8.md#livescript-extension"
},
{
"name": "plpgsql",
"comment": "PL/pgSQL procedural language",
"tags": ["Language"]
"tags": ["Language"],
"link": "https://www.postgresql.org/docs/current/plpgsql.html"
},
{
"name": "plpgsql_check",
"comment": "extended check for plpgsql functions",
"href": "https://supabase.com/docs/guides/database/extensions/plpgsql_check",
"tags": ["Utility", "Testing"]
"tags": ["Utility", "Testing"],
"link": "/guides/database/extensions/plpgsql_check"
},
{
"name": "plv8",
"comment": "PL/JavaScript (v8) trusted procedural language",
"link": "http://localhost:3001/docs/guides/database/extensions/plv8",
"tags": ["Language"]
"tags": ["Language"],
"link": "/guides/database/extensions/plv8"
},
{
"name": "postgis",
"comment": "PostGIS geometry and geography spatial types and functions",
"link": "https://supabase.com/docs/guides/database/extensions/postgis",
"tags": ["Geo"]
},
{
"name": "postgis-3",
"comment": "PostGIS geometry and geography spatial types and functions",
"tags": ["Geo"]
},
{
"name": "postgis_raster",
"comment": "PostGIS raster types and functions",
"tags": ["Geo"]
},
{
"name": "postgis_raster-3",
"comment": "PostGIS raster types and functions",
"tags": ["Geo"]
},
{
"name": "postgis_sfcgal",
"comment": "PostGIS SFCGAL functions",
"tags": ["Geo"]
},
{
"name": "postgis_sfcgal-3",
"comment": "PostGIS SFCGAL functions",
"tags": ["Geo"]
},
{
"name": "postgis_tiger_geocoder",
"comment": "PostGIS tiger geocoder and reverse geocoder",
"tags": ["Geo"]
},
{
"name": "postgis_tiger_geocoder-3",
"comment": "PostGIS tiger geocoder and reverse geocoder",
"tags": ["Geo"]
},
{
"name": "postgis_topology",
"comment": "PostGIS topology spatial types and functions",
"tags": ["Geo"]
},
{
"name": "postgis_topology-3",
"comment": "PostGIS topology spatial types and functions",
"tags": ["Geo"]
"tags": ["Geo"],
"link": "/guides/database/extensions/postgis"
},
{
"name": "postgres_fdw",
"comment": "foreign-data wrapper for remote PostgreSQL servers",
"tags": ["Admin"]
"tags": ["Admin"],
"link": "https://www.postgresql.org/docs/current/postgres-fdw.html"
},
{
"name": "refint",
"comment": "functions for implementing referential integrity (obsolete)",
"tags": ["Utility"]
"tags": ["Utility"],
"link": "https://www.postgresql.org/docs/current/contrib-spi.html#id-1.11.7.50.5"
},
{
"name": "rum",
"comment": "GIN-like index for text search",
"link": "https://supabase.com/docs/guides/database/extensions/rum",
"tags": ["Index", "Search"]
"tags": ["Index", "Search"],
"link": "/guides/database/extensions/rum"
},
{
"name": "seg",
"comment": "data type for representing line segments or floating-point intervals",
"tags": ["Utility"]
"tags": ["Utility"],
"link": "https://www.postgresql.org/docs/current/seg.html"
},
{
"name": "sslinfo",
"comment": "information about SSL certificates",
"tags": ["Admin", "Utility"]
"tags": ["Admin", "Utility"],
"link": "https://www.postgresql.org/docs/current/sslinfo.html"
},
{
"name": "supautils",
"comment": "Supabase standard library",
"tags": ["Utility"]
"tags": ["Utility"],
"link": "https://supabase.github.io/supautils/"
},
{
"name": "tablefunc",
"comment": "functions that manipulate whole tables, including crosstab",
"tags": ["Utility"]
"tags": ["Utility"],
"link": "https://www.postgresql.org/docs/current/tablefunc.html"
},
{
"name": "tcn",
"comment": "Triggered change notifications",
"tags": ["Utility", "Notifications"]
"tags": ["Utility", "Notifications"],
"link": "https://www.postgresql.org/docs/current/tcn.html"
},
{
"name": "timescaledb",
"comment": "Enables scalable inserts and complex queries for time-series data",
"link": "https://supabase.com/docs/guides/database/extensions/timescaledb",
"tags": ["Time Series", "Data Type", "Utility"]
"tags": ["Time Series", "Data Type", "Utility"],
"link": "/guides/database/extensions/timescaledb"
},
{
"name": "tsm_system_rows",
"comment": "TABLESAMPLE method which accepts number of rows as a limit",
"tags": ["Utility"]
"tags": ["Utility"],
"link": "https://www.postgresql.org/docs/current/tsm-system-rows.html"
},
{
"name": "tsm_system_time",
"comment": "TABLESAMPLE method which accepts time in milliseconds as a limit",
"tags": ["Utility"]
"tags": ["Utility"],
"link": "https://www.postgresql.org/docs/current/tsm-system-time.html"
},
{
"name": "unaccent",
"comment": "text search dictionary that removes accents",
"tags": ["Search"]
"tags": ["Search"],
"link": "https://www.postgresql.org/docs/current/unaccent.html"
},
{
"name": "uuid-ossp",
"comment": "generate universally unique identifiers (UUIDs)",
"link": "https://supabase.com/docs/guides/database/extensions/uuid-ossp",
"tags": ["Utility", "Data Type"]
"tags": ["Utility", "Data Type"],
"link": "/guides/database/extensions/uuid-ossp"
},
{
"name": "pgvector",
"comment": "vector data type with similarity search",
"link": "https://supabase.com/docs/guides/database/extensions/pgvector",
"tags": ["AI", "Data Type", "Search"]
"tags": ["AI", "Data Type", "Search"],
"link": "/guides/database/extensions/pgvector"
},
{
"name": "pg_repack",
"comment": "Optimize physical storage and remove bloat from tables and indexes",
"link": "https://supabase.com/docs/guides/database/extensions/pgrepack",
"tags": ["Admin", "Utility"]
"tags": ["Admin", "Utility"],
"link": "/guides/database/extensions/pg_repack"
},
{
"name": "wrappers",
"comment": "Foreign data wrappers developed by Supabase",
"link": "https://supabase.com/docs/guides/database/extensions/wrappers",
"tags": ["Admin", "Utility"]
},
{
"name": "xml2",
"comment": "XPath querying and XSLT",
"tags": ["Utility"]
"tags": ["Admin", "Utility"],
"link": "/guides/database/extensions/wrappers"
}
]
+1 -1
View File
@@ -15,7 +15,7 @@ The Management API is in `beta`. It is usable in it's current state, but it's li
## Authentication
All API requests require a Supabase Personal token to be included in the Authorization header: `Authorization Bearer <supabase_personal_token`.
To generate or manage your API token, visit your [account](https://app.supabase.com/account/tokens) page.
To generate or manage your API token, visit your [account](https://supabase.com/dashboard/account/tokens) page.
Your API tokens carry the same privileges as your user account, so be sure to keep it secret.
```bash
+1 -1
View File
@@ -23,7 +23,7 @@ hideTitle: true
## Authentication
All API requests require a Supabase Personal token to be included in the Authorization header: `Authorization Bearer <supabase_personal_token`.
To generate or manage your API token, visit your [account](https://app.supabase.com/account/tokens) page.
To generate or manage your API token, visit your [account](https://supabase.com/dashboard/account/tokens) page.
Your API tokens carry the same privileges as your user account, so be sure to keep it secret.
```bash
+134 -14
View File
@@ -181,12 +181,18 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supab
</RefSubLayout.EducationRow>
### Add KotlinX Serialization (required for PostgREST and Realtime serialization)
### Serialization
supabase-kt provides several different ways to encode and decode your custom objects.
By default, [KotlinX Serialization](https://github.com/Kotlin/kotlinx.serialization) is used.
<RefSubLayout.EducationRow>
<RefSubLayout.Examples>
<RefSubLayout.Details>
Add the serialization plugin
Use [KotlinX Serialization](https://github.com/Kotlin/kotlinx.serialization).
</RefSubLayout.Details>
<RefSubLayout.Examples>
<Tabs
size="small"
@@ -247,20 +253,134 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supab
</TabPanel>
</Tabs>
Now you can create serializable classes in your project:
```kotlin
@Serializable
data class Message(
val id: Int,
val content: String,
@SerialName("author_id")
val authorId: String
)
val client = createSupabaseClient(supabaseUrl, supabaseKey) {
//Already the default serializer
}
```
And use them in your Supabase queries:
</RefSubLayout.Examples>
</RefSubLayout.EducationRow>
<RefSubLayout.EducationRow>
<RefSubLayout.Details>
Use [Moshi](https://github.com/square/moshi).
</RefSubLayout.Details>
<RefSubLayout.Examples>
<Tabs
size="small"
type="underlined"
defaultActiveId="kotlin">
<TabPanel id="kotlin" label="build.gradle.kts">
```kotlin
implementation("io.github.jan-tennert.supabase:serializer-moshi:VERSION")
```
</TabPanel>
<TabPanel id="groovy" label="build.gradle">
```groovy
implementation 'io.github.jan-tennert.supabase:serializer-moshi:VERSION'
```
</TabPanel>
<TabPanel id="xml" label="pom.xml">
```xml
<dependency>
<groupId>io.github.jan-tennert.supabase</groupId>
<artifactId>serializer-moshi</artifactId>
<version>VERSION</version>
</dependency>
```
</TabPanel>
</Tabs>
```kotlin
val messages = client.postgrest["messages"].select().decodeList<Message>()
val client = createSupabaseClient(supabaseUrl, supabaseKey) {
defaultSerializer = MoshiSerializer()
}
```
</RefSubLayout.Examples>
</RefSubLayout.EducationRow>
<RefSubLayout.EducationRow>
<RefSubLayout.Details>
Use [Jackson](https://github.com/FasterXML/jackson-module-kotlin).
</RefSubLayout.Details>
<RefSubLayout.Examples>
<Tabs
size="small"
type="underlined"
defaultActiveId="kotlin">
<TabPanel id="kotlin" label="build.gradle.kts">
```kotlin
implementation("io.github.jan-tennert.supabase:serializer-jackson:VERSION")
```
</TabPanel>
<TabPanel id="groovy" label="build.gradle">
```groovy
implementation 'io.github.jan-tennert.supabase:serializer-jackson:VERSION'
```
</TabPanel>
<TabPanel id="xml" label="pom.xml">
```xml
<dependency>
<groupId>io.github.jan-tennert.supabase</groupId>
<artifactId>serializer-jackson</artifactId>
<version>VERSION</version>
</dependency>
```
</TabPanel>
</Tabs>
```kotlin
val client = createSupabaseClient(supabaseUrl, supabaseKey) {
defaultSerializer = JacksonSerializer()
}
```
</RefSubLayout.Examples>
</RefSubLayout.EducationRow>
<RefSubLayout.EducationRow>
<RefSubLayout.Details>
Use custom serializer.
</RefSubLayout.Details>
<RefSubLayout.Examples>
```kotlin
class CustomSerializer: SupabaseSerializer {
override fun <T : Any> encode(type: KType, value: T): String {
//encode value to string
}
override fun <T : Any> decode(type: KType, value: String): T {
//decode value
}
}
```
```kotlin
val client = createSupabaseClient(supabaseUrl, supabaseKey) {
defaultSerializer = CustomSerializer()
}
```
</RefSubLayout.Examples>
+18 -5
View File
@@ -18,15 +18,28 @@ This reference documents every object and method available in Supabase's Kotlin
Supported Kotlin targets:
- JVM
- Android
- iOS (Experimental)
- JS (Browser)
| **Module** | **GoTrue** | **Realtime** | **Postgrest** | **Storage** | **Functions** | **Apollo-GraphQL** |
| -------------------------------------- | ---------- | ------------ | ------------- | ----------- | ------------- | ------------------ |
| **JVM** | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| **Android** | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| **JS** _(Browser)_ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| **IOS** | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| **MacOS** _(macosX64 & macosArm64)_ 🚧 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| **Windows** _(mingwX64)_ 🚧 | ☑️ | ✅ | ✅ | ✅ | ✅ | ❌ |
| **Linux** _(linuxX64)_ 🚧 | ☑️ | ✅ | ✅ | ✅ | ✅ | ❌ |
✅ = full support
☑️ = partial support: no built-in OAuth/OTP link handling. Linux also has no persistent storage.
🚧 = experimental/needs feedback
❌ = not supported
</div>
<div className="max-w-xl bg-slate-300 px-4 py-2 rounded-md">
<p>The Kotlin client library is created and maintained by the Supabase community, and is not an official library. Please be tolerant of areas where the library is still being developed, and — as with all the libraries — feel free to contribute wherever you find issues.</p>
<p>The Kotlin client library is created and maintained by the Supabase community, and is not an official library. Please be tolerant of areas where the library is still being developed, and — as with all the libraries — feel free to contribute wherever you find issues.</p>
<p>Huge thanks to official maintainer, [jan-tennert](https://github.com/jan-tennert).</p>
@@ -122,6 +122,10 @@ Download your Google Cloud API JWT and store it under gcloud.json in your workin
required.
</Admonition>
### Storage Location
Currently, all BigQuery datasets stored and managed by Analytics, whether via CLI or self-hosted, will default to the US region.
## Production Recommendations
To self-host in a production setting, we recommend performing the following for a better experience.
+1 -1
View File
@@ -15,7 +15,7 @@ The Management API is in `beta`. It is usable in it's current state, but it's li
## Authentication
All API requests require a Supabase Personal token to be included in the Authorization header: `Authorization Bearer <supabase_personal_token`.
To generate or manage your API token, visit your [account](https://app.supabase.com/account/tokens) page.
To generate or manage your API token, visit your [account](https://supabase.com/dashboard/account/tokens) page.
Your API tokens carry the same privileges as your user account, so be sure to keep it secret.
```bash
+1 -1
View File
@@ -96,7 +96,7 @@ const levelsData = {
},
reference_swift_v0: {
icon: '/docs/img/icons/menu/reference-swift',
name: 'Swift Reference v1.0',
name: 'Swift Reference v0.0',
},
reference_kotlin_v0: {
icon: '/docs/img/icons/menu/reference-kotlin',
+3 -2
View File
@@ -1,9 +1,10 @@
import fs from 'fs'
import { CodeHikeConfig, remarkCodeHike } from '@code-hike/mdx'
import codeHikeTheme from 'config/code-hike.theme.json' assert { type: 'json' }
import matter from 'gray-matter'
import { serialize } from 'next-mdx-remote/serialize'
import codeHikeTheme from 'config/code-hike.theme.json' assert { type: 'json' }
import remarkGfm from 'remark-gfm'
import { ICommonMarkdown } from '~/components/reference/Reference.types'
async function generateRefMarkdown(sections: ICommonMarkdown[], slug: string) {
@@ -52,7 +53,7 @@ async function generateRefMarkdown(sections: ICommonMarkdown[], slug: string) {
// https://mdxjs.com/packages/mdx/#compilefile-options
mdxOptions: {
useDynamicImport: true,
remarkPlugins: [[remarkCodeHike, codeHikeOptions]],
remarkPlugins: [remarkGfm, [remarkCodeHike, codeHikeOptions]],
},
// Indicates whether or not to parse the frontmatter from the mdx source
})
@@ -0,0 +1,167 @@
import Layout from '~/layouts/DefaultGuideLayout'
import { Tabs } from 'ui'
export const TabPanel = Tabs.Panel
export const meta = {
id: 'ai-choosing-compute-addon',
title: 'Choosing Compute Add-on',
description: 'Choosing the right Compute Add-on for your workload.',
subtitle: 'Choosing the right Compute Add-on for your workload.',
sidebar_label: 'Choosing Compute Add-on',
}
This guide will help you choose the right Compute Add-on for your workload. We'll provide general guidance, as it is impossible to provide specific instructions for every possible use case. The goal is to give you a starting point from which you can make your own benchmarks and optimizations.
Note that it is only useful for index searches, not for sequential scans. Sequential scans will result to significantly higher latencies and lower throughput, but will guarantee 100% precision and will not be RAM bound. Therefore it is possible to use a smaller plan for sequential scans.
For more information about engineering at scale, see our [Engineering for Scale](/docs/guides/ai/engineering-for-scale) guide.
## Simple workloads
We've run a set of benchmarks using
- The [dbpedia-entities-openai-1M](https://huggingface.co/datasets/KShivendu/dbpedia-entities-openai-1M) dataset. This dataset contains 1,000,000 embeddings for text, with each embedding being 1536 dimensions made using OpenAI API.
- The [gist-960-angular](http://corpus-texmex.irisa.fr/) dataset. This dataset contains 1,000,000 embeddings for images, with each embedding being 960 dimensions.
- The [GloVe Reddit comments](https://nlp.stanford.edu/projects/glove/) dataset, which contains 1,623,397 embeddings for words, with each embedding being 512 dimensions.
We used [Vecs](https://github.com/supabase/vecs) to create a collection, upload the embeddings to a single table, and create an `inner-product` index for the embedding column. We then ran a series of queries to measure the performance of different compute add-ons:
### Results
<Tabs
scrollable
size="small"
type="underlined"
defaultActiveId="dbpedia1536"
>
<TabPanel id="dbpedia1536" label="OpenAI-1536, probes = 10">
Emdeddings of 1536 dimensions by OpenAI for dbpedia dataset with 1,000,000 vectors.
| Plan | Vectors | Lists | RPS | Latency Mean | Latency p95 | RAM Usage | RAM |
| ------ | --------- | ----- | ---- | ------------ | ----------- | ------------------ | ------ |
| Free | 20,000 | 40 | 135 | 0.372 sec | 0.412 sec | 1 GB + 200 Mb Swap | 1 GB |
| Small | 50,000 | 100 | 140 | 0.357 sec | 0.398 sec | 1.8 GB | 2 GB |
| Medium | 100,000 | 200 | 130 | 0.383 sec | 0.446 sec | 3.7 GB | 4 GB |
| Large | 250,000 | 500 | 130 | 0.378 sec | 0.434 sec | 7 GB | 8 GB |
| XL | 500,000 | 1000 | 235 | 0.213 sec | 0.271 sec | 13.5 GB | 16 GB |
| 2XL | 1,000,000 | 2000 | 380 | 0.133 sec | 0.236 sec | 30 GB | 32 GB |
| 4XL | 1,000,000 | 2000 | 720 | 0.068 sec | 0.120 sec | 35 GB | 64 GB |
| 8XL | 1,000,000 | 2000 | 1250 | 0.039 sec | 0.066 sec | 38 GB | 128 GB |
| 12XL | 1,000,000 | 2000 | 1600 | 0.030 sec | 0.052 sec | 41 GB | 192 GB |
| 16XL | 1,000,000 | 2000 | 1790 | 0.029 sec | 0.051 sec | 45 GB | 256 GB |
For 1,000,000 vectors 10 probes results to precision of 0.91. And for 500,000 vectors and below 10 probes results to precision in the range of 0.95 - 0.99. To increase precision, you need to increase the number of probes.
</TabPanel>
<TabPanel id="dbpedia1536_40" label="OpenAI-1536, probes = 40">
Emdeddings of 1536 dimensions by OpenAI for dbpedia dataset with 1,000,000 vectors.
| Plan | Vectors | Lists | RPS | Latency Mean | Latency p95 | RAM Usage | RAM |
| ------ | --------- | ----- | --- | ------------ | ----------- | --------- | ------ |
| Free | 20,000 | 40 | - | - | - | - | 1 GB |
| Small | 50,000 | 100 | - | - | - | - | 2 GB |
| Medium | 100,000 | 200 | - | - | - | - | 4 GB |
| Large | 250,000 | 500 | - | - | - | - | 8 GB |
| XL | 500,000 | 1000 | - | - | - | - | 16 GB |
| 2XL | 1,000,000 | 2000 | 140 | 0.358 sec | 0.575 sec | 30 GB | 32 GB |
| 4XL | 1,000,000 | 2000 | 270 | 0.186 sec | 0.304 sec | 35 GB | 64 GB |
| 8XL | 1,000,000 | 2000 | 470 | 0.104 sec | 0.166 sec | 38 GB | 128 GB |
| 12XL | 1,000,000 | 2000 | 600 | 0.085 sec | 0.132 sec | 41 GB | 192 GB |
| 16XL | 1,000,000 | 2000 | 670 | 0.081 sec | 0.129 sec | 45 GB | 256 GB |
For 1,000,000 vectors 40 probes results to precision of 0.98. Note that exact values may vary depending on the dataset and queries, we recommend to run benchmarks with your own data to get precise results. Use this table as a reference.
</TabPanel>
<TabPanel id="gist960" label="gist-960, probes = 10">
Emdeddings of 960 dimensions from gist-960 dataset with 1,000,000 vectors.
| Plan | Vectors | Lists | RPS | Latency Mean | Latency p95 | RAM Usage | RAM |
| ------ | --------- | ----- | ---- | ------------ | ----------- | ------------------ | ------ |
| Free | 30,000 | 30 | 75 | 0.065 sec | 0.088 sec | 1 GB + 100 Mb Swap | 1 GB |
| Small | 100,000 | 100 | 78 | 0.064 sec | 0.092 sec | 1.8 GB | 2 GB |
| Medium | 250,000 | 250 | 58 | 0.085 sec | 0.129 sec | 3.2 GB | 4 GB |
| Large | 500,000 | 500 | 55 | 0.088 sec | 0.140 sec | 5 GB | 8 GB |
| XL | 1,000,000 | 1000 | 110 | 0.046 sec | 0.070 sec | 14 GB | 16 GB |
| 2XL | 1,000,000 | 1000 | 235 | 0.083 sec | 0.136 sec | 10 GB | 32 GB |
| 4XL | 1,000,000 | 1000 | 420 | 0.071 sec | 0.106 sec | 11 GB | 64 GB |
| 8XL | 1,000,000 | 1000 | 815 | 0.072 sec | 0.106 sec | 13 GB | 128 GB |
| 12XL | 1,000,000 | 1000 | 1150 | 0.052 sec | 0.078 sec | 15.5 GB | 192 GB |
| 16XL | 1,000,000 | 1000 | 1345 | 0.072 sec | 0.106 sec | 17.5 GB | 256 GB |
</TabPanel>
<TabPanel id="glove512" label="GloVe-512, probes = 10">
Emdeddings of 512 dimensions from GloVe Reddit comments dataset with 1,623,397 vectors.
| Plan | Vectors | Lists | RPS | Latency Mean | Latency p95 | RAM Usage | RAM |
| ------ | --------- | ----- | ---- | ------------ | ----------- | ------------------ | ------ |
| Free | 100,000 | 100 | 250 | 0.395 sec | 0.432 sec | 1 GB + 300 Mb Swap | 1 GB |
| Small | 250,000 | 250 | 440 | 0.223 sec | 0.250 sec | 2 GB + 200 Mb Swap | 2 GB |
| Medium | 500,000 | 500 | 425 | 0.116 sec | 0.143 sec | 3.7 GB | 4 GB |
| Large | 1,000,000 | 1000 | 515 | 0.096 sec | 0.116 sec | 7.5 GB | 8 GB |
| XL | 1,623,397 | 1275 | 465 | 0.212 sec | 0.272 sec | 14 GB | 16 GB |
| 2XL | 1,623,397 | 1275 | 1400 | 0.061 sec | 0.075 sec | 22 GB | 32 GB |
| 4XL | 1,623,397 | 1275 | 1800 | 0.027 sec | 0.043 sec | 20 GB | 64 GB |
| 8XL | 1,623,397 | 1275 | 2850 | 0.032 sec | 0.049 sec | 21 GB | 128 GB |
| 12XL | 1,623,397 | 1275 | 3700 | 0.020 sec | 0.036 sec | 26 GB | 192 GB |
| 16XL | 1,623,397 | 1275 | 3700 | 0.025 sec | 0.042 sec | 29 GB | 256 GB |
Random vectors were generated for queries.
</TabPanel>
<TabPanel id="glove512_60" label="GloVe-512, probes = 60">
Emdeddings of 512 dimensions from GloVe Reddit comments dataset with 1,623,397 vectors.
| Plan | Vectors | Lists | RPS | Latency Mean | Latency p95 | RAM Usage | RAM |
| ------ | --------- | ----- | --- | ------------ | ----------- | --------- | ------ |
| Free | 100,000 | 100 | - | - | - | - | 1 GB |
| Small | 250,000 | 250 | - | - | - | - | 2 GB |
| Medium | 500,000 | 500 | 75 | 0.656 sec | 0.750 sec | 3.7 GB | 4 GB |
| Large | 1,000,000 | 1000 | 102 | 0.488 sec | 0.580 sec | 7.5 GB | 8 GB |
| XL | 1,000,000 | 1000 | 188 | 0.525 sec | 0.596 sec | 14 GB | 16 GB |
| XL | 1,623,397 | 1275 | 75 | 0.679 sec | 0.798 sec | 14 GB | 16 GB |
| 2XL | 1,623,397 | 1275 | 160 | 0.314 sec | 0.384 sec | 22 GB | 32 GB |
| 4XL | 1,623,397 | 1275 | 300 | 0.083 sec | 0.113 sec | 20 GB | 64 GB |
| 8XL | 1,623,397 | 1275 | 565 | 0.105 sec | 0.141 sec | 21 GB | 128 GB |
| 12XL | 1,623,397 | 1275 | 840 | 0.093 sec | 0.124 sec | 26 GB | 192 GB |
| 16XL | 1,623,397 | 1275 | 940 | 0.084 sec | 0.108 sec | 29 GB | 256 GB |
Random vectors were generated for queries.
</TabPanel>
</Tabs>
<Admonition type="note">
It is possible to upload more vectors to a single table if Memory allows it (for example, 4XL plan and higher for OpenAI embeddings). But it will affect the performance of the queries: RPS will be lower, and latency will be higher. Scaling should be almost linear, but it is recommended to benchmark your workload to find the optimal number of vectors per table and per database instance.
</Admonition>
## Methodology
We follow techniques outlined in the [ANN Benchmarks](https://github.com/erikbern/ann-benchmarks) methodology. A Python test runner is responsible for uploading the data, creating the index, and running the queries. The pgvector engine is implemented using [vecs](https://github.com/supabase/vecs), a Python client for pgvector.
<div>
<img
alt="multi database"
className="dark:hidden"
src="/docs/img/ai/instance-type/vecs-benchmark--light.png"
/>
<img
alt="multi database"
className="hidden dark:block"
src="/docs/img/ai/instance-type/vecs-benchmark--dark.png"
/>
</div>
Each test is run for a minimum of 30-40 minutes. They include a series of experiments executed at different concurrency levels to measure the engine's performance under different load types. The results are then averaged.
As a general recommendation, we suggest using a concurrency level of 5 or more for most workloads and 30 or more for high-load workloads.
export const Page = ({ children }) => <Layout meta={meta} children={children} />
export default Page
@@ -1,79 +0,0 @@
import Layout from '~/layouts/DefaultGuideLayout'
export const meta = {
id: 'ai-choosing-instance-type',
title: 'Choosing Instance Type',
description: 'Choosing the right instance type for your workload.',
subtitle: 'Choosing the right instance type for your workload.',
sidebar_label: 'Choosing Instance Type',
}
This guide will help you choose the right instance type for your workload. We'll provide general guidance, as it is impossible to provide specific instructions for every possible use case. The goal is to give you a starting point from which you can make your own benchmarks and optimizations.
For more information about engineering at scale, see our [Engineering for Scale](/docs/guides/ai/engineering-for-scale) guide.
## Simple workloads
We've run a set of benchmarks using the [gist-960-angular](http://corpus-texmex.irisa.fr/) dataset. This dataset contains 1,000,000 embeddings for images, with each embedding being 960 dimensions.
We used [Vecs](https://github.com/supabase/vecs) to create a collection, upload the embeddings to a single table, and create an `inner-product` index for the embedding column. We then ran a series of queries to measure the performance of different instance types:
### Results
The number of vectors in `gist-960-angular` was cut to fit the instance size.
| Plan | CPU | Memory | Vectors | RPS | Latency Mean | Latency p95 | CPU Usage - Max % | Memory Usage - Max |
| ------ | ------ | ------ | ------- | --- | ------------ | ----------- | ----------------- | ------------------ |
| Free | 2-core | 1 GB | 30,000 | 75 | 0.065 sec | 0.088 sec | 90% | 1 GB + 100 Mb Swap |
| Small | 2-core | 2 GB | 100,000 | 78 | 0.064 sec | 0.092 sec | 80% | 1.8 GB |
| Medium | 2-core | 4 GB | 250,000 | 58 | 0.085 sec | 0.129 sec | 90% | 3.2 GB |
| Large | 2-core | 8 GB | 500,000 | 55 | 0.088 sec | 0.140 sec | 90% | 5 GB |
The full number of vectors in `gist-960-angular` dataset - 1,000,000.
| Plan | CPU | Memory | Vectors | RPS | Latency Mean | Latency p95 | CPU Usage - Max % | Memory Usage - Max |
| ---- | ------- | ------ | --------- | ---- | ------------ | ----------- | ----------------- | ------------------ |
| XL | 4-core | 16 GB | 1,000,000 | 110 | 0.046 sec | 0.070 sec | 45% | 14 GB |
| 2XL | 8-core | 32 GB | 1,000,000 | 235 | 0.083 sec | 0.136 sec | 33% | 10 GB |
| 4XL | 16-core | 64 GB | 1,000,000 | 420 | 0.071 sec | 0.106 sec | 45% | 11 GB |
| 8XL | 32-core | 128 GB | 1,000,000 | 815 | 0.072 sec | 0.106 sec | 75% | 13 GB |
| 12XL | 48-core | 192 GB | 1,000,000 | 1150 | 0.052 sec | 0.078 sec | 70% | 15.5 GB |
| 16XL | 64-core | 256 GB | 1,000,000 | 1345 | 0.072 sec | 0.106 sec | 60% | 17.5 GB |
- Lists set to `Number of vectors / 1000`
- Probes set to `10`
<Admonition type="note">
It is possible to upload more than 1,000,000 vectors to a single table if Memory allows it (for example, 2XL instance and higher). But it will affect the performance of the queries: RPS will be lower, and latency will be higher. Scaling should be almost linear, but it is recommended to benchmark your workload to find the optimal number of vectors per table and per instance.
</Admonition>
## Methodology
We follow techniques outlined in the [ANN Benchmarks](https://github.com/erikbern/ann-benchmarks) methodology. A Python test runner is responsible for uploading the data, creating the index, and running the queries. The pgvector engine is implemented using [vecs](https://github.com/supabase/vecs), a Python client for pgvector.
<div>
<img
alt="multi database"
className="dark:hidden"
src="/docs/img/ai/instance-type/vecs-benchmark--light.png"
/>
<img
alt="multi database"
className="hidden dark:block"
src="/docs/img/ai/instance-type/vecs-benchmark--dark.png"
/>
</div>
Each test is run for a minimum of 30-40 minutes. They include a series of experiments executed at different concurrency levels to measure the engine's performance under different load types. The results are then averaged.
As a general recommendation, we suggest using a concurrency level of 5 or more for most workloads and 30 or more for high-load workloads.
## Future benchmarks
We'll continue to add more benchmarks on datasets consisting of different vector dimensions, number of `lists` in the index, and number of `probes` in the index. Stay tuned for more information about how it may affect the performance and precision of your queries.
export const Page = ({ children }) => <Layout meta={meta} children={children} />
export default Page
@@ -37,7 +37,7 @@ There are 3 steps to build similarity search inside your documentation:
### Prepare your database
To prepare, create a [new Supabase project](https://database.new) and store the database and API credentials, which you can find in the project [settings](https://app.supabase.com/_/settings).
To prepare, create a [new Supabase project](https://database.new) and store the database and API credentials, which you can find in the project [settings](https://supabase.com/dashboard/_/settings).
Now we can use the [Headless Vector Search](https://github.com/supabase/headless-vector-search#set-up) instructions to set up the database:
@@ -46,7 +46,7 @@ Now we can use the [Headless Vector Search](https://github.com/supabase/headless
3. Apply the database migrations: `supabase db push`
4. Set your OpenAI key as a secret: `supabase secrets set OPENAI_KEY=sk-xxx`
5. Deploy the Edge Functions: `supabase functions deploy --no-verify-jwt`
6. Expose `docs` schema via API in Supabase Dashboard [settings](https://app.supabase.com/project/_/settings/api) > `API Settings` > `Exposed schemas`
6. Expose `docs` schema via API in Supabase Dashboard [settings](https://supabase.com/dashboard/project/_/settings/api) > `API Settings` > `Exposed schemas`
### Ingest your documentation
@@ -20,15 +20,15 @@ We can combine Hugging Face with [Supabase Storage](https://supabase.com/storage
## Setup
- Open your Supabase project dashboard or [create a new project](https://app.supabase.com/projects).
- [Create a new bucket](https://app.supabase.com/project/_/storage/buckets) called `images`.
- Open your Supabase project dashboard or [create a new project](https://supabase.com/dashboard/projects).
- [Create a new bucket](https://supabase.com/dashboard/project/_/storage/buckets) called `images`.
- Generate TypeScript types from remote Database.
- Create a new Database table called `image_caption`.
- Create `id` column of type `uuid` which references `storage.objects.id`.
- Create a `caption` column of type `text`.
- Regenerate TypeScript types to include new `image_caption` table.
- Deploy the function to Supabase: `supabase functions deploy huggingface-image-captioning`.
- Create the Database Webhook in the [Supabase Dashboard](https://app.supabase.com/project/_/database/hooks) to trigger the `huggingface-image-captioning` function anytime a record is added to the `storage.objects` table.
- Create the Database Webhook in the [Supabase Dashboard](https://supabase.com/dashboard/project/_/database/hooks) to trigger the `huggingface-image-captioning` function anytime a record is added to the `storage.objects` table.
## Generate TypeScript Types
@@ -22,13 +22,13 @@ We assume that you have a Next.js project with a collection of `.mdx` files nest
## Create a project
1. [Create a new project](https://app.supabase.com) in the Supabase Dashboard.
1. [Create a new project](https://supabase.com/dashboard) in the Supabase Dashboard.
1. Enter your project details.
1. Wait for the new database to launch.
## Prepare the database
Let's prepare the database schema. We can use the "OpenAI Vector Search" quickstart in the [SQL Editor](https://app.supabase.com/project/_/sql), or you can copy/paste the SQL below and run it yourself.
Let's prepare the database schema. We can use the "OpenAI Vector Search" quickstart in the [SQL Editor](https://supabase.com/dashboard/project/_/sql), or you can copy/paste the SQL below and run it yourself.
<Tabs
scrollable
@@ -38,7 +38,7 @@ Let's prepare the database schema. We can use the "OpenAI Vector Search" quickst
>
<TabPanel id="dashboard" label="Dashboard">
1. Go to the [SQL Editor](https://app.supabase.com/project/_/sql) page in the Dashboard.
1. Go to the [SQL Editor](https://supabase.com/dashboard/project/_/sql) page in the Dashboard.
2. Click **OpenAI Vector Search**.
3. Click **Run**.
+3 -3
View File
@@ -17,7 +17,7 @@ export const meta = {
Google Colab is a hosted Jupyter Notebook service. It provides free access to computing resources, including GPUs and TPUs, and is well-suited to machine learning, data science, and education. We can use Colab to manage collections using [Supabase Vecs](/docs/guides/ai/vecs-python-client).
In this tutorial we'll connect to a database running on the Supabase [platform](https://app.supabase.com/). If you don't already have a database, you can create one here: [database.new](https://database.new).
In this tutorial we'll connect to a database running on the Supabase [platform](https://supabase.com/dashboard/). If you don't already have a database, you can create one here: [database.new](https://database.new).
## Create a new notebook
@@ -39,7 +39,7 @@ pip install vecs
## Connect to your database
Find the Postgres connection string for your Supabase project in the [database settings](https://app.supabase.com/_/settings/database) of the dashboard. Copy the "URI" format, which should look something like `postgresql:/postgres:<password>@<host>:5432/postgres`
Find the Postgres connection string for your Supabase project in the [database settings](https://supabase.com/dashboard/_/settings/database) of the dashboard. Copy the "URI" format, which should look something like `postgresql:/postgres:<password>@<host>:5432/postgres`
Create a new code block below the install block (`ctrl+m b`) and add the following code using the Postgres URI you copied above:
@@ -79,7 +79,7 @@ collection.upsert(
)
```
This will create a table inside your database within the `vecs` schema, called `colab_collection`. You can view the inserted items in the [Table Editor](https://app.supabase.com/project/_/editor/), by selecting the `vecs` schema from the schema dropdown.
This will create a table inside your database within the `vecs` schema, called `colab_collection`. You can view the inserted items in the [Table Editor](https://supabase.com/dashboard/project/_/editor/), by selecting the `vecs` schema from the schema dropdown.
![Colab documents](/docs/img/ai/google-colab/colab-documents.png)
@@ -52,7 +52,7 @@ Replace the `DB_CONNECTION` with your own connection string for your database, w
Now all that's left is to step through the notebook. You can do this by clicking the "execute" button (`ctrl+enter`) at the top left of each code cell. The notebook guides you through the process of creating a collection, adding data to it, and querying it.
You can view the inserted items in the [Table Editor](https://app.supabase.com/project/_/editor/), by selecting the `vecs` schema from the schema dropdown.
You can view the inserted items in the [Table Editor](https://supabase.com/dashboard/project/_/editor/), by selecting the `vecs` schema from the schema dropdown.
![Colab documents](/docs/img/ai/google-colab/colab-documents.png)
+20
View File
@@ -1,4 +1,6 @@
import Layout from '~/layouts/DefaultGuideLayout'
import { Tabs } from 'ui'
export const TabPanel = Tabs.Panel
export const meta = {
id: 'ai-lang-chain',
@@ -14,6 +16,21 @@ export const meta = {
Prepare you database with the relevant tables:
<Tabs
scrollable
size="small"
type="underlined"
defaultActiveId="dashboard"
>
<TabPanel id="dashboard" label="Dashboard">
1. Go to the [SQL Editor](https://supabase.com/dashboard/project/_/sql) page in the Dashboard.
2. Click **LangChain** in the Quick start section.
3. Click **Run**.
</TabPanel>
<TabPanel id="sql" label="SQL">
```sql
-- Enable the pgvector extension to work with embedding vectors
create extension vector;
@@ -55,6 +72,9 @@ end;
$$;
```
</TabPanel>
</Tabs>
## Usage
You can now search your documents using any Node.js application. This is intended to be run on a secure server route.
@@ -9,7 +9,7 @@ export const meta = {
A collection is a group of vector records managed by the `vecs` Python library. Records can be added to or updated in a collection. Collections can be queried at any time, but should be indexed for scalable query performance.
Supabase provides a [Python client](/docs/guides/ai/vecs-python-client) called `vecs` for managing unstructured vector stores in Postgres. If you come from a data science background, this unstructured data approach will feel familiar. If you are more interested in a structured data approach, see [Vector columns](/docs/guides/ai/vector-columns) or read our guide on [Structured & Unstructured Embeddings](/docs/guides/ai/structured-unstructured-embeddings).
Supabase provides a [Python client](/docs/guides/ai/vecs-python-client) called `vecs` for managing unstructured vector stores in Postgres. If you come from a data science background, this unstructured data approach will feel familiar. If you are more interested in a structured data approach, see [Vector columns](/docs/guides/ai/vector-columns) or read our guide on [Structured & Unstructured Embeddings](/docs/guides/ai/structured-unstructured).
Under the hood `vecs` will manage the necessary Postgres tables and columns to store and query your collections.
@@ -49,7 +49,7 @@ Replace the `DB_CONNECTION` with your own connection string for your database, w
Now all that's left is to step through the notebook. You can do this by clicking the "execute" button (`ctrl+enter`) at the top left of each code cell. The notebook guides you through the process of creating a collection, adding data to it, and querying it.
You can view the inserted items in the [Table Editor](https://app.supabase.com/project/_/editor/), by selecting the `vecs` schema from the schema dropdown.
You can view the inserted items in the [Table Editor](https://supabase.com/dashboard/project/_/editor/), by selecting the `vecs` schema from the schema dropdown.
![Colab documents](/docs/img/ai/google-colab/colab-documents.png)
@@ -49,7 +49,7 @@ Replace the `DB_CONNECTION` with your own connection string for your database, w
Now all that's left is to step through the notebook. You can do this by clicking the "execute" button (`ctrl+enter`) at the top left of each code cell. The notebook guides you through the process of creating a collection, adding data to it, and querying it.
You can view the inserted items in the [Table Editor](https://app.supabase.com/project/_/editor/), by selecting the `vecs` schema from the schema dropdown.
You can view the inserted items in the [Table Editor](https://supabase.com/dashboard/project/_/editor/), by selecting the `vecs` schema from the schema dropdown.
![Colab documents](/docs/img/ai/google-colab/colab-documents.png)
@@ -50,7 +50,7 @@ Replace the `DB_CONNECTION` with your own connection string for your database, w
Now all that's left is to step through the notebook. You can do this by clicking the "execute" button (`ctrl+enter`) at the top left of each code cell. The notebook guides you through the process of creating a collection, adding data to it, and querying it.
You can view the inserted items in the [Table Editor](https://app.supabase.com/project/_/editor/), by selecting the `vecs` schema from the schema dropdown.
You can view the inserted items in the [Table Editor](https://supabase.com/dashboard/project/_/editor/), by selecting the `vecs` schema from the schema dropdown.
![Colab documents](/docs/img/ai/google-colab/colab-documents.png)
@@ -23,7 +23,7 @@ create table docs (
);
insert into docs
(id, content, url, embedding)
(id, embedding, content, url)
values
('79409372-7556-4ccc-ab8f-5786a6cfa4f7', array[0.1, 0.2, 0.3], 'Hello world', '/hello-world');
```
@@ -89,7 +89,7 @@ create table docs (
);
insert into docs
(id, embedding, meta)
(id, embedding, content, url, meta)
values
(
'79409372-7556-4ccc-ab8f-5786a6cfa4f7',
+1 -1
View File
@@ -23,7 +23,7 @@ Vectors in Supabase are enabled via [pgvector](https://github.com/pgvector/pgvec
>
<TabPanel id="dashboard" label="Dashboard">
1. Go to the [Database](https://app.supabase.com/project/_/database/tables) page in the Dashboard.
1. Go to the [Database](https://supabase.com/dashboard/project/_/database/tables) page in the Dashboard.
2. Click on **Extensions** in the sidebar.
3. Search for "vector" and enable the extension.
+3 -3
View File
@@ -50,7 +50,7 @@ Reference:
## GraphQL API [#graphql-api-overview]
Supabase uses [pg_graphql](https://supabase.github.io/pg_graphql/) to expose a GraphQL API endpoint at `https://<project_ref>.supabase.co/graphql/v1/`.
You can introspect and query the GraphQL API of an existing Supabase project within Studio [here](https://app.supabase.com/project/_/api/graphiql),
You can introspect and query the GraphQL API of an existing Supabase project within Studio [here](https://supabase.com/dashboard/project/_/api/graphiql),
or navigate there manually at `API Docs > GraphQL > GraphiQL`.
The GraphQL interface is automatically reflected from your database's schema and supports:
@@ -72,11 +72,11 @@ Reference:
Supabase provides a Realtime API using [Realtime](https://github.com/supabase/realtime). You can use this to listen to database changes over websockets.
Realtime leverages PostgreSQL's built-in logical replication. You can manage your Realtime API simply by managing Postgres publications.
Go to your project's [Replication section](https://app.supabase.com/project/_/database/replication) to get started.
Go to your project's [Replication section](https://supabase.com/dashboard/project/_/database/replication) to get started.
## API URL and Keys
You can find the API URL and Keys in the [Dashboard](https://app.supabase.com/project/_/settings/api).
You can find the API URL and Keys in the [Dashboard](https://supabase.com/dashboard/project/_/settings/api).
<video width="99%" muted playsInline controls={true}>
<source
+2 -2
View File
@@ -6,9 +6,9 @@ export const meta = {
description: 'Securing your Serverless API with Postgres Row Level Security.',
}
Supabase provides two default keys when you create a project: an `anon` key, and a `service_role` key. You can find both keys in the [API Settings](https://app.supabase.com/project/_/settings/api).
Supabase provides two default keys when you create a project: an `anon` key, and a `service_role` key. You can find both keys in the [API Settings](https://supabase.com/dashboard/project/_/settings/api).
The Serverless APIs are designed to work with Postgres Row Level Security (RLS). These keys both map to Postgres roles. You can find an `anon` user and a `service_role` user in the [Roles](http://app.supabase.com/project/_/database/roles) section of the dashboard.
The Serverless APIs are designed to work with Postgres Row Level Security (RLS). These keys both map to Postgres roles. You can find an `anon` user and a `service_role` user in the [Roles](http://supabase.com/dashboard/project/_/database/roles) section of the dashboard.
The keys are both long-lived JWTs. If you decode these keys, you will see that they contain the "role", an "issued date", and an "expiry date" ~10 years in the future.
@@ -22,7 +22,7 @@ This creates a corresponding route `todos` which can accept `GET`, `POST`, `PATC
>
<TabPanel id="dashboard" label="Dashboard">
1. Go to the [Table editor](https://app.supabase.com/project/_/editor) page in the Dashboard.
1. Go to the [Table editor](https://supabase.com/dashboard/project/_/editor) page in the Dashboard.
1. Click **New Table** and create a table with the name `todos`.
1. Click **Save**.
1. Click **New Column** and create a column with the name `task` and type `text`.
@@ -54,7 +54,7 @@ create table
Every Supabase project has a unique API URL. Your API is secured behind an API gateway which requires an API Key for every request.
1. Go to the [Settings](https://app.supabase.com/project/_/settings/general) page in the Dashboard.
1. Go to the [Settings](https://supabase.com/dashboard/project/_/settings/general) page in the Dashboard.
2. Click **API** in the sidebar.
3. Find your API `URL`, `anon`, and `service_role` keys on this page.
@@ -198,7 +198,7 @@ By default Realtime is disabled on your database. Let's turn on Realtime for the
>
<TabPanel id="dashboard" label="Dashboard">
1. Go to the [Database](https://app.supabase.com/project/_/database/tables) page in the Dashboard.
1. Go to the [Database](https://supabase.com/dashboard/project/_/database/tables) page in the Dashboard.
2. Click on **Replication** in the sidebar.
3. Control which database events are sent by toggling **Insert**, **Update**, and **Delete**.
4. Control which tables broadcast changes by selecting **Source** and toggling each table.
@@ -91,7 +91,7 @@ const { data, error } = await supabase.from('countries').select(`
<TabPanel id="dart" label="Dart">
```dart
final data = await supabase.from('todos').select('id, name, cities(id, name)');
final data = await supabase.from('countries').select('id, name, cities(id, name)');
```
</TabPanel>
+4 -4
View File
@@ -16,9 +16,9 @@ We'll create a database table called `todos` for storing tasks. This creates a c
<StepHikeCompact.Step step={1}>
<StepHikeCompact.Details title="Set up a Supabase project with a 'todos' table">
[Create a new project](https://app.supabase.com) in the Supabase Dashboard.
[Create a new project](https://supabase.com/dashboard) in the Supabase Dashboard.
After your project is ready, create a table in your Supabase database. You can do this with either the Table interface or the [SQL Editor](https://app.supabase.com/project/_/sql).
After your project is ready, create a table in your Supabase database. You can do this with either the Table interface or the [SQL Editor](https://supabase.com/dashboard/project/_/sql).
</StepHikeCompact.Details>
@@ -110,7 +110,7 @@ We'll create a database table called `todos` for storing tasks. This creates a c
<StepHikeCompact.Step step={4}>
<StepHikeCompact.Details title="Fetch the data">
Find your API URL and Keys in your Dashboard [API Settings](https://app.supabase.com/project/_/settings/api). You can now query your "todos" table by appending `/rest/v1/todos` to the API URL.
Find your API URL and Keys in your Dashboard [API Settings](https://supabase.com/dashboard/project/_/settings/api). You can now query your "todos" table by appending `/rest/v1/todos` to the API URL.
Copy this block of code, substitute `<PROJECT_REF>` and `<ANON_KEY>`, then run it from a terminal.
@@ -141,7 +141,7 @@ You can query the route in your browser, by appending the `anon` key as a query
### Client libraries
We provide a numerous [Client Libraries](https://github.com/supabase/supabase#client-libraries).
We provide a number of [Client Libraries](https://github.com/supabase/supabase#client-libraries).
<Tabs
scrollable
@@ -6,9 +6,9 @@ export const meta = {
description: 'Supabase provides documentation that updates automatically.',
}
Supabase generates documentation in the [Dashboard](https://app.supabase.com) which updates as you make database changes.
Supabase generates documentation in the [Dashboard](https://supabase.com/dashboard) which updates as you make database changes.
1. Go to the [API](https://app.supabase.com/project/_/api) page in the Dashboard.
1. Go to the [API](https://supabase.com/dashboard/project/_/api) page in the Dashboard.
2. Select any table under **Tables and Views** in the sidebar.
3. Switch between the JavaScript and the cURL docs using the tabs.
@@ -22,7 +22,7 @@ To enable RLS on any table:
>
<TabPanel id="dashboard" label="Dashboard">
1. Go to the [Authentication](https://app.supabase.com/project/_/auth/users) page in the Dashboard.
1. Go to the [Authentication](https://supabase.com/dashboard/project/_/auth/users) page in the Dashboard.
2. Click on **Policies** in the sidebar.
3. Select **Enable RLS** to enable Row Level Security.
+2 -2
View File
@@ -64,7 +64,7 @@ You can enable third-party providers with the click of a button by navigating to
### Redirect URLs and wildcards
When using third-party providers, the [Supabase client library](/docs/reference/javascript/auth-signinwithoauth#sign-in-using-a-third-party-provider-with-redirect) redirects the user to the provider. When the third-party provider successfully authenticates the user, the provider redirects the user to the Supabase Auth callback URL where they are further redirected to the URL specified in the `redirectTo` parameter. This parameter defaults to the [`SITE_URL`](/docs/reference/auth/config#site_url). You can modify the `SITE_URL` or add additional [redirect URLs](https://app.supabase.com/project/_/auth/url-configuration).
When using third-party providers, the [Supabase client library](/docs/reference/javascript/auth-signinwithoauth#sign-in-using-a-third-party-provider-with-redirect) redirects the user to the provider. When the third-party provider successfully authenticates the user, the provider redirects the user to the Supabase Auth callback URL where they are further redirected to the URL specified in the `redirectTo` parameter. This parameter defaults to the [`SITE_URL`](/docs/reference/auth/config#site_url). You can modify the `SITE_URL` or add additional [redirect URLs](https://supabase.com/dashboard/project/_/auth/url-configuration).
You can use wildcard match patterns to support preview URLs from providers like Netlify and Vercel. See the [full list of supported patterns](https://pkg.go.dev/github.com/gobwas/glob#Compile). Use [this tool](https://www.digitalocean.com/community/tools/glob?comments=true&glob=http%3A%2F%2Flocalhost%3A3000%2F%2A%2A&matches=false&tests=http%3A%2F%2Flocalhost%3A3000&tests=http%3A%2F%2Flocalhost%3A3000%2F&tests=http%3A%2F%2Flocalhost%3A3000%2F%3Ftest%3Dtest&tests=http%3A%2F%2Flocalhost%3A3000%2Ftest-test%3Ftest%3Dtest&tests=http%3A%2F%2Flocalhost%3A3000%2Ftest%2Ftest%3Ftest%3Dtest) to test your patterns.
@@ -84,7 +84,7 @@ For deployments with Vercel, set the `SITE_URL` to your official site URL. Add t
- `http://localhost:3000/**`
- `https://*-username.vercel.app/**`
Vercel provides an environment variable for the URL of the deployment called `NEXT_PUBLIC_VERCEL_URL`. See the [Vercel docs](https://vercel.com/docs/concepts/projects/environment-variables#system-environment-variables) for more details. You can use this variable to dynamically redirect depending on the environment:
Vercel provides an environment variable for the URL of the deployment called `NEXT_PUBLIC_VERCEL_URL`. See the [Vercel docs](https://vercel.com/docs/concepts/projects/environment-variables#system-environment-variables) for more details. You can use this variable to dynamically redirect depending on the environment. You should also set the value of the environment variable called NEXT_PUBLIC_SITE_URL, this should be set to your site URL in production environment to ensure that redirects function correctly.
```js
const getURL = () => {
+4 -4
View File
@@ -51,7 +51,7 @@ In the Settings page, look for the **Sitekey** section and copy the key.
## Enable Captcha protection for your Supabase project
Navigate to the **[Authentication](https://app.supabase.com/project/_/settings/auth)** page in the Supabase Dashboard and find the **Enable Captcha protection** toggle under the **Security and Protection** section.
Navigate to the **[Authentication](https://supabase.com/dashboard/project/_/settings/auth)** page in the Supabase Dashboard and find the **Enable Captcha protection** toggle under the **Security and Protection** section.
![supabase_auth_general_settings.png](/docs/img/guides/auth-captcha/supabase_auth_general_settings.png)
@@ -165,18 +165,18 @@ Let's create an empty state to store our `captchaToken`
const [captchaToken, setCaptchaToken] = useState()
```
Now lets add the Cloudflare Turnstile component to the JSX section of our code
Now lets add the Cloudflare Turnstile component to the JSX section of our code:
```html
<Turnstile />
```
We will pass it the sitekey we copied from the Cloudflare website as a property along with a `onVerify` property which takes a callback function. This callback function will have a token as one of its properties. Let's set the token in the state using `setCaptchaToken`
We will pass it the sitekey we copied from the Cloudflare website as a property along with a `onSuccess` property which takes a callback function. This callback function will have a token as one of its properties. Let's set the token in the state using `setCaptchaToken`:
```jsx
<Turnstile
sitekey="your-sitekey"
onVerify={(token) => { setCaptchaToken(token) }
onSuccess={(token) => { setCaptchaToken(token) }
/>
```
@@ -22,7 +22,7 @@ The templating system provides the following variables for use:
| `{{ .ConfirmationURL }}` | Contains the confirmation URL. For example, a signup confirmation URL would look like: `https://project-ref.supabase.co/auth/v1/verify?token={{ .TokenHash }}&type=signup&redirect_to=https://example.com/path` . |
| `{{ .Token }}` | Contains a 6-digit One-Time-Password (OTP) that can be used instead of the `{{. ConfirmationURL }}` . |
| `{{ .TokenHash }}` | Contains a hashed version of the `{{ .Token }}`. This is useful for constructing your own email link in the email template. |
| `{{ .SiteURL }}` | Contains your application's Site URL. This can be configured in your project's [authentication settings](https://app.supabase.com/project/_/auth/url-configuration). |
| `{{ .SiteURL }}` | Contains your application's Site URL. This can be configured in your project's [authentication settings](https://supabase.com/dashboard/project/_/auth/url-configuration). |
## Limitations
@@ -45,6 +45,28 @@ To guard against this:
The user should be brought to a page on your site where they can confirm the action by clicking a button.
The button should contain the actual confirmation link which can be obtained from parsing the `confirmation_url={{ .ConfirmationURL }}` query parameter in the URL.
### Redirecting the user to a server-side endpoint
If you intend to use [Server-side rendering](/docs/guides/auth/server-side-rendering), you might want the email link to redirect the user to a server-side endpoint to check if they are authenticated before returning the page. However, the default email link will redirect the user after verification to the redirect URL with the session in the query fragments. Since the session is returned in the query fragments by default, you won't be able to access it on the server-side.
You can customize the email link in the email template to redirect the user to a server-side endpoint successfully. For example:
```html
<a href="https://api.example.com/v1/authenticate?token_hash={{ .TokenHash }}&type=invite"
>Accept the invite
</a>
```
When the user clicks on the link, the request will hit `https://api.example.com/v1/authenticate` and you can grab the `token_hash` and `type` query parameters from the URL. Then, you can call the [`verifyOtp`](/docs/reference/javascript/auth-verifyotp) method to get back an authenticated session before redirecting the user back to the client. Since the `verifyOtp` method makes a `POST` request to Supabase Auth to verify the user, the session will be returned in the response body, which can be read by the server. For example:
```js
const { token_hash, type } = Object.fromEntries(new URLSearchParams(window.location.search))
const { data: { session }, error } = supabase.auth.verifyOtp({ token_hash, type })
// subsequently redirect the user back to the client
// ...
```
export const Page = ({ children }) => <Layout meta={meta} children={children} />
export default Page
+3 -3
View File
@@ -10,13 +10,13 @@ export const meta = {
Setting up Email logins for your Supabase application.
- Add Email authenticator to your [Supabase Project](https://app.supabase.com)
- Add Email authenticator to your [Supabase Project](https://supabase.com/dashboard)
- Add the login code to your application - [JavaScript](https://github.com/supabase/supabase-js) | [Flutter](https://github.com/supabase/supabase-flutter)
## Configure email settings
1. For [Site URL](https://app.supabase.com/project/_/auth/url-configuration), enter the final (hosted) URL of your app.
1. For [Auth Providers](https://app.supabase.com/project/_/auth/providers), **enable email provider**.
1. For [Site URL](https://supabase.com/dashboard/project/_/auth/url-configuration), enter the final (hosted) URL of your app.
1. For [Auth Providers](https://supabase.com/dashboard/project/_/auth/providers), **enable email provider**.
<Admonition type="info" label="Self hosting">
@@ -31,7 +31,7 @@ npm install @supabase/auth-helpers-react
## Set up environment variables
Retrieve your project URL and anon key in your project's [API settings](https://app.supabase.com/project/_/settings/api) in the Dashboard to set up the following environment variables. For local development you can set them in a `.env.local` file. See an [example](https://github.com/supabase/auth-helpers/blob/main/examples/nextjs/.env.local.example).
Retrieve your project URL and anon key in your project's [API settings](https://supabase.com/dashboard/project/_/settings/api) in the Dashboard to set up the following environment variables. For local development you can set them in a `.env.local` file. See an [example](https://github.com/supabase/auth-helpers/blob/main/examples/nextjs/.env.local.example).
```bash .env.local
NEXT_PUBLIC_SUPABASE_URL=your-supabase-url
@@ -43,7 +43,7 @@ This creates a new Next.js app configured with:
### Declare Environment Variables
Retrieve your project's URL and anon key from your [API settings](https://app.supabase.com/project/_/settings/api), and create a `.env.local` file with the following environment variables:
Retrieve your project's URL and anon key from your [API settings](https://supabase.com/dashboard/project/_/settings/api), and create a `.env.local` file with the following environment variables:
```bash .env.local
NEXT_PUBLIC_SUPABASE_URL=your-supabase-url
@@ -68,7 +68,7 @@ npm install @supabase/auth-helpers-nextjs @supabase/supabase-js
### Declare Environment Variables
Retrieve your project's URL and anon key from your [API settings](https://app.supabase.com/project/_/settings/api), and create a `.env.local` file with the following environment variables:
Retrieve your project's URL and anon key from your [API settings](https://supabase.com/dashboard/project/_/settings/api), and create a `.env.local` file with the following environment variables:
```bash .env.local
NEXT_PUBLIC_SUPABASE_URL=your-supabase-url
@@ -79,7 +79,7 @@ NEXT_PUBLIC_SUPABASE_ANON_KEY=your-supabase-anon-key
When using the Supabase client on the server, you must perform extra steps to ensure the user's auth session remains active. Since the user's session is tracked in a cookie, we need to read this cookie and update it if necessary.
In Next.js Server Components, you can read a cookie, but you can't write back to it. Middleware on the other hand, allow you to both read a write to cookies.
Next.js Server Components allow you to read a cookie but not write back to it. Middleware on the other hand allow you to both read and write to cookies.
Next.js [Middleware](https://nextjs.org/docs/app/building-your-application/routing/middleware) runs immediately before each route is rendered. We'll use Middleware to refresh the user's session before loading Server Component routes.
@@ -528,7 +528,7 @@ This allows for the Supabase client to be easily instantiated in the correct con
<div className="video-container">
<iframe
src="https://www.youtube-nocookie.com/embed/f4yAnVgcJqI"
src="https://www.youtube-nocookie.com/embed/6Sb8R1PYhTY"
frameBorder="1"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allowFullScreen
@@ -696,7 +696,7 @@ Check out the [Next.js auth example repo](https://github.com/supabase/supabase/t
<div className="video-container">
<iframe
src="https://www.youtube-nocookie.com/embed/B5TUzTKO9CE"
src="https://www.youtube-nocookie.com/embed/4_epZIxqCho"
frameBorder="1"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allowFullScreen
@@ -784,7 +784,7 @@ TypeScript types can be [generated with the Supabase CLI](/docs/reference/javasc
<div className="video-container">
<iframe
src="https://www.youtube-nocookie.com/embed/3kK-40z0DHI"
src="https://www.youtube-nocookie.com/embed/r6q7ypXbPFI"
frameBorder="1"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allowFullScreen
@@ -32,7 +32,7 @@ This library supports the following tooling versions:
## Set up environment variables
Retrieve your project URL and anon key in your project's [API settings](https://app.supabase.com/project/_/settings/api) in the Dashboard to set up the following environment variables. For local development you can set them in a `.env` file. See an [example](https://github.com/supabase/auth-helpers/blob/main/examples/remix/.env.example).
Retrieve your project URL and anon key in your project's [API settings](https://supabase.com/dashboard/project/_/settings/api) in the Dashboard to set up the following environment variables. For local development you can set them in a `.env` file. See an [example](https://github.com/supabase/auth-helpers/blob/main/examples/remix/.env.example).
```bash .env
SUPABASE_URL=YOUR_SUPABASE_URL
@@ -743,7 +743,7 @@ export default function Index() {
</Tabs>
> Ensure you have [enabled replication](https://app.supabase.com/project/_/database/replication) on the table you are subscribing to.
> Ensure you have [enabled replication](https://supabase.com/dashboard/project/_/database/replication) on the table you are subscribing to.
## Migration Guide
@@ -21,10 +21,10 @@ npm install @supabase/auth-helpers-sveltekit @supabase/supabase-js
### Declare Environment Variables
Retrieve your project's URL and anon key from your [API settings](https://app.supabase.com/project/_/settings/api), and create a `.env.local` file with the following environment variables:
Retrieve your project's URL and anon key from your [API settings](https://supabase.com/dashboard/project/_/settings/api), and create a `.env.local` file with the following environment variables:
```bash .env.local
# Find these in your Supabase project settings https://app.supabase.com/project/_/settings/api
# Find these in your Supabase project settings https://supabase.com/dashboard/project/_/settings/api
PUBLIC_SUPABASE_URL=https://your-project.supabase.co
PUBLIC_SUPABASE_ANON_KEY=your-anon-key
```
@@ -416,6 +416,8 @@ We can access the supabase instance in our `+page.svelte` file through the data
```js src/routes/login/+page.server.js
// src/routes/login/+page.server.js
import { fail } from '@sveltejs/kit'
export const actions = {
default: async ({ request, url, locals: { supabase } }) => {
const formData = await request.formData()
@@ -17,11 +17,17 @@ Setting up Magic Link logins for your Supabase application.
## Add Magic Link into your Supabase Project
1. For [Site URL](https://app.supabase.com/project/_/auth/url-configuration), enter the final (hosted) URL of your app.
1. For [Auth Providers](https://app.supabase.com/project/_/auth/providers), **enable email provider**.
1. For [Site URL](https://supabase.com/dashboard/project/_/auth/url-configuration), enter the final (hosted) URL of your app.
1. For [Auth Providers](https://supabase.com/dashboard/project/_/auth/providers), **enable email provider**.
## Add login code to your client app
<Admonition type="caution">
When making use of Magic Links with [the PKCE Flow](https://supabase.com/blog/supabase-auth-sso-pkce#introducing-pkce) do bear in mind that links can only be used in the same browser that they are sent from. Consequently, a magic link sent from Chrome on Desktop will be invalid if used on a Mobile Device.
</Admonition>
<Tabs
scrollable
size="small"
@@ -17,8 +17,8 @@ export const meta = {
Supabase provides a convenient method [`.resetPasswordForEmail`](/docs/reference/javascript/auth-resetpasswordforemail)
to reset a user password. This method takes a parameter of `redirectTo` which we will use to pass an absolute URL to
the update password page. This URL must be saved in your
allowed [Redirect URLs](https://app.supabase.com/project/_/auth/url-configuration) list found at
[Authentication > Redirect Configuration](https://app.supabase.com/project/_/auth/url-configuration) or it won't
allowed [Redirect URLs](https://supabase.com/dashboard/project/_/auth/url-configuration) list found at
[Authentication > Redirect Configuration](https://supabase.com/dashboard/project/_/auth/url-configuration) or it won't
redirect the user.
```ts
@@ -45,8 +45,8 @@ await supabase.auth.updateUser({ password: new_password })
Supabase provides a convenient method [`.resetPasswordForEmail`](/docs/reference/javascript/auth-resetpasswordforemail)
to reset a user password. This method takes a parameter of `redirectTo` which we will use to pass an absolute URL to
the callback page along with a query parameter to the update password page. This URL must be saved in your
allowed [Redirect URLs](https://app.supabase.com/project/_/auth/url-configuration) list found at
[Authentication > Redirect Configuration](https://app.supabase.com/project/_/auth/url-configuration) or it won't
allowed [Redirect URLs](https://supabase.com/dashboard/project/_/auth/url-configuration) list found at
[Authentication > Redirect Configuration](https://supabase.com/dashboard/project/_/auth/url-configuration) or it won't
redirect the user.
```ts
@@ -24,7 +24,7 @@ We'll cover:
What you'll need:
- A MessageBird account (sign up here: https://dashboard.messagebird.com/en/sign-up)
- A Supabase project (create one here: https://app.supabase.com)
- A Supabase project (create one here: https://supabase.com/dashboard)
- A mobile phone capable of receiving SMS
## Steps
@@ -49,7 +49,7 @@ You will need the following values to get started:
- Live API Key / Test API Key
- MessageBird originator
Now go to the Auth > Settings page in the Supabase dashboard (https://app.supabase.com/project/YOUR-PROJECT-REF/auth/settings).
Now go to the Auth > Settings page in the Supabase dashboard (https://supabase.com/dashboard/project/YOUR-PROJECT-REF/auth/settings).
You should see an option to enable Phone Signup.
@@ -68,7 +68,7 @@ Now the backend should be setup, we can proceed to add our client-side code!
The SMS message sent to a phone containing an OTP code can be customized. This is useful if you need to mention a brand name or display a website address.
Go to Auth > Templates page in the Supabase dashboard (https://app.supabase.com/project/YOUR-PROJECT-REF/auth/templates).
Go to Auth > Templates page in the Supabase dashboard (https://supabase.com/dashboard/project/YOUR-PROJECT-REF/auth/templates).
Use the variable `.Code` in the template to display the code.
@@ -276,7 +276,7 @@ The user does not have a password therefore will need to sign in via this method
## Resources
- [MessageBird Signup](https://dashboard.messagebird.com/en/sign-up)
- [Supabase Dashboard](https://app.supabase.com)
- [Supabase Dashboard](https://supabase.com/dashboard)
- [Supabase Row Level Security](/docs/guides/auth#row-level-security)
export const Page = ({ children }) => <Layout meta={meta} children={children} />
@@ -25,7 +25,7 @@ We'll cover:
What you'll need:
- A Twilio account (sign up here: https://www.twilio.com/try-twilio)
- A Supabase project (create one here: https://app.supabase.com)
- A Supabase project (create one here: https://supabase.com/dashboard)
- A mobile phone capable of receiving SMS
## Video
@@ -68,7 +68,7 @@ You should now be able to see all three values you'll need to get started:
![All the credentials you'll need](/docs/img/guides/auth-twilio/6.png)
Now go to the Auth > Settings page in the Supabase dashboard (https://app.supabase.com/project/YOUR-PROJECT-REF/auth/settings).
Now go to the Auth > Settings page in the Supabase dashboard (https://supabase.com/dashboard/project/YOUR-PROJECT-REF/auth/settings).
You should see an option to enable Phone Signup:
@@ -86,7 +86,7 @@ Now the backend should be setup, we can proceed to add our client-side code!
The SMS message sent to a phone containing an OTP code can be customized. This is useful if you need to mention a brand name or display a website address.
Go to Auth > Templates page in the Supabase dashboard (https://app.supabase.com/project/YOUR-PROJECT-REF/auth/templates).
Go to Auth > Templates page in the Supabase dashboard (https://supabase.com/dashboard/project/YOUR-PROJECT-REF/auth/templates).
Use the variable `.Code` in the template to display the OTP code. Here's an example in the SMS template.
@@ -350,7 +350,7 @@ let { data, error } = await supabase.auth.verifyOtp({
## Resources
- [Twilio Signup](https://www.twilio.com/try-twilio)
- [Supabase Dashboard](https://app.supabase.com)
- [Supabase Dashboard](https://supabase.com/dashboard)
- [Supabase Row Level Security](/docs/guides/auth#row-level-security)
export const Page = ({ children }) => <Layout meta={meta} children={children} />
@@ -24,7 +24,7 @@ We'll cover:
What you'll need:
- A Vonage account (sign up here: https://dashboard.nexmo.com/sign-up)
- A Supabase project (create one here: https://app.supabase.com)
- A Supabase project (create one here: https://supabase.com/dashboard)
- A mobile phone capable of receiving SMS
## Steps
@@ -49,7 +49,7 @@ Select the country you want a number for. You will need a mobile phone number wi
### Configure Supabase
Now go to the Auth > Settings page in the Supabase dashboard (https://app.supabase.com/project/YOUR-PROJECT-REF/auth/settings).
Now go to the Auth > Settings page in the Supabase dashboard (https://supabase.com/dashboard/project/YOUR-PROJECT-REF/auth/settings).
You should see an option to enable Phone Signup.
@@ -61,7 +61,7 @@ Now the backend should be setup, we can proceed to add our client-side code!
The SMS message sent to a phone containing an OTP code can be customized. This is useful if you need to mention a brand name or display a website address.
Go to Auth > Templates page in the Supabase dashboard (https://app.supabase.com/project/YOUR-PROJECT-REF/auth/templates).
Go to Auth > Templates page in the Supabase dashboard (https://supabase.com/dashboard/project/YOUR-PROJECT-REF/auth/templates).
Use the variable `.Code` in the template to display the code.
@@ -269,7 +269,7 @@ The user does not have a password therefore will need to sign in via this method
## Resources
- [Vonage Signup](https://dashboard.nexmo.com/sign-up)
- [Supabase Dashboard](https://app.supabase.com)
- [Supabase Dashboard](https://supabase.com/dashboard)
- [Supabase Row Level Security](/docs/guides/auth#row-level-security)
export const Page = ({ children }) => <Layout meta={meta} children={children} />
@@ -12,9 +12,9 @@ export const meta = {
<StepHikeCompact.Step step={1}>
<StepHikeCompact.Details title="Create a new Supabase project">
[Launch a new project](https://app.supabase.com) in the Supabase Dashboard.
[Launch a new project](https://supabase.com/dashboard) in the Supabase Dashboard.
Your new database has a table for storing your users. You can see that this table is currently empty by running some SQL in the [SQL Editor](https://app.supabase.com/project/_/sql).
Your new database has a table for storing your users. You can see that this table is currently empty by running some SQL in the [SQL Editor](https://supabase.com/dashboard/project/_/sql).
</StepHikeCompact.Details>
@@ -52,7 +52,7 @@ export const meta = {
<StepHikeCompact.Step step={3}>
<StepHikeCompact.Details title="Declare Supabase Environment Variables">
Rename `.env.local.example` to `.env.local` and populate with [your project's URL and Anon Key](https://app.supabase.com/project/_/settings/api).
Rename `.env.local.example` to `.env.local` and populate with [your project's URL and Anon Key](https://supabase.com/dashboard/project/_/settings/api).
</StepHikeCompact.Details>
@@ -12,9 +12,9 @@ export const meta = {
<StepHikeCompact.Step step={1}>
<StepHikeCompact.Details title="Create a new Supabase project">
[Launch a new project](https://app.supabase.com) in the Supabase Dashboard.
[Launch a new project](https://supabase.com/dashboard) in the Supabase Dashboard.
Your new database has a table for storing your users. You can see that this table is currently empty by running some SQL in the [SQL Editor](https://app.supabase.com/project/_/sql).
Your new database has a table for storing your users. You can see that this table is currently empty by running some SQL in the [SQL Editor](https://supabase.com/dashboard/project/_/sql).
</StepHikeCompact.Details>
@@ -68,7 +68,7 @@ export const meta = {
<StepHikeCompact.Step step={4}>
<StepHikeCompact.Details title="Set up your login component">
In `index.js`, create a Supabase client using your [Project URL and public API (anon) key](https://app.supabase.com/project/_/settings/api).
In `index.js`, create a Supabase client using your [Project URL and public API (anon) key](https://supabase.com/dashboard/project/_/settings/api).
You can configure the Auth component to display whenever there is no session inside `supabase.auth.getSession()`
@@ -317,7 +317,7 @@ Initializing a client with a Service Key will not override RLS if a user token i
### Testing policies
To test policies on the database itself (i.e., from the [SQL Editor](https://app.supabase.com/project/_/sql) or from `psql`) without switching to your frontend and logging in as different users, you can utilize the following helper SQL procedures ([credits](https://github.com/supabase/supabase/issues/7311#issuecomment-1398648114)):
To test policies on the database itself (i.e., from the [SQL Editor](https://supabase.com/dashboard/project/_/sql) or from `psql`) without switching to your frontend and logging in as different users, you can utilize the following helper SQL procedures ([credits](https://github.com/supabase/supabase/issues/7311#issuecomment-1398648114)):
```sql
grant anon, authenticated to postgres;
@@ -36,7 +36,7 @@ Upon successful verification of the identity of the user, the Supabase Auth serv
<Admonition type="tip">
You can configure [redirects URLs](https://app.supabase.com/project/_/auth/url-configuration) in the Supabase Dashboard. You can use [wildcard match patterns](/docs/guides/auth#redirect-urls-and-wildcards) like `*` and `**` to allow redirects to different forms of URLs.
You can configure [redirects URLs](https://supabase.com/dashboard/project/_/auth/url-configuration) in the Supabase Dashboard. You can use [wildcard match patterns](/docs/guides/auth#redirect-urls-and-wildcards) like `*` and `**` to allow redirects to different forms of URLs.
</Admonition>
@@ -40,7 +40,7 @@ supabase.auth.signInWithOAuth({
This call takes the user to Apple's consent screen. Once the flow ends, the user's profile information is exchanged and validated with Supabase Auth before it redirects back to your web application with an access and refresh token representing the user's session.
### Configuration
### Configuration [#configuration-web]
You will require the following information:
@@ -113,7 +113,7 @@ Please take a look at these open-source projects which may help you obtain an ID
For apps written in Swift, please consult the [community maintained library](/docs/reference/swift/introduction).
### Configuration
### Configuration [#configuration-native-app]
Native sign in requires less configuration steps than OAuth flow. You will need to perform these steps:
@@ -155,7 +155,7 @@ document.addEventListener('AppleIDSignInOnSuccess', async (event) => {
Please make sure you request for the scope `name email` when initializing the library.
### Configuration
### Configuration [#configuration-apple-js]
To use Sign in with Apple JS you need to configure these options:
@@ -13,7 +13,7 @@ To enable Bitbucket Auth for your project, you need to set up a BitBucket OAuth
Setting up Bitbucket logins for your application consists of 3 parts:
- Create and configure a Bitbucket OAuth Consumer on [Bitbucket](https://bitbucket.org)
- Add your Bitbucket OAuth Consumer keys to your [Supabase Project](https://app.supabase.com)
- Add your Bitbucket OAuth Consumer keys to your [Supabase Project](https://supabase.com/dashboard)
- Add the login code to your [Supabase JS Client App](https://github.com/supabase/supabase-js)
## Access your Bitbucket account
@@ -13,7 +13,7 @@ To enable Discord Auth for your project, you need to set up a Discord Applicatio
Setting up Discord logins for your application consists of 3 parts:
- Create and configure a Discord Application [Discord Developer Portal](https://discord.com/developers)
- Add your Discord OAuth Consumer keys to your [Supabase Project](https://app.supabase.com)
- Add your Discord OAuth Consumer keys to your [Supabase Project](https://supabase.com/dashboard)
- Add the login code to your [Supabase JS Client App](https://github.com/supabase/supabase-js)
## Access your Discord account
@@ -13,7 +13,7 @@ To enable Facebook Auth for your project, you need to set up a Facebook OAuth ap
Setting up Facebook logins for your application consists of 3 parts:
- Create and configure a Facebook Application on the [Facebook Developers Site](https://developers.facebook.com)
- Add your Facebook keys to your [Supabase Project](https://app.supabase.com)
- Add your Facebook keys to your [Supabase Project](https://supabase.com/dashboard)
- Add the login code to your [Supabase JS Client App](https://github.com/supabase/supabase-js)
## Access your Facebook Developer account
@@ -13,7 +13,7 @@ To enable GitHub Auth for your project, you need to set up a GitHub OAuth applic
Setting up GitHub logins for your application consists of 3 parts:
- Create and configure a GitHub OAuth App on [GitHub](https://github.com)
- Add your GitHub OAuth keys to your [Supabase Project](https://app.supabase.com)
- Add your GitHub OAuth keys to your [Supabase Project](https://supabase.com/dashboard)
- Add the login code to your [Supabase JS Client App](https://github.com/supabase/supabase-js)
## Access your GitHub account
@@ -13,7 +13,7 @@ To enable GitLab Auth for your project, you need to set up a GitLab OAuth applic
Setting up GitLab logins for your application consists of 3 parts:
- Create and configure a GitLab Application on [GitLab](https://gitlab.com)
- Add your GitLab Application keys to your [Supabase Project](https://app.supabase.com)
- Add your GitLab Application keys to your [Supabase Project](https://supabase.com/dashboard)
- Add the login code to your [Supabase JS Client App](https://github.com/supabase/supabase-js)
## Access your GitLab account
@@ -37,7 +37,7 @@ supabase.auth.signInWithOAuth({
})
```
This call takes the user to Google's consent screen. When the flow ends, the user's profile information is exchanegd and validated with Supabase Auth before it redirects back to your web application with an access and refresh token representing the user's session.
This call takes the user to Google's consent screen. When the flow ends, the user's profile information is exchanged and validated with Supabase Auth before it redirects back to your web application with an access and refresh token representing the user's session.
You can additionally extract the `provider_token` from the session (on initial login only) which is the OAuth 2.0 access token issued by Google that grants your application access to the Google services for the authenticated users. Please store this token in local storage, cookies or in your database or server.
@@ -55,7 +55,7 @@ const { data, error } = await supabase.auth.signInWithOAuth({
})
```
### Configuration
### Configuration [#configuration-web]
To use the OAuth 2.0 flow, you will require the following information:
@@ -95,7 +95,7 @@ const discoveryUrl =
final appAuth = FlutterAppAuth();
// authorize the user by opening the concent page
// authorize the user by opening the consent page
final result = await appAuth.authorize(
AuthorizationRequest(
clientId,
@@ -159,7 +159,7 @@ Please take a look at these open-source projects which may help you obtain an ID
For apps written in Kotlin, please consult the [community maintained library](/docs/reference/kotlin/introduction).
### Configuration
### Configuration [#configuration-native-app]
1. Configure OAuth credentials for your Google Cloud project in the [Credentials](https://console.cloud.google.com/apis/credentials) page of the console. When creating a new OAuth client ID, choose _Android_ or _iOS_ depending on the mobile operating system your app is built for.
@@ -222,7 +222,7 @@ chrome.identity.launchWebAuthFlow(
)
```
### Configuration
### Configuration [#configuration-chrome-extension]
You will need to configure a client ID for your Chrome extension:
@@ -278,13 +278,13 @@ async function handleSignInWithGoogle(response) {
Use of nonce is recommended, though optional. Make sure each nonce is generated randomly and available both in the `data-nonce` attribute as well as in the `handleSignInWithGoogle` callback function; otherwise the ID token will not be accepted.
### Configuration
### Configuration [#configuration-personalized-sign-in-button]
1. Obtain OAuth credentials for your Google Cloud project in the [Credentials](https://console.developers.google.com/apis/credentials) page of the console. When creating a new credential, choose _Web application_. As you're using the Google sign in button, you should configure the _Authorized JavaScript origins_ and _Authorized redirect URIs_ to the website where the buttons appear. You should not use your Supabase project domain name. For this use case, the client secret provided is not needed and can be ignored.
2. Configure the [OAuth Consent Screen](https://console.cloud.google.com/apis/credentials/consent). This information is shown to the user when giving consent to your app. In particular, make sure you have set up links to your app's privacy policy and terms of service.
3. Finally, add the client ID from step 1 in the [Google provider on the Supabase Dashboard](https://supabase.com/dashboard/project/_/auth/providers) under _Authorized Client IDs_.
Note that you do not have to configure the OAuth flow client ID and secret in the Supabae Dashboard when using this approach!
Note that you do not have to configure the OAuth flow client ID and secret in the Supabase Dashboard when using this approach!
export const Page = ({ children }) => <Layout meta={meta} children={children} />
@@ -0,0 +1,97 @@
import Layout from '~/layouts/DefaultGuideLayout'
export const meta = {
id: 'auth-kakao',
title: 'Login with Kakao',
description: 'Add Kakao OAuth to your Supabase project',
}
To enable Kakao Auth for your project, you need to set up an Kakao OAuth application and add the application credentials to your Supabase Dashboard.
## Overview
Kakao OAuth consists of six broad steps:
- Create and configure your app in the [Kakao Developer Portal](https://developers.kakao.com).
- Obtaining a `REST API key` - this will serve as the `client_id`.
- Generating the `Client secret code` - this will serve as the `client_secret`.
- Additional configurations on Kakao Developers Portal.
- Add your `client id` and `client secret` keys to your [Supabase Project](https://supabase.com/dashboard).
- Add the login code to your [Supabase JS Client App](https://github.com/supabase/supabase-js).
## Access your Kakao Developer account
- Go to [Kakao Developers Portal](https://developers.kakao.com).
- Click on `Login` at the top right to log in.
![Kakao Developers Portal.](/docs/img/guides/auth-kakao/kakao-developers-page.png)
## Create and configure your app
- Go to `My Application`.
- Click on `Add an application` at the top.
- Fill out your app information:
- App icon.
- App name.
- Company name.
- Click `Save` at the bottom right.
## Obtain a REST API key
This will serve as the `client_id` when you make API calls to authenticate the user.
- Go to `My Application`.
- Click on your app.
- You will be redirected to `Summary` tab of your app.
- In the `App Keys` section you will see `REST API key` -- this ID will become your `client_id` later.
## Find your callback URL
<SocialProviderSetup provider="Kakao" />- To add callback URL on Kakao, go to `Product settings` >
`Kakao Login` > `Redirect URI`.
## Generate and activate a `client_secret`
- Go to `Product settings` > `Kakao Login` > `Security`.
- Click on the `Kakao Login` switch to enable Kakao Login.
- Click on `generate code` at the bottom to generate the `Client secret code` -- this will serve as a `client_secret` for your supabase project.
- Make sure you enabled `Client sercet code` by selecting `enable` from the `Activation state` section.
## Additional configurations on Kakao Developers Portal
- Make sure the Kakao Login is enabled in the `Kakao Login` tab.
- Set following scopes under the "Consent Items": account_email, profile_image, profile_nickname
![Consent items needs to be set.](/docs/img/guides/auth-kakao/kakao-developers-consent-items-set.png)
## Add your OAuth credentials to Supabase
<SocialProviderSettingsSupabase provider="Kakao" />
## Add login code to your client app
When your user signs in, call [signInWithOAuth()](/docs/reference/javascript/auth-signinwithoauth) with `kakao` as the `provider`:
```js
async function signInWithKakao() {
const { data, error } = await supabase.auth.signInWithOAuth({
provider: 'kakao',
})
}
```
When your user signs out, call [signOut()](/docs/reference/javascript/auth-signout) to remove them from the browser session and any objects from localStorage:
```js
async function signout() {
const { error } = await supabase.auth.signOut()
}
```
## Resources
- [Kakao Developers Portal](https://developers.kakao.com).
export const Page = ({ children }) => <Layout meta={meta} children={children} />
export default Page
@@ -13,7 +13,7 @@ To enable LinkedIn Auth for your project, you need to set up a LinkedIn OAuth ap
Setting up LinkedIn logins for your application consists of 3 parts:
- Create and configure a LinkedIn Project and App on the [LinkedIn Developer Dashboard](https://www.linkedin.com/developers/apps).
- Add your LinkedIn `client_id` and `client_secret` to your [Supabase Project](https://app.supabase.com).
- Add your LinkedIn `client_id` and `client_secret` to your [Supabase Project](https://supabase.com/dashboard).
- Add the login code to your [Supabase JS Client App](https://github.com/supabase/supabase-js).
## Access your LinkedIn Developer account
@@ -13,7 +13,7 @@ To enable Notion Auth for your project, you need to set up a Notion Application
Setting up Notion logins for your application consists of 3 parts:
- Create and configure a Notion Application [Notion Developer Portal](https://www.notion.so/my-integrations)
- Retrieve your OAuth client ID and OAuth client secret and add them to your [Supabase Project](https://app.supabase.com)
- Retrieve your OAuth client ID and OAuth client secret and add them to your [Supabase Project](https://supabase.com/dashboard)
- Add the login code to your [Supabase JS Client App](https://github.com/supabase/supabase-js)
## Create your notion integration
@@ -13,7 +13,7 @@ To enable Slack Auth for your project, you need to set up a Slack OAuth applicat
Setting up Slack logins for your application consists of 3 parts:
- Create and configure a Slack Project and App on the [Slack Developer Dashboard](https://api.slack.com/apps).
- Add your Slack `API Key` and `API Secret Key` to your [Supabase Project](https://app.supabase.com).
- Add your Slack `API Key` and `API Secret Key` to your [Supabase Project](https://supabase.com/dashboard).
- Add the login code to your [Supabase JS Client App](https://github.com/supabase/supabase-js).
## Access your Slack Developer account
@@ -13,7 +13,7 @@ To enable Spotify Auth for your project, you need to set up a Spotify OAuth appl
Setting up Spotify logins for your application consists of 3 parts:
- Create and configure a Spotify Project and App on the [Spotify Developer Dashboard](https://developer.spotify.com/dashboard/).
- Add your Spotify `API Key` and `API Secret Key` to your [Supabase Project](https://app.supabase.com).
- Add your Spotify `API Key` and `API Secret Key` to your [Supabase Project](https://supabase.com/dashboard).
- Add the login code to your [Supabase JS Client App](https://github.com/supabase/supabase-js).
## Access your Spotify Developer account
@@ -13,7 +13,7 @@ To enable Twitch Auth for your project, you need to set up a Twitch Application
Setting up Twitch logins for your application consists of 3 parts:
- Create and configure a Twitch Application [Twitch Developer Console](https://dev.twitch.tv/console)
- Add your Twitch OAuth Consumer keys to your [Supabase Project](https://app.supabase.com)
- Add your Twitch OAuth Consumer keys to your [Supabase Project](https://supabase.com/dashboard)
- Add the login code to your [Supabase JS Client App](https://github.com/supabase/supabase-js)
## Access your Twitch Developer account
@@ -13,7 +13,7 @@ To enable Twitter Auth for your project, you need to set up a Twitter OAuth appl
Setting up Twitter logins for your application consists of 3 parts:
- Create and configure a Twitter Project and App on the [Twitter Developer Dashboard](https://developer.twitter.com/en/portal/dashboard).
- Add your Twitter `API Key` and `API Secret Key` to your [Supabase Project](https://app.supabase.com).
- Add your Twitter `API Key` and `API Secret Key` to your [Supabase Project](https://supabase.com/dashboard).
- Add the login code to your [Supabase JS Client App](https://github.com/supabase/supabase-js).
## Access your Twitter Developer account
@@ -13,7 +13,7 @@ To enable Zoom Auth for your project, you need to set up a Zoom OAuth applicatio
Setting up Zoom logins for your application consists of 3 parts:
- Create and configure a Zoom OAuth App on [Zoom App Marketplace](https://marketplace.zoom.us/)
- Add your Zoom OAuth keys to your [Supabase Project](https://app.supabase.com)
- Add your Zoom OAuth keys to your [Supabase Project](https://supabase.com/dashboard)
- Add the login code to your [Supabase JS Client App](https://github.com/supabase/supabase-js)
## Access your Zoom Developer account
@@ -7,6 +7,11 @@ export const meta = {
video: 'https://www.youtube.com/v/em1cpOAXknM',
}
<Admonition>
Looking for guides on how to use Single Sign-On with the Supabase dashboard? Head on over to
[Enable SSO for Your Organization](/docs/guides/platform/sso).
</Admonition>
Supabase Auth supports enterprise-level Single Sign-On (SSO) for any identity providers compatible with the using the SAML 2.0 protocol. This is a non-exclusive list of supported identity providers:
- Google Workspaces (formerly known as GSuite)
@@ -15,7 +20,7 @@ Supabase Auth supports enterprise-level Single Sign-On (SSO) for any identity pr
- PingIdentity
- OneLogin
If you're having issues with identity provider software not on this list, please [open a support ticket](https://app.supabase.com/support/new).
If you're having issues with identity provider software not on this list, please [open a support ticket](https://supabase.com/dashboard/support/new).
## Prerequisites
@@ -23,7 +28,7 @@ This guide requires the use of the [Supabase CLI](/docs/guides/cli). Please make
You can use the `supabase sso` [subcommands](/docs/reference/cli/supabase-sso) to manage your project's configuration.
SAML 2.0 support is disabled by default on Supabase projects. You can configure this on the [Auth Providers](https://app.supabase.com/project/_/auth/providers) page on your project.
SAML 2.0 support is disabled by default on Supabase projects. You can configure this on the [Auth Providers](https://supabase.com/dashboard/project/_/auth/providers) page on your project.
Please note that SAML 2.0 support is offered on plans Pro and above. Check the [Pricing](https://supabase.com/pricing) page for more information.
@@ -130,7 +135,7 @@ CREATE POLICY "View organization settings."
## Managing SAML 2.0 connections
Once you've enabled SAML 2.0 support on your project via the [Auth Providers](https://app.supabase.com/project/_/auth/providers) page in the dashboard, you can use the [Supabase CLI](/docs/reference/cli/supabase-sso) to add, update, remove and view information about identity providers.
Once you've enabled SAML 2.0 support on your project via the [Auth Providers](https://supabase.com/dashboard/project/_/auth/providers) page in the dashboard, you can use the [Supabase CLI](/docs/reference/cli/supabase-sso) to add, update, remove and view information about identity providers.
### Add a connection
@@ -287,7 +292,7 @@ supabase sso remove <provider-id> --project-ref <your-project>
If successful, the details of the removed identity provider will be shown. All user accounts from that identity provider will be immediately logged out. User information will remain in the system, but it will no longer be possible for any of those accounts to be accessed in the future, even if you add the connection again.
If you need to reassign those user accounts to another identity provider, please [open a support ticket](https://app.supabase.com/support/new).
If you need to reassign those user accounts to another identity provider, please [open a support ticket](https://supabase.com/dashboard/support/new).
A [list of all](/docs/reference/cli/supabase-sso-list) registered identity providers can be displayed by running:
@@ -364,7 +369,7 @@ Should you run into this problem, it is most likely a misconfiguration issue **o
At this time it is not possible to extract the RSA private key used by your project's Supabase Auth server. This is done to keep the private key as secure as possible, given that SAML does not offer an easy way to rotate keys without disrupting service. (Please use a SAML 2.0 Metadata URL whenever possible for this reason!)
If you really need access to the key, please [open a support ticket](https://app.supabase.com/support/new) and we'll try to support you as best as possible.
If you really need access to the key, please [open a support ticket](https://supabase.com/dashboard/support/new) and we'll try to support you as best as possible.
export const Page = ({ children }) => <Layout meta={meta} children={children} />
+7
View File
@@ -114,6 +114,13 @@ brew upgrade supabase
</TabPanel>
</Tabs>
If you have any Supabase containers running locally, remember to restart them after upgrading to use the new features.
```bash
npx supabase stop --no-backup
npx supabase start
```
## See also
- [Supabase CLI Reference](/docs/reference/cli/introduction)
@@ -23,7 +23,7 @@ Make sure you have these installed on your local machine:
To get started:
- Create a [Supabase project](https://app.supabase.com) or use an existing one
- Create a [Supabase project](https://supabase.com/dashboard) or use an existing one
- Initialize a local Git repository
<div className="video-container">
@@ -53,7 +53,7 @@ supabase link --project-ref $PROJECT_ID
You can get your `$PROJECT_ID` from your project's dashboard URL:
```
https://app.supabase.com/project/<project-id>
https://supabase.com/dashboard/project/<project-id>
```
If you're using an existing Supabase project, you might have made schema changes through the Dashboard.
@@ -196,6 +196,7 @@ The Supabase CLI requires a few environment variables to run in non-interactive
- `SUPABASE_ACCESS_TOKEN` is your personal access token
- `SUPABASE_DB_PASSWORD` is your project specific database password
- `SUPABASE_PROJECT_ID` is your project specific reference string
We recommend adding these as [encrypted secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets) to your GitHub Actions runners.
@@ -218,19 +219,22 @@ on:
jobs:
test:
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: supabase/setup-cli@v1
with:
version: latest
- name: Start Supabase local development setup
run: supabase start
- name: Verify generated types are up-to-date
- name: Verify generated types are checked in
run: |
supabase gen types typescript --local > types.ts
if [ "$(git diff --ignore-space-at-eol types.ts | wc -l)" -gt "0" ]; then
supabase gen types typescript --local > types.gen.ts
if ! git diff --ignore-space-at-eol --exit-code --quiet types.gen.ts; then
echo "Detected uncommitted changes after build. See status below:"
git diff
exit 1
@@ -251,21 +255,22 @@ on:
jobs:
deploy:
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
env:
SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }}
SUPABASE_DB_PASSWORD: ${{ secrets.STAGING_DB_PASSWORD }}
STAGING_PROJECT_ID: abcdefghijklmnopqrst
SUPABASE_PROJECT_ID: ${{ secrets.STAGING_PROJECT_ID }}
steps:
- uses: actions/checkout@v3
- uses: supabase/setup-cli@v1
with:
version: latest
- run: |
supabase link --project-ref $STAGING_PROJECT_ID
supabase db push
- run: supabase link --project-ref $SUPABASE_PROJECT_ID
- run: supabase db push
```
</TabPanel>
@@ -282,21 +287,22 @@ on:
jobs:
deploy:
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
env:
SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }}
SUPABASE_DB_PASSWORD: ${{ secrets.PRODUCTION_DB_PASSWORD }}
PRODUCTION_PROJECT_ID: abcdefghijklmnopqrst
SUPABASE_PROJECT_ID: ${{ secrets.PRODUCTION_PROJECT_ID }}
steps:
- uses: actions/checkout@v3
- uses: supabase/setup-cli@v1
with:
version: latest
- run: |
supabase link --project-ref $PRODUCTION_PROJECT_ID
supabase db push
- run: supabase link --project-ref $SUPABASE_PROJECT_ID
- run: supabase db push
```
</TabPanel>
+1 -1
View File
@@ -98,7 +98,7 @@ Read about resetting your database password [here](/docs/guides/database/managin
## Next steps
- Read more about [Postgres](https://www.postgresql.org/about/)
- Sign in: [app.supabase.com](https://app.supabase.com)
- Sign in: [supabase.com/dashboard](https://supabase.com/dashboard)
export const Page = ({ children }) => <Layout meta={meta} children={children} />
+3 -3
View File
@@ -20,7 +20,7 @@ Create a test table with a text array (an array of strings):
>
<TabPanel id="dashboard" label="Dashboard">
1. Go to the [Table editor](https://app.supabase.com/project/_/editor) page in the Dashboard.
1. Go to the [Table editor](https://supabase.com/dashboard/project/_/editor) page in the Dashboard.
1. Click **New Table** and create a table with the name `arraytest`.
1. Click **Save**.
1. Click **New Column** and create a column with the name `textarray`, type `text`, and select **Define as array**.
@@ -49,7 +49,7 @@ create table arraytest (
>
<TabPanel id="dashboard" label="Dashboard">
1. Go to the [Table editor](https://app.supabase.com/project/_/editor) page in the Dashboard.
1. Go to the [Table editor](https://supabase.com/dashboard/project/_/editor) page in the Dashboard.
1. Select the `arraytest` table.
1. Click **Insert row** and add `["Harry", "Larry", "Moe"]`.
1. Click **Save.**
@@ -85,7 +85,7 @@ const { data, error } = await supabase
>
<TabPanel id="dashboard" label="Dashboard">
1. Go to the [Table editor](https://app.supabase.com/project/_/editor) page in the Dashboard.
1. Go to the [Table editor](https://supabase.com/dashboard/project/_/editor) page in the Dashboard.
1. Select the `arraytest` table.
You should see:
@@ -23,7 +23,7 @@ Supabase provides auto-updating [APIs](/docs/guides/database/api). This is the e
## Direct connections
Every Supabase project provides a full Postgres database. You can connect to the database using [any tool which supports Postgres](#integrations). You can find the connection string in the [Database settings](https://app.supabase.com/project/_/settings/database) inside the dashboard:
Every Supabase project provides a full Postgres database. You can connect to the database using [any tool which supports Postgres](#integrations). You can find the connection string in the [Database settings](https://supabase.com/dashboard/project/_/settings/database) inside the dashboard:
1. Go to the `Settings` section.
2. Click `Database`.
@@ -38,7 +38,7 @@ Every Supabase project provides a full Postgres database. You can connect to the
## Connection Pooler
Every Supabase project comes with PgBouncer for connection pooling. A connection pooler is useful for managing a large number of _temporary_ connections. For example, if you are using [Prisma](/docs/guides/integrations/prisma), Drizzle, Kysely, or anything deployed to a Serverless environment (AWS Lambdas or Edge Functions). You can find the connection pool config in the [Database settings](https://app.supabase.com/project/_/settings/database) inside the dashboard:
Every Supabase project comes with PgBouncer for connection pooling. A connection pooler is useful for managing a large number of _temporary_ connections. For example, if you are using [Prisma](/docs/guides/integrations/prisma), Drizzle, Kysely, or anything deployed to a Serverless environment (AWS Lambdas or Edge Functions). You can find the connection pool config in the [Database settings](https://supabase.com/dashboard/project/_/settings/database) inside the dashboard:
1. Go to the `Settings` section.
2. Click `Database`.
@@ -19,7 +19,7 @@ Supabase has pre-installed some of the most useful open source extensions.
>
<TabPanel id="dashboard" label="Dashboard">
1. Go to the [Database](https://app.supabase.com/project/_/database/tables) page in the Dashboard.
1. Go to the [Database](https://supabase.com/dashboard/project/_/database/tables) page in the Dashboard.
2. Click **Extensions** in the sidebar.
3. Enable or disable an extension.
@@ -45,7 +45,7 @@ You can use the `http` extension to make these network requests from Postgres.
>
<TabPanel id="dashboard" label="Dashboard">
1. Go to the [Database](https://app.supabase.com/project/_/database/tables) page in the Dashboard.
1. Go to the [Database](https://supabase.com/dashboard/project/_/database/tables) page in the Dashboard.
2. Click on **Extensions** in the sidebar.
3. Search for "http" and enable the extension.
@@ -20,7 +20,7 @@ The motivation for HypoPG is to allow users to quickly search for an index to im
>
<TabPanel id="dashboard" label="Dashboard">
1. Go to the [Database](https://app.supabase.com/project/_/database/tables) page in the Dashboard.
1. Go to the [Database](https://supabase.com/dashboard/project/_/database/tables) page in the Dashboard.
2. Click on **Extensions** in the sidebar.
3. Search for "hypopg" and enable the extension.
@@ -1,7 +1,7 @@
import Layout from '~/layouts/DefaultGuideLayout'
export const meta = {
id: 'pgcron',
id: 'pg_cron',
title: 'pg_cron: Job Scheduling',
description:
'pgnet: a simple cron-based job scheduler for PostgreSQL that runs inside the database.',
@@ -21,7 +21,7 @@ The `pg_cron` extension is a simple cron-based job scheduler for PostgreSQL that
>
<TabPanel id="dashboard" label="Dashboard">
1. Go to the [Database](https://app.supabase.com/project/_/database/tables) page in the Dashboard.
1. Go to the [Database](https://supabase.com/dashboard/project/_/database/tables) page in the Dashboard.
2. Click on **Extensions** in the sidebar.
3. Search for "pg_cron" and enable the extension.
@@ -24,7 +24,7 @@ For more information about how the SQL schema is reflected into a GraphQL schema
>
<TabPanel id="dashboard" label="Dashboard">
1. Go to the [Database](https://app.supabase.com/project/_/database/tables) page in the Dashboard.
1. Go to the [Database](https://supabase.com/dashboard/project/_/database/tables) page in the Dashboard.
2. Click on **Extensions** in the sidebar.
3. Search for "pg_graphql" and enable the extension.
@@ -18,7 +18,7 @@ export const meta = {
>
<TabPanel id="dashboard" label="Dashboard">
1. Go to the [Database](https://app.supabase.com/project/_/database/tables) page in the Dashboard.
1. Go to the [Database](https://supabase.com/dashboard/project/_/database/tables) page in the Dashboard.
2. Click on **Extensions** in the sidebar.
3. Search for "pg_hashids" and enable the extension.
@@ -18,7 +18,7 @@ export const meta = {
>
<TabPanel id="dashboard" label="Dashboard">
1. Go to the [Database](https://app.supabase.com/project/_/database/tables) page in the Dashboard.
1. Go to the [Database](https://supabase.com/dashboard/project/_/database/tables) page in the Dashboard.
2. Click on **Extensions** in the sidebar.
3. Search for "pg_jsonschema" and enable the extension.
@@ -1,7 +1,7 @@
import Layout from '~/layouts/DefaultGuideLayout'
export const meta = {
id: 'pgnet',
id: 'pg_net',
title: 'pg_net: Async Networking',
description: 'pg_net: an async networking extension for PostgreSQL.',
}
@@ -26,7 +26,7 @@ It differs from the `http` extension in that it is asynchronous by default. This
>
<TabPanel id="dashboard" label="Dashboard">
1. Go to the [Database](https://app.supabase.com/project/_/database/tables) page in the Dashboard.
1. Go to the [Database](https://supabase.com/dashboard/project/_/database/tables) page in the Dashboard.
2. Click on **Extensions** in the sidebar.
3. Search for "pg_net" and enable the extension.
@@ -1,6 +1,7 @@
import Layout from '~/layouts/DefaultGuideLayout'
export const meta = {
id: 'pg_repack',
title: 'pg_repack: Physical storage optimization and maintenance',
description:
'A tool to remove bloat from tables and indexes and optimize physical data order and physical storage',
@@ -35,7 +36,7 @@ Get started with pg_repack by enabling the extension in the Supabase Dashboard.
>
<TabPanel id="dashboard" label="Dashboard">
1. Go to the [Database](https://app.supabase.com/project/_/database/tables) page in the Dashboard.
1. Go to the [Database](https://supabase.com/dashboard/project/_/database/tables) page in the Dashboard.
2. Click on **Extensions** in the sidebar.
3. Search for "pg_repack" and enable the extension.
@@ -24,7 +24,7 @@ For more information on query optimization, check out the [query performance gui
>
<TabPanel id="dashboard" label="Dashboard">
1. Go to the [Database](https://app.supabase.com/project/_/database/tables) page in the Dashboard.
1. Go to the [Database](https://supabase.com/dashboard/project/_/database/tables) page in the Dashboard.
2. Click on **Extensions** in the sidebar.
3. Search for "pg_stat_monitor" and enable the extension.
@@ -34,7 +34,7 @@ For more information on query optimization, check out the [query performance gui
>
<TabPanel id="dashboard" label="Dashboard">
1. Go to the [Database](https://app.supabase.com/project/_/database/tables) page in the Dashboard.
1. Go to the [Database](https://supabase.com/dashboard/project/_/database/tables) page in the Dashboard.
2. Click on **Extensions** in the sidebar.
3. Search for "pg_stat_statements" and enable the extension.
@@ -20,7 +20,7 @@ PGAudit grants fine grain control over which statements and objects are emitted
>
<TabPanel id="dashboard" label="Dashboard">
1. Go to the [Database](https://app.supabase.com/project/_/database/tables) page in the Dashboard.
1. Go to the [Database](https://supabase.com/dashboard/project/_/database/tables) page in the Dashboard.
2. Click on **Extensions** in the sidebar.
3. Search for "pgaudit" and enable the extension.
@@ -18,7 +18,7 @@ The [pgjwt](https://github.com/michelp/pgjwt) (PostgreSQL JSON Web Token) extens
>
<TabPanel id="dashboard" label="Dashboard">
1. Go to the [Database](https://app.supabase.com/project/_/database/tables) page in the Dashboard.
1. Go to the [Database](https://supabase.com/dashboard/project/_/database/tables) page in the Dashboard.
2. Click on **Extensions** in the sidebar.
3. Search for "pgjwt" and enable the extension.
@@ -18,7 +18,7 @@ export const meta = {
>
<TabPanel id="dashboard" label="Dashboard">
1. Go to the [Database](https://app.supabase.com/project/_/database/tables) page in the Dashboard.
1. Go to the [Database](https://supabase.com/dashboard/project/_/database/tables) page in the Dashboard.
2. Click on **Extensions** in the sidebar.
3. Search for "pgroonga" and enable the extension.
@@ -100,6 +100,83 @@ The pgroonga index is used to retrive the result set:
| 2 | 'Groonga is a fast full text search engine that supports all languages.' |
```
## Full Text Search
The `&@~` operator performs full text search. It returns any matching results. Unlike `LIKE` operator, pgroonga can search any text that contains the keyword case insensitive.
Take the following example:
{/* prettier-ignore */}
```sql
select * from memos where content &@~ 'groonga';
```
And the result:
```markdown
id | content
----+------------------------------------------------------------------------
2 | Groonga is a fast full text search engine that supports all languages.
3 | PGroonga is a PostgreSQL extension that uses Groonga as index.
4 | There is groonga command.
(3 rows)
```
### Match all search words
To find all memos where content contains BOTH of the words `postgres` and `pgroonga`, we can just use space to separate each words:
{/* prettier-ignore */}
```sql
select * from memos where content &@~ 'postgres pgroonga';
```
And the result:
```markdown
id | content
----+----------------------------------------------------------------
3 | PGroonga is a PostgreSQL extension that uses Groonga as index.
(1 row)
```
### Match any search words
To find all memos where content contain ANY of the words `postgres` or `pgroonga`, use the upper case `OR`:
{/* prettier-ignore */}
```sql
select * from memos where content &@~ 'postgres OR pgroonga';
```
And the result:
```markdown
id | content
----+----------------------------------------------------------------
1 | PostgreSQL is a relational database management system.
3 | PGroonga is a PostgreSQL extension that uses Groonga as index.
(2 rows)
```
### Search that matches words with negation
To find all memos where content contain the word `postgres` but not `pgroonga`, use `-` symbol:
{/* prettier-ignore */}
```sql
select * from memos where content &@~ 'postgres -pgroonga';
```
And the result:
```markdown
id | content
----+--------------------------------------------------------
1 | PostgreSQL is a relational database management system.
(1 row)
```
## Resources
- Official [PGroonga documentation](https://pgroonga.github.io/tutorial/)
@@ -32,7 +32,7 @@ The core functionality of `pgRouting` is a set of path finding algorithms includ
>
<TabPanel id="dashboard" label="Dashboard">
1. Go to the [Database](https://app.supabase.com/project/_/database/tables) page in the Dashboard.
1. Go to the [Database](https://supabase.com/dashboard/project/_/database/tables) page in the Dashboard.
2. Click on **Extensions** in the sidebar.
3. Search for "pgrouting" and enable the extension.
@@ -63,7 +63,7 @@ It also enables some Postgres specific features including:
>
<TabPanel id="dashboard" label="Dashboard">
1. Go to the [Database](https://app.supabase.com/project/_/database/tables) page in the Dashboard.
1. Go to the [Database](https://supabase.com/dashboard/project/_/database/tables) page in the Dashboard.
2. Click on **Extensions** in the sidebar.
3. Search for "pgsodium" and enable the extension.
@@ -25,7 +25,7 @@ Let's cover some basic concepts:
>
<TabPanel id="dashboard" label="Dashboard">
1. Go to the [Database](https://app.supabase.com/project/_/database/tables) page in the Dashboard.
1. Go to the [Database](https://supabase.com/dashboard/project/_/database/tables) page in the Dashboard.
2. Click on **Extensions** in the sidebar.
3. Search for "pgtap" and enable the extension.
Loaded 100 of 1175 files, more files were not shown because too many files have changed in this diff. Show more