Merge pull request #9995 from supabase/master

Prod deploy Dashboard
This commit is contained in:
Joshen Lim authored and GitHub committed 2022-11-01 16:05:48 +07:00
commit ead80f150c
539 files changed
+37183 -29662

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
name: Automatically fix typos
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: master
- uses: sobolevn/misspell-fixer-action@master
- uses: peter-evans/create-pull-request@v2.4.4
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
with:
token: ${{ secrets.GITHUB_TOKEN }}
+1
View File
@@ -0,0 +1 @@
^./i18n
+2 -2
View File
@@ -163,7 +163,7 @@ Did you have an issue, like a merge conflict, or don't know how to open a pull r
### Add a redirect
Create a new entry in the [`next.config.js`](https://github.com/supabase/supabase/blob/master/apps/www/next.config.js) file in our main site.
Create a new entry in the [`redirects.js`](https://github.com/supabase/supabase/blob/master/apps/www/lib/redirects.js) file in our main site.
## Monorepo
@@ -183,7 +183,7 @@ Then edit and visit any of the following sites:
Site | Directory | Description | Local development server
---- | --------- | ----------- | ------------------------
[supabase.com](https://supabase.com) | `/apps/www` | The main website | http://localhost:3000
[supabase.com/docs](https://supabase.com/docs) | `apps/reference` | Guides and Reference documentaion | http://localhost:3010/docs
[supabase.com/docs](https://supabase.com/docs) | `apps/reference` | Guides and Reference documentation | http://localhost:3010/docs
[POC] Community forum | `/apps/temp-community-forum` | GitHub Discussions in a Next.js site | http://localhost:3002
[POC] DEV articles site | `/apps/temp-community-tutorials` | A Next.js site for our DEV articles (which community members can write) | http://localhost:3003
+1 -1
View File
@@ -15,7 +15,7 @@ import Process from '@site/docs/careers/_snippets/process.mdx'
We're looking for Graphic / Web Designers to join our team to help change the way developers build their applications.
You'll be primarily responsible for growing our marketing and brand collataral across the entire Supabase ecosystem.
You'll be primarily responsible for growing our marketing and brand collateral across the entire Supabase ecosystem.
You'll be an indispensable part of team, by working very closely with our sales, marketing, front end team, founders and backend engineers; you'll be directly contributing to brand decisions, building a team culture and co authoring internal processes for a growing team. We want to expand our marketing efforts rapidly throughout 2022 and want you to be at the centre of growing and nurturing our brand, while also nurturing new talent that come on board.
+1 -1
View File
@@ -690,7 +690,7 @@ div[class*=' codeBlockTitle'] {
font-size: 0.8rem !important;
border-color: #444;
}
.repsonse-header {
.response-header {
border-radius: 0 0 4px 4px;
}
File renamed without changes.
+58
View File
@@ -0,0 +1,58 @@
---
slug: /
sidebar_position: 1
sidebar_label: Realtime Server
---
# Supabase Realtime Server
Supabase Realtime is a server built with Elixir using the [Phoenix Framework](https://www.phoenixframework.org) that allows you to listen to changes in your PostgreSQL database via logical replication and then broadcast those changes via WebSockets.
There are two versions of this server: `Realtime` and `Realtime RLS`.
`Realtime` server works by:
1. listening to PostgreSQL's replication functionality (using PostgreSQL's logical decoding)
2. converting the byte stream into JSON
3. broadcasting to all connected clients over WebSockets
`Realtime RLS` server works by:
1. polling PostgreSQL's replication functionality (using PostgreSQL's logical decoding and [wal2json](https://github.com/eulerto/wal2json) output plugin)
2. passing database changes to a [Write Ahead Log Realtime Unified Security (WALRUS)](https://github.com/supabase/walrus) PostgresSQL function and receiving a list of authorized subscribers depending on Row Level Security (RLS) policies
3. converting the changes into JSON
4. broadcasting to authorized subscribers over WebSockets
### Why not just use PostgreSQL's `NOTIFY`?
A few reasons:
1. You don't have to set up triggers on every table.
2. `NOTIFY` has a payload limit of 8000 bytes and will fail for anything larger. The usual solution is to send an ID and then fetch the record, but that's heavy on the database.
3. `Realtime` server consumes two connections to the database, then you can connect many clients to this server. Easier on your database, and to scale up you just add additional `Realtime` servers.
### Benefits
1. The beauty of listening to the replication functionality is that you can make changes to your database from anywhere - your API, directly in the DB, via a console, etc. - and you will still receive the changes via WebSockets.
2. Decoupling. For example, if you want to send a new slack message every time someone makes a new purchase you might build that functionality directly into your API. This allows you to decouple your async functionality from your API.
3. This is built with Phoenix, an [extremely scalable Elixir framework](https://www.phoenixframework.org/blog/the-road-to-2-million-websocket-connections).
### Does this server guarantee delivery of every data change?
Not yet! Due to the following limitations:
1. Postgres database runs out of disk space due to Write-Ahead Logging (WAL) buildup, which can crash the database and prevent Realtime server from receiving and broadcasting changes. This can be mitigated in the Realtime RLS version of this server by setting the Postgres config `max_slot_wal_keep_size` to a reasonable size.
2. Realtime server can crash due to a larger replication lag than available memory, forcing the creation of a new replication slot and resetting replication to read from the latest WAL data.
3. When Realtime server falls too far behind for any reason, for example disconnecting from database as WAL continues to build up, then database can delete WAL segments the server still needs to read from, for example after reconnecting.
## Client libraries
- [JavaScript](https://github.com/supabase/realtime-js)
- [Dart](https://github.com/supabase/realtime-dart)
## Additional Links
- [Source Code](https://github.com/supabase/storage-api)
- [Known bugs and issues](https://github.com/supabase/storage-js/issues)
- [Storage Guides](https://supabase.com/docs/guides/storage)
- [OpenAPI Docs](https://supabase.github.io/storage-api/)
@@ -0,0 +1,7 @@
---
id: release-notes
---
# Release Notes
All release notes can be found in the [GitHub Releases](https://github.com/supabase/realtime/releases) page.
+4 -4
View File
@@ -106,7 +106,7 @@ interface Session {
### New Auth methods
We're removing the `signIn()` method in favor of more explicit function signatures:
`signInWithPassword()`, `signInWithPasswordless()`, and `signInWithOtp()`.
`signInWithPassword()`, `signInWithOtp()`, and `signInWithOtp()`.
```ts
// v2
@@ -149,7 +149,7 @@ supabaseClient
.subscribe()
```
We will deprecate the `.from().on().subscribe()` method previosuly used for listening to postgres changes.
We will deprecate the `.from().on().subscribe()` method previously used for listening to postgres changes.
### Deprecated setAuth()
@@ -170,8 +170,8 @@ Deprecated and removed `setAuth()` . To set a custom `access_token` jwt instead,
- client-level `throwOnError`
- `gotrue-js`
- `supabase-js` client allows passing a `storageKey` param which will allow the user to set the key used in local storage for storing the session. By default, this will be namespace-d with the supabase project ref. ([PR](https://github.com/supabase/supabase-js/pull/460))
- `signIn` method is now split into `signInWithPassword` , `signInWithPasswordless` , `signInWithOAuth` ([PR](https://github.com/supabase/gotrue-js/pull/304))
- Deprecated and removed `session()` , `user()` in favour of using `getSession()` instead. `getSession()` will always return a valid session if a user is already logged in, meaning no more random logouts. ([PR](https://github.com/supabase/gotrue-js/pull/299))
- `signIn` method is now split into `signInWithPassword` , `signInWithOtp` , `signInWithOAuth` ([PR](https://github.com/supabase/gotrue-js/pull/304))
- Deprecated and removed `session()` , `user()` in favor of using `getSession()` instead. `getSession()` will always return a valid session if a user is already logged in, meaning no more random logouts. ([PR](https://github.com/supabase/gotrue-js/pull/299))
- Deprecated and removed setting for `multitab` support because `getSession()` and gotrue’s reuse interval setting takes care of session management across multiple tabs ([PR](https://github.com/supabase/gotrue-js/pull/366))
- No more throwing of random errors, gotrue-js v2 always returns a custom error type: ([PR](https://github.com/supabase/gotrue-js/pull/341))
- `AuthSessionMissingError`
+1 -1
View File
@@ -1,6 +1,6 @@
---
id: api
title: Data APIs
title: Serverless APIs
description: Auto-generating and Realtime APIs.
sidebar_label: Overview
---
@@ -6,71 +6,62 @@ description: How to generate types for your API and Supabase libraries.
Supabase APIs are generated from your database, which means that we can use database introspection to generate type-safe API definitions.
### Generating types from OpenAPI specification
### Generating types using Supabase CLI
Supabase generates an OpenAPI specification file for your database which can be used to generate your data types for usage with TypeScript.
The Supabase CLI is a single binary Go application that provides everything you need to setup a local development environment.
The OpenAPI specification for your Supabase project can be accessed as follows:
```txt
https://your-project.supabase.co/rest/v1/?apikey=your-anon-key
```
Using the open source [openapi-typescript](https://github.com/drwpow/openapi-typescript#%EF%B8%8F-reading-specs-from-remote-resource) tool you can generate your types and store them locally:
You can [install the CLI](https://www.npmjs.com/package/supabase) via npm or other supported package managers. The minimum required version of the CLI is [v1.8.1](https://github.com/supabase/cli/releases).
```bash
npx openapi-typescript https://your-project.supabase.co/rest/v1/?apikey=your-anon-key --output types/supabase.ts
npm i supabase@">=1.8.1" --save-dev
```
Important notes:
Login with your Personal Access Token
- Since the generator uses JSON API, there is no way to determine if a column is an Array. It will generate array types as `string`, even though Supabase handles this automatically and returns arrays.
You can fix this manually in the files by changing the type, e.g. `names: string` -> `names: string[]`
- The types won't automatically stay in sync with your database, so make sure to regenerate your types after you make changes to your database.
```bash
npx supabase login
```
After you have generated your types, you can use them in your TypeScript projects:
Generate types for your project to produce the file `types/supabase.ts`
```ts
```bash
npx supabase gen types typescript --project-id "$PROJECT_ID" --schema public > types/supabase.ts
```
After you have generated your types, you can use them in `src/index.ts`
```tsx
import { NextApiRequest, NextApiResponse } from 'next'
import { createClient } from '@supabase/supabase-js'
import { definitions } from '../../types/supabase'
import { Database } from '../types/supabase'
const supabase = createClient(
const supabase = createClient<Database>(
process.env.NEXT_PUBLIC_SUPABASE_URL,
process.env.SUPABASE_SECRET_KEY
)
export default async (req: NextApiRequest, res: NextApiResponse) => {
const allOnlineUsers = await supabase
.from<definitions['users']>('users')
.from('users')
.select('*')
.eq('status', 'ONLINE')
res.status(200).json(allOnlineUsers)
}
```
For more advance type-support, check out [`postgrest-js-tools`](https://github.com/mzalevski/postgrest-js-tools).
## Update types automatically with GitHub Actions
One way to keep your type definitions in sync with your database is to set up a GitHub action that runs on a schedule.
The following script can be run in your terminal to produce the file `types/database/index.ts`.
Add the script above to your `package.json` to run it using `npm run update-types`
```
npx openapi-typescript https://your-project.supabase.co/rest/v1/?apikey=your-anon-key --output types/database/index.ts
```json
"update-types": "npx supabase gen types typescript --project-id \"$PROJECT_ID\" > types/supabase.ts"
```
You can add this script to your `package.json` and run it using `npm run update-types`:
Create a file `.github/workflows/update-types.yml` with the following snippet to define the action along with the environment variables. This script will commit new type changes to your repo every night.
```
"update-types": "npx openapi-typescript \"${SUPABASE_URL}/rest/v1/?apikey=${SUPABASE_ANON_KEY}\" --version=2 --output types/database/index.ts"
```
You can use GitHub actions to generate this file automatically. This script will commit the change to your repo every night.
Create a file `.github/workflows/update-types.yml` and add the following snippet into this file to define the action along with the environment variables.
```yml
```yaml
name: Update database types
on:
@@ -82,8 +73,8 @@ jobs:
update:
runs-on: ubuntu-latest
env:
SUPABASE_URL: ${{secrets.SUPABASE_URL}}
SUPABASE_ANON_KEY: ${{secrets.SUPABASE_ANON_KEY}}
SUPABASE_ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
PROJECT_ID: <your-project-id>
steps:
- uses: actions/checkout@v2
with:
@@ -91,7 +82,7 @@ jobs:
fetch-depth: 0
- uses: actions/setup-node@v2.1.5
with:
node-version: 14
node-version: 16
- run: npm run update-types
- name: check for file changes
id: git_status
@@ -46,6 +46,18 @@ A collection of framework-specific Auth utilities for working with Supabase.
style={{ height: '100%' }}
/>
</div>
{/* Remix */}
<div class="col col--4">
<ButtonCard
class="card"
to={useBaseUrl('/guides/auth/auth-helpers/remix')}
title={'Remix'}
description={
'Helpers for authenticating users in Remix applications.'
}
style={{ height: '100%' }}
/>
</div>
</div>
</div>
@@ -300,7 +300,7 @@ export const getServerSideProps = withPageAuth({
## Server-side data fetching to OAuth APIs using `provider_token`
When using third-party auth providers, sessions are initiated with an additional `provider_token` field which is persisted as an HTTPOnly cookie upon logging in to enabled usage on the server side. The `provider_token` can be used to make API requests to the OAuth provider's API endpoints on behalf of the logged-in user. In the following example, we fetch the user's full profile from the third-party API during SSR using their id and auth token:
When using third-party auth providers, sessions are initiated with an additional `provider_token` field which is persisted in the auth cookie and can be accessed within the session object. The `provider_token` can be used to make API requests to the OAuth provider's API endpoints on behalf of the logged-in user.
```js
import { User, withPageAuth } from '@supabase/auth-helpers-nextjs'
@@ -0,0 +1,904 @@
---
id: remix
title: Supabase Auth with Remix
description: Authentication helpers for loaders and actions in Remix.
sidebar_label: 'Remix'
---
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
This submodule provides convenience helpers for implementing user authentication in Remix applications.
## Install the Remix helper library
<Tabs
groupId="install"
defaultValue="npm"
values={[
{label: 'npm', value: 'npm'},
{label: 'Yarn', value: 'yarn'},
]}>
<TabItem value="npm">
```sh
npm install @supabase/auth-helpers-remix
```
This library supports the following tooling versions:
- Remix: `>=1.7.2`
</TabItem>
<TabItem value="yarn">
```sh
yarn add @supabase/auth-helpers-remix
```
This library supports the following tooling versions:
- Remix: `>=1.7.2`
</TabItem>
</Tabs>
## 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).
```bash title=".env"
SUPABASE_URL=YOUR_SUPABASE_URL
SUPABASE_ANON_KEY=YOUR_SUPABASE_ANON_KEY
```
## Loader
<Tabs
defaultValue="js"
values={[
{label: 'JavaScript', value: 'js'},
{label: 'TypeScript', value: 'ts'},
]}>
<TabItem value="js">
Loader functions run on the server immediately before the component is rendered. They respond to all GET requests on a route. You can create an authenticated Supabase client by calling the `createServerClient` function and passing it your `SUPABASE_URL`, `SUPABASE_ANON_KEY`, and a `Request` and `Response`.
```jsx
import { json } from '@remix-run/node' // change this import to whatever runtime you are using
import { createServerClient } from '@supabase/auth-helpers-remix'
export const loader = async ({ request }) => {
const response = new Response()
// an empty response is required for the auth helpers
// to set cookies to manage auth
const supabaseClient = createServerClient(
process.env.SUPABASE_URL,
process.env.SUPABASE_ANON_KEY,
{ request, response }
)
const { data } = await supabaseClient.from('test').select('*')
// in order for the set-cookie header to be set,
// headers must be returned as part of the loader response
return json(
{ data },
{
headers: response.headers,
}
)
}
```
> Supabase will set cookie headers to manage the user's auth session, therefore, the `response.headers` must be returned from the `Loader` function.
</TabItem>
<TabItem value="ts">
Loader functions run on the server immediately before the component is rendered. You can create an authenticated Supabase client by calling the `createServerClient` function and passing it your `SUPABASE_URL`, `SUPABASE_ANON_KEY`, and a `Request` and `Response`.
```jsx
import { LoaderFunction, json } from '@remix-run/node' // change this import to whatever runtime you are using
import { createServerClient } from '@supabase/auth-helpers-remix'
export const loader: LoaderFunction = async ({
request,
}: {
request: Request,
}) => {
const response = new Response()
const supabaseClient = createServerClient(
process.env.SUPABASE_URL,
process.env.SUPABASE_ANON_KEY,
{ request, response }
)
const { data } = await supabaseClient.from('test').select('*')
return json(
{ data },
{
headers: response.headers,
}
)
}
```
> Supabase will set cookie headers to manage the user's auth session, therefore, the `response.headers` must be returned from the `Loader` function.
</TabItem>
</Tabs>
## Action
<Tabs
defaultValue="js"
values={[
{label: 'JavaScript', value: 'js'},
{label: 'TypeScript', value: 'ts'},
]}>
<TabItem value="js">
Action functions run on the server and respond to HTTP requests to a route, other than GET - POST, PUT, PATCH, DELETE etc. You can create an authenticated Supabase client by calling the `createServerClient` function and passing it your `SUPABASE_URL`, `SUPABASE_ANON_KEY`, and a `Request` and `Response`.
```jsx
import { json } from '@remix-run/node' // change this import to whatever runtime you are using
import { createServerClient } from '@supabase/auth-helpers-remix'
export const action = async ({ request }) => {
const response = new Response()
const supabaseClient = createServerClient(
process.env.SUPABASE_URL,
process.env.SUPABASE_ANON_KEY,
{ request, response }
)
const { data } = await supabaseClient.from('test').select('*')
return json(
{ data },
{
headers: response.headers,
}
)
}
```
> Supabase will set cookie headers to manage the user's auth session, therefore, the `response.headers` must be returned from the `Action` function.
</TabItem>
<TabItem value="ts">
Action functions run on the server and respond to HTTP requests to a route, other than GET - POST, PUT, PATCH, DELETE etc. You can create an authenticated Supabase client by calling the `createServerClient` function and passing it your `SUPABASE_URL`, `SUPABASE_ANON_KEY`, and a `Request` and `Response`.
```jsx
import { ActionFunction, json } from '@remix-run/node' // change this import to whatever runtime you are using
import { createServerClient } from '@supabase/auth-helpers-remix'
export const action: ActionFunction = async ({
request,
}: {
request: Request,
}) => {
const response = new Response()
const supabaseClient = createServerClient(
process.env.SUPABASE_URL,
process.env.SUPABASE_ANON_KEY,
{ request, response }
)
const { data } = await supabaseClient.from('test').select('*')
return json(
{ data },
{
headers: response.headers,
}
)
}
```
> Supabase will set cookie headers to manage the user's auth session, therefore, the `response.headers` must be returned from the `Action` function.
</TabItem>
</Tabs>
## Session and User
You can determine if a user is authenticated by checking their session using the `getSession` function.
```jsx
const {
data: { session },
} = await supabaseClient.auth.getSession()
```
The session contains a user property.
```jsx
const user = session?.user
```
> This is the recommended way for accessing the logged in user. There is also a `getUser()` function but this does not refresh the session if it has expired.
## Client-side
<Tabs
defaultValue="js"
values={[
{label: 'JavaScript', value: 'js'},
{label: 'TypeScript', value: 'ts'},
]}
>
<TabItem value="js">
In order to use the Supabase client in the browser - fetching data in `useEffect` or subscribing to realtime events - we need to do a little more plumbing. Remix does not include a way to make environment variables available to the browser, so we need to pipe them through from a `loader` function in our `root.jsx` route and attach them to the `window`.
```jsx title="app/root.jsx"
export const loader = () => {
const { SUPABASE_URL, SUPABASE_ANON_KEY } = process.env
return json({
env: {
SUPABASE_URL,
SUPABASE_ANON_KEY,
},
})
}
```
> These may not be stored in `process.env` for environments other than Node.
Next, we call the `useLoaderData` hook in our component to get the `env` object.
```jsx title="app/root.jsx"
const { env } = useLoaderData()
```
And then, add a `<script>` tag to attach these environment variables to the `window`. This should be placed immediately before the `<Scripts />` component in `app/root.jsx`
```jsx title="app/root.jsx"
<script
dangerouslySetInnerHTML={{
__html: `window.env = ${JSON.stringify(env)}`,
}}
/>
```
Full example for Node:
```jsx title="app/root.jsx"
import { json } from '@remix-run/node' // change this import to whatever runtime you are using
import {
Form,
Links,
LiveReload,
Meta,
Outlet,
Scripts,
ScrollRestoration,
useLoaderData,
} from '@remix-run/react'
import {
createBrowserClient,
createServerClient,
} from '@supabase/auth-helpers-remix'
export const meta = () => ({
charset: 'utf-8',
title: 'New Remix App',
viewport: 'width=device-width,initial-scale=1',
})
export const loader = () => {
const { SUPABASE_URL, SUPABASE_ANON_KEY } = process.env
return json({
env: {
SUPABASE_URL,
SUPABASE_ANON_KEY,
},
})
}
export default function App() {
const { env } = useLoaderData()
return (
<html lang="en">
<head>
<Meta />
<Links />
</head>
<body>
<Outlet />
<ScrollRestoration />
<script
dangerouslySetInnerHTML={{
__html: `window.env = ${JSON.stringify(env)}`,
}}
/>
<Scripts />
<LiveReload />
</body>
</html>
)
}
```
Now we can call `createBrowserClient` in our components to fetch data client-side, or subscribe to realtime events - changes in the database.
</TabItem>
<TabItem value="ts">
In order to use the Supabase client in the browser - fetching data in `useEffect` or subscribing to realtime events - we need to do a little more plumbing. Remix does not include a way to make environment variables available to the browser, so we need to pipe them through from a `loader` function in our `root.tsx` route and attach them to the `window`.
```jsx title="app/root.tsx"
export const loader = () => {
const { SUPABASE_URL, SUPABASE_ANON_KEY } = process.env
return json({
env: {
SUPABASE_URL,
SUPABASE_ANON_KEY,
},
})
}
```
> These may not be stored in `process.env` for environments other than Node.
Next, we call the `useLoaderData` hook in our component to get the `env` object.
```jsx title="app/root.tsx"
const { env } = useLoaderData()
```
And then, add a `<script>` tag to attach these environment variables to the `window`. This should be placed immediately before the `<Scripts />` component in `app/root.tsx`
```jsx title="app/root.tsx"
<script
dangerouslySetInnerHTML={{
__html: `window.env = ${JSON.stringify(env)}`,
}}
/>
```
Full example for Node:
```jsx title="app/root.tsx"
import { json, MetaFunction, LoaderFunction } from '@remix-run/node' // change this import to whatever runtime you are using
import {
Form,
Links,
LiveReload,
Meta,
Outlet,
Scripts,
ScrollRestoration,
useLoaderData,
} from '@remix-run/react'
import {
createBrowserClient,
createServerClient,
} from '@supabase/auth-helpers-remix'
export const meta: MetaFunction = () => ({
charset: 'utf-8',
title: 'New Remix App',
viewport: 'width=device-width,initial-scale=1',
})
export const loader: LoaderFunction = () => {
const { SUPABASE_URL, SUPABASE_ANON_KEY } = process.env
return json({
env: {
SUPABASE_URL,
SUPABASE_ANON_KEY,
},
})
}
export default function App() {
const { env } = useLoaderData()
return (
<html lang="en">
<head>
<Meta />
<Links />
</head>
<body>
<Outlet />
<ScrollRestoration />
<script
dangerouslySetInnerHTML={{
__html: `window.env = ${JSON.stringify(env)}`,
}}
/>
<Scripts />
<LiveReload />
</body>
</html>
)
}
```
Now we can call `createBrowserClient` in our components to fetch data client-side, or subscribe to realtime events - changes in the database.
</TabItem>
</Tabs>
## Authentication
Now that authentication is based on cookies, users can sign in and out server-side with actions.
Given this Remix `<Form />` component.
```jsx
<Form method="post">
<input type="text" name="email" />
<input type="password" name="password" />
<button type="submit">Go!</button>
</Form>
```
### Signing Up
<Tabs
defaultValue="js"
values={[
{label: 'JavaScript', value: 'js'},
{label: 'TypeScript', value: 'ts'},
]}>
<TabItem value="js">
Any of the [supported authentication strategies from `supabase-js`](https://supabase.com/docs/reference/javascript/auth-signup) will work server-side. This is how you would handle simple `email` and `password` auth.
```jsx
export const action = async ({ request }) => {
const { email, password } = Object.fromEntries(await request.formData())
const response = new Response()
const supabaseClient = createServerClient(
process.env.SUPABASE_URL,
process.env.SUPABASE_ANON_KEY,
{ request, response }
)
const { data, error } = await supabaseClient.auth.signUp({
email,
password,
})
// in order for the set-cookie header to be set,
// headers must be returned as part of the loader response
return json(
{ data, error },
{
headers: response.headers,
}
)
}
```
</TabItem>
<TabItem value="ts">
Any of the [supported authentication strategies from `supabase-js`](https://supabase.com/docs/reference/javascript/auth-signup) will work server-side. This is how you would handle simple `email` and `password` auth.
```jsx
export const action: ActionFunction = async ({
request
}: {
request: Request;
}) => {
const { email, password } = Object.fromEntries(await request.formData());
const response = new Response();
const supabaseClient = createServerClient(
process.env.SUPABASE_URL!,
process.env.SUPABASE_ANON_KEY!,
{ request, response }
);
const { data, error } = await supabaseClient.auth.signUp({
email: String(registerEmail),
password: String(registerPassword)
});
// in order for the set-cookie header to be set,
// headers must be returned as part of the loader response
return json(
{ data, error },
{
headers: response.headers
}
);
};
```
</TabItem>
</Tabs>
### Login
<Tabs
defaultValue="js"
values={[
{label: 'JavaScript', value: 'js'},
{label: 'TypeScript', value: 'ts'},
]}>
<TabItem value="js">
Any of the [supported authentication strategies from `supabase-js`](https://supabase.com/docs/reference/javascript/auth-signinwithpassword) will work server-side. This is how you would handle simple `email` and `password` auth.
```jsx
export const action = async ({ request }) => {
const { email, password } = Object.fromEntries(await request.formData())
const response = new Response()
const supabaseClient = createServerClient(
process.env.SUPABASE_URL,
process.env.SUPABASE_ANON_KEY,
{ request, response }
)
const { data, error } = await supabaseClient.auth.signInWithPassword({
email: String(loginEmail),
password: String(loginPassword),
})
// in order for the set-cookie header to be set,
// headers must be returned as part of the loader response
return json(
{ data, error },
{
headers: response.headers,
}
)
}
```
</TabItem>
<TabItem value="ts">
Any of the [supported authentication strategies from `supabase-js`](https://supabase.com/docs/reference/javascript/auth-signinwithpassword) will work server-side. This is how you would handle simple `email` and `password` auth.
```jsx
export const action: ActionFunction = async ({
request
}: {
request: Request;
}) => {
const { email, password } = Object.fromEntries(await request.formData());
const response = new Response();
const supabaseClient = createServerClient(
process.env.SUPABASE_URL!,
process.env.SUPABASE_ANON_KEY!,
{ request, response }
);
const { data, error } = await supabaseClient.auth.signInWithPassword({
email: String(loginEmail),
password: String(loginPassword)
});
// in order for the set-cookie header to be set,
// headers must be returned as part of the loader response
return json(
{ data, error },
{
headers: response.headers
}
);
};
```
</TabItem>
</Tabs>
### Logout
<Tabs
defaultValue="js"
values={[
{label: 'JavaScript', value: 'js'},
{label: 'TypeScript', value: 'ts'},
]}>
<TabItem value="js">
```jsx
export const action = async ({ request }) => {
const { email, password } = Object.fromEntries(await request.formData())
const response = new Response()
const supabaseClient = createServerClient(
process.env.SUPABASE_URL,
process.env.SUPABASE_ANON_KEY,
{ request, response }
)
const { error } = await supabaseClient.auth.signOut()
// in order for the set-cookie header to be set,
// headers must be returned as part of the loader response
return json(
{ error },
{
headers: response.headers,
}
)
}
```
</TabItem>
<TabItem value="ts">
```jsx
export const action: ActionFunction = async ({
request
}: {
request: Request;
}) => {
const { email, password } = Object.fromEntries(await request.formData());
const response = new Response();
const supabaseClient = createServerClient(
process.env.SUPABASE_URL!,
process.env.SUPABASE_ANON_KEY!,
{ request, response }
);
const { error } = await supabaseClient.auth.signOut();
// in order for the set-cookie header to be set,
// headers must be returned as part of the loader response
return json(
{ error },
{
headers: response.headers
}
);
};
```
</TabItem>
</Tabs>
## Subscribe to realtime events
```jsx
import { createBrowserClient } from '@supabase/auth-helpers-remix'
import { useState, useEffect } from 'react'
export default function SubscribeToRealtime() {
const [data, setData] = useState([])
useEffect(() => {
const supabaseClient = createBrowserClient(
window.env.SUPABASE_URL,
window.env.SUPABASE_ANON_KEY
)
const channel = supabaseClient
.channel('test')
.on(
'postgres_changes',
{ event: 'INSERT', schema: 'public', table: 'test' },
(payload) => {
setData((data) => [...data, payload.new])
}
)
.subscribe()
return () => {
supabaseClient.removeChannel(channel)
}
}, [session])
return <pre>{JSON.stringify({ data }, null, 2)}</pre>
}
```
> Note: `window.env` is not automatically populated by Remix. Check out the "Client-side" instructions above to configure this.
In this example we are listening to `INSERT` events on the `test` table. Anytime new rows are added to Supabase's `test` table, our UI will automatically update new data.
## Merge server and client state on realtime events
```jsx
import { json, LoaderFunction } from '@remix-run/node';
import { useLoaderData, useNavigate } from '@remix-run/react';
import {
createServerClient,
createBrowserClient
} from '@supabase/auth-helpers-remix';
import { useEffect } from 'react';
import { Database } from '../../db_types';
// this route demonstrates how to subscribe to realtime updates
// and synchronize data between server and client
export const loader: LoaderFunction = async ({
request
}: {
request: Request;
}) => {
const response = new Response();
const supabaseClient = createServerClient<Database>(
process.env.SUPABASE_URL!,
process.env.SUPABASE_ANON_KEY!,
{ request, response }
);
const {
data: { session }
} = await supabaseClient.auth.getSession();
const { data, error } = await supabaseClient.from('test').select('*');
if (error) {
throw error;
}
// in order for the set-cookie header to be set,
// headers must be returned as part of the loader response
return json(
{ data, session },
{
headers: response.headers
}
);
};
export default function SubscribeToRealtime() {
const { data, session } = useLoaderData();
const navigate = useNavigate();
useEffect(() => {
// Note: window.env is not automatically populated by Remix
// Check out the [example in this repo](../root.tsx) or
// [Remix docs](https://remix.run/docs/en/v1/guides/envvars#browser-environment-variables) for more info
const supabaseClient = createBrowserClient<Database>(
window.env.SUPABASE_URL,
window.env.SUPABASE_ANON_KEY
);
// make sure you have enabled `Replication` for your table to receive realtime events
// https://supabase.com/docs/guides/database/replication
const channel = supabaseClient
.channel('test')
.on(
'postgres_changes',
{ event: '*', schema: 'public', table: 'test' },
(payload: any) => {
// you could manually merge the `payload` with `data` here
// the `navigate` trick below causes all active loaders to be called again
// this handles inserts, updates and deletes, keeping everything in sync
// which feels more remix-y than manually merging state
// https://sergiodxa.com/articles/automatic-revalidation-in-remix
navigate('.', { replace: true });
}
)
.subscribe();
return () => {
supabaseClient.removeChannel(channel);
};
}, [session]);
return (
<div style={{ fontFamily: 'system-ui, sans-serif', lineHeight: '1.4' }}>
<pre>{JSON.stringify({ data }, null, 2)}</pre>
</div>
);
}
```
> Note: `window.env` is not automatically populated by Remix. Check out the "Client-side" instructions above to configure this.
## Usage with TypeScript
You can pass types that were [generated with the Supabase CLI](/docs/reference/javascript/typescript-support#generating-types) to the `createServerClient` or `createBrowserClient` functions to get enhanced type safety and auto completion:
### Server-side
```ts
import { createServerClient } from '@supabase/auth-helpers-remix'
import { Database } from '../../db_types'
export const loader = async ({ request }) => {
const response = new Response()
const supabaseClient = createServerClient<Database>(
process.env.SUPABASE_URL,
process.env.SUPABASE_ANON_KEY,
{ request, response }
)
}
```
### Client-side
```ts
import { createBrowserClient } from '@supabase/auth-helpers-remix'
import { Database } from '../../db_types'
const supabaseClient = createBrowserClient<Database>(
process.env.SUPABASE_URL,
process.env.SUPABASE_ANON_KEY
)
```
## Server-side data fetching to OAuth APIs using `provider_token`
When using third-party auth providers, sessions are initiated with an additional `provider_token` field which is persisted in the auth cookie and can be accessed within the session object. The `provider_token` can be used to make API requests to the OAuth provider's API endpoints on behalf of the logged-in user.
```js
import { json, LoaderFunction, redirect } from '@remix-run/node'; // change this import to whatever runtime you are using
import { useLoaderData } from '@remix-run/react';
import { createServerClient, User } from '@supabase/auth-helpers-remix';
import { Database } from '../../db_types';
export const loader: LoaderFunction = async ({
request
}: {
request: Request;
}) => {
const response = new Response();
const supabaseClient = createServerClient<Database>(
process.env.SUPABASE_URL!,
process.env.SUPABASE_ANON_KEY!,
{ request, response }
);
const {
data: { session }
} = await supabaseClient.auth.getSession();
if (!session) {
// there is no session, therefore, we are redirecting
// to the landing page. we still need to return
// response.headers to attach the set-cookie header
return redirect('/', {
headers: response.headers
});
}
// Retrieve provider_token & logged in user's third-party id from metadata
const { provider_token, user } = session;
const userId = user.user_metadata.user_name;
const allRepos = await (
await fetch(`https://api.github.com/search/repositories?q=user:${userId}`, {
method: 'GET',
headers: {
Authorization: `token ${provider_token}`
}
})
).json();
// in order for the set-cookie header to be set,
// headers must be returned as part of the loader response
return json(
{ user, allRepos },
{
headers: response.headers
}
);
};
export default function ProtectedPage() {
// by fetching the user in the loader, we ensure it is available
// for first SSR render - no flashing of incorrect state
const { user, allRepos } = useLoaderData<{ user: User; allRepos: any }>();
return <pre>{JSON.stringify({ user, allRepos }, null, 2)}</pre>;
}
```
+18
View File
@@ -22,6 +22,16 @@ You can also use the CLI to manage your Supabase projects, handle database migra
{label: 'Windows', value: 'windows'},
{label: 'Linux', value: 'linux'},
]}>
<TabItem value="npm">
Install the CLI as dev dependency via [npm](https://www.npmjs.com/package/supabase):
```sh
npm install supabase --save-dev
```
</TabItem>
<TabItem value="macos">
Install the CLI with [Homebrew](https://brew.sh):
@@ -78,6 +88,14 @@ When a new [version](https://github.com/supabase/cli/releases) is released, you
{label: 'Windows', value: 'windows'},
{label: 'Linux', value: 'linux'},
]}>
<TabItem value="npm">
```sh
npm update supabase --save-dev
```
</TabItem>
<TabItem value="macos">
```sh
@@ -160,7 +160,7 @@ In the example above, we have:
1. created a column called `id`
1. assigned the data type `bigint`
1. instructed the database that this should be `generated always as identity`, which means that Postgres will automatically assign a unique number to this column.
1. Becuase it's unique, we can also use it as our `primary key`.
1. Because it's unique, we can also use it as our `primary key`.
We could also use `generated by default as identity`, which would allow us to insert our own unique values.
@@ -0,0 +1,70 @@
---
id: testing
title: Testing Your Database
description: Test your database schema, tables, functions, and policies.
---
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
You can use the Supabase CLI to test your database. To get started:
- [Install the Supabase CLI](/docs/guides/cli) on your local machine
## Creating a test
Create a tests folder inside the supabase folder:
```bash
mkdir -p ./supabase/tests/database
```
Create a new file with the `.sql` extension which will contain the test.
```bash
touch ./supabase/tests/database/hello_world.test.sql
```
## Writing tests
All `sql` files use [pgTAP](/docs/guides/database/extensions/pgtap) as the test runner.
Let's write a simple test to check that our `auth.users` table has an ID column. Open `hello_world.test.sql` and add the following code:
```sql
begin;
select plan(1); -- only one statement to run
SELECT has_column(
'auth',
'users',
'id',
'id should exist'
);
select * from finish();
rollback;
```
## Running tests
To run the test, you can use:
```bash
supabase test db
```
This will produce the following output:
```bash
$ supabase test db
supabase/tests/database/hello_world.test.sql .. ok
All tests successful.
Files=1, Tests=1, 1 wallclock secs ( 0.01 usr 0.00 sys + 0.04 cusr 0.02 csys = 0.07 CPU)
Result: PASS
```
## More resource
- [pgTAP extension](https://supabase.com/docs/guides/database/extensions/pgtap)
- Official [pgTAP documentation](https://pgtap.org/)
+2 -1
View File
@@ -127,7 +127,7 @@ Globally distributed TypeScript functions to execute custom business logic. [Doc
<br />
## Project Managment
## Project Management
### CLI
@@ -165,6 +165,7 @@ Both Postgres and the Supabase Platform are production-ready. Some tools we offe
| Auth | Passwordless | `beta` |
| Auth | Next.js Auth Helpers | `alpha` |
| Auth | SvelteKit Auth Helpers | `alpha` |
| Auth | Remix Auth Helpers | `alpha` |
| Management API | | `beta` |
| CLI | | `beta` |
| Client Library: JavaScript | | `GA` |
@@ -28,14 +28,26 @@ const examples = [
},
{
name: 'Building a RESTful Service API',
description: 'Learn how to use HTTP methods and paths to build a RESTful service for managing tasks.',
description:
'Learn how to use HTTP methods and paths to build a RESTful service for managing tasks.',
href: 'https://github.com/supabase/supabase/blob/master/examples/edge-functions/supabase/functions/restful-tasks/index.ts',
},
{
name: 'Working with Supabase Storage',
description: 'An example on reading a file from Supbase Storage.',
href: 'https://github.com/supabase/supabase/blob/master/examples/edge-functions/supabase/functions/read-storage/index.ts',
}
},
{
name: 'OpenGraph Image Generation',
description:
'Generate Open Graph images with Deno and Supabase Edge Functions, no framework needed.',
href: 'https://github.com/supabase/supabase/tree/master/examples/edge-functions/supabase/functions/opengraph',
},
{
name: 'Get User Location',
description: `Get user location data from user's IP address.`,
href: 'https://github.com/supabase/supabase/tree/master/examples/edge-functions/supabase/functions/location',
},
]
You can find a list of useful [Edge Function Examples](https://github.com/supabase/supabase/tree/master/examples/edge-functions) in our GitHub repository.
@@ -49,7 +49,8 @@ The "middleware" is everything except Postgres, and it should work with any Post
### Extensions
Supabase requires some Postgres extensions to be enabled by default for the API and Auth system to work. You can find the extensions inside the
[schema initialization script](https://github.com/supabase/supabase/blob/master/docker/volumes/db/init/00-initial-schema.sql).
[schema migration scripts](https://github.com/supabase/postgres/tree/develop/migrations). These are mounted at `/docker-entrypoint-initdb.d`
to run automatically when starting the database container.
We recommend installing all extensions into an `extensions` schema. This will keep your API clean,
since all tables in the `public` schema are exposed via the API.
@@ -72,7 +73,8 @@ For working with JWT and Auth functions.
### Roles
Supabase creates several default roles in your Postgres database. To restore defaults at any time you can run the commands inside the
[schema initialization script](https://github.com/supabase/supabase/blob/master/docker/volumes/db/init/00-initial-schema.sql).
[schema initialization scripts](https://github.com/supabase/postgres/tree/develop/migrations/db/init-scripts). Remember to change your
[role passwords](./docker#securing-your-setup) before deploying to production environments.
##### `postgres`
@@ -47,7 +47,7 @@ You can also assign roles to your team members with different access levels. The
| **Members** |
| Add an Owner | ✅ | | |
| Remove an Owner | ✅ | | |
| Add an Adminstrator | ✅ | ✅ | |
| Add an Administrator | ✅ | ✅ | |
| Remove an Administrator | ✅ | ✅ | |
| Add a Developer | ✅ | ✅ | |
| Remove a Developer | ✅ | ✅ | |
@@ -48,7 +48,7 @@ Your cache is now created. PolyScale automatically checks to see that your datab
## Step 2: Connect to your PolyScale Cache
Using your PolyScale cache is simple -- instead of connecting to your Supabase database directly, you'll replace your orignal connection string with the PolyScale connection string in your application.
Using your PolyScale cache is simple -- instead of connecting to your Supabase database directly, you'll replace your original connection string with the PolyScale connection string in your application.
For example, if your original connection string was: `postgres://postgres:zqSPGHFAbPLvVCKw@db.rogpiubvixysbakciwqz.supabase.co:5432`
@@ -49,7 +49,7 @@ Click `Save` to create the new table.
## Step 3: Setup your Next.js App with SuperTokens.
Since the scope of this guide is limited to the intergration between SuperTokens and Supabase, you can refer to the SuperTokens website to see [how to setup your Next.js app with SuperTokens](https://supertokens.com/docs/thirdpartyemailpassword/nextjs/about).
Since the scope of this guide is limited to the integration between SuperTokens and Supabase, you can refer to the SuperTokens website to see [how to setup your Next.js app with SuperTokens](https://supertokens.com/docs/thirdpartyemailpassword/nextjs/about).
Once you finish setting up your app, you will be greeted with the following screen
@@ -17,13 +17,13 @@ Custom domains allow you to present a branded experience to your users. You can
To get started:
1. [Install](/docs/guides/cli) the Supabase CLI 1.10.1+.
1. [Install](/docs/guides/cli) the Supabase CLI 1.11.3+.
1. [Log in](/docs/guides/cli/local-development#log-in-to-the-supabase-cli) to your Supabase account using the CLI.
1. Enable the Custom Domains add-on in the Billing page of the Dashboard.
## Configure a Custom Domain
This example assumes your Supabase project is `foobar` with a corresponding API URL `foobar.supabase.co` and configures a custom domain at `api.example.com`.
This example assumes your Supabase project is `foobar` with a corresponding API URL `foobarbaz.supabase.co` and configures a custom domain at `api.example.com`.
### <a id="cname-configure"></a>Configure a CNAME
@@ -34,7 +34,7 @@ Set up a CNAME record for `api.example.com`, resolving to `foobarbaz.supabase.co
Use the `create` subcommand of the CLI to notify Supabase of your domain and retrieve TXT verification records:
```bash
supabase custom-hostname create --project-ref foobar --custom-hostname api.example.com --experimental
supabase domains create --project-ref foobar --custom-hostname api.example.com --experimental
```
The output of the `create` command includes two TXT records[^1] you will need to set up, in order to verify your control over the domain in question,
@@ -47,14 +47,14 @@ Required outstanding validation records:
api.example.com TXT -> ca3-F1HvR9i938OgVwpCFwi1jTsbhe1hvT0Ic3efPY3Q
```
[^1] One of the records requires you to *replace* the CNAME record set up in [the first step](#cname-configure) with a TXT record. You'll be able to restore it back to the CNAME after the verification process has been completed.
[^1] One of the records requires you to _replace_ the CNAME record set up in [the first step](#cname-configure) with a TXT record. You'll be able to restore it back to the CNAME after the verification process has been completed.
### Verify your domain
Set up both records as instructed, and then use the `reverify` command for the Supabase Platform to verify the records:
```bash
supabase custom-hostname reverify --project-ref foobarbaz --experimental
supabase domains reverify --project-ref foobarbaz --experimental
```
You might need to wait a few minutes before your updated DNS records are propagated, especially if the older records were using a high TTL.
@@ -72,7 +72,7 @@ Additionally, update the DNS configuration for `api.example.com` to once more us
Finally, you can use the `activate` subcommand to reconfigure your project:
```bash
supabase custom-hostname activate --project-ref foobarbaz --experimental
supabase domains activate --project-ref foobarbaz --experimental
```
## Remove a Custom Domain
@@ -80,7 +80,11 @@ supabase custom-hostname activate --project-ref foobarbaz --experimental
If you have a custom domain (`api.example.com`) set up for your Supabase project (ref `foobarbaz`, with assigned endpoints at `foobarbaz.supabase.co`), and would like to go back to using the Supabase-provisioned endpoints (`foobarbaz.supabase.co`), you can use the `delete` subcommand:
```bash
supabase custom-hostname delete --project-ref foobarbaz --experimental
supabase domains delete --project-ref foobarbaz --experimental
```
As with the final activation stage of the process for setting up a custom domain, you'll need to update any references in your client code and OAuth providers from the custom domain to the Supabase-provisioned endpoints.
## Limitations
Edge functions do not honor the custom domain setting and they still have to be invoked via the `foobarbaz.supabase.co` domain.
@@ -0,0 +1,55 @@
---
id: database-usage
title: Database usage
description: Understanding how database usage applies to your subscription.
---
Database storage refers to the _monthly average storage usage_, as reported by Postgres. This metric is reported in your project's [billing page](https://app.supabase.com/project/_/settings/billing) and is updated daily.
For an instantaneous live view of the DB storage usage, you can execute in Postgres:
```sql
select sum(pg_database_size(pg_database.datname)) / (1024 * 1024) as db_size_mb
from pg_database;
```
This value is also reported in the [database settings page](https://app.supabase.com/project/_/settings/database).
## Database storage management
Your project will be changed to read-only mode once it reaches 95% of your subscription quota, preventing further writes to your project.
In read-only mode, clients will encounter errors such as `cannot execute INSERT in a read-only transaction`.
Regular operation (read-write mode) is automatically re-enabled once database storage usage falls under 95%.
If you are on Pro or Enterprise, database storage expands automatically, however you may also encounter this error if fill the database faster than it can expand.
Supabase uses network-attached storage, which balances performance with scalability. Pro projects can store up to 1024TB.
If you intend to grow beyond this, reach out to our team to learn more about our Enterprise tier.
### Increasing available database storage
1. [Upgrade to the Pro or Enterprise plan](https://app.supabase.com/project/_/settings/billing) to increase your storage quota.
2. Delete data from your project's database to lower its disk usage. If your database is already in read-only mode, run the following command to change the transaction mode to read-write for your session:
```sql
SET default_transaction_read_only = 'off';
```
This allows you to delete data from within the session.
## Vacuum operations
Postgres does not immediately reclaim the physical space used by dead tuples (i.e., deleted rows) in the DB. Instead, they are internally marked as removed until a [vacuum operation](https://www.postgresql.org/docs/current/routine-vacuuming.html) is executed.
As a result, deleting data from your database may not immediately reduce the reported disk usage.
:::note
Vacuum operations can temporarily increase resource utilization, which may adversely impact the observed performance of your project until the maintenance is completed.
:::
Supabase projects have automatic vacuuming enabled, which ensures that these operations are performed regularly to keep the database healthy and performant.
However, it can be necessary to either [fine-tune](https://www.percona.com/blog/2018/08/10/tuning-autovacuum-in-postgresql-and-autovacuum-internals/)
the [autovacuum parameters](https://www.enterprisedb.com/blog/postgresql-vacuum-and-analyze-best-practice-tips),
or [manually initiate](https://www.postgresql.org/docs/current/sql-vacuum.html) vacuum operations.
For example, running a manual vacuum after deleting large amounts of data from your DB could help reduce the reported disk usage by Postgres.
@@ -1,25 +0,0 @@
---
id: disk-usage
title: Disk space usage
description: Learn how database disk space usage is reported.
---
Database disk space usage refers to the _monthly average disk usage_, as reported by Postgres. This metric is reported in your project's [billing page](https://app.supabase.com/project/_/settings/billing) and is updated daily.
For an instantaneous live view of the DB disk space being used by your project, you can execute in Postgres:
```sql
SELECT SUM(pg_database_size(pg_database.datname)) / (1024 * 1024) as db_size_mb FROM pg_database;
```
This value is also reported in the [database settings page](https://app.supabase.com/project/_/settings/database).
## Vacuum operations
Postgres does not immediately reclaim the physical space used by dead tuples (i.e., deleted rows) in the DB. Instead, they are internally marked as removed until a [vacuum operation](https://www.postgresql.org/docs/current/routine-vacuuming.html) is executed. As a result, deleting data from your DB may not immediately reduce the reported disk usage.
:::note
Vacuum operations can temporarily increase resource utilization, which can adversely impact the observed performance of your project until the maintenance is completed.
:::
Supabase projects have automatic vacuuming enabled, which ensures that these operations are performed regularly to keep the database healthy and performant. However, it can be necessary to either [fine-tune](https://www.percona.com/blog/2018/08/10/tuning-autovacuum-in-postgresql-and-autovacuum-internals/) [the autovacuum parameters](https://www.enterprisedb.com/blog/postgresql-vacuum-and-analyze-best-practice-tips), or [manually initiate](https://www.postgresql.org/docs/current/sql-vacuum.html) vacuum operations. For example, running a manual vacuum after deleting large amounts of data from your DB could help reduce the reported disk usage by Postgres.
@@ -0,0 +1,74 @@
---
id: rate-limits
title: Realtime Rate Limits
description: Understanding Realtime rate limiting
sidebar_label: Rate Limits
---
Supabase Realtime is a global cluster. We've implemented some rate limits to help ensure high availability for all customers.
Rate limits are configurable per project and our cluster supports millions of concurrent connections. [Contact support](https://app.supabase.com/support/new) if these limits are causing issues.
## Limits by Plan
Limits are set on the Free and Pro plans accordingly. See our [pricing page](https://supabase.com/pricing) for more information.
Enterprise plans are billed on a usage basis. We still employ limiting on Enterprise plans. If you're on an Enterprise plan simply contact support and we'll increase your limits as needed.
Enterprise plan limits start at:
- 500 concurrent clients
- 1,000 messages per second
- 500 concurrent Channels
## System Limits
The following limits apply to all projects:
- 500 Channel joins per second
- 100 Channels per connected client
## Client-Side Limiting
Some basic WebSocket message rate limiting is implemented client-side.
For example, the [multiplayer.dev demo](/docs/guides/realtime/quickstart#cursor-positions) instantiates the Supabase client with an `eventsPerSecond` parameter.
## Rate Limiting Errors
Rate limiting errors can appear in backend logs and messages in the WebSocket connection.
:::note
Use the [Realtime Inspector](https://realtime.supabase.com/inspector/new) to reproduce an error and share those connection details with Supabase support.
:::
### Backend Logs
If your project is being rate limited, check your [Realtime logs](https://app.supabase.com/project/_/database/realtime-logs).
### WebSocket Errors
- `tenant_events`: Clients will be disconnected if your project is generating too many messages per second. `supabase-js` should reconnect automatically when the message rate decreases below your plan limit.
Some limits can cause a Channel join to be refused. Realtime will reply with one of the following WebSocket messages:
- `too_many_channels`: Too many channels currently joined for a single client.
- `too_many_connections`: Too many total concurrent connections for a project.
- `too_many_joins`: Too many Channel joins per second.
:::note
Use your browser's developer tools to find the WebSocket initiation request and view individual messages.
:::
## Payload Limits
Realtime has a message byte size limit of 1 megabyte.
## Presence Limits
Realtime Presence is a CRDT backed in-memory key value store based on Phoenix Presence. It's more expensive to update a Presence than Broadcast a message.
The following limits apply to Presence messages:
- 10 keys per object
- Message rate limit is 10% of your Realtime message rate limit
+1 -1
View File
@@ -12,7 +12,7 @@ Supabase Storage makes it simple to store and serve large files.
### Files
Files can be any sort of media file. This includes images, GIFs, and videos. It is best practice to store files outside of your database because of their sizes.
Files can be any sort of media file. This includes images, GIFs, and videos. It is best practice to store files outside of your database because of their sizes. For security, HTML files are returned as plain text.
### Folders
+12 -12
View File
@@ -171,7 +171,7 @@ class SplashPage extends StatefulWidget {
}
class _SplashPageState extends State<SplashPage> {
bool _redicrectCalled = false;
bool _redirectCalled = false;
@override
void didChangeDependencies() {
super.didChangeDependencies();
@@ -180,11 +180,11 @@ class _SplashPageState extends State<SplashPage> {
Future<void> _redirect() async {
await Future.delayed(Duration.zero);
if (_redicrectCalled || !mounted) {
if (_redirectCalled || !mounted) {
return;
}
_redicrectCalled = true;
_redirectCalled = true;
final session = supabase.auth.currentSession;
if (session != null) {
Navigator.of(context).pushReplacementNamed('/account');
@@ -249,7 +249,7 @@ class _LoginPageState extends State<LoginPage> {
} on AuthException catch (error) {
context.showErrorSnackBar(message: error.message);
} catch (error) {
context.showErrorSnackBar(message: 'Unexpected error occured');
context.showErrorSnackBar(message: 'Unexpected error occurred');
}
setState(() {
@@ -346,7 +346,7 @@ class _AccountPageState extends State<AccountPage> {
} on PostgrestException catch (error) {
context.showErrorSnackBar(message: error.message);
} catch (error) {
context.showErrorSnackBar(message: 'Unexpected exception occured');
context.showErrorSnackBar(message: 'Unexpected exception occurred');
}
setState(() {
@@ -376,7 +376,7 @@ class _AccountPageState extends State<AccountPage> {
} on PostgrestException catch (error) {
context.showErrorSnackBar(message: error.message);
} catch (error) {
context.showErrorSnackBar(message: 'Unexpeted error occured');
context.showErrorSnackBar(message: 'Unexpeted error occurred');
}
setState(() {
_loading = false;
@@ -389,7 +389,7 @@ class _AccountPageState extends State<AccountPage> {
} on AuthException catch (error) {
context.showErrorSnackBar(message: error.message);
} catch (error) {
context.showErrorSnackBar(message: 'Unexpected error occured');
context.showErrorSnackBar(message: 'Unexpected error occurred');
}
if (mounted) {
Navigator.of(context).pushReplacementNamed('/');
@@ -619,7 +619,7 @@ class _AvatarState extends State<Avatar> {
}
} catch (error) {
if (mounted) {
context.showErrorSnackBar(message: 'Unexpected error occured');
context.showErrorSnackBar(message: 'Unexpected error occurred');
}
}
@@ -670,7 +670,7 @@ class _AccountPageState extends State<AccountPage> {
} on PostgrestException catch (error) {
context.showErrorSnackBar(message: error.message);
} catch (error) {
context.showErrorSnackBar(message: 'Unexpected exception occured');
context.showErrorSnackBar(message: 'Unexpected exception occurred');
}
setState(() {
@@ -700,7 +700,7 @@ class _AccountPageState extends State<AccountPage> {
} on PostgrestException catch (error) {
context.showErrorSnackBar(message: error.message);
} catch (error) {
context.showErrorSnackBar(message: 'Unexpeted error occured');
context.showErrorSnackBar(message: 'Unexpeted error occurred');
}
setState(() {
_loading = false;
@@ -713,7 +713,7 @@ class _AccountPageState extends State<AccountPage> {
} on AuthException catch (error) {
context.showErrorSnackBar(message: error.message);
} catch (error) {
context.showErrorSnackBar(message: 'Unexpected error occured');
context.showErrorSnackBar(message: 'Unexpected error occurred');
}
if (mounted) {
Navigator.of(context).pushReplacementNamed('/');
@@ -734,7 +734,7 @@ class _AccountPageState extends State<AccountPage> {
} on PostgrestException catch (error) {
context.showErrorSnackBar(message: error.message);
} catch (error) {
context.showErrorSnackBar(message: 'Unexpected error has occured');
context.showErrorSnackBar(message: 'Unexpected error has occurred');
}
if (!mounted) {
return;
+2 -3
View File
@@ -473,13 +473,12 @@ export default function Account({ session }: { session: Session }) {
Now that we have all the components in place, let's update `pages/index.js`:
```jsx title="pages/index.js"
import type { NextPage } from 'next'
import { Auth, ThemeSupa } from '@supabase/auth-ui-react'
import { useSession, useSupabaseClient } from '@supabase/auth-helpers-react'
// highlight-next-line
import Account from '../components/Account'
const Home: NextPage = () => {
const Home = () => {
const session = useSession()
const supabase = useSupabaseClient()
@@ -771,6 +770,6 @@ At this stage you have a fully functional application!
- Explore the [pre-built Auth UI for React](https://supabase.com/docs/guides/auth/auth-helpers/auth-ui).
- Explore the [Auth Helpers for Next.js](https://supabase.com/docs/guides/auth/auth-helpers/nextjs).
- Explore the [Supabase Cache Helpers](https://github.com/psteinroe/supabase-cache-helpers).
- See the [Next.js Supscription Payments Starter](https://github.com/vercel/nextjs-subscription-payments) template on GitHub.
- See the [Next.js Subscription Payments Starter](https://github.com/vercel/nextjs-subscription-payments) template on GitHub.
- Got a question? [Ask here](https://github.com/supabase/supabase/discussions).
- Sign in: [app.supabase.com](https://app.supabase.com)
+10
View File
@@ -58,6 +58,16 @@ Reference documentation for self-hosting Supabase features.
/>
</div>
{/* */}
<div class="col col--6">
<ButtonCard
class="card"
to={useBaseUrl('/reference/realtime')}
style={{ height: '100%' }}
title={'Realtime'}
description="Build multiplayer applications and listen to your database changes via websockets."
/>
</div>
{/* */}
<div class="col col--6">
<ButtonCard
class="card"
+12
View File
@@ -81,6 +81,18 @@ const config = {
'https://github.com/supabase/supabase/edit/master/apps/reference/',
},
],
[
'@docusaurus/plugin-content-docs',
{
id: '_realtime',
path: '_realtime',
routeBasePath: '/reference/realtime',
sidebarPath: require.resolve('./nav/realtime_sidebars.js'),
breadcrumbs: false,
editUrl:
'https://github.com/supabase/supabase/edit/master/apps/reference/',
},
],
[
'@docusaurus/plugin-content-docs',
{
+2 -2
View File
@@ -54,7 +54,7 @@ export default async function gen(inputFileName: string, outputDir: string) {
const description =
pageSpec.description ||
tsDocCommentToMdComment(getDescriptionFromDefintion(tsDefinition))
tsDocCommentToMdComment(getDescriptionFromDefinition(tsDefinition))
// Create page
const content = Page({
@@ -107,7 +107,7 @@ function generateParameters(tsDefinition: any) {
return methodListGroup(parameters)
}
function getDescriptionFromDefintion(tsDefinition) {
function getDescriptionFromDefinition(tsDefinition) {
if (!tsDefinition) return null
if (
['Method', 'Constructor', 'Constructor signature'].includes(
+6 -2
View File
@@ -93,6 +93,7 @@ const sidebars = {
'guides/auth/auth-helpers/auth-ui',
'guides/auth/auth-helpers/nextjs',
'guides/auth/auth-helpers/sveltekit',
'guides/auth/auth-helpers/remix',
],
},
{
@@ -120,12 +121,13 @@ const sidebars = {
'guides/database/functions',
'guides/database/webhooks',
'guides/database/full-text-search',
'guides/database/testing',
// 'guides/database/json',
// 'guides/database/arrays',
// 'guides/database/sql-to-api',
{
type: 'category',
label: 'Data APIs',
label: 'Serverless APIs',
collapsed: true,
items: ['guides/api', 'guides/api/generating-types'],
},
@@ -175,6 +177,7 @@ const sidebars = {
'guides/realtime',
'guides/realtime/quickstart',
'guides/realtime/postgres-cdc',
'guides/realtime/rate-limits',
],
},
{
@@ -190,7 +193,7 @@ const sidebars = {
items: [
'guides/hosting/platform',
'guides/platform/custom-domains',
'guides/platform/disk-usage',
'guides/platform/database-usage',
'guides/platform/logs',
'guides/platform/metrics',
'guides/platform/migrating-and-upgrading-projects',
@@ -311,6 +314,7 @@ const sidebars = {
collapsed: false,
items: [
{ type: 'link', label: 'Auth Server', href: '/reference/auth' },
{ type: 'link', label: 'Realtime Server', href: '/reference/realtime' },
{ type: 'link', label: 'Storage Server', href: '/reference/storage' },
],
},
+31
View File
@@ -0,0 +1,31 @@
/**
* Creating a sidebar enables you to:
- create an ordered group of docs
- render a sidebar for each doc of that group
- provide next/previous navigation
The sidebars can be generated from the filesystem, or explicitly defined here.
Create as many sidebars as you want.
*/
// @ts-check
/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
const sidebars = {
// By default, Docusaurus generates a sidebar from the docs folder structure
// tutorialSidebar: [{type: 'autogenerated', dirName: '.'}],
sidebar: [
'intro',
'generated/config',
'release-notes',
// {
// type: "category",
// label: "Release Notes",
// items: ["release-notes"],
// },
],
}
module.exports = sidebars
@@ -41,6 +41,7 @@ const sidebars = {
'generated/auth-signout',
'generated/auth-verifyotp',
'generated/auth-getsession',
'generated/auth-refreshsession',
'generated/auth-getuser',
'generated/auth-updateuser',
'generated/auth-setsession',
+4 -2
View File
@@ -18,7 +18,7 @@
"storage:version": "docusaurus docs:version:_storage",
"supabase-js:version": "docusaurus docs:version:_supabase_js",
"supabase-dart:version": "docusaurus docs:version:_supabase_dart",
"generate:all": "npm-run-all --parallel gen:api gen:cli gen:gotrue gen:storage gen:supabase-dart:v0 gen:supabase-dart:v1 gen:supabase-js:v1 gen:supabase-js:v2",
"generate:all": "npm-run-all --parallel gen:api gen:cli gen:gotrue gen:storage gen:supabase-dart:v0 gen:supabase-dart:v1 gen:supabase-js:v1 gen:supabase-js:v2 gen:realtime",
"gen:api": "npm-run-all gen:api:usage",
"gen:api:usage": "ts-node ./generator/index.ts gen --type api --url https://api.supabase.com --input ../../spec/transforms/api_v0_openapi_deparsed.json --output ./_api/usage.mdx",
"gen:cli": "npm-run-all gen:cli:commands gen:cli:config",
@@ -37,7 +37,9 @@
"gen:supabase-js:v1": "npm-run-all gen:supabase-js:v1:ref",
"gen:supabase-js:v1:ref": "ts-node ./generator/index.ts gen --type legacy --input ../../spec/supabase_js_v1.yml --output ./_supabase_js_versioned_docs/version-v1/generated",
"gen:supabase-js:v2": "npm-run-all gen:supabase-js:v2:ref",
"gen:supabase-js:v2:ref": "ts-node ./generator/index.ts gen --type legacy --input ../../spec/supabase_js_v2.yml --output ./_supabase_js/generated"
"gen:supabase-js:v2:ref": "ts-node ./generator/index.ts gen --type legacy --input ../../spec/supabase_js_v2.yml --output ./_supabase_js/generated",
"gen:realtime": "npm-run-all gen:realtime:config",
"gen:realtime:config": "ts-node ./generator/index.ts gen --type config --input ../../spec/realtime_v0_config.yaml --output ./_realtime/generated/config.mdx"
},
"dependencies": {
"@docusaurus/core": "^2.0.1",
@@ -31,7 +31,7 @@ export default function CustomCodeBlock({
</div>
{response && (
<>
<div className={'code-with-header repsonse-header'}>
<div className={'code-with-header response-header'}>
<a
className="code-header has-hover-pointer"
style={
+1 -1
View File
@@ -26,7 +26,7 @@ Global variables can be overridden at root like this:
}
```
Styles can be overriden like this:
Styles can be overridden like this:
```css
#__docusaurus {
@@ -10,6 +10,7 @@ const subNavRoutes = [
`/${baseUrl}/reference/cli`,
`/${baseUrl}/reference/auth`,
`/${baseUrl}/reference/storage`,
`/${baseUrl}/reference/realtime`,
`/${baseUrl}/reference/javascript`,
`/${baseUrl}/reference/dart`,
]
@@ -26,6 +27,9 @@ const headerNames = {
auth: {
name: 'Auth',
},
realtime: {
name: 'Realtime',
},
storage: {
name: 'Storage',
},
+3 -1
View File
@@ -18,4 +18,6 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*
**/*/generated
**/*/generated/**/*
!**/*/generated/.gitkeep
!**/*/generated/**/.gitkeep
+4 -4
View File
@@ -104,7 +104,7 @@ interface Session {
### New Auth methods
We're removing the `signIn()` method in favor of more explicit function signatures:
`signInWithPassword()`, `signInWithPasswordless()`, and `signInWithOtp()`.
`signInWithPassword()`, `signInWithOtp()`, and `signInWithOtp()`.
```ts
// v2
@@ -147,7 +147,7 @@ supabaseClient
.subscribe()
```
We will deprecate the `.from().on().subscribe()` method previosuly used for listening to postgres changes.
We will deprecate the `.from().on().subscribe()` method previously used for listening to postgres changes.
### Deprecated setAuth()
@@ -168,8 +168,8 @@ Deprecated and removed `setAuth()` . To set a custom `access_token` jwt instead,
- client-level `throwOnError`
- `gotrue-js`
- `supabase-js` client allows passing a `storageKey` param which will allow the user to set the key used in local storage for storing the session. By default, this will be namespace-d with the supabase project ref. ([PR](https://github.com/supabase/supabase-js/pull/460))
- `signIn` method is now split into `signInWithPassword` , `signInWithPasswordless` , `signInWithOAuth` ([PR](https://github.com/supabase/gotrue-js/pull/304))
- Deprecated and removed `session()` , `user()` in favour of using `getSession()` instead. `getSession()` will always return a valid session if a user is already logged in, meaning no more random logouts. ([PR](https://github.com/supabase/gotrue-js/pull/299))
- `signIn` method is now split into `signInWithPassword` , `signInWithOtp` , `signInWithOAuth` ([PR](https://github.com/supabase/gotrue-js/pull/304))
- Deprecated and removed `session()` , `user()` in favor of using `getSession()` instead. `getSession()` will always return a valid session if a user is already logged in, meaning no more random logouts. ([PR](https://github.com/supabase/gotrue-js/pull/299))
- Deprecated and removed setting for `multitab` support because `getSession()` and gotrue’s reuse interval setting takes care of session management across multiple tabs ([PR](https://github.com/supabase/gotrue-js/pull/366))
- No more throwing of random errors, gotrue-js v2 always returns a custom error type: ([PR](https://github.com/supabase/gotrue-js/pull/341))
- `AuthSessionMissingError`
+16 -7
View File
@@ -1,5 +1,6 @@
import React from 'react'
import Link from 'next/link'
import Image from 'next/image'
export default function ButtonCard({
children = undefined,
@@ -11,22 +12,30 @@ export default function ButtonCard({
}) {
return (
<Link href={to}>
<a className={['button-card h-full pb-4 block', `button-card--${layout}`].join(' ')}>
<a
className={[
'h-full block shadow-none bg-scale-400 rounded transition',
'border border-transparent hover:border-scale-600',
].join('')}
>
{children ? (
children
) : (
<div
className={`button-card__inner p-4 gap-1 flex ${
layout === 'vertical' ? 'flex-col' : 'items-center'
}`}
className={[
'px-6 py-4 gap-x-4 gap-y-2 flex',
`${layout === 'vertical' ? 'flex-col' : 'items-center'}`,
].join(' ')}
>
{icon && typeof icon == 'string' ? (
<img className="m-0" src={icon} width={24} alt={title} />
<div className="w-[24px] h-[24px]">
<Image className="m-0" src={icon} width={24} height={24} alt={title} />
</div>
) : (
icon
)}
<h3 className="mt-0">{title}</h3>
<p>{description}</p>
<h3 className="my-0 text-base truncate">{title}</h3>
<p className="my-0 text-sm truncate">{description}</p>
</div>
)}
</a>
@@ -7,9 +7,12 @@ import { DocSearchModal } from '@docsearch/react'
import clsx from 'clsx'
import { useActionKey } from '~/hooks/useActionKey'
const INDEX_NAME = 'tailwindcss_dev'
const API_KEY = '5fc87cef58bb80203d2207578309fab6'
const APP_ID = 'KNPXZI5B0M'
// [Joshen] We're currently using this over Algolia search for the time being
// Refer to the comment in Navigation/AlgoliaSearch for more information about this
const INDEX_NAME = process.env.NEXT_PUBLIC_ALGOLIA_INDEX_NAME
const API_KEY = process.env.NEXT_PUBLIC_ALGOLIA_SEARCH_API_KEY
const APP_ID = process.env.NEXT_PUBLIC_ALGOLIA_APP_ID
const SearchContext = createContext(null)
@@ -64,10 +67,6 @@ export function SearchProvider({ children }: any) {
// @ts-ignore
initialQuery={initialQuery}
initialScrollY={window.scrollY}
searchParameters={{
facetFilters: 'version:v3',
distinct: 1,
}}
placeholder="Search documentation"
onClose={onClose}
indexName={INDEX_NAME}
+40 -36
View File
@@ -4,56 +4,82 @@ const Frameworks = () => {
const frameworks = [
{
name: 'Angular',
// logo: AngularLogo,
logo: {
light: '/docs/img/libraries/angular-icon.svg',
dark: '/docs/img/libraries/angular-icon.svg',
},
href: '/guides/with-angular',
},
{
name: 'Expo',
// logo: ExpoLogo,
logo: {
light: '/docs/img/libraries/expo-icon.svg',
dark: '/docs/img/libraries/expo-icon.svg',
},
href: '/guides/with-expo',
},
{
name: 'Flutter',
// logo: FlutterLogo,
logo: {
light: '/docs/img/libraries/dart-icon.svg',
dark: '/docs/img/libraries/dart-icon.svg',
},
href: '/guides/with-flutter',
},
{
name: 'JavaScript',
// logo: JavascriptLogo,
logo: {
light: '/docs/img/libraries/javascript-icon.svg',
dark: '/docs/img/libraries/javascript-icon.svg',
},
href: '/reference/javascript/installing#javascript',
},
{
name: 'Next.js',
themed: true,
logo: {
dark: '/img/libraries/nextjs-dark-icon.svg',
light: '/img/libraries/nextjs-light-icon.svg',
light: '/docs/img/libraries/nextjs-icon.svg',
dark: '/docs/img/libraries/nextjs-icon.svg',
},
href: '/guides/with-nextjs',
},
{
name: 'React',
// logo: ReactLogo,
logo: {
light: '/docs/img/libraries/react-icon.svg',
dark: '/docs/img/libraries/react-icon.svg',
},
href: '/guides/with-react',
},
{
name: 'RedwoodJS',
// logo: RedwoodJsLogo,
logo: {
light: '/docs/img/libraries/redwoodjs-icon.svg',
dark: '/docs/img/libraries/redwoodjs-icon.svg',
},
href: '/guides/with-redwoodjs',
},
{
name: 'SolidJS',
// logo: SolidJSLogo,
logo: {
light: '/docs/img/libraries/solidjs-icon.svg',
dark: '/docs/img/libraries/solidjs-icon.svg',
},
href: '/guides/with-solidjs',
},
{
name: 'Svelte',
// logo: SvelteLogo,
logo: {
light: '/docs/img/libraries/svelte-icon.svg',
dark: '/docs/img/libraries/svelte-icon.svg',
},
href: '/guides/with-svelte',
},
{
name: 'Vue',
// logo: VuejsLogo,
logo: {
light: '/docs/img/libraries/vuejs-icon.svg',
dark: '/docs/img/libraries/vuejs-icon.svg',
},
href: '/guides/with-vue-3',
},
]
@@ -65,30 +91,8 @@ const Frameworks = () => {
layout="horizontal"
to={x.href}
title={x.name}
// icon={
// x.logo && !x.themed ? (
// <x.logo
// width="20"
// alt={x.name}
// style={{ display: 'block', maxHeight: 20, minWidth: 20 }}
// />
// ) : (
// <ThemedImage
// style={{
// display: 'block',
// maxHeight: 20,
// minWidth: 20,
// margin: 0,
// }}
// alt={x.name}
// width="20"
// sources={{
// light: useBaseUrl(x.logo.light),
// dark: useBaseUrl(x.logo.dark),
// }}
// />
// )
// }
// [Joshen] Nice to have: theming
icon={x.logo.dark}
/>
</div>
))}
@@ -0,0 +1,167 @@
import { render } from 'react-dom'
import { IconCommand } from 'ui'
import { createElement, FC, useEffect, useRef, Fragment } from 'react'
import algoliasearch from 'algoliasearch/lite'
import { autocomplete, getAlgoliaResults } from '@algolia/autocomplete-js'
import { createLocalStorageRecentSearchesPlugin } from '@algolia/autocomplete-plugin-recent-searches'
import { useRouter } from 'next/router'
// [Joshen] We're currently using DocSearch from Algolia as it provides a nice
// UI out of the box + some good preconfigured search settings (e.g hierarchy).
// However, we're using our own Algolia account to store the records in the indexes
// (rather than going through the DocSearch program from Algolia where they'll crawl
// our site for us). Refer to scripts/build-search on how we're saving the records.
// Using Algolia's autocomplete library gives us full flexbility in terms of customizing
// our search experience, but that will take time to figure out. Hence why for now we're just
// using DocSearch with our own records.
// Potentially for search, we could
// - Go ahead with the DocSearch program and let them crawl our site to generate the records
// - But we need to ensure that our site is semantically correct first
// - Use Algolia itself to flesh out our own search logic
// - The basics are already set up to be honest, but will take time to make it great
// - Go back to Typesense if we deem that Algolia is not helpful in the long run
const searchClient = algoliasearch(
process.env.NEXT_PUBLIC_ALGOLIA_APP_ID,
process.env.NEXT_PUBLIC_ALGOLIA_SEARCH_API_KEY
)
// [Joshen] Not working properly, but lets not get stuck on this
// Priority just to get a search working
const recentSearchesPlugin = createLocalStorageRecentSearchesPlugin({
key: 'docs-search',
limit: 3,
//@ts-ignore
transformSource({ source }) {
return {
...source,
templates: {
...source.templates,
header({ state }) {
if (state.query) return null
return (
<Fragment>
<span className="aa-SourceHeaderTitle">Your searches</span>
<div className="aa-SourceHeaderLine" />
</Fragment>
)
},
},
}
},
})
interface Props {}
const AlgoliaSearch: FC<Props> = ({}) => {
const searchRef = useRef(null)
const router = useRouter()
useEffect(() => {
if (!searchRef.current) {
return undefined
}
const search = autocomplete({
openOnFocus: true,
container: searchRef.current,
defaultActiveItemId: 0,
detachedMediaQuery: '',
// @ts-ignore
renderer: { createElement, Fragment, render },
placeholder: 'Search docs',
plugins: [recentSearchesPlugin],
renderNoResults({ state, render }, root) {
render(
<div className="text-scale-1100 py-2 text-sm px-4">
No results found for {state.query}.
</div>,
root
)
},
navigator: {
navigate({ itemUrl }) {
router.push(itemUrl)
},
},
onSelect({ item, setQuery, setIsOpen, refresh }) {
console.log('onSelect', item.url)
},
// @ts-ignore
getSources({ query }) {
return [
{
sourceId: 'pages',
templates: {
item({ item, components }) {
return (
<a
href={item.url as string}
className="aa-ItemLink truncate flex justify-between space-x-4"
>
<div className="aa-ItemContent w-full">
<div className="aa-ItemTitle flex items-center space-x-1">
{item.category && (
<p
className={`${
['cli', 'api'].includes(item.category as string)
? 'uppercase'
: 'capitalize'
}`}
>
{item.category}
{item.version ? ` (${item.version})` : ''}:
</p>
)}
<p>
<components.Highlight hit={item} attribute="title" />
</p>
</div>
<p className="aa-ItemContentSubtitle">{item.description}</p>
</div>
</a>
)
},
},
getItemUrl({ item }) {
return item.url
},
getItems() {
// if (!query) return []
return getAlgoliaResults({
searchClient,
queries: [
{
indexName: 'dev_docs',
query,
},
],
})
},
},
]
},
})
return () => {
search.destroy()
}
}, [])
return (
<div className="w-[200px] relative">
<div ref={searchRef} />
<div className="flex items-center space-x-1 absolute top-[7px] right-2">
<div className="text-scale-1200 flex items-center justify-center h-6 w-6 rounded bg-scale-500">
<IconCommand size={12} strokeWidth={1.5} />
</div>
<div className="text-xs text-scale-1200 flex items-center justify-center h-6 w-6 rounded bg-scale-500">
K
</div>
</div>
</div>
)
}
export default AlgoliaSearch
+64 -16
View File
@@ -1,13 +1,31 @@
import Image from 'next/image'
import Link from 'next/link'
import { useState, useEffect } from 'react'
import { IconMenu, IconSearch, Input, IconCommand, Button, IconMoon, IconSun } from 'ui'
import { useRouter } from 'next/router'
import { useState, useEffect, FC } from 'react'
import { IconMenu, IconMoon, IconSearch, IconSun, IconCommand, Listbox } from 'ui'
import { useTheme } from '../Providers'
import { REFERENCES } from './Navigation.constants'
import { SearchButton } from '../DocSearch'
const NavBar = ({ currentPage }: { currentPage: string }) => {
interface Props {
currentPage: string
}
const NavBar: FC<Props> = ({ currentPage }) => {
const { isDarkMode, toggleTheme } = useTheme()
const [mounted, setMounted] = useState(false)
const { asPath, push } = useRouter()
const pathSegments = asPath.split('/')
const library = pathSegments.length >= 3 ? pathSegments[2] : undefined
const libraryMeta = REFERENCES?.[library] ?? undefined
const versions = libraryMeta?.versions ?? []
const version = versions.includes(pathSegments[pathSegments.indexOf(library) + 1])
? pathSegments[pathSegments.indexOf(library) + 1]
: versions[0]
useEffect(() => {
setMounted(true)
}, [isDarkMode])
@@ -25,6 +43,16 @@ const NavBar = ({ currentPage }: { currentPage: string }) => {
document.documentElement.className = key === 'true' ? 'dark' : ''
}
const onSelectVersion = (version: string) => {
// [Joshen] Ideally we use <Link> but this works for now
if (!library) return
if (version === versions[0]) {
push(`/reference/${library}`)
} else {
push(`/reference/${library}/${version}`)
}
}
return (
<nav
className={[
@@ -67,7 +95,24 @@ const NavBar = ({ currentPage }: { currentPage: string }) => {
))}
</ul>
</nav>
{versions.length > 0 && (
<div className="ml-8">
<Listbox
size="small"
defaultValue={version}
style={{ width: '70px' }}
onChange={onSelectVersion}
>
{versions.map((version) => (
<Listbox.Option key={version} label={version} value={version}>
{version}
</Listbox.Option>
))}
</Listbox>
</div>
)}
</div>
<div className="flex items-center space-x-4">
<div className="hidden items-center md:flex">
<ul className="flex items-center">
@@ -137,19 +182,22 @@ const NavBar = ({ currentPage }: { currentPage: string }) => {
</li>
</ul>
</div>
<Input
placeholder="Search"
icon={<IconSearch />}
type="search"
actions={[
<Button disabled key="icon-command" type="default" size="tiny">
<IconCommand size="tiny" />
</Button>,
<Button disabled key="icon-letter" type="default" size="tiny">
K
</Button>,
]}
/>
<SearchButton>
<div className="flex items-center justify-between space-x-6 bg-scale-300 border border-scale-700 pl-3 pr-1.5 py-1.5 rounded">
<div className="flex items-center space-x-2">
<IconSearch className="text-scale-1100" size={18} strokeWidth={2} />
<p className="text-scale-800 text-sm">Search docs</p>
</div>
<div className="flex items-center space-x-1">
<div className="text-scale-1200 flex items-center justify-center h-6 w-6 rounded bg-scale-500">
<IconCommand size={12} strokeWidth={1.5} />
</div>
<div className="text-xs text-scale-1200 flex items-center justify-center h-6 w-6 rounded bg-scale-500">
K
</div>
</div>
</div>
</SearchButton>
</div>
</nav>
)
@@ -7,19 +7,33 @@ import SupabaseAPINav from 'data/nav/supabase-api'
import AuthServerNav from 'data/nav/auth-server'
import StorageServerNav from 'data/nav/storage-server'
export interface NavMenu {
[key: string]: NavMenuGroup[]
}
import { NavMenu, References } from './Navigation.types'
export interface NavMenuGroup {
label: string
items: NavMenuSection[]
}
export interface NavMenuSection {
name: string
url?: string
items: NavMenuSection[]
export const REFERENCES: References = {
javascript: {
name: 'supabase-js',
library: 'supabase-js',
versions: ['v2', 'v1'],
icon: '/docs/img/libraries/javascript-icon.svg',
},
dart: {
name: 'Flutter',
library: 'supabase-dart',
versions: ['v1', 'v0'],
icon: '/docs/img/libraries/dart-icon.svg',
},
cli: {
name: 'CLI',
library: undefined,
versions: [],
icon: '/docs/img/libraries/cli-icon.svg',
},
api: {
name: 'API',
library: undefined,
versions: [],
icon: '/docs/img/libraries/api-icon.svg',
},
}
export const menuItems: NavMenu = {
@@ -109,6 +123,7 @@ export const menuItems: NavMenu = {
{ name: 'Auth UI', url: '/guides/auth/auth-helpers/auth-ui', items: [] },
{ name: 'Next.js', url: '/guides/auth/auth-helpers/nextjs', items: [] },
{ name: 'SvelteKit', url: '/guides/auth/auth-helpers/sveltekit', items: [] },
{ name: 'Remix', url: '/guides/auth/auth-helpers/remix', items: [] },
],
},
{
@@ -233,7 +248,7 @@ export const menuItems: NavMenu = {
{ name: 'Firebase Auth', url: '/guides/migrations/firebase-auth', items: [] },
{ name: 'Firestore Data', url: '/guides/migrations/firestore-data', items: [] },
{ name: 'Firebase Storage', url: '/guides/migrations/firebase-storage', items: [] },
{ name: 'Herokuy', url: '/guides/migrations/heroku', items: [] },
{ name: 'Heroku', url: '/guides/migrations/heroku', items: [] },
],
},
{
@@ -288,10 +303,10 @@ export const menuItems: NavMenu = {
label: 'Official',
items: [
{ name: 'Reference Documentation', url: '/reference', items: [] },
{ name: 'Supabase Javascript Library', url: '/reference/javascript', items: [] },
{ name: 'Supabase JavaScript Library', url: '/reference/javascript', items: [] },
{ name: 'Supabase Flutter Library', url: '/reference/dart', items: [] },
{ name: 'Supabase CLI', url: '/reference/cli', items: [] },
{ name: 'Supabase API', url: '/reference/api', items: [] },
{ name: 'Management API', url: '/reference/api', items: [] },
],
},
{
@@ -0,0 +1,23 @@
export interface NavMenu {
[key: string]: NavMenuGroup[]
}
export interface NavMenuGroup {
label: string
items: NavMenuSection[]
}
export interface NavMenuSection {
name: string
url?: string
items: NavMenuSection[]
}
export interface References {
[key: string]: {
name: string
library?: string
versions: string[]
icon: string
}
}
@@ -2,7 +2,8 @@ import Link from 'next/link'
import Image from 'next/image'
import { useRouter } from 'next/router'
import { IconChevronRight, IconArrowLeft } from '~/../../packages/ui'
import { NavMenuGroup, NavMenuSection } from './Nav.constants'
import { REFERENCES } from './Navigation.constants'
import { NavMenuGroup, NavMenuSection } from './Navigation.types'
import * as Accordion from '@radix-ui/react-accordion'
const SideBar = ({ menuItems = [] }: { menuItems: any }) => {
@@ -10,13 +11,7 @@ const SideBar = ({ menuItems = [] }: { menuItems: any }) => {
const pathSegments = asPath.split('/')
const isInReferencePages = pathSegments.includes('reference') && pathSegments.length >= 3
const references = {
javascript: { name: 'supabase-js', icon: '/docs/img/libraries/javascript-icon.svg' },
dart: { name: 'Flutter', icon: '/docs/img/libraries/dart-icon.svg' },
cli: { name: 'CLI', icon: '/docs/img/libraries/cli-icon.svg' },
api: { name: 'API', icon: '/docs/img/libraries/api-icon.svg' },
}
const referenceMeta = pathSegments.length >= 3 ? references[pathSegments[2]] : undefined
const referenceMeta = pathSegments.length >= 3 ? REFERENCES[pathSegments[2]] : undefined
const currentSection: NavMenuGroup = menuItems.find((group) => {
const foundItem = group.items.find((section) => {
@@ -45,8 +40,6 @@ const SideBar = ({ menuItems = [] }: { menuItems: any }) => {
})
: undefined
console.log({ currentSection, currentSubSection })
return (
<div
className="dark:bg-scale-200 dark:border-scale-400 sidebar-width sticky top-0
@@ -80,6 +73,7 @@ const SideBar = ({ menuItems = [] }: { menuItems: any }) => {
)}
{menuItems.length === 1 ? (
<div className="my-2">
<h4 className="text-scale-1200 pt-2 pb-3">{menuItems[0].label}</h4>
{menuItems[0].items.map((item) => (
<Link href={item.url}>
<a>
File renamed without changes.
+29
View File
@@ -0,0 +1,29 @@
# [WIP] Adding navigation for a new section
[Note] This isn't the best way for versioning in my opinion, but this is the current way to do it while we're migrating to Next.js
This folder holds the structure for the side navigation menu in the reference documentation pages. Each reference section (as well as their individual versions where applicable) have its own set of navigation.
The following are relevant to adding navigation for a new section:
- `getPageType()` from `lib/helpers`
- `menuItems` and `REFERENCES` from `components/Navigation/Navigation.constants`
- `NavMenu` from `components/Navigation/Navigation.types`
## Adding navigation for a section that doesn't require versioning
Example for standalone sections are the API and CLI reference pages. You'll just need to add a new file in this folder following the `NavMenu` interface (naming is arbitrary).
Thereafter, update `getPageType` to be able to get the page type based on the URL path - preferably follow the syntax of `reference/{section_name}`.
Finally, add the menu to `menuItems` under a new key - the key should be what you added to `getPageType` before.
## Adding navigation for a section that requires versioning
This is more applicable for client libraries (e.g supabase-js and supabase-dart). Versions will all sit within their own folder - if the folder doesn't exist yet, just create one. The navigation for each section will then be named as 'v1', 'v2', and so on.
Then, update `REFERENCES` accordingly.
Thereafter, update `getPageType` to be able to get the page type based on the URL path - preferably follow the syntax of `reference/{section_name}/{version}`. Typically the latest version available will not have the `/{version}` in it.
Finally, add the menu to `menuItems` under a new key - the key should be what you added to `getPageType` before.
+1 -1
View File
@@ -2,7 +2,7 @@ const Nav = [
{
label: 'Getting Started',
items: [
{ name: 'Supabase Javascript Library', url: '/reference/javascript/v1', items: [] },
{ name: 'Supabase JavaScript Library', url: '/reference/javascript/v1', items: [] },
{ name: 'Installing', url: '/reference/javascript/v1/installing', items: [] },
{ name: 'Initializing', url: '/reference/javascript/v1/initializing', items: [] },
{ name: 'Generating Types', url: '/reference/javascript/v1/generating-types', items: [] },
+1 -1
View File
@@ -2,7 +2,7 @@ const Nav = [
{
label: 'Getting Started',
items: [
{ name: 'Supabase Javascript Library', url: '/reference/javascript', items: [] },
{ name: 'Supabase JavaScript Library', url: '/reference/javascript', items: [] },
{ name: 'Installing', url: '/reference/javascript/installing', items: [] },
{ name: 'Initializing', url: '/reference/javascript/initializing', items: [] },
{ name: 'Typescript Support', url: '/reference/javascript/typescript-support', items: [] },
@@ -0,0 +1,26 @@
const nonGeneratedReferencePages = [
'docs/reference/javascript',
'docs/reference/javascript/installing',
'docs/reference/javascript/release-notes',
'docs/reference/javascript/upgrade-guide',
'docs/reference/javascript/typescript-support',
'docs/reference/javascript/v1',
'docs/reference/javascript/v1/installing',
'docs/reference/javascript/v1/initializing',
'docs/reference/javascript/v1/generating-types',
'docs/reference/dart',
'docs/reference/dart/installing',
'docs/reference/dart/initializing',
'docs/reference/dart/upgrade-guide',
'docs/reference/dart/v0',
'docs/reference/api',
'docs/reference/api/release-notes',
'docs/reference/cli',
'docs/reference/cli/release-notes',
'docs/reference/auth',
'docs/reference/auth/release-notes',
'docs/reference/storage',
'docs/reference/storage/release-notes',
]
export default nonGeneratedReferencePages
+148 -8
View File
@@ -1,16 +1,156 @@
---
title: 'Architecture',
description: 'Supabase Architecture',
id: architecture
title: Architecture
description: 'Supabase design and architecture'
---
# Architecture
Supabase is open source. We choose open source tools which are scalable and make them simple to use.
Supabase is open source. Wherever possible, we use and support existing tools rather than developing from scratch. We choose open source tools which are scalable and we make them simple to use.
Supabase is not a 1-to-1 mapping of Firebase. While we are building many of the features that Firebase offers, we are not going about it the same way:
our technological choices are quite different; everything we use is open source; and wherever possible, we use and support existing tools rather than developing from scratch.
![Supabase Architecture](https://supabase.com/docs/assets/images/supabase-architecture-9050a7317e9ec7efb7807f5194122e48.png)
Most notably, we use Postgres rather than a NoSQL store. This choice was deliberate. We believe that no other database offers the functionality required to compete with Firebase,
while maintaining the scalability required to go beyond it.
Supabase is not a 1-to-1 mapping of Firebase. While we are building many of the features that Firebase offers, we are not going about it the same way.
## Architecture
Our technological choices are quite different to Firebase. Everything we use is open source. Wherever possible, we use and support existing tools in the ecosystem, rather than developing from scratch.
Each Supabase project consists of several tools:
Most notably, we use Postgres rather than a NoSQL store. This was a deliberate choice. We believe that no other database on the market offers the scalability and functionality required to legitimately compete with Firebase.
![Supabase Architecture](/img/supabase-architecture.png)
### PostgreSQL (Database)
PostgreSQL is the core of Supabase. We do not abstract the PostgreSQL database — you can access it and use it with full privileges. We simply provide tools which makes PostgreSQL as easy to use as Firebase.
- Official Docs: [postgresql.org/docs](https://www.postgresql.org/docs/current/index.html)
- Source code: [github.com/postgres/postgres](https://github.com/postgres/postgres) (mirror)
- License: [PostgreSQL Licence](https://www.postgresql.org/about/licence/)
- Language: C
### Studio (Dashboard)
An open source Dashboard for managing your database and services.
- Official Docs: [Supabase docs](/docs)
- Source code: [github.com/supabase/supabase](https://github.com/supabase/supabase/tree/master/studio)
- License: [Apache 2](https://github.com/supabase/supabase/blob/master/LICENSE)
- Language: TypeScript
### GoTrue (Auth)
A JWT-based API for managing users and issuing access tokens. This integrates with PostgreSQL's Row Level Security and the API servers.
- Official Docs: [Supabase Auth reference docs](/docs/reference/auth)
- Source code: [github.com/supabase/gotrue](https://github.com/supabase/gotrue)
- License: [MIT](https://github.com/supabase/gotrue/blob/master/LICENSE)
- Language: Go
### PostgREST (API)
A standalone web server that turns your PostgreSQL database directly into a RESTful API.
We use this with our [pg_graphql](https://github.com/supabase/pg_graphql) extension to provide a GraphQL API.
- Official Docs: [postgrest.org](https://postgrest.org/)
- Source code: [github.com/PostgREST/postgrest](https://github.com/PostgREST/postgrest)
- License: [MIT](https://github.com/PostgREST/postgrest/blob/main/LICENSE)
- Language: Haskel
### Realtime (API & multiplayer)
A scalable websocket engine for managing user Presence, broadcasting messages, and streaming database changes.
- Official Docs: [Supabase Realtime docs](/docs/guides/realtime)
- Source code: [github.com/supabase/realtime](https://github.com/supabase/realtime)
- License: [Apache 2](https://github.com/supabase/realtime/blob/master/LICENSE)
- Language: Elixir
### Storage API (large file storage)
An S3-compatible object storage service that stores metadata in Postgres.
- Official Docs: [Supabase Storage reference docs](/docs/reference/storage)
- Source code: [github.com/supabase/storage-api](https://github.com/supabase/storage-api)
- License: [Apache 2.0](https://github.com/supabase/storage-api/blob/master/LICENSE)
- Language: NodeJS / TypeScript
### Deno (Edge Functions)
A modern runtime for JavaScript and TypeScript.
- Official Docs: [deno.land](https://deno.land/)
- Source code: [github.com/denoland/deno](https://github.com/denoland/deno)
- License: [MIT](https://github.com/denoland/deno/blob/main/LICENSE.md)
- Language: TypeScript / Rust
### postgres-meta (Database management)
A RESTful API for managing your Postgres. Fetch tables, add roles, and run queries.
- Official Docs: [supabase.github.io/postgres-meta](https://supabase.github.io/postgres-meta/)
- Source code: [github.com/supabase/postgres-meta](https://github.com/supabase/postgres-meta)
- License: [Apache 2.0](https://github.com/supabase/postgres-meta/blob/master/LICENSE)
- Language: NodeJS / TypeScript
### PgBouncer
A lightweight connection pooler for PostgreSQL. This is useful for connecting to Postgres when using Serverless functions.
- Official Docs: [pgbouncer.org](http://www.pgbouncer.org/)
- Source code: [pgbouncer/pgbouncer](https://github.com/pgbouncer/pgbouncer)
- License: [ISC](https://github.com/pgbouncer/pgbouncer/blob/master/COPYRIGHT)
- Language: C
### Kong (API Gateway)
A cloud-native API gateway, built on top of Nginx.
- Official Docs: [docs.konghq.com](https://docs.konghq.com/)
- Source code: [github.com/kong/kong](https://github.com/kong/kong)
- License: [Apache 2.0](https://github.com/Kong/kong/blob/master/LICENSE)
- Language: Lua
## Product Principles
It is our goal to provide an architecture that any large-scale company would design for themselves,
and then provide tooling around that architecture that is easy-to-use for indie-developers and small teams.
We use a series of principles to ensure that scalability and usability are never mutually exclusive:
### Everything works in isolation
Each system must work as a standalone tool with as few moving parts as possible.
The litmus test for this is: "Can a user run this product with nothing but a Postgres database?"
### Everything is integrated
Supabase is composable. Even though every product works in isolation, each product on the platform needs to 10x the other products.
For integration, each tool should expose an API and Webhooks.
### Everything is extensible
We're deliberate about adding a new tool, and prefer instead to extend an existing one.
This is the opposite of many cloud providers whose product offering expands into niche use-cases. We provide _primitives_ for developers, which allow them to achieve any goal.
Less, but better.
### Everything is portable
To avoid lock-in, we make it easy to migrate in and out. Our cloud offering is compatible with our self-hosted product.
We use existing standards to increase portability (like pg_dump an CSV files). If a new standard emerges which competes with a "Supabase" approach, we will deprecate the approach in favor of the standard.
This forces us compete on experience. We aim to be the best Postgres hosting service.
### Play the long game
We sacrifice short-term wins for long-term gains. For example, it is tempting to run a fork of Postgres with additional functionality which only our customers need.
Instead, we prefer to support efforts to upstream missing functionality so that the entire community benefits. This has the additional benefit of ensuring portability and longevity.
### Build for developers
"Developers" are a specific profile of user: they are _builders_.
When assessing impact as a function of effort, developers have a large efficiency due to the type of products and systems they can build.
As the profile of a developer changes over time, Supabase will continue to evolve the product to fit this evolving profile.
### Support existing tools
Supabase supports existing tools and communities wherever possible. Supabase is more like a "community of communities" - each tool typically has its own community
which we work with.
Open source is something we approach [collaboratively](https://supabase.com/blog/supabase-series-b#giving-back): we employ maintainers, sponsor projects, invest in businesses, and develop our own open source tools.
@@ -1,35 +0,0 @@
---
id: config-reference
title: "Config reference"
slug: config-reference
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/cli.yml
---
import Tabs from '@theme/Tabs';
import TabsPanel from '@theme/TabsPanel';
The config file resides in `supabase/config.json` after you run `supabase init`.
#### `projectId` (required)
A string used to distinguish different Supabase projects on the same host. Defaults to the working directory name when running `supabase init`.
#### `ports.api` (required)
Host port used for the API URL. Defaults to `54321`.
#### `ports.db` (required)
Host port used for the DB URL. Defaults to `54322`.
#### `ports.studio` (required)
Host port used for Supabase Studio. Defaults to `54323`.
#### `ports.inbucket` (optional)
Host port used for the web interface of Inbucket email testing server. When not specified, emails are automatically confirmed. When specified, emails are not sent to the recipient, but rather monitored and accessible via the web interface.
#### `dbVersion` (required)
Server version number used for the database. This needs to match the server version number of the remote database you intend to link to with `supabase db remote set`. You can retrieve it by running `SHOW server_version_num`.
-27
View File
@@ -1,27 +0,0 @@
---
id: index
title: "About"
slug: about
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/cli.yml
---
import Tabs from '@theme/Tabs';
import TabsPanel from '@theme/TabsPanel';
The Supabase CLI can be found in our [CLI](https://github.com/supabase/cli) repository.
- [x] Running Supabase locally
- [x] Managing database migrations
- [x] Pushing your local changes to production
- [ ] Manage your Supabase Account
- [ ] Manage your Supabase Projects
- [ ] Generating types directly from your database schema
- [ ] Generating API and validation schemas from your database
## Installing the CLI
Installation instructions can be found [here](https://github.com/supabase/cli#install-the-cli).
## Support
Report issues to our [issue tracker](https://github.com/supabase/cli/issues).
@@ -1,16 +0,0 @@
---
id: supabase-db-branch-create
title: "supabase db branch create"
slug: supabase-db-branch-create
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/cli.yml
---
import Tabs from '@theme/Tabs';
import TabsPanel from '@theme/TabsPanel';
```
Create a branch.
Usage:
supabase db branch create <branch name>
```
@@ -1,16 +0,0 @@
---
id: supabase-db-branch-delete
title: "supabase db branch delete"
slug: supabase-db-branch-delete
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/cli.yml
---
import Tabs from '@theme/Tabs';
import TabsPanel from '@theme/TabsPanel';
```
Delete a branch.
Usage:
supabase db branch delete <branch name>
```
@@ -1,16 +0,0 @@
---
id: supabase-db-branch-list
title: "supabase db branch list"
slug: supabase-db-branch-list
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/cli.yml
---
import Tabs from '@theme/Tabs';
import TabsPanel from '@theme/TabsPanel';
```
List branches.
Usage:
supabase db branch list
```
@@ -1,16 +0,0 @@
---
id: supabase-db-changes
title: "supabase db changes"
slug: supabase-db-changes
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/cli.yml
---
import Tabs from '@theme/Tabs';
import TabsPanel from '@theme/TabsPanel';
```
Diffs the local database with current migrations, then print the diff to standard output.
Usage:
supabase db changes
```
@@ -1,16 +0,0 @@
---
id: supabase-db-commit
title: "supabase db commit"
slug: supabase-db-commit
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/cli.yml
---
import Tabs from '@theme/Tabs';
import TabsPanel from '@theme/TabsPanel';
```
Diffs the local database with current migrations, writing it as a new migration.
Usage:
supabase db commit <migration name>
```
@@ -1,16 +0,0 @@
---
id: supabase-db-push
title: "supabase db push"
slug: supabase-db-push
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/cli.yml
---
import Tabs from '@theme/Tabs';
import TabsPanel from '@theme/TabsPanel';
```
Push new migrations to the remote database.
Usage:
supabase db push
```
@@ -1,16 +0,0 @@
---
id: supabase-db-remote-commit
title: "supabase db remote commit"
slug: supabase-db-remote-commit
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/cli.yml
---
import Tabs from '@theme/Tabs';
import TabsPanel from '@theme/TabsPanel';
```
Commit changes on the remote database since the last pushed migration.
Usage:
supabase db remote commit
```
@@ -1,16 +0,0 @@
---
id: supabase-db-remote-set
title: "supabase db remote set"
slug: supabase-db-remote-set
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/cli.yml
---
import Tabs from '@theme/Tabs';
import TabsPanel from '@theme/TabsPanel';
```
Set the remote database to push migrations to.
Usage:
supabase db remote set <remote database url>
```
@@ -1,16 +0,0 @@
---
id: supabase-db-reset
title: "supabase db reset"
slug: supabase-db-reset
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/cli.yml
---
import Tabs from '@theme/Tabs';
import TabsPanel from '@theme/TabsPanel';
```
Resets the local database to reflect current migrations. Any changes on the local database that is not committed will be lost.
Usage:
supabase db reset
```
@@ -1,16 +0,0 @@
---
id: supabase-db-switch
title: "supabase db switch"
slug: supabase-db-switch
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/cli.yml
---
import Tabs from '@theme/Tabs';
import TabsPanel from '@theme/TabsPanel';
```
Switch branches.
Usage:
supabase db switch <branch name>
```
@@ -1,17 +0,0 @@
---
id: supabase-eject
title: "supabase eject"
slug: supabase-eject
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/cli.yml
---
import Tabs from '@theme/Tabs';
import TabsPanel from '@theme/TabsPanel';
```bash
supabase eject
```
Run in any folder to create a `docker` folder with a `docker-compose.yml`. This is useful for self-hosting or adding custom configuration.
See our [Self Hosting](/docs/guides/hosting/overview) docs for more details.
-17
View File
@@ -1,17 +0,0 @@
---
id: supabase-help
title: "supabase help"
slug: supabase-help
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/cli.yml
---
import Tabs from '@theme/Tabs';
import TabsPanel from '@theme/TabsPanel';
```
Help provides help for any command in the application.
Simply type supabase help [path to command] for full details.
Usage:
supabase help [command]
```
-16
View File
@@ -1,16 +0,0 @@
---
id: supabase-init
title: "supabase init"
slug: supabase-init
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/cli.yml
---
import Tabs from '@theme/Tabs';
import TabsPanel from '@theme/TabsPanel';
```
Initialize a project to use Supabase CLI.
Usage:
supabase init
```
@@ -1,16 +0,0 @@
---
id: supabase-migration-new
title: "supabase migration new"
slug: supabase-migration-new
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/cli.yml
---
import Tabs from '@theme/Tabs';
import TabsPanel from '@theme/TabsPanel';
```
Create an empty migration.
Usage:
supabase migration new <migration name>
```
@@ -1,16 +0,0 @@
---
id: supabase-start
title: "supabase start"
slug: supabase-start
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/cli.yml
---
import Tabs from '@theme/Tabs';
import TabsPanel from '@theme/TabsPanel';
```
Start the Supabase local development setup.
Usage:
supabase start
```
-15
View File
@@ -1,15 +0,0 @@
---
id: supabase-stop
title: "supabase stop"
slug: supabase-stop
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/cli.yml
---
import Tabs from '@theme/Tabs';
import TabsPanel from '@theme/TabsPanel';
```bash
supabase stop
```
When you are finished with Supabase, run `supabase stop` to stop the Docker services.
-54
View File
@@ -1,54 +0,0 @@
---
id: aup
title: Acceptable Use Policy
---
# Acceptable Use Policy
`Last Modified: 15 April 2021`
This Acceptable Use Policy (this “Policy”) describes prohibited uses of the web services offered by Supabase, Inc. and its affiliates (the “Services”) and the website located at https://supabase.com (the “Supabase Site”). The examples described in this Policy are not exhaustive. We may modify this Policy at any time by posting a revised version on the Supabase Site. By using the Services or accessing the Supabase Site, you agree to the latest version of this Policy. If you violate the Policy or authorize or help others to do so, we may suspend or terminate your use of the Services.
## No Illegal, Harmful, or Offensive Use or Content
You may not use, or encourage, promote, facilitate or instruct others to use, the Services or Supabase Site for any illegal, harmful, fraudulent, infringing or offensive use, or to transmit, store, display, distribute or otherwise make available content that is illegal, harmful, fraudulent, infringing or offensive. Prohibited activities or content include:
- **Illegal, Harmful or Fraudulent Activities.** Any activities that are illegal, that violate the rights of others, or that may be harmful to others, our operations or reputation, including disseminating, promoting or facilitating child pornography, offering or disseminating fraudulent goods, services, schemes, or promotions, make-money-fast schemes, ponzi and pyramid schemes, phishing, or pharming.
- **Infringing Content.** Content that infringes or misappropriates the intellectual property or proprietary rights of others.
- **Offensive Content.** Content that is defamatory, obscene, abusive, invasive of privacy, or otherwise objectionable, including content that constitutes child pornography, relates to bestiality, or depicts non-consensual sex acts.
- **Harmful Content.** Content or other computer technology that may damage, interfere with, surreptitiously intercept, or expropriate any system, program, or data, including viruses, Trojan horses, worms, time bombs, or cancelbots.
- **Platform compliance.** Any activities that are deemed unacceptable by the platforms used by the Supabase Site and Services, including [AWS](https://aws.amazon.com/aup/).
## No Security Violations
You may not use the Services to violate the security or integrity of any network, computer or communications system, software application, or network or computing device (each, a “System”). Prohibited activities include:
- **Unauthorized Access.** Accessing or using any System without permission, including attempting to probe, scan, or test the vulnerability of a System or to breach any security or authentication measures used by a System.
- **Interception.** Monitoring of data or traffic on a System without permission.
- **Falsification of Origin.** Forging TCP-IP packet headers, e-mail headers, or any part of a message describing its origin or route. The legitimate use of aliases and anonymous remailers is not prohibited by this provision.
## No Network Abuse
You may not make network connections to any users, hosts, or networks unless you have permission to communicate with them. Prohibited activities include:
- **Monitoring or Crawling.** Monitoring or crawling of a System that impairs or disrupts the System being monitored or crawled.
- **Denial of Service (DoS).** Inundating a target with communications requests so the target either cannot respond to legitimate traffic or responds so slowly that it becomes ineffective.
- **Intentional Interference.** Interfering with the proper functioning of any System, including any deliberate attempt to overload a system by mail bombing, news bombing, broadcast attacks, or flooding techniques.
- **Operation of Certain Network Services.** Operating network services like open proxies, open mail relays, or open recursive domain name servers.
- **Avoiding System Restrictions.** Using manual or electronic means to avoid any use limitations placed on a System, such as access and storage restrictions.
## No E-Mail or Other Message Abuse
You will not distribute, publish, send, or facilitate the sending of unsolicited mass e-mail or other messages, promotions, advertising, or solicitations (like “spam”), including commercial advertising and informational announcements. You will not alter or obscure mail headers or assume a sender’s identity without the sender’s explicit permission. You will not collect replies to messages sent from another internet service provider if those messages violate this Policy or the acceptable use policy of that provider.
## Our Monitoring and Enforcement
We reserve the right, but do not assume the obligation, to investigate any violation of this Policy or misuse of the Services or Supabase Site. We may:
- investigate violations of this Policy or misuse of the Services or Supabase Site; or
- remove, disable access to, or modify any content or resource that violates this Policy or any other agreement we have with you for use of the Services or the Supabase Site.
We may report any activity that we suspect violates any law or regulation to appropriate law enforcement officials, regulators, or other appropriate third parties. Our reporting may include disclosing appropriate customer information. We also may cooperate with appropriate law enforcement agencies, regulators, or other appropriate third parties to help with the investigation and prosecution of illegal conduct by providing network and systems information related to alleged violations of this Policy.
Reporting of Violations of this Policy
If you become aware of any violation of this Policy, you will immediately notify us and provide us with assistance, as requested, to stop or remedy the violation. To report any violation of this Policy, please contact us at support@supabase.io.
-294
View File
@@ -1,294 +0,0 @@
---
id: privacy
title: Privacy Policy
---
# Privacy Policy
`Last modified: 27 March 2021`
Thank you for your interest in Supabase, Inc., ("**_Supabase_**," "**_we_**", "**_our_**" or "**_us_**"). Supabase provides a suite of open source tools, stitched together to build a seamless developer experience. This Privacy Notice explains how information about you, that directly identifies you, or that makes you identifiable ("**_personal information_**") is collected, used and disclosed by Supabase in connection with our website at [supabase.io](https://supabase.com) (the "**_Site_**") and our services offered in connection with the Site (collectively with the Site, the "**_Service_**").
We may also provide you with additional privacy notices or disclosures where the scope of the inquiry, request, or personal information we require falls outside the scope of this Privacy Notice. In that case, the additional Privacy Notice or disclosures will govern how we may process the information you provide at that time. Please note that this Privacy Notice does not cover or apply to our processing of information about our employees or contractors.
This Policy explains how we use your personal information when we act as a data controller. As far as you use our Service as a natural person, we are the controller of your personal information. We are responsible for, and control, the processing of your personal information.
Wherever our customers use our Service to submit, manage, or otherwise use content relating to our customers’ end users ("**_Customer Data_**") during the provision of our Service, we have contractually committed ourselves to only process such information on behalf and under the instruction of the respective customer, who is the data controller. This Privacy Notice does not apply to such processing and we recommend you read the Privacy Notice of the respective customer, if their processing concerns your personal information.
## Region-specific Disclosures
- **California - Your California Privacy Rights:** If you are a California resident, California Civil Code Section 1798.83 permits you to request information regarding the disclosure of personal information to third parties for their direct marketing purposes during the immediately preceding calendar year. Note we do not share your personal information with third parties for their own marketing purposes.
- **Nevada:** Chapter 603A of the Nevada Revised Statutes permits a Nevada resident to opt out of future sales of certain covered information that a website operator has collected or will collect about the resident. Note we do not sell your personal information within the meaning of Chapter 603A. However, if you would still like to submit such a request, please contact us at support@supabase.io.
- **European Economic Area, United Kingdom or Switzerland:** If you are located in the European Economic Area ("**_EEA_**"), United Kingdom or Switzerland, or otherwise engage with Supabase’s European operations, please see the **Privacy Disclosures for the European Economic Area, United Kingdom and Switzerland** for additional European-specific privacy disclosures, including what constitutes your personal information, the lawful bases we rely on to process your personal information, how we use cookies when you access our Sites from the EEA, UK or Switzerland and your rights in respect of your personal information.
**Note for International Visitors:** Personal information may be transferred to, stored and processed in a country other than the one in which it was collected. For example, the Sites are primarily hosted in and provided from the United States. Please note the country to which personal data is transferred may not provide the same level of protection for personal information as the country from which it was transferred.
## 1. Information we collect and our use
We collect personal information in connection with your visits to and use of the Service. This collection includes information that you provide in connection with the Service, information from third parties, and information that is collected automatically such as through the use of cookies and other technologies.
### Information That You Provide
We collect personal information from you. The categories of information we collect can include:
- **_Registration information._** We collect personal and/or business information that you provide when you register for an account at the Site. This information may include your name, email address, GitHub username. We use this information to administer your account, provide you with the relevant services and information, communicate with you regarding your account, the Site and for customer support purposes.
- **_Information collected through the Use of the Service._** After registration, you may create, upload or transmit files, documents, videos, images, data or information as part of your use of the Service (collectively, "**_User Content_**"). User Content and any information contained in the User Content, including personal information you may have included, is stored and collected as part of the Service. You have full control of the information included in the User Content.
- **_Payment information._** If you make a purchase or payment on the Site, such as for a subscription, we collect transactional information provided in connection with your purchase or payment. Please note that we use third party payment processors, including Stripe, to process payments made to us. As such, we do not retain any personally identifiable financial information such as credit card numbers. Rather, all such information is provided directly by you to our third-party processor. The payment processor’s use of your personal information is governed by their privacy notice. To view Stripe’s privacy notice, please visit: <https://stripe.com/privacy>.
- **_Communications._** If you communicate with us through any paper or electronic form, we may collect your name, email address, mailing address, phone number, or any other personal information you choose to provide to us. We use this information to investigate and respond to your inquiries, and to communicate with you, to enhance the services we offer to our users and to manage and grow our organization. If you register for our newsletters or updates, we may communicate with you by email. To unsubscribe from promotional messages, please follow the instructions within our messages and review the **Control Over Your Information** section below. If you become a contributor, we may also collect your GitHub name and feature you on our website.
- **_Inquiries and Feedback._** If you contact us, we will collect the information that you provide us, such as your contact information and the contents of your communication with us.
You are free to choose which personal information you want to provide to us or whether you want to provide us with personal information at all. However, some information, such as your name, address, payment transaction information, and information on your requested Services may be necessary for the performance of our contractual obligations.
### Information from Third Party Sources
We may receive personal information about you from our business partners and service providers and combine this information with other data we collect from you. The third-parties may include website and service operators, payment processors, marketing partners, and shipping providers. The information may include contact information, demographic information, information about your communications and related activities, and information about your orders. We may use this information to administer and facilitate our services, your orders and our marketing activities.
- **_Single Sign-On._** We use single sign-on ("**SSO**") such as Github to allow a user to authenticate their account using one set of login information. We will have access to certain information from those third parties in accordance with the authorization procedures determined by those third parties, including, for example, your name, username, email address, language preference, and profile picture. We use this information to operate, maintain, and provide to you the features and functionality of the Service. We may also send you service-related emails or messages (e.g., account verification, purchase confirmation, customer support, changes or updates to features of the Site, technical and security notices).
- **_Social Media._** When you interact with our Site through various social media, such as when you click on the social media icon on the Site, follow us on a social media site, or post a comment to one of our pages, we may receive information from the social network such as your profile information, profile picture, gender, user name, user ID associated with your social media account, age range, language, country, and any other information you permit the social network to share with third parties. The data we receive is dependent upon your privacy settings with the social network. We use this information to operate, maintain, and provide to you the features and functionality of the Service, as well as to communicate directly with you, such as to send you email messages about products and services that may be of interest to you.
- **_Employment Applications._** If you apply for employment, we collect your contact and demographic information, educational and work history, employment interests, information obtained during interviews and any other information you choose to provide. We use the information provided to evaluate your candidacy for employment, to communicate with you during the application process and to facilitate the onboarding process.
- **_Information from Other Sources._** We may obtain information from other sources, including through third-party information providers, our shareholders, customers, or through transactions such as mergers and acquisitions. We may combine this information with other information we collect from or about you. In these cases, our Privacy Notice governs the handling of the combined personal information. We use this information to operate, maintain, and provide to you the features and functionality of the Service, as well as to communicate directly with you, such as to send you email messages about products and services that may be of interest to you.
### Other Uses of Personal Information
In addition to the uses described above, we may collect and use personal information for the following purposes:
- For our business activities, including to operate the Service and to provide you with the features and functionality of the Service;
- To communicate with you and respond to your requests, such as to respond to your questions, contact you about changes to the Service, and communicate about account related matters;
- For marketing and advertising purposes, such as to market to you or offer you with information and updates on our products or services we think that you may be interested in. While we may use your personal information in this manner, please note that we do not use User Content to serve you ads, and we will never share User Content with any third parties for marketing or advertising purposes, unless you have explicitly submitted it to us for that purpose;
- For analytics and research purposes;
- To enforce our **Terms of Service**, to resolve disputes, to carry out our obligations and enforce our rights, and to protect our business interests and the interests and rights of third parties;
- To comply with contractual and legal obligations and requirements;
- To fulfill any other purpose for which you provide personal information; and
- For any other lawful purpose, or other purpose that you consent to.
## 2. How we share personal information
We may share your personal information in the instances described below. For further information on your choices regarding your information, see **Control Over Your Information**.
- We may share your personal information with third-party service providers or business partners who help us deliver or improve our Site or services, or who perform services on our behalf, which are subject to reasonable confidentiality terms, and may include processing payments, providing web hosting services, or providing analytics.
- Third parties as required by law or subpoena or if we reasonably believe that such action is necessary to (a) comply with the law and the reasonable requests of law enforcement; (b) to enforce our **Terms of Service** or other agreements or to protect the security or integrity of the Supabase services, including to prevent harm or financial loss, or in connection with preventing fraud or illegal activity; and/or (c) to exercise or protect the rights, property, or personal safety of Supabase, our Customers, visitors, or others.
- We may share with other companies and brands owned or controlled by Supabase, and other companies owned by or under common ownership as Supabase. These companies will use your personal information in the same way as we can under this Privacy Notice.
- We may transfer any information we collect in the event we sell or transfer all or a portion of our business or assets (including any shares in the company) or any portion or combination of our products, services, businesses and/or assets. Should such a transaction occur (whether a divestiture, merger, acquisition, bankruptcy, dissolution, reorganization, liquidation, or similar transaction or proceeding), we will use reasonable efforts to ensure that any transferred information is treated in a manner consistent with this Privacy Notice.
- We may disclose your information publicly or with another third party with your prior authorization.
- With others in an aggregated or otherwise anonymized form that does not reasonably identify you directly as an individual.
## 3. Control over your information
### Email Communications
From time to time, we may send you emails regarding updates to our Service, products or services, notices about our organization, or information about products/services we offer (or promotional offers from third parties) that we think may be of interest to you. If you wish to unsubscribe from such emails, simply click the "unsubscribe link" provided at the bottom of the email communication. Note that you cannot unsubscribe from certain services-related email communications (e.g., account verification, confirmations of transactions, technical or legal notices).
### Modifying Account Information
If you have an online account with us, you have the ability to modify certain information in your account (e.g., your contact information) through the account options provided on the Site. If there is personal information in your User Content, you can use the features and functionality of the Service to edit or delete the personal information or User Content. Not all personal information is maintained in a format that you can access or change. If you would like to request access to, or correction or deletion of personal information, you may send your request to us at the email provided below. We will review your request and may require you to provide additional information to identify yourself, but we do not promise that we will be able to satisfy your request.
## 4. How We Use Cookies and Other Tracking Technology to Collect Information
We, and our third-party partners, automatically collect certain types of usage information when you visit our Site, read our emails, or otherwise engage with us.  We typically collect this information through a variety of tracking technologies, including cookies, web beacons, embedded scripts, location-identifying technologies, file information, and similar technology (collectively, "**tracking technologies**").
We, and our third-party partners, use tracking technologies to automatically collect usage and device information, such as:
- Information about your device and its software, such as your IP address, browser type, Internet service provider, device type/model/manufacturer, operating system, date and time stamp, and a unique ID that allows us to uniquely identify your browser or your account (including, for example, a persistent device identifier), and other such information.
- When you access our sites from a mobile device, we may collect unique identification numbers associated with your device or our mobile application mobile carrier, device type, model and manufacturer, mobile device operating system brand and model, and depending on your mobile device settings, we may be able to approximate a device’s location by analyzing other information, like an IP address.
- Information about the way you access and use our services, for example, the site from which you came and the site to which you are going when you leave our services, the pages you visit, the links you click, whether you open emails or click the links contained in emails, whether you access the services from multiple devices, and other actions you take on the Sites.
We use the data collected through tracking technologies to:  (a) remember information so that you will not have to re-enter it during your visit or the next time you visit the site; (b) provide custom content and information; (c) identify you across multiple devices; (d) provide and monitor the effectiveness of our services; (e) monitor aggregate metrics such as total number of visitors, traffic, usage, and demographic patterns on our Site; (f) diagnose or fix technology problems; and (g) to provide, plan for, and enhance our services.
**Note we do not engage in online targeted advertising.**
**Cookies and Other Tracking Technologies Opt-Out.** Depending on your browser or mobile device, you may be able to set your browser to delete or notify you of cookies and other tracking technology by actively managing the settings on your browser or mobile device.
If you would prefer not to accept cookies, most browsers will allow you to: (i) change your browser settings to notify you when you receive a cookie, which lets you choose whether or not to accept it; (ii) disable existing cookies; or (iii) set your browser to automatically reject cookies. Please note that doing so may negatively impact your experience using the sites, as some features and services on our sites may not work properly. Depending on your mobile device and operating system, you may not be able to delete or block all cookies. You may also set your e-mail options to prevent the automatic downloading of images that may contain technologies that would allow us to know whether you have accessed our e-mail and performed certain functions with it.
## 5. Data Retention and Security
We will retain your personal information for the length of time needed to fulfill the purposes outlined in this Privacy Notice, unless a longer retention period is required or permitted by law. We store data on servers in the U.S. or any other country in which Supabase or its affiliates, subsidiaries, agents or contractors maintain facilities. If you are located in the European Union or other regions with laws governing data collection and use that may differ from U.S. law, please note that your personal information may be transferred to a country and jurisdiction that does not have the same data protection laws as your jurisdiction. When you register for use with Supabase you have the option of where you store your information and we will not transfer it without providing information to you in advance.
Supabase cares about the security of your information and uses commercially reasonable physical, technical and organizational measures designed to preserve the integrity and security of all information we collect. However, no security system is impenetrable, and we cannot guarantee the security of our systems 100%. In the event that any information under our control is compromised as a result of a breach of security, we will take reasonable steps to investigate the situation and where appropriate, notify those individuals whose information may have been compromised and take other steps, in accordance with any applicable laws and regulations.
## 6. Links to Third-Party Websites and Services
For your convenience, our Site may provide links to third-party websites or services that we do not own or operate. We are not responsible for the practices employed by any websites or services linked to or from the services, including the information or content contained within them. Your browsing and interaction on any other website or service are subject to the applicable third party’s rules and policies, not ours. If you are using a third-party website or service, you do so at your own risk. We encourage you to review the privacy policies of any site or service before providing any personal information.
## 7. Children’s Privacy
Our services are not intended for children under the age of 13. We do not knowingly solicit or collect personal information from children under the age of 13. If we learn that any personal information has been collected inadvertently from a child under 13, we will delete the information as soon as possible. If you believe that we might have collected information from a child under 13, please contact us at privacy@supabase.io.
## 8. Changes to Privacy Notice
We reserve the right to change this Privacy Notice from time to time in our sole discretion. We will notify you about material changes in the way we treat personal data by sending a notice to the primary email address specified in your Supabase account and/or by placing a prominent notice on our Site. It is your responsibility to review this Privacy Notice periodically. When we do change the Privacy Notice, we will also revise the "last modified" date.
## 9. Contact Us
For additional inquiries about this Privacy Notice, please send us an email at privacy@supabase.io.
This Privacy Notice was last modified on 27th March 2021
## Privacy disclosures for the European economic area, United Kingdom, and Switzerland.
While we are primarily based in the United States, Supabase maintains operations in Europe and may direct our services to individuals located in the European Economic Area ("**_EEA_**"), United Kingdom and Switzerland, including through our Site [supabase.io](/) (collectively, our "**_European Services_**"). The following disclosures ("**_Privacy Disclosures_**") apply to our processing of personal data in connection with our European Services.
Supabase, Inc. is the data controller responsible for the processing of personal data in connection with our European Services. This means that we determine and are responsible for how your personal information is used.
**Personal Data:** When we use the term "personal data" in this section, we mean information relating to an identified or identifiable natural person.
### 1. Personal data we collect from you when you use the Supabase European Services, and how we use it.
We collect the categories of personal data that you voluntarily submit directly to us when you use the European Services, as set forth in our Privacy Notice under the section entitled **Information We Collect and Our Use**. The table at **Annex 1** sets out in detail the categories of personal data we collect about you and how we use that information when you use the European Services, as well as the legal basis which we rely on to process the personal information and recipients of that personal information.
### 2. Information we collect about you automatically.
We also automatically collect personal information indirectly about how you access and use the European Services, and information about the device you use to access the European Services. For example, we may collect:
(a) information about the features you use and the pages you view on the European Services;
(b) information about your device (such as your IP address, device identifier, device type, model and manufacturer); and
(c) information about your usage patterns (such as how often you use the Supabase European Services and your language settings).
We use this information to provide you the features and functionality of the European Services, to monitor and improve the European Services and to develop new services.
The table at **Annex 2** sets out further information about the categories of personal information we collect about you automatically and how we use that information. The table also lists the legal basis which we rely on to process the personal information and recipients of that personal information.
We may link or combine the personal information we collect about you and the information we collect automatically.
We may anonymise and aggregate any of the personal information we collect (so that it does not directly identify you). We may use anonymised information for purposes that include testing our IT systems, research, data analysis, improving the Supabase European Services. We may also share such anonymised and aggregated information with others.
### 3. How long will we store your personal information
We will usually store the personal information we collect about you for no longer than necessary for the purposes set out in Annex 1 and Annex 2, in accordance with our legal obligations and legitimate business interests.
The criteria used to determine the period for which personal information about you will be retained varies depending on the legal basis under which we process the personal information:
1. **Legitimate Interests.** Where we are processing personal information based on our legitimate interests, we generally will retain such information for a reasonable period of time based on the particular interest, taking into account the fundamental interests and the rights and freedoms of data subjects.
2. **Consent.** Where we are processing personal information based on your consent, we generally will retain the information until you withdraw your consent, or otherwise for the period of time necessary to fulfill the underlying agreement with you or provide you with the applicable service for which we process that personal information.
3. **Contract.** Where we are processing personal information based on contract, we generally will retain the information for the duration of the contract plus some additional limited period of time that is necessary to comply with law or that represents the statute of limitations for legal claims that could arise from the contractual relationship.
4. **Legal Obligation.** Where we are processing personal information based on a legal obligation, we generally will retain the information for the period of time necessary to fulfill the legal obligation.
5. **Legal Claim.** We may need to apply a "legal hold" that retains information beyond our typical retention period where we face threat of legal claim.  In that case, we will retain the information until the hold is removed, which typically means the claim or threat of claim has been resolved.
In all cases, in addition to the purposes and legal bases, we consider the amount, nature and sensitivity of the personal information, as well as the potential risk of harm from unauthorized use or disclosure of your personal information.
### 4. Recipients of Personal Information
In addition to the recipients listed in Annexes 1 and 2, we may also share your personal information with the following (as required in accordance with the uses set out in Annexes 1 and 2):
1. **Service providers and advisors**: we may share your personal information with third party vendors and other service providers that perform services for us or on our behalf, which may include providing professional services, such as legal and accounting services, mailing, email or chat services, fraud prevention, web hosting, or providing analytic services.
2. **Affiliates**. Other companies owned by or under common ownership as Supabase, including our subsidiaries (i.e., any organization we own or control) and our ultimate holding company (i.e., any organization that owns or controls us) and any subsidiaries it owns. These companies will use your personal information in the same way as we can under these Privacy Disclosures.
3. **Purchasers and third parties in connection with a business transaction**: your personal information may be disclosed to third parties in connection with a transaction, such as a merger, sale of assets or shares, reorganization, financing, change of control or acquisition of all or a portion of our business.
4. **Law enforcement, regulators and other parties for legal reasons**: we may share your personal information with third parties as required by law or if we reasonably believe that such action is necessary to (i) comply with the law and the reasonable requests of law enforcement; (ii) detect and investigate illegal activities and breaches of agreements, including our Terms; and/or (iii) exercise or protect the rights, property, or personal safety of Supabase, its users or others.
### 5. Marketing and Advertising
From time to time we may contact you with information about our services, including sending you marketing messages and asking for your feedback on our services. Most marketing messages we send will be by email. For some marketing messages, we may use personal information we collect about you to help us determine the most relevant marketing information to share with you.
We will only send you marketing messages if you have given us your consent to do so. You can withdraw your consent at a later date by clicking on the unsubscribe link at the bottom of our marketing emails or by updating your preferences via your account on the Site.
### 6. Storing and transferring your personal information
**Security**. We implement appropriate technical and organizational measures to protect your personal information against accidental or unlawful destruction, loss, change or damage. All personal information we collect will be stored by our cloud hosting provider on secure servers. We will never send you unsolicited emails or contact you by phone requesting credit or debit card information or national identification numbers.
**International Transfers of your Personal Information**. The personal information we collect may be transferred to and stored in countries outside of the jurisdiction you are in where we and our third party service providers have operations. If you are located in the EEA, United Kingdom or Switzerland, your personal information may be processed outside of those regions, including in the United States.
In the event of such a transfer, we ensure that: (i) the personal information is transferred to countries recognized as offering an equivalent level of protection; or (ii) the transfer is made pursuant to appropriate safeguards, such as standard data protection clauses adopted by the European Commission.
If you wish to enquire further about these safeguards used, please contact us using the details set out at the end of these Privacy Disclosures.
### 7. Profiling
We may analyze personal data we have collected about you to create a profile of your interests and send product updates. We may also use personal data about you to detect and reduce fraud.
### 8. Your rights in respect of your personal information
In accordance with applicable privacy law, you have the following rights in respect of your personal information that we hold:
1. **Right of access**. You have the right to obtain:
1. confirmation of whether, and where, we are processing your personal information;
2. information about the categories of personal information we are processing, the purposes for which we process your personal information and information as to how we determine applicable retention periods;
3. information about the categories of recipients with whom we may share your personal information; and
4. a copy of the personal information we hold about you.
2. **Right of portability**. You have the right, in certain circumstances, to receive a copy of the personal information you have provided to us in a structured, commonly used, machine-readable format that supports re-use, or to request the transfer of your personal data to another person.
3. **Right to rectification**. You have the right to obtain rectification of any inaccurate or incomplete personal information we hold about you without undue delay.
4. **Right to erasure**. You have the right, in some circumstances, to require us to erase your personal information without undue delay if the continued processing of that personal information is not justified.
5. **Right to restriction**. You have the right, in some circumstances, to require us to limit the purposes for which we process your personal information if the continued processing of the personal information in this way is not justified, such as where the accuracy of the personal information is contested by you.
6. **Right to withdraw consent**. There are certain circumstances where we require your consent to process your personal information. In these instances, and if you have provided consent, you have the right to withdraw your consent. If you withdraw your consent, this will not affect the lawfulness of our use of your personal information before your withdrawal.
**You also have the right to object to any processing based on our legitimate interests where there are grounds relating to your particular situation. There may be compelling reasons for continuing to process your personal information, and we will assess and inform you if that is the case. You can object to marketing activities for any reason.**
You also have the right to lodge a complaint to your local data protection authority. If you are based in the European Union, information about how to contact your local data protection authority is available [here](http://ec.europa.eu/justice/data-protection/bodies/authorities/index_en.htm). If you are based in the UK or Switzerland, your local data protection authorities are the UK Information Commissioner's Office (<https://ico.org.uk/global/contact-us/>) and the Swiss Federal Data Protection and Information Commissioner (<https://www.edoeb.admin.ch/edoeb/en/home/the-fdpic/contact/address.html>).
If you wish to exercise one of these rights, please contact us using the contact details at the end of these Privacy Disclosures.
Due to the confidential nature of data processing we may ask you to provide proof of identity when exercising the above rights. This can be done by providing a scanned copy of a valid identity document or a signed photocopy of a valid identity document.
### 9. Cookies and similar technologies used on our European Services
Our European Services uses cookies and similar technologies such as pixels and Local Storage Objects (LSOs) like HTML5 (together "**_cookies_**") to distinguish you from other users of our European Services. This helps us to provide you with a good experience when you browse our European Services and also allows us to monitor and analyse how you use and interact with our European Services so that we can continue to improve our European Services.
Cookies are pieces of code that allow for personalization of our European Services experience by saving your information such as user ID and other preferences. A cookie is a small data file that we transfer to your computer's hard disk for record-keeping purposes.
We use the following types of cookies:
1. **Strictly necessary cookies**. These are cookies that are required for the operation of our European Services. They include, for example, cookies that enable you to log into secure areas of our European Services.
Please see **Annex 3** for more information about the cookies we use on the European Services.
Most browsers also allow you to change your cookie settings to block certain cookies. Depending on your mobile device and operating system, you may not be able to delete or block all cookies. Please note that if you choose to refuse all cookies you may not be able to use the full functionality of our European Services. These settings will typically be found in the "options" or "preferences" menu of your browser. In order to understand these settings, the following links may be helpful, otherwise you should use the "Help" option in your browser for more details.
- [Cookie settings in Internet Explorer](https://support.microsoft.com/en-gb/help/278835/how-to-delete-cookie-files-in-internet-explorer)
- [Cookie settings in Firefox](http://support.mozilla.org/en-US/kb/cookies)
- [Cookie settings in Chrome](https://support.google.com/chrome/answer/95647?hl=en)
- [Cookies settings in Safari web](https://support.apple.com/en-gb/guide/safari/manage-cookies-and-website-data-sfri11471/mac) and [iOS](https://support.apple.com/en-gb/HT201265).
If you would like to find out more about cookies and other similar technologies, please visit [allaboutcookies.org](http://www.allaboutcookies.org).
Please note that deleting or blocking cookies may not be effective for all types of tracking technologies, such as Local Storage Objects (LSOs) like HTML5.
### 10. Tracking technologies used in our emails
Our emails may contain tracking pixels that identify if and when you have opened an email that we have sent you, how many times you have read it and whether you have clicked on any links in that email. This helps us measure the effectiveness of our marketing email campaigns, make the emails we send to you more relevant to your interests and to understand if you have opened and read any important administrative emails we might send you.
Most popular email clients will allow you to block these pixels by disabling certain external images in emails. You can do this through the settings on your email client – these generally give you the option of choosing whether emails will display "remote images", "remote content" or "images" by default.
Some browsers also give you the option of downloading and installing extensions that block pixels and other tracking technologies.
## Annex 1 – Personal information you provide to us
| **Category of Personal Information** | **How we may use the Personal Information** | **Legal Bases for Processing** | **Recipients of Personal Information** |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Contact information**, such as first name, last name and email address. | We may use this information to set up and authenticate your account on the Service. | The processing is necessary for the performance of a contract with you and to take steps prior to entering into a contract with you, namely our Terms of Service. | <p>We may share this information with the following service providers through the provision of the Service: Segment, Auth0, Stripe, Intercom, Hubspot, Mixpanel, Notion, Slack, Amazon Web Services, and BigQuery (Google Cloud). </p><p> </p> |
| | We may use this information to communicate with you, including sending service-related communications. | The processing is necessary for the performance of a contract with you, namely our Terms of Service. | |
| | We may use this information to deal with enquiries and complaints made by or about you relating to the Service. | The processing is necessary for our legitimate interests, namely administering the Service, and for communicating with you effectively to respond to your queries or complaints. | |
| | We may use this information in connection with providing you with marketing communications in accordance with your preferences. | We will only use your personal information in this way to the extent you have given us consent to do so. | |
| **Your registration / account information** such as your full name, email, and password. | <p>We may use this information to create your account on the Service.</p><p></p><p></p> | <p>The processing is necessary for the performance of a contract with you.</p><p></p><p></p> | <p>We may share this information with the following service providers through the provision of the Service: Segment, Auth0, Stripe, Amazon Web Services.</p><p></p> |
| | <p>We use this information to deal with enquiries and complaints made by or about you relating to the Service.</p><p></p> | The processing is necessary for our legitimate interests, namely for communicating with our members effectively to respond to any queries or complaints. | |
| **Payment transaction information.** When you make a purchase, we may collect information such as your billing address and other information such as date and time of your transaction. | <p>We may use this information to process your orders through the Service.</p><p></p> | The processing is necessary for the performance of a contract. | <p>We may share this information with the following service providers through the provision of the Service: Stripe, and Amazon Web Services.</p><p></p> |
| | We may use this information to verify your identity in connection with the detection and prevention of fraud or financial crime. | The processing is necessary for our and third partiers' legitimate interests, namely the detection and prevention of fraud and financial crime. | |
| **Approximate Location information.** When you visit our Service, we may collect information about your location. This information may be derived from WiFi positioning or your IP address. | We may use information to present the Service to you on your device. | The processing is necessary for performance of a contract with you. | <p>We may share this information with the following service providers through the provision of the Service: Sentry, BigQuery (Google Cloud), and Amazon Web Services.</p><p></p> |
| | We may use this information to localise features of the Service. | The processing is necessary for our legitimate interest, namely localising features of the Service and tailoring the Service so that it is more relevant to our users. | |
| | We may use this information to determine content that may be of interest to you. | The processing is necessary for our legitimate interests, namely tailoring the Service so that it is more relevant to you. | |
| **Chat, comments and opinions.** When you contact us directly, e.g. by email or phone we will record your comments and opinions. | We may use this information to address your questions, issues and concerns. | The processing is necessary for our legitimate interests, namely communicating with you and responding to queries, complaints and concerns. | <p>We may share this information with the following service providers through the provision of the Service: Intercom, Hubspot, Google Gsuite, and Slack.</p><p></p> |
| | We may use this information to improve the Service. | The processing is necessary for our legitimate interests (to develop and improve our service). | |
| **Information received from third parties, such as social networks.** If you interact with us through a social network, we may receive information from the social network such as your name, profile information, and any other information you permit the social network to share with third parties. We use single sign-on ("**_SSO_**") such as Github to allow a user to authenticate their account using one set of login information. The data we receive is dependent on your privacy settings with the social network. | We may use this information to reshare content created through the use of the Service | The processing is necessary for our legitimate interests (to develop our service and inform our marketing strategy) | We may share this information with the following service providers through the provision of the Service: Auth0 and Slack. |
| | <p>We may use this information to authenticate you and allow you to access the Service.</p><p></p> | The processing is necessary for the performance of a contract with you. | |
| **Your preferences**, such as preferences set for notifications, marketing communications, how the Service is displayed and the active functionalities on the Service. | <p>We use this information to provide notifications, send news, alerts and marketing communications and provide the Service in accordance with your choices.</p><p></p> | <p>The processing is necessary for our legitimate interest, namely ensuring the user receives the correct marketing and other communications, and that this is displayed in accordance with the user's preferences.</p><p></p> | We may share this information with the following service providers through the provision of the Service: Segment, Intercom and Hubspot. |
| | <p>We use this information to ensure that we comply with our legal obligation to send only those marketing communications to which you have consented. </p><p></p> | The processing is necessary for compliance with a legal obligation to which we are subject. | |
## Annex 2 – Personal information collected automatically
| **Category of personal information** | **How we may use it** | **Legal basis for the processing** | **Recipients of Personal Data** |
| :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Approximate location information.** Other than information you choose to provide to us, we do not collect information about your precise location. Your device’s IP address may however help us determine an approximate location. | We may use information you provide to us about your location to monitor and detect fraud or suspicious activity in relation to your Supabase account. | The processing is necessary for our legitimate interests, namely to protect our business and your account from fraud and other illegal activities. | <p>**Approximate location information:** We may share this information with the following service providers through the provision of the Service: Sentry, BigQuery (Google Cloud), and Amazon Web Services.</p><p></p><p></p><p></p><p>**Information about how you access and use the Service.** We may share this information with the following service providers through the provision of the Service: Segment, Mixpanel, Intercom, Hubspot, BigQuery (Google Cloud), and Amazon Web Services.</p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p>**Log files and information about your device.** We may share this information with the following service providers through the provision of the Service: Segment, Mixpanel, Intercom, Hubspot, Sentry, BigQuery (Google Cloud), and Amazon Web Services.</p> |
| | We may use this information to tailor how the Service is displayed to you (such as the language in which it is provided to you). | The processing is necessary for our legitimate interest, namely tailoring our service so that it is more relevant to our users. | |
| **Information about how you access and use the Service.** For example, how frequently you access the Service, the time you access the Service and how long you use it for, the approximate location that you access the Service from, the site from which you came and the site to which you are going when you leave our website, the website pages you visit, the links you click, whether you open emails or click the links contained in emails, whether you access the Service from multiple devices, and other actions you take on the Service. | <p>We may use information about how you use and connect to the Service to present the Service to you on your device.</p><p></p> | The processing is necessary for our legitimate interests, namely to tailor the Service to the user. | |
| | We may use this information to determine products and services that may be of interest to you for marketing purposes. | The processing is necessary for our legitimate interests, namely to inform our direct marketing. | |
| | <p>We may use this information to monitor and improve the Service and business, resolve issues and to inform the development of new products and services.</p><p></p> | The processing is necessary for our legitimate interests, namely to monitor and resolve issues with the Service and to improve the Service generally. | |
| **Log files and information about your device.** We also collect information about the tablet, smartphone or other electronic device you use to connect to the Service. This information can include details about the, operating systems, browsers and applications connected to the Service through the device and your IP address. | <p>We may use information about how you use and connect to the Service to present the Service to you on your device.</p><p></p> | The processing is necessary for our legitimate interests, namely to tailor the Service to the user. | |
| | <p>We may use this information to monitor and improve the Service and business, resolve issues and to inform the development of new products and services.</p><p></p> | The processing is necessary for our legitimate interests, namely to monitor and resolve issues with the Service and to improve the Service generally. | |
## Annex 3 - Cookies
| **Cookie Name** | **Type of cookie** | **How long does the cookie stay on my device?** | **Purpose of the cookie** |
| :----------------------------- | :----------------- | :---------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| <p>a0:session</p><p></p> | Strictly necessary | 1 Day | Authentication Purposes. |
| <p>a0:state</p><p></p> | Strictly necessary | 2 Hours | Authentication Purposes. |
| <p>youtube-nocookie</p><p></p> | Strictly necessary | Persistent | <p>Privacy-enhanced cookie, essential for embedded videos. [Link.](https://support.google.com/youtube/answer/171780)</p><p><blockquote><small>Privacy Enhanced Mode allows you to embed YouTube videos without using cookies that track viewing behavior. This means no activity is collected to personalize the viewing experience.</small></blockquote></p> |
-237
View File
@@ -1,237 +0,0 @@
---
id: terms
title: Terms of Service
---
# Terms of Service
`Last Modified: 20 November 2020`
These Customer Terms and Conditions (this "**Agreement**"), effective as of the date on which you click a button or check a box (or something similar) acknowledging your acceptance of this Agreement (the "**Effective Date**"), is by and between Supabase, Inc., a Delaware corporation with offices located at 970 Toa Payoh North #07-04, Singapore 318992 ("**Supabase**") and the entity on whose behalf the individual accepting this Agreement accepts this Agreement ("**Customer**"). The individual accepting this Agreement hereby represents and warrants that it is duly authorized by the entity on whose behalf it accepts this Agreement to so accept this Agreement. Supabase and Customer may be referred to herein collectively as the "**Parties**" or individually as a "**Party**." The Parties agree as follows:
## 1. Definitions.
1. "**Aggregated Data**" means data and information related to or derived from Customer Data or Customer's use of the Services that is used by Supabase in an aggregate and anonymized manner, including to compile statistical and performance information related to the Services.
2. "**Authorized User**" means Customer's employees, consultants, contractors, and agents (i) who are authorized by Customer to access and use the Services under the rights granted to Customer pursuant to this Agreement; and (ii) for whom access to the Services has been purchased hereunder.
3. "**Customer Data**" means information, data, and other content, in any form or medium, that is submitted, posted, or otherwise transmitted by or on behalf of Customer or an Authorized User through the Services; provided that, for purposes of clarity, Customer Data does not include Aggregated Data.
4. "**Documentation**" means Supabase's end user documentation relating to the Services available at [supabase.io](https://supabase.com).
5. "**Harmful Code**" means any software, hardware, or other technology, device, or means, including any virus, worm, malware, or other malicious computer code, the purpose or effect of which is to permit unauthorized access to, or to destroy, disrupt, disable, distort, or otherwise harm or impede in any manner any (i) computer, software, firmware, hardware, system, or network; or (ii) any application or function of any of the foregoing or the security, integrity, confidentiality, or use of any data processed thereby.
6. "**Order**" means: (i) the purchase order, order form, or other ordering document entered into by the Parties that incorporates this Agreement by reference; or (ii) if Customer registered for the Services through Supabase's online ordering process, the results of such online ordering process.
7. "**Personal Information**" means any information that, individually or in combination, does or can identify a specific individual or by or from which a specific individual may be identified, contacted, or located, including without limitation all data considered "personal data", "personally identifiable information", or something similar under applicable laws, rules, or regulations relating to data privacy.
8. "**Supabase IP**" means the Services, the Documentation, and any and all intellectual property provided to Customer or any Authorized User in connection with the foregoing. For the avoidance of doubt, Supabase IP includes Aggregated Data and any information, data, or other content derived from Supabase's provision of the Services but does not include Customer Data.
9. "**Services**" means Supabase's proprietary hosted software platform, as made available by Supabase to Authorized Users from time to time.
10. "**Subscription Period**" means the time period identified on the Order during which Customer's Authorized Users may access and use the Services.
11. "**Third-Party Products**" means any third-party products provided with, integrated with, or incorporated into the Services.
12. "**Usage Limitations**" means the usage limitations set forth in this Agreement and the Order, including without limitation any limitations on the number of Authorized Users (if any), and the applicable product, pricing, and support tiers agreed-upon by the Parties.
## 2. Access and Use.
### 1. Provision of Access.
Subject to and conditioned on Customer's compliance with the terms and conditions of this Agreement, including without limitation the Usage Limitations, Supabase will make available to Customer during the Subscription Period, on a non-exclusive, non-transferable (except in compliance with Section 13.8), and non-sublicensable basis, access to and use of the Services, solely for use by Authorized Users. Such use is limited to Customer's internal business purposes and the features and functionalities specified in the Order. Supabase shall provide to Customer the necessary access credentials to allow Customer to access the Services.
### 2. Documentation License.
Subject to and conditioned on Customer's compliance with the terms and conditions of this Agreement, Supabase hereby grants to Customer a non-exclusive, non-transferable (except in compliance with Section 13.8), and non-sublicensable license to use the Documentation during the Subscription Period solely for Customer's internal business purposes in connection with its use of the Services.
### 3. Use Restrictions.
Customer shall not use the Services for any purposes beyond the scope of the access granted in this Agreement. Customer shall not at any time, directly or indirectly, and shall not permit any Authorized Users to: (i) copy, modify, or create derivative works of any Supabase IP, whether in whole or in part; (ii) rent, lease, lend, sell, license, sublicense, assign, distribute, publish, transfer, or otherwise make available the Services or Documentation to any third party; (iii) reverse engineer, disassemble, decompile, decode, adapt, or otherwise attempt to derive or gain access to any software component of the Services, in whole or in part; (iv) remove any proprietary notices from any Supabase IP; (v) use any Supabase IP in any manner or for any purpose that infringes, misappropriates, or otherwise violates any intellectual property right or other right of any person, or that violates any applicable law; (vi) access or use any Supabase IP for purposes of competitive analysis of Supabase or the Services, the development, provision, or use of a competing software service or product, or any other purpose that is to Supabase's detriment or commercial disadvantage; (vii) bypass or breach any security device or protection used by the Services or access or use the Services other than by an Authorized User through the use of valid access credentials; or (vii) input, upload, transmit, or otherwise provide to or through the Services any information or materials that are unlawful or injurious, or that contain, transmit, or activate any Harmful Code.
### 4. Reservation of Rights.
Supabase reserves all rights not expressly granted to Customer in this Agreement. Except for the limited rights and licenses expressly granted under this Agreement, nothing in this Agreement grants, by implication, waiver, estoppel, or otherwise, to Customer or any third party any intellectual property rights or other right, title, or interest in or to the Supabase IP.
### 5. Suspension.
Notwithstanding anything to the contrary in this Agreement, Supabase may temporarily suspend Customer's and any Authorized User's access to any portion or all of the Services if: (i) Supabase reasonably determines that (A) there is a threat or attack on any of the Supabase IP; (B) Customer's or any Authorized User's use of the Supabase IP disrupts or poses a security risk to the Supabase IP or to any other customer or vendor of Supabase; (C) Customer, or any Authorized User, is using the Supabase IP for fraudulent or illegal activities; (D) subject to applicable law, Customer has ceased to continue its business in the ordinary course, made an assignment for the benefit of creditors or similar disposition of its assets, or become the subject of any bankruptcy, reorganization, liquidation, dissolution, or similar proceeding; or (E) Supabase's provision of the Services to Customer or any Authorized User is prohibited by applicable law; (ii) any vendor of Supabase has suspended or terminated Supabase's access to or use of any Third-Party Products required to enable Customer to access the Services; or (iii) in accordance with Section 5.1 (any such suspension described in subclause (i), (ii), or (iii), a "**Service Suspension**"). Supabase shall use commercially reasonable efforts to provide written notice of any Service Suspension to Customer and to provide updates regarding resumption of access to the Services following any Service Suspension. Supabase shall use commercially reasonable efforts to resume providing access to the Services as soon as reasonably possible after the event giving rise to the Service Suspension is cured. Supabase will have no liability for any damage, liabilities, losses (including any loss of data or profits), or any other consequences that Customer or any Authorized User may incur as a result of a Service Suspension.
### 6. Aggregated Data.
Notwithstanding anything to the contrary in this Agreement, Supabase may monitor Customer's use of the Services and collect and compile Aggregated Data. As between Supabase and Customer, all right, title, and interest in Aggregated Data, and all intellectual property rights therein, belong to and are retained solely by Supabase. Customer acknowledges that Supabase may compile Aggregated Data based on Customer Data input into the Services. Customer agrees that Supabase may (i) make Aggregated Data available to third parties including its other customers in compliance with applicable law, and (ii) use Aggregated Data to the extent and in the manner permitted under applicable law.
## 3. Customer Responsibilities.
### 1. General.
Customer is responsible and liable for all uses of the Services and Documentation resulting from access provided by Customer, directly or indirectly, whether such access or use is permitted by or in violation of this Agreement. Without limiting the generality of the foregoing, Customer is responsible for all acts and omissions of Authorized Users, and any act or omission by an Authorized User that would constitute a breach of this Agreement if taken by Customer will be deemed a breach of this Agreement by Customer. Customer shall use reasonable efforts to make all Authorized Users aware of this Agreement's provisions as applicable to such Authorized User's use of the Services and shall cause Authorized Users to comply with such provisions.
### 2. Third-Party Products.
Supabase may from time to time make Third-Party Products available to Customer or Supabase may allow for certain Third-Party Products to be integrated with the Services to allow for the transmission of Customer Data from such Third-Party Products into the Services. For purposes of this Agreement, such Third-Party Products are subject to their own terms and conditions. If Customer does not agree to abide by the applicable terms for any such Third-Party Products, then Customer should not install or use such Third-Party Products. By authorizing Supabase to transmit Customer Data from Third-Party Products into the Services, Customer represents and warrants to Supabase that it has all right, power, and authority to provide such authorization.
### 3. Customer Control and Responsibility.
Customer has and will retain sole responsibility for: (i) all Customer Data, including its content and use; (ii) all information, instructions, and materials provided by or on behalf of Customer or any Authorized User in connection with the Services; (iii) Customer's information technology infrastructure, including computers, software, databases, electronic systems (including database management systems), and networks, whether operated directly by Customer or through the use of third-party services ("**Customer Systems**"); (iv) the security and use of Customer's and its Authorized Users' access credentials; and (v) all access to and use of the Services directly or indirectly by or through the Customer Systems or its or its Authorized Users' access credentials, with or without Customer's knowledge or consent, including all results obtained from, and all conclusions, decisions, and actions based on, such access or use.
## 4. Support.
During the Subscription Period, Supabase will use commercially reasonable efforts to provide Customer with basic customer support via Supabase's standard support channels during Supabase's normal business hours.
## 5. Fees and Taxes.
### 1. Fees.
Where paid for services are agreed between Supabase and Customer per the Order, Customer shall pay Supabase the fees ("**Fees**") identified in the Order without offset or deduction at the cadence identified in the Order (e.g., monthly or annually). Fees paid by Customer are non-refundable. If Customer fails to make any payment when due, and Customer has not notified Supabase in writing within ten (10) days of the payment becoming due and payable that the payment is subject to a good faith dispute, without limiting Supabase's other rights and remedies: (i) Supabase may charge interest on the undisputed past due amount at the rate of 1.5% per month, calculated daily and compounded monthly or, if lower, the highest rate permitted under applicable law; (ii) Customer shall reimburse Supabase for all reasonable costs incurred by Supabase in collecting any late payments or interest, including attorneys' fees, court costs, and collection agency fees; and (iii) if such failure continues for ten (10) days or more, Supabase may suspend Customer's and its Authorized Users' access to any portion or all of the Services until such amounts are paid in full.
### 2. Taxes.
All Fees and other amounts payable by Customer under this Agreement are exclusive of taxes and similar assessments. Customer is responsible for all sales, use, and excise taxes, and any other similar taxes, duties, and charges of any kind imposed by any federal, state, or local governmental or regulatory authority on any amounts payable by Customer hereunder, other than any taxes imposed on Supabase's income. To the extent that Supabase is required by law to pay any such taxes, duties, or other charges to any governmental or regulatory authority, Supabase may invoice Customer for such taxes, duties, or other charges and Customer will pay such invoiced amounts in accordance with this Agreement.
## 6. Confidential Information.
### 1. Definition.
From time to time during the Subscription Period, either Party may disclose or make available to the other Party information about its business affairs, products, confidential intellectual property, trade secrets, third-party confidential information, and other sensitive or proprietary information, whether orally or in written, electronic, or other form or media that: (i) is marked, designated or otherwise identified as "confidential" or something similar at the time of disclosure or within a reasonable period of time thereafter; or (ii) would be considered confidential by a reasonable person given the nature of the information or the circumstances of its disclosure (collectively, "**Confidential Information**"). Except for Personal Information, Confidential Information does not include information that, at the time of disclosure is: (a) in the public domain; (b) known to the receiving Party at the time of disclosure; (c) rightfully obtained by the receiving Party on a non-confidential basis from a third party; or (d) independently developed by the receiving Party without use of, reference to, or reliance upon the disclosing Party's Confidential Information.
### 2. Duty.
The receiving Party shall not disclose the disclosing Party's Confidential Information to any person or entity, except to the receiving Party's employees, contractors, and agents who have a need to know the Confidential Information for the receiving Party to exercise its rights or perform its obligations hereunder ("**Representatives**"). The receiving Party will be responsible for all the acts and omissions of its Representatives as they relate to Confidential Information hereunder. Notwithstanding the foregoing, each Party may disclose Confidential Information to the limited extent required (i) in order to comply with the order of a court or other governmental body, or as otherwise necessary to comply with applicable law, provided that the Party making the disclosure pursuant to the order shall first have given written notice to the other Party and made a reasonable effort to obtain a protective order; or (ii) to establish a Party's rights under this Agreement, including to make required court filings. Further, notwithstanding the foregoing, each Party may disclose the terms and existence of this Agreement to its actual or potential investors, debtholders, acquirers, or merger partners under customary confidentiality terms.
### 3. Return of Materials; Effects of Termination/Expiration.
On the expiration or termination of the Agreement, the receiving Party shall promptly return to the disclosing Party all copies, whether in written, electronic, or other form or media, of the disclosing Party's Confidential Information, or destroy all such copies and certify in writing to the disclosing Party that such Confidential Information has been destroyed. Each Party's obligations of non-use and non-disclosure with regard to Confidential Information are effective as of the Effective Date and will expire three (3) years from the date of termination or expiration of this Agreement; provided, however, with respect to any Confidential Information that constitutes a trade secret (as determined under applicable law), such obligations of non-disclosure will survive the termination or expiration of this Agreement for as long as such Confidential Information remains subject to trade secret protection under applicable law.
## 7. Personal Information.
Customer will ensure that its Customer Data, and its use of such Customer Data, complies with this Agreement and any applicable law. Customer is responsible for properly configuring and using the Services and taking its own steps to maintain appropriate security, protection, and backup of Customer Data. Customer may not store or process protected health information (as defined in HIPAA) using the Services unless Customer signs a Business Associate Agreement with Supabase. Customer may not store any payment cardholder information using the Services without Supabase's prior written approval.
## 8. Intellectual Property Ownership; Feedback.
### 1. Supabase IP.
Customer acknowledges that, as between Customer and Supabase, Supabase owns all right, title, and interest, including all intellectual property rights, in and to the Supabase IP and, with respect to Third-Party Products, the applicable third-party providers own all right, title, and interest, including all intellectual property rights, in and to the Third-Party Products.
### 2. Customer Data.
Supabase acknowledges that, as between Supabase and Customer, Customer owns all right, title, and interest, including all intellectual property rights, in and to the Customer Data. Customer hereby grants to Supabase a non-exclusive, royalty-free, worldwide license to reproduce, distribute, and otherwise use and display the Customer Data and perform all acts with respect to the Customer Data as may be necessary for Supabase to provide the Services to Customer, and a non-exclusive, perpetual, irrevocable, royalty-free, worldwide license to reproduce, distribute, modify, and otherwise use and display Customer Data incorporated within the Aggregated Data. Customer may export the Customer Data at any time through the features and functionalities made available via the Services.
### 3. Feedback.
If Customer or any of its employees or contractors sends or transmits any communications or materials to Supabase by mail, email, telephone, or otherwise, suggesting or recommending changes to the Supabase IP, including without limitation, new features or functionality relating thereto, or any comments, questions, suggestions, or the like ("**Feedback**"), Supabase is free to use such Feedback irrespective of any other obligation or limitation between the Parties governing such Feedback so long as Supabase does not identify Customer as the source of the Feedback without Customer's prior approval.
## 9. Warranty Disclaimer.
The Supabase IP is provided "as is" and Supabase
hereby disclaims all warranties, whether express, implied, statutory, or
otherwise. Supabase specifically disclaims all implied warranties of
merchantability, fitness for a particular purpose, title, and non-infringement,
and all warranties arising from course of dealing, usage, or trade practice. Supabase
makes no warranty of any kind that the Supabase IP, or any products or results
of the use thereof, will meet Customer’s or any other person’s requirements,
operate without interruption, achieve any intended result, be compatible or
work with any software, system or other services, or be secure, accurate,
complete, free of harmful code, or error free.
## 10. Indemnification.
### 1. Supabase Indemnification.
1. Supabase shall indemnify, defend, and hold harmless Customer from and against any and all losses, damages, liabilities, costs (including reasonable attorneys' fees) ("**Losses**") incurred by Customer resulting from any third-party claim, suit, action, or proceeding ("**Third-Party Claim**") that the Services, or any use of the Services in accordance with this Agreement, infringes or misappropriates such third party's US copyrights or trade secrets; provided that Customer promptly notifies Supabase in writing of the claim, cooperates with Supabase, and allows Supabase sole authority to control the defense and settlement of such claim.
2. If such a claim is made or appears possible, Customer agrees to permit Supabase, at Supabase's sole discretion: to (i) modify or replace the Services, or component or part thereof, to make it non-infringing; or (ii) obtain the right for Customer to continue use. If Supabase determines that neither alternative is reasonably commercially available, Supabase may terminate this Agreement, in its entirety or with respect to the affected component or part, effective immediately on written notice to Customer.
3. This Section 10.1 will not apply to the extent that the alleged infringement arises from: (i) use of the Services in combination with data, software, hardware, equipment, or technology not provided by Supabase or authorized by Supabase in writing; (ii) modifications to the Services not made by Supabase; (iii) Customer Data; or (iv) Third-Party Products.
### 2. Customer Indemnification.
Customer shall indemnify, hold harmless, and, at Supabase's option, defend Supabase from and against any Losses resulting from any Third-Party Claim that the Customer Data, or any use of the Customer Data in accordance with this Agreement, infringes or misappropriates such third party's US intellectual property or other rights and any Third-Party Claims based on Customer's or any Authorized User's (i) negligence or willful misconduct; (ii) use of the Services in a manner not authorized by this Agreement; or (iii) use of the Services in combination with data, software, hardware, equipment or technology not provided by Supabase or authorized by Supabase in writing; in each case provided that Customer may not settle any Third-Party Claim against Supabase unless Supabase consents to such settlement, and further provided that Supabase will have the right, at its option, to defend itself against any such Third-Party Claim or to participate in the defense thereof by counsel of its own choice.
### 3. Sole Remedy.
This section 10.3 sets forth Customer's sole remedies and Supabase's sole liability and obligation for any actual, threatened, or alleged claims that the services infringe, misappropriate, or otherwise violate any intellectual property rights of any third party.
## 11. Limitations of Liability.
Except for: (i) a party’s breach of its confidentiality obligations;
(ii) a party’s indemnity obligations; or (iii) a party’s gross negligence,
fraud, or willful misconduct ("**Excluded Liabilities**"), (a) in no
event will either party be liable under or in connection with this agreement
under any legal or equitable theory, including breach of contract, tort
(including negligence), strict liability, and otherwise, for any: (1)
consequential, incidental, indirect, exemplary, special, enhanced, or punitive
damages; (2) increased costs, diminution in value or lost business, production,
revenues, or profits; (3) loss of goodwill or reputation; (4) use, inability to
use, loss, interruption, delay or recovery of any data, or breach of data or
system security; or (5) cost of replacement goods or services, in each case
regardless of whether such party was advised of the possibility of such losses
or damages or such losses or damages were otherwise foreseeable; and (b) in no
event will either party’s aggregate liability arising out of or related to this
agreement under any legal or equitable theory, including breach of contract,
tort (including negligence), strict liability, and otherwise exceed the total
amounts paid and/or payable to Supabase under this agreement in the twelve (12)
months immediately preceding the claim; provided that, notwithstanding the
foregoing, Supabase's aggregate liability arising out of or relating to any
excluded liabilities will not exceed three times (3x) the total amounts paid
and/or payable to Supabase by Customer under this agreement in the twelve (12)
months immediately preceding the claim.
## 12. Subscription Period and Termination.
### 1. Subscription Period.
The initial term of this Agreement begins on the Effective Date and, unless terminated earlier pursuant to Section 12.2, will continue in effect for the period identified in the Order (the "**Initial Subscription Period**"). This Agreement will automatically renew for additional successive terms equal to the length of the Initial Subscription Period unless earlier terminated pursuant to this Agreement's express provisions or either Party gives the other Party written notice of non-renewal at least thirty (30) days prior to the expiration of the then-current term (each a "**Renewal Subscription Period**" and together with the Initial Subscription Period, the "**Subscription Period**").]
#### 2. Termination.
In addition to any other express termination right set forth in this Agreement:
1. Supabase may terminate this Agreement, effective on written notice to Customer, if Customer: (i) fails to pay any amount when due hereunder, and such failure continues more than ten (10) calendar days after Supabase's delivery of written notice thereof; or (ii) breaches any of its obligations under Section 2.3 or Section 6;
2. either Party may terminate this Agreement, effective on written notice to the other Party, if the other Party materially breaches this Agreement, and such breach: (i) is incapable of cure; or (ii) being capable of cure, remains uncured thirty (30) calendar days after the non-breaching Party provides the breaching Party with written notice of such breach; or
3. either Party may terminate this Agreement, effective immediately upon written notice to the other Party, if the other Party: (i) becomes insolvent or is generally unable to pay, or fails to pay, its debts as they become due; (ii) files or has filed against it, a petition for voluntary or involuntary bankruptcy or otherwise becomes subject, voluntarily or involuntarily, to any proceeding under any domestic or foreign bankruptcy or insolvency law; (iii) makes or seeks to make a general assignment for the benefit of its creditors; or (iv) applies for or has appointed a receiver, trustee, custodian, or similar agent appointed by order of any court of competent jurisdiction to take charge of or sell any material portion of its property or business.
### 3. Effect of Expiration or Termination.
Upon expiration or earlier termination of this Agreement, Customer shall immediately discontinue use of the Supabase IP and, without limiting Customer's obligations under Section 6, Customer shall delete, destroy, or return all copies of the Supabase IP and certify in writing to the Supabase that the Supabase IP has been deleted or destroyed. No expiration or termination will affect Customer's obligation to pay all Fees that may have become due before such expiration or termination or entitle Customer to any refund.
### 4. Survival.
This Section 12.4 and Sections 1, 5, 6, 8, 9, 10, 11, and 13 survive any termination or expiration of this Agreement. No other provisions of this Agreement survive the expiration or earlier termination of this Agreement.
## 13. Miscellaneous.
### 1. Entire Agreement.
This Agreement, together with any other documents incorporated herein by reference, constitutes the sole and entire agreement of the Parties with respect to the subject matter of this Agreement and supersedes all prior and contemporaneous understandings, agreements, and representations and warranties, both written and oral, with respect to such subject matter. In the event of any inconsistency between the statements made in the body of this Agreement, the related Exhibits, and any other documents incorporated herein by reference, the following order of precedence governs: (i) first, this Agreement; and (ii) second, any other documents incorporated herein by reference.
### 2. Notices.
All notices, requests, consents, claims, demands, waivers, and other communications hereunder (each, a "**Notice**") must be in writing and addressed to the Parties at the addresses set forth on the first page of this Agreement or as identified on the Order Form (or to such other address that may be designated by the Party giving Notice from time to time in accordance with this Section). All Notices must be delivered by personal delivery, nationally recognized signed for on delivery courier (with all fees pre-paid), or email (with confirmation of transmission). All email Notices to Supabase must be sent to [legal@supabase.io](mailto:legal@supabase.io). Except as otherwise provided in this Agreement, a Notice is effective only: (i) upon receipt by the receiving Party; and (ii) if the Party giving the Notice has complied with the requirements of this Section.
### 3. Force Majeure.
In no event shall either Party be liable to the other Party, or be deemed to have breached this Agreement, for any failure or delay in performing its obligations under this Agreement (except for any obligations to make payments), if and to the extent such failure or delay is caused by any circumstances beyond such Party's reasonable control, including but not limited to acts of God, flood, fire, earthquake, explosion, war, terrorism, invasion, riot or other civil unrest, strikes, labor stoppages or slowdowns or other industrial disturbances, or passage of law or any action taken by a governmental or public authority, including imposing an embargo.
### 4. Amendment and Modification.
Supabase may change this Agreement (except for any Orders) from time to time at its discretion. The date on which the Agreement was last modified will be updated at the top of this Agreement. Supabase will provide Customer with reasonable notice prior to any amendments or modifications taking effect, either by emailing the email address associated with Customer's account on the Services or by another method reasonably designed to provide notice to Customer. If Customer accesses or uses the Services after the effective date of the revised Agreement, such access and use will constitute Customer's acceptance of the revised Agreement beginning at the next Renewal Subscription Period or, if Customer enters into a new Order with Supabase, as of the date of execution of such Order.
### 5. Waiver.
No failure or delay by either Party in exercising any right or remedy available to it in connection with this Agreement will constitute a waiver of such right or remedy. No waiver under this Agreement will be effective unless made in writing and signed by an authorized representative of the Party granting the waiver.
### 6. Severability.
If any provision of this Agreement is invalid, illegal, or unenforceable in any jurisdiction, such invalidity, illegality, or unenforceability will not affect any other term or provision of this Agreement or invalidate or render unenforceable such term or provision in any other jurisdiction. Upon such determination that any term or other provision is invalid, illegal, or unenforceable, the Parties shall negotiate in good faith to modify this Agreement so as to effect their original intent as closely as possible in a mutually acceptable manner in order that the transactions contemplated hereby be consummated as originally contemplated to the greatest extent possible.
### 7. Governing Law; Submission to Jurisdiction.
This Agreement is governed by and construed in accordance with the internal laws of the State of California without giving effect to any choice or conflict of law provision or rule that would require or permit the application of the laws of any jurisdiction other than those of the State of California. Any legal suit, action, or proceeding arising out of or related to this Agreement or the licenses granted hereunder must be instituted in the federal courts of the United States or the courts of the State of California in each case located in San Francisco County, California and each Party irrevocably submits to the exclusive jurisdiction of such courts in any such suit, action, or proceeding.
### 8. Assignment.
Customer may not assign any of its rights or delegate any of its obligations hereunder, in each case whether voluntarily, involuntarily, by operation of law or otherwise, without the prior written consent of Supabase. Any purported assignment or delegation in violation of this Section will be null and void. No assignment or delegation will relieve the assigning or delegating Party of any of its obligations hereunder. This Agreement is binding upon and inures to the benefit of the Parties and their respective permitted successors and assigns.
### 9. Export Regulation.
The Services utilize software and technology that may be subject to US export control laws, including the US Export Administration Act and its associated regulations. Customer shall not, directly or indirectly, export, re-export, or release the Services or the underlying software or technology to, or make the Services or the underlying software or technology accessible from, any jurisdiction or country to which export, re-export, or release is prohibited by law, rule, or regulation. Customer shall comply with all applicable federal laws, regulations, and rules, and complete all required undertakings (including obtaining any necessary export license or other governmental approval), prior to exporting, re-exporting, releasing, or otherwise making the Services or the underlying software or technology available outside the US.
### 10. US Government Rights.
Each of the Documentation and the software components that constitute the Services is a "commercial item" as that term is defined at 48 C.F.R. § 2.101, consisting of "commercial computer software" and "commercial computer software documentation" as such terms are used in 48 C.F.R. § 12.212. Accordingly, if Customer is an agency of the US Government or any contractor therefor, Customer only receives those rights with respect to the Services and Documentation as are granted to all other end users, in accordance with (a) 48 C.F.R. § 227.7201 through 48 C.F.R. § 227.7204, with respect to the Department of Defense and their contractors, or (b) 48 C.F.R. § 12.212, with respect to all other US Government users and their contractors.
### 11. Equitable Relief.
Each Party acknowledges and agrees that a breach or threatened breach by such Party of any of its obligations under Section 6 or, in the case of Customer, Section 2.3, would cause the other Party irreparable harm for which monetary damages would not be an adequate remedy and agrees that, in the event of such breach or threatened breach, the other Party will be entitled to equitable relief, including a restraining order, an injunction, specific performance and any other relief that may be available from any court, without any requirement to post a bond or other security, or to prove actual damages or that monetary damages are not an adequate remedy. Such remedies are not exclusive and are in addition to all other remedies that may be available at law, in equity or otherwise.
### 12. Publicity.
Supabase may identify Customer as a user of the Services and may use Customer's name, logo, and other trademarks in Supabase's customer list, press releases, blog posts, advertisements, and website (and all use thereof and goodwill arising therefrom shall inure to the sole and exclusive benefit of Customer). Otherwise, neither Party may use the name, logo, or other trademarks of the other Party for any purpose without the other Party's prior written approval.
@@ -1,72 +0,0 @@
---
id: auth-onauthstatechange
title: "auth.onAuthStateChange()"
slug: auth-onauthstatechange
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml
---
import Tabs from '@theme/Tabs';
import TabsPanel from '@theme/TabsPanel';
Receive a notification every time an auth event happens.
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
final subscription = supabase.auth.onAuthStateChange((event, session) {
print(session?.user?.id);
// handle auth state change
});
```
</TabsPanel>
</Tabs>
## Examples
### Listen to auth changes
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
final subscription = supabase.auth.onAuthStateChange((event, session) {
print(session?.user?.id);
// handle auth state change
});
```
</TabsPanel>
</Tabs>
-66
View File
@@ -1,66 +0,0 @@
---
id: auth-session
title: "auth.session()"
slug: auth-session
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml
---
import Tabs from '@theme/Tabs';
import TabsPanel from '@theme/TabsPanel';
Returns the session data, if there is an active session.
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
final session = supabase.auth.session();
```
</TabsPanel>
</Tabs>
## Examples
### Get the session data
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
final session = supabase.auth.session();
```
</TabsPanel>
</Tabs>
-103
View File
@@ -1,103 +0,0 @@
---
id: auth-signin
title: 'auth.signIn()'
slug: auth-signin
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml
---
import Tabs from '@theme/Tabs'
import TabsPanel from '@theme/TabsPanel'
Log in an existing user, or login via a third-party provider.
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
final res = await supabase.auth.signIn(email: 'example@email.com', password: 'example-password');
final user = res.data?.user;
final error = res.error;
```
</TabsPanel>
</Tabs>
## Notes
- A user can sign up via email, phone number.
- If you provide `email` without a `password`, the user will be sent a magic link.
- The magic link's destination URL is determined by the SITE_URL config variable. To change this, you can go to Authentication -> Settings on [app.supabase.com](https://app.supabase.com)
- Similarly, if you provide `phone` without a `password`, the user will be sent a one time password.
- If you are looking to sign users in with OAuth in Flutter apps, go to [`signInWithProvider()`](/docs/reference/dart/auth-signinwithprovider).
## Examples
### Sign in with email.
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
final res = await supabase.auth.signIn(email: 'example@email.com', password: 'example-password');
final user = res.data?.user;
final error = res.error;
```
</TabsPanel>
</Tabs>
### Sign in with magic link.
If email is provided, but no password is provided, the user will be sent a "magic link" to their email address, which they can click to open your application with a valid session. By default, a given user can only request a Magic Link once every 60 seconds.
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
final res = await supabase.auth.signIn(email: 'example@email.com');
final error = res.error;
```
</TabsPanel>
</Tabs>
### Get OAuth sign in URL.
Passing provider parameter to `signIn()` will return a URL to sign your user in via OAuth.
If you are looking to sign in a user via OAuth on Flutter app, go to [`signInWithProvider()`](/docs/reference/dart/auth-signinwithprovider).
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
final res = await supabase.auth.signIn(provider: Provider.github);
final url = res.data?.url;
final error = res.error;
```
</TabsPanel>
</Tabs>
@@ -1,129 +0,0 @@
---
id: auth-signinwithprovider
title: "auth.signInWithProvider()"
slug: auth-signinwithprovider
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml
---
import Tabs from '@theme/Tabs';
import TabsPanel from '@theme/TabsPanel';
Signs the user in using third party OAuth providers.
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
final res = await supabase.auth.signInWithProvider(Provider.github);
final error = res.error;
```
</TabsPanel>
</Tabs>
## Notes
- `auth.signInWithProvider()` is only available on `supabase_flutter`
- It will open the browser to the relevant login page.
## Examples
### Sign in with provider.
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
final res = await supabase.auth.signInWithProvider(Provider.github);
final error = res.error;
```
</TabsPanel>
</Tabs>
### With `redirectTo`
Specify the redirect link to bring back the user via deeplink.
Note that `redirectTo` should be null for Flutter Web.
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
final res = await supabase.auth.signInWithProvider(
Provider.github,
options: AuthOptions(
redirectTo: kIsWeb
? null
: 'io.supabase.flutter://reset-callback/'),
);
final error = res.error;
```
</TabsPanel>
</Tabs>
### With scopes
If you need additional data from an OAuth provider, you can include a space-separated list of scopes in your request to get back an OAuth provider token.
You may also need to specify the scopes in the provider's OAuth app settings, depending on the provider.
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
const { user, session, error } = await supabase.auth.signIn({
provider: 'github'
}, {
scopes: 'repo gist notifications'
})
const oAuthToken = session.provider_token // use to access provider API
```
</TabsPanel>
</Tabs>
-70
View File
@@ -1,70 +0,0 @@
---
id: auth-signout
title: "auth.signOut()"
slug: auth-signout
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml
---
import Tabs from '@theme/Tabs';
import TabsPanel from '@theme/TabsPanel';
Signs out the current user, if there is a logged in user.
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
final res = await supabase.auth.signOut();
final error = res.error;
```
</TabsPanel>
</Tabs>
## Examples
### Sign out
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
final res = await supabase.auth.signOut();
final error = res.error;
```
</TabsPanel>
</Tabs>
-62
View File
@@ -1,62 +0,0 @@
---
id: auth-signup
title: 'auth.signUp()'
slug: auth-signup
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml
---
import Tabs from '@theme/Tabs'
import TabsPanel from '@theme/TabsPanel'
Creates a new user.
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
final res = await supabase.auth.signUp('example@email.com', 'example-password');
final user = res.data?.user;
final error = res.error;
```
</TabsPanel>
</Tabs>
## Notes
- By default, the user will need to verify their email address before logging in. If you would like to change this, you can disable "Email Confirmations" by going to Authentication -> Settings on [app.supabase.com](https://app.supabase.com)
- If "Email Confirmations" is turned on, a `user` is returned but `session` will be null
- If "Email Confirmations" is turned off, both a `user` and a `session` will be returned
- When the user confirms their email address, they will be redirected to localhost:3000 by default. To change this, you can go to Authentication -> Settings on [app.supabase.com](https://app.supabase.com)
## Examples
### Sign up.
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
final res = await supabase.auth.signUp('example@email.com', 'example-password');
final user = res.data?.user;
final error = res.error;
```
</TabsPanel>
</Tabs>
### Sign up with third-party providers.
If you are using Flutter, you can sign up with OAuth providers using the [`signInWithProvider()`](/docs/reference/dart/auth-signinwithprovider) method available on `supabase_flutter`.
-76
View File
@@ -1,76 +0,0 @@
---
id: auth-update
title: "auth.update()"
slug: auth-update
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml
---
import Tabs from '@theme/Tabs';
import TabsPanel from '@theme/TabsPanel';
Updates user data, if there is a logged in user.
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
final res = await supabase.auth.update(
UserAttributes(data: {'hello': 'world'})
);
final error = res.error;
```
</TabsPanel>
</Tabs>
## Notes
It's generally better to store user data in a table inside your public schema (i.e. `public.users`).
Use the `update()` method if you have data which rarely changes or is specific only to the logged in user.
## Examples
### Update a user's metadata.
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
final res = await supabase.auth.update(
UserAttributes(data: {'hello': 'world'})
);
final error = res.error;
```
</TabsPanel>
</Tabs>
-66
View File
@@ -1,66 +0,0 @@
---
id: auth-user
title: "auth.user()"
slug: auth-user
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml
---
import Tabs from '@theme/Tabs';
import TabsPanel from '@theme/TabsPanel';
Returns the user data, if there is a logged in user.
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
final user = supabase.auth.user();
```
</TabsPanel>
</Tabs>
## Examples
### Get the logged in user
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
final user = supabase.auth.user();
```
</TabsPanel>
</Tabs>
-145
View File
@@ -1,145 +0,0 @@
---
id: containedby
title: ".containedBy()"
slug: containedby
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml
---
import Tabs from '@theme/Tabs';
import TabsPanel from '@theme/TabsPanel';
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
final res = await supabase
.from('countries')
.select('name, id, main_exports')
.containedBy('main_exports', ['cars', 'food', 'machine'])
.execute();
```
</TabsPanel>
</Tabs>
## Examples
### With `select()`
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
final res = await supabase
.from('countries')
.select('name, id, main_exports')
.containedBy('main_exports', ['cars', 'food', 'machine'])
.execute();
```
</TabsPanel>
</Tabs>
### With `update()`
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
final res = await supabase
.from('countries')
.update({ 'name': 'Mordor' })
.containedBy('main_exports', ['orks', 'surveillance', 'evil'])
.execute();
```
</TabsPanel>
</Tabs>
### With `delete()`
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
final res = await supabase
.from('countries')
.delete()
.containedBy('main_exports', ['cars', 'food', 'machine'])
.execute();
```
</TabsPanel>
</Tabs>
### With `rpc()`
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
// Only valid if the Stored Procedure returns a table type.
final res = await supabase
.rpc('echo_all_countries')
.containedBy('main_exports', ['cars', 'food', 'machine'])
.execute();
```
</TabsPanel>
</Tabs>
-145
View File
@@ -1,145 +0,0 @@
---
id: contains
title: ".contains()"
slug: contains
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml
---
import Tabs from '@theme/Tabs';
import TabsPanel from '@theme/TabsPanel';
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
final res = await supabase
.from('countries')
.select('name, id, main_exports')
.contains('main_exports', ['oil'])
.execute();
```
</TabsPanel>
</Tabs>
## Examples
### With `select()`
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
final res = await supabase
.from('countries')
.select('name, id, main_exports')
.contains('main_exports', ['oil'])
.execute();
```
</TabsPanel>
</Tabs>
### With `update()`
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
final res = await supabase
.from('countries')
.update({ 'name': 'Mordor' })
.contains('main_exports', ['oil'])
.execute();
```
</TabsPanel>
</Tabs>
### With `delete()`
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
final res = await supabase
.from('countries')
.delete()
.contains('main_exports', ['oil'])
.execute();
```
</TabsPanel>
</Tabs>
### With `rpc()`
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
// Only valid if the Stored Procedure returns a table type.
final res = await supabase
.rpc('echo_all_countries')
.contains('main_exports', ['oil'])
.execute();
```
</TabsPanel>
</Tabs>
-76
View File
@@ -1,76 +0,0 @@
---
id: delete
title: "Delete data: delete()"
slug: delete
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml
---
import Tabs from '@theme/Tabs';
import TabsPanel from '@theme/TabsPanel';
Performs a DELETE on the table.
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
final res = await supabase
.from('cities')
.delete()
.match({ 'id': 666 })
.execute();
```
</TabsPanel>
</Tabs>
## Notes
TODO update link to dart
- `delete()` should always be combined with [Filters](/docs/reference/javascript/using-filters) to target the item(s) you wish to delete.
## Examples
### Delete records
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
final res = await supabase
.from('cities')
.delete()
.match({ 'id': 666 })
.execute();
```
</TabsPanel>
</Tabs>
-146
View File
@@ -1,146 +0,0 @@
---
id: eq
title: ".eq()"
slug: eq
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml
---
import Tabs from '@theme/Tabs';
import TabsPanel from '@theme/TabsPanel';
Finds all rows whose value on the stated `column` exactly matches the specified `value`.
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
final res = await supabase
.from('cities')
.select('name, country_id')
.eq('name', 'The shire')
.execute();
```
</TabsPanel>
</Tabs>
## Examples
### With `select()`
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
final res = await supabase
.from('cities')
.select('name, country_id')
.eq('name', 'The shire')
.execute();
```
</TabsPanel>
</Tabs>
### With `update()`
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
final res = await supabase
.from('cities')
.update({ 'name': 'Mordor' })
.eq('name', 'San Francisco')
.execute();
```
</TabsPanel>
</Tabs>
### With `delete()`
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
final res = await supabase
.from('cities')
.delete()
.eq('name', 'Mordor')
.execute();
```
</TabsPanel>
</Tabs>
### With `rpc()`
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
// Only valid if the Stored Procedure returns a table type.
final res = await supabase
.rpc('echo_all_cities')
.eq('name', 'San Francisco')
.execute();
```
</TabsPanel>
</Tabs>
-170
View File
@@ -1,170 +0,0 @@
---
id: filter
title: ".filter()"
slug: filter
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml
---
import Tabs from '@theme/Tabs';
import TabsPanel from '@theme/TabsPanel';
Finds all rows whose `column` satisfies the filter.
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
final res = await supabase
.from('cities')
.select('name, country_id')
.filter('name', 'in', '("Paris","Tokyo")')
.execute();
```
</TabsPanel>
</Tabs>
## Notes
- `.filter()` expects you to use the raw [PostgREST syntax](https://postgrest.org/en/stable/api.html#horizontal-filtering-rows) for the filter values, so it should only be used as an escape hatch in case other filters don't work.
## Examples
### With `select()`
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
final res = await supabase
.from('cities')
.select('name, country_id')
.filter('name', 'in', '("Paris","Tokyo")')
.execute();
```
</TabsPanel>
</Tabs>
### With `update()`
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
final res = await supabase
.from('cities')
.update({ 'name': 'Mordor' })
.filter('name', 'in', '("Paris","Tokyo")')
.execute();
```
</TabsPanel>
</Tabs>
### With `delete()`
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
final res = await supabase
.from('cities')
.delete()
.filter('name', 'in', '("Paris","Tokyo")')
.execute();
```
</TabsPanel>
</Tabs>
### With `rpc()`
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
// Only valid if the Stored Procedure returns a table type.
final res = await supabase
.rpc('echo_all_cities')
.filter('name', 'in', '("Paris","Tokyo")')
```
</TabsPanel>
</Tabs>
### Filter embedded resources
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
final res = await supabase
.from('cities')
.select('name, countries ( name )')
.filter('countries.name', 'in', '("France","Japan")')
.execute();
```
</TabsPanel>
</Tabs>
@@ -1,66 +0,0 @@
---
id: getsubscriptions
title: "getSubscriptions()"
slug: getsubscriptions
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml
---
import Tabs from '@theme/Tabs';
import TabsPanel from '@theme/TabsPanel';
Returns an array of all your subscriptions.
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
final subscriptions = supabase.getSubscriptions();
```
</TabsPanel>
</Tabs>
## Examples
### Get all subscriptions
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
final subscriptions = supabase.getSubscriptions();
```
</TabsPanel>
</Tabs>
-146
View File
@@ -1,146 +0,0 @@
---
id: gt
title: ".gt()"
slug: gt
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml
---
import Tabs from '@theme/Tabs';
import TabsPanel from '@theme/TabsPanel';
Finds all rows whose value on the stated `column` is greater than the specified `value`.
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
final res = await supabase
.from('cities')
.select('name, country_id')
.gt('country_id', 250)
.execute();
```
</TabsPanel>
</Tabs>
## Examples
### With `select()`
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
final res = await supabase
.from('cities')
.select('name, country_id')
.gt('country_id', 250)
.execute();
```
</TabsPanel>
</Tabs>
### With `update()`
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
final res = await supabase
.from('cities')
.update({ 'name': 'Mordor' })
.gt('country_id', 250)
.execute();
```
</TabsPanel>
</Tabs>
### With `delete()`
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
final res = await supabase
.from('cities')
.delete()
.gt('country_id', 250)
.execute();
```
</TabsPanel>
</Tabs>
### With `rpc()`
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
// Only valid if the Stored Procedure returns a table type.
final res = await supabase
.rpc('echo_all_cities')
.gt('country_id', 250)
.execute();
```
</TabsPanel>
</Tabs>
-146
View File
@@ -1,146 +0,0 @@
---
id: gte
title: ".gte()"
slug: gte
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml
---
import Tabs from '@theme/Tabs';
import TabsPanel from '@theme/TabsPanel';
Finds all rows whose value on the stated `column` is greater than or equal to the specified `value`.
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
final res = await supabase
.from('cities')
.select('name, country_id')
.gte('country_id', 250)
.execute();
```
</TabsPanel>
</Tabs>
## Examples
### With `select()`
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
final res = await supabase
.from('cities')
.select('name, country_id')
.gte('country_id', 250)
.execute();
```
</TabsPanel>
</Tabs>
### With `update()`
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
final res = await supabase
.from('cities')
.update({ 'name': 'Mordor' })
.gte('country_id', 250)
.execute();
```
</TabsPanel>
</Tabs>
### With `delete()`
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
final res = await supabase
.from('cities')
.delete()
.gte('country_id', 250)
.execute();
```
</TabsPanel>
</Tabs>
### With `rpc()`
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
// Only valid if the Stored Procedure returns a table type.
final res = await supabase
.rpc('echo_all_cities')
.gte('country_id', 250)
.execute();
```
</TabsPanel>
</Tabs>
-146
View File
@@ -1,146 +0,0 @@
---
id: ilike
title: ".ilike()"
slug: ilike
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml
---
import Tabs from '@theme/Tabs';
import TabsPanel from '@theme/TabsPanel';
Finds all rows whose value in the stated `column` matches the supplied `pattern` (case insensitive).
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
final res = await supabase
.from('cities')
.select('name, country_id')
.ilike('name', '%la%')
.execute();
```
</TabsPanel>
</Tabs>
## Examples
### With `select()`
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
final res = await supabase
.from('cities')
.select('name, country_id')
.ilike('name', '%la%')
.execute();
```
</TabsPanel>
</Tabs>
### With `update()`
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
final res = await supabase
.from('cities')
.update({ 'name': 'Mordor' })
.ilike('name', '%la%')
.execute();
```
</TabsPanel>
</Tabs>
### With `delete()`
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
final res = await supabase
.from('cities')
.delete()
.ilike('name', '%la%')
.execute();
```
</TabsPanel>
</Tabs>
### With `rpc()`
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
// Only valid if the Stored Procedure returns a table type.
final res = await supabase
.rpc('echo_all_cities')
.ilike('name', '%la%')
.execute();
```
</TabsPanel>
</Tabs>
-148
View File
@@ -1,148 +0,0 @@
---
id: in_
title: ".in_()"
slug: in_
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml
---
import Tabs from '@theme/Tabs';
import TabsPanel from '@theme/TabsPanel';
Finds all rows whose value on the stated `column` is found on the specified `values`.
`is_` and `in_` filter methods are suffixed with `_` to avoid collisions with reserved keywords.
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
final res = await supabase
.from('cities')
.select('name, country_id')
.in_('name', ['Rio de Janeiro', 'San Francisco'])
.execute();
```
</TabsPanel>
</Tabs>
## Examples
### With `select()`
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
final res = await supabase
.from('cities')
.select('name, country_id')
.in_('name', ['Rio de Janeiro', 'San Francisco'])
.execute();
```
</TabsPanel>
</Tabs>
### With `update()`
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
final res = await supabase
.from('cities')
.update({ 'name': 'Mordor' })
.in_('name', ['Rio de Janeiro', 'San Francisco'])
.execute();
```
</TabsPanel>
</Tabs>
### With `delete()`
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
final res = await supabase
.from('cities')
.delete()
.in_('name', ['Rio de Janeiro', 'San Francisco'])
.execute();
```
</TabsPanel>
</Tabs>
### With `rpc()`
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
// Only valid if the Stored Procedure returns a table type.
final res = await supabase
.rpc('echo_all_cities')
.in_('name', ['Rio de Janeiro', 'San Francisco'])
.execute();
```
</TabsPanel>
</Tabs>
-12
View File
@@ -1,12 +0,0 @@
---
id: index
title: "Getting started"
slug: getting-started
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml
---
import Tabs from '@theme/Tabs';
import TabsPanel from '@theme/TabsPanel';
Supabase Dart.
-84
View File
@@ -1,84 +0,0 @@
---
id: initializing
title: "Initializing"
slug: initializing
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml
---
import Tabs from '@theme/Tabs';
import TabsPanel from '@theme/TabsPanel';
## Dart
You can initialize a new Supabase client using the `SupabaseClient()` method.
The Supabase client is your entrypoint to the rest of the Supabase functionality
and is the easiest way to interact with everything we offer within the Supabase ecosystem.
## Flutter
For `supabase_flutter`, you will be using the static `initialize()` method on `Supabase` class.
## Examples
### Dart SupabaseClient()
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
final supabase = SupabaseClient('https://xyzcompany.supabase.co', 'public-anon-key');
```
</TabsPanel>
</Tabs>
### Flutter initialize()
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart title="main.dart"
Future<void> main() async {
await Supabase.initialize(url: 'https://xyzcompany.supabase.co', anonKey: 'public-anon-key');
runApp(MyApp());
}
```
</TabsPanel>
</Tabs>
-102
View File
@@ -1,102 +0,0 @@
---
id: insert
title: "Create data: insert()"
slug: insert
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml
---
import Tabs from '@theme/Tabs';
import TabsPanel from '@theme/TabsPanel';
Performs an INSERT into the table.
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
final res = await supabase
.from('cities')
.insert([
{'name': 'The Shire', 'country_id': 554}
]).execute();
```
</TabsPanel>
</Tabs>
## Notes
- By default, every time you run `insert()`, the client library will make a `select` to return the full record.
This is convenient, but it can also cause problems if your Policies are not configured to allow the `select` operation.
If you are using Row Level Security and you are encountering problems, try setting the `returning` param to `minimal`.
## Examples
### Create a record
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
final res = await supabase
.from('cities')
.insert([
{'name': 'The Shire', 'country_id': 554}
]).execute();
```
</TabsPanel>
</Tabs>
### Bulk create
<Tabs
defaultActiveId="dart"
groupId="reference/dart"
values={[{ label: 'Dart', value: 'dart' }]}>
<TabsPanel id="dart" label="dart">
```dart
final res = await supabase
.from('cities')
.insert([
{'name': 'The Shire', 'country_id': 554},
{'name': 'Rohan', 'country_id': 555},
]).execute();
```
</TabsPanel>
</Tabs>
Loaded 100 of 539 files, more files were not shown because too many files have changed in this diff. Show more