diff --git a/apps/reference/_supabase_js/release-notes.md b/apps/reference/_supabase_js/release-notes.md index 57af05f0980..d77cf283abc 100644 --- a/apps/reference/_supabase_js/release-notes.md +++ b/apps/reference/_supabase_js/release-notes.md @@ -20,6 +20,7 @@ const supabase = createClient(apiURL, apiKey, { schema: 'public', }, auth: { + storage: AsyncStorage, autoRefreshToken: true, persistSession: true, detectSessionInUrl: true, diff --git a/apps/reference/_supabase_js/upgrade-guide.mdx b/apps/reference/_supabase_js/upgrade-guide.mdx new file mode 100644 index 00000000000..c66a896e9ba --- /dev/null +++ b/apps/reference/_supabase_js/upgrade-guide.mdx @@ -0,0 +1,414 @@ +--- +id: upgrade-guide +title: Upgrade to supabase-js v2 +description: 'Learn how to upgrade to supabase-js v2.' +--- + +import Tabs from '@theme/Tabs' +import TabItem from '@theme/TabItem' + +supabase-js v2 focuses on "quality-of-life" improvements for developers and addresses some of the largest pain points in v1. v2 includes type support, a rebuilt Auth library with async methods, improved errors, and more. + +No new features will be added to supabase-js v1 , but we'll continuing merging security fixes to v1, with maintenance patches for the next 3 months. + +## Upgrade the client library + + +```sh +npm install @supabase/supabase-js@2 +``` + +*Optionally* if you are using custom configuration with `createClient` then follow below: + + + + + +```ts title="src/supabaseClient.ts" +const supabaseClient = createClient(SUPABASE_URL, SUPABASE_ANON_KEY, { + schema: 'custom', + persistSession: false +}) +``` + + + + +```ts title="src/supabaseClient.ts" +const supabaseClient = createClient(SUPABASE_URL, SUPABASE_ANON_KEY, { + db: { + schema: 'custom' + }, + auth: { + persistSession: true + } +}) +``` + + + +Read more about the [constructor options](/docs/reference/javascript/release-notes#explicit-constructor-options). + +### Auth methods + +The signIn() method has been deprecated in favor of more explicit method signatures to help with type hinting. Previously it was difficult for developers to know what they were missing (e.g., a lot of developers didn't realize they could use passwordless magic links). + +#### Sign in with email and password + + + + +```ts +const { user, error } = await supabase.auth.signIn({ email, password }) +``` + + + + +```ts +const { data: { user }, error } = await supabase.auth.signInWithPassword({ email, password }) +``` + + + +#### Sign in with magic link + + + + +```ts +const { error } = await supabase.auth.signIn({ email }) +``` + + + + +```ts +const { error } = await supabase.auth.signInWithOtp({ email }) +``` + + + +#### Sign in with a third-party provider + + + + +```ts +const { error } = await supabase.auth.signIn({ provider }) +``` + + + + +```ts +const { error } = await supabase.auth.signInWithOAuth({ provider }) +``` + + + +#### Sign in with phone + + + + +```ts +const { error } = await supabase.auth.signIn({ phone, password }) +``` + + + + +```ts +const { error } = await supabase.auth.signInWithPassword({ phone, password }) +``` + + + +#### Sign in with phone using OTP + + + + +```ts +const { error } = await supabase.auth.api.sendMobileOTP(phone) +``` + + + + +```ts +const { data, error } = await supabase.auth.signInWithOtp({ phone }) + +// After receiving a SMS with a OTP. +const { data, error } = await supabase.auth.verifyOtp({ phone, token }) +``` + + + +#### Reset password for email + + + + +```ts +const { data, error } = await supabase.auth.api.resetPasswordForEmail(email) +``` + + + + +```ts +const { data, error } = await supabase.auth.resetPasswordForEmail(email) +``` + + + +#### Get the user's current session + + + + +```ts +const session = supabase.auth.session() +``` + + + + +```ts +const { data: { session } } = await supabase.auth.getSession() +``` + + + +#### Get the logged-in user + + + + +```ts +const user = supabase.auth.user() +``` + + + + +```ts +const { data: { session } } = await supabase.auth.getSession() +const { user } = session +``` + + + +#### Update user data for a logged-in user + + + + +```ts +const { user, error } = await supabase.auth.update({ attributes }) +``` + + + + +```ts +const { data: { user }, error } = await supabase.auth.updateUser({ attributes }) +``` + + + +#### Use a custom `access_token` JWT with Supabase + + + + + +```ts +const { user, error } = supabase.auth.setAuth(access_token) +``` + + + + +```ts +const supabase = createClient(SUPABASE_URL, SUPABASE_ANON_KEY, { + global: { + headers: { + Authorization: `Bearer ${access_token}` + } + } +}) +``` + + + +### Data methods + +`.insert()` / `.upsert()` / `.update()` / `.delete()` don't return rows by default: [PR](https://github.com/supabase/postgrest-js/pull/276). + +Previously, these methods return inserted/updated/deleted rows by default (which caused [some confusion](https://github.com/supabase/supabase/discussions/1548)), and you can opt to not return it by specifying `returning: 'minimal'`. Now the default behavior is to not return rows. To return inserted/updated/deleted rows, add a `.select()` call at the end. + +#### Insert and return data + + + + + +```ts +const { data, error } = await supabase.auth.insert({ new_data }) +``` + + + + +```ts +const { data, error } = await supabase.auth.insert({ new_data }).select() +``` + + + +#### Update and return data + + + + + +```ts +const { data, error } = await supabase.auth.update({ new_data }).eq('id', id) +``` + + + + +```ts +const { data, error } = await supabase.auth.update({ new_data }).eq('id', id).select() +``` + + + +### Realtime methods + +#### Subscribe + + + + + +```ts +const userListener = supabase.from('users') + .on('*', + (payload) => handleAllEventsPayload(payload.new) + ) + .subscribe() +``` + + + + +```ts +const userListener = supabase.channel('public:user') + .on( + 'postgres_changes', + { event: '*', schema: 'public', table: 'user' } + (payload) => handleAllEventsPayload() + ) + .subscribe() +``` + + + +#### Unsubscribe + + + + + +```ts +userListener.unsubscribe() +``` + + + + +```ts +supabase.removeChannel('public:users') +``` + + \ No newline at end of file diff --git a/apps/reference/docs/guides/cli/custom-hostnames.mdx b/apps/reference/docs/guides/cli/custom-hostnames.mdx new file mode 100644 index 00000000000..15c8304a93b --- /dev/null +++ b/apps/reference/docs/guides/cli/custom-hostnames.mdx @@ -0,0 +1,69 @@ +--- +id: custom-domains +title: Custom Domains +description: Configuring a Custom Domain for your Supabase project. +--- + +import Tabs from '@theme/Tabs' +import TabItem from '@theme/TabItem' + +:::note + +Custom Domains are currently in beta, and are being slowly made available to projects. + +::: + +## Overview + +Custom domains allow you to present a branded experience to your users. You can also use a subdomain for the purposes of this guide. + +Before you start, here are some prerequisites: + +- [Install the Supabase CLI](/docs/guides/cli) 1.10.1+ +- Ensure that you've configured the CLI for your account +- A Supabase project (create a new one if you don't already have one) +- Ensure that you've subscribed to the Custom Domains add-on + +## Configure a Custom Domain + +Setting up a custom domain (`api.example.com`) for your Supabase project (ref `foobarbaz`, with assigned endpoints at `foobarbaz.supabase.co`) involves a few steps. + +1) Set up a CNAME record for `api.example.com`, resolving to `foobarbaz.supabase.co.`, with as low a TTL as possible. + +2) Use the `create` subcommand of the CLI to initiate the process: + +```bash +supabase custom-hostname create --project-ref foobarbaz --custom-hostname api.example.com --experimental +``` + +3) The output of the `create` command includes two TXT records you will need to set up, in order to verify your control over the domain in question, and for us to issue SSL certificates for it. For example: + +``` +[...] +Required outstanding validation records: + _cf-custom-hostname.api.example.com TXT -> 46BBC14D-D50A-409C-8DB5-F862CF5BA660 + api.example.com TXT -> ca3-F1HvR9i938OgVwpCFwi1jTsbhe1hvT0Ic3efPY3Q +``` + +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 +``` + +You might need to wait a few minutes before your updated DNS records get propagated, especially if the older records were using a high TTL. Upon successful verification, you will be able to proceed to the final activation step: + +``` +Custom hostname configuration complete, and ready for activation. +``` + +4) The final activation step reconfigures your project to start serving traffic on your custom domain (`api.example.com`). The auth service, in particular, will no longer work with the original URL (`foobarbaz.supabase.co`). As such, it is recommended that you schedule a downtime window of 20-30 minutes, depending on the complexity of your project, to update all the services that need to know about your custom domain: + +- any client code (e.g., frontends, mobile apps) +- any OAuth providers (e.g., google, github) + +Additionally, update the DNS configuration for `api.example.com` to once more use a CNAME record that resolves to `foobarbaz.supabase.co`. Finally, you can use the `activate` subcommand to reconfigure your project: + +```bash +supabase custom-hostname activate --project-ref foobarbaz --experimental +``` diff --git a/apps/reference/docs/guides/with-angular.mdx b/apps/reference/docs/guides/with-angular.mdx index 2d4dc88df31..604808ae2cb 100644 --- a/apps/reference/docs/guides/with-angular.mdx +++ b/apps/reference/docs/guides/with-angular.mdx @@ -33,7 +33,7 @@ If you want to do it yourself, let's get started! ### GitHub -Whenever you get stuck at any point, take a look at [this repo](https://github.com/supabase/examples/tree/main/supabase-js-v2/user-management/angular-user-management). +Whenever you get stuck at any point, take a look at [this repo](https://github.com/supabase/supabase/tree/master/examples/user-management/angular-user-management). ## Project set up @@ -261,7 +261,7 @@ export class SupabaseService { } ``` -Optionally, update [src/styles.css](https://raw.githubusercontent.com/supabase/examples/main/supabase-js-v2/user-management/angular-user-management/src/styles.css) to style the app. +Optionally, update [src/styles.css](https://raw.githubusercontent.com/supabase/supabase/master/examples/user-management/angular-user-management/src/styles.css) to style the app. ### Set up a Login component diff --git a/apps/reference/docs/guides/with-react.mdx b/apps/reference/docs/guides/with-react.mdx index 2d4d2fb9c61..a348e36e5f8 100644 --- a/apps/reference/docs/guides/with-react.mdx +++ b/apps/reference/docs/guides/with-react.mdx @@ -195,7 +195,7 @@ export const supabase = createClient(supabaseUrl, supabaseAnonKey) ``` And one optional step is to update the CSS file `src/index.css` to make the app look nice. -You can find the full contents of this file [here](https://raw.githubusercontent.com/supabase/examples/main/supabase-js-v2/user-management/react-user-management/src/index.css). +You can find the full contents of this file [here](https://raw.githubusercontent.com/supabase/supabase/master/examples/user-management/react-user-management/src/index.css). ### Set up a Login component diff --git a/apps/reference/docs/guides/with-redwoodjs.mdx b/apps/reference/docs/guides/with-redwoodjs.mdx index f05dcaf1ba0..792af09bd5b 100644 --- a/apps/reference/docs/guides/with-redwoodjs.mdx +++ b/apps/reference/docs/guides/with-redwoodjs.mdx @@ -324,7 +324,7 @@ export default App ``` And one optional step is to update the CSS file `web/src/index.css` to make the app look nice. -You can find the full contents of this file [here](https://raw.githubusercontent.com/supabase/examples/main/supabase-js-v2/user-management/react-user-management/src/index.css). +You can find the full contents of this file [here](https://raw.githubusercontent.com/supabase/supabase/master/examples/user-management/react-user-management/src/index.css). ### Start RedwoodJS and your first Page diff --git a/apps/reference/docs/guides/with-solidjs.mdx b/apps/reference/docs/guides/with-solidjs.mdx index e601c98aee8..2aa83e84992 100644 --- a/apps/reference/docs/guides/with-solidjs.mdx +++ b/apps/reference/docs/guides/with-solidjs.mdx @@ -194,7 +194,7 @@ export const supabase = createClient(supabaseUrl, supabaseAnonKey) ``` And one optional step is to update the CSS file `src/index.css` to make the app look nice. -You can find the full contents of this file [here](https://raw.githubusercontent.com/supabase/examples/main/supabase-js-v2/user-management/solid-user-management/src/index.css). +You can find the full contents of this file [here](https://raw.githubusercontent.com/supabase/supabase/master/examples/user-management/solid-user-management/src/index.css). ### Set up a Login component diff --git a/apps/reference/docs/guides/with-svelte.mdx b/apps/reference/docs/guides/with-svelte.mdx index cae5b2d5f05..c3fdea765d2 100644 --- a/apps/reference/docs/guides/with-svelte.mdx +++ b/apps/reference/docs/guides/with-svelte.mdx @@ -24,7 +24,7 @@ By the end of this guide you'll have an app which allows users to login and upda ### GitHub -Whenever you get stuck at any point, take a look at [this repo](https://github.com/supabase/examples/tree/main/supabase-js-v2/user-management/svelte-user-management). +Whenever you get stuck at any point, take a look at [this repo](https://github.com/supabase/supabase/tree/master/examples/user-management/svelte-user-management). ## Project set up @@ -178,7 +178,7 @@ export const supabase = createClient(supabaseUrl, supabaseAnonKey) ``` And one optional step is to update the CSS file `src/app.css` to make the app look nice. -You can find the full contents of this file [here](https://raw.githubusercontent.com/supabase/examples/main/supabase-js-v2/user-management/svelte-user-management/src/app.css). +You can find the full contents of this file [here](https://raw.githubusercontent.com/supabase/supabase/master/examples/user-management/svelte-user-management/src/app.css). ### Set up a Login component diff --git a/apps/reference/docs/guides/with-sveltekit.mdx b/apps/reference/docs/guides/with-sveltekit.mdx index fb3374561ae..6687292a82f 100644 --- a/apps/reference/docs/guides/with-sveltekit.mdx +++ b/apps/reference/docs/guides/with-sveltekit.mdx @@ -162,24 +162,22 @@ And finally we want to save the environment variables in a `.env`. All we need are the `SUPABASE_URL` and the `SUPABASE_KEY` key that you copied [earlier](#get-the-api-keys). ```bash title=".env" -VITE_SUPABASE_URL="YOUR_SUPABASE_URL" -VITE_SUPABASE_ANON_KEY="YOUR_SUPABASE_KEY" +PUBLIC_SUPABASE_URL="YOUR_SUPABASE_URL" +PUBLIC_SUPABASE_ANON_KEY="YOUR_SUPABASE_KEY" ``` Now that we have the API credentials in place, let's create a helper file to initialize the Supabase client. These variables will be exposed on the browser, and that's completely fine since we have [Row Level Security](/docs/guides/auth#row-level-security) enabled on our Database. -```js title="lib/supabaseClient.js" -import { createClient } from '@supabase/supabase-js' +```js title="lib/supabaseClient.ts" +import { createClient } from '@supabase/auth-helpers-sveltekit' +import { env } from '$env/dynamic/public' -const supabaseUrl = import.meta.env.VITE_SUPABASE_URL -const supabaseAnonKey = import.meta.env.VITE_SUPABASE_ANON_KEY - -export const supabase = createClient(supabaseUrl, supabaseAnonKey) +export const supabaseClient = createClient(env.PUBLIC_SUPABASE_URL, env.PUBLIC_SUPABASE_ANON_KEY) ``` And one optional step is to update the CSS file `public/global.css` to make the app look nice. -You can find the full contents of this file [here](https://raw.githubusercontent.com/supabase/examples/main/supabase-js-v2/user-management/svelte-user-management/src/app.css). +You can find the full contents of this file [here](https://raw.githubusercontent.com/supabase/supabase/master/examples/user-management/svelte-user-management/src/app.css). ### Set up a Login component diff --git a/apps/reference/docs/guides/with-vue-3.mdx b/apps/reference/docs/guides/with-vue-3.mdx index 49ce6b3739b..80b652a9f67 100644 --- a/apps/reference/docs/guides/with-vue-3.mdx +++ b/apps/reference/docs/guides/with-vue-3.mdx @@ -24,7 +24,7 @@ By the end of this guide you'll have an app which allows users to login and upda ### GitHub -Whenever you get stuck at any point, take a look at [this repo](https://github.com/supabase/examples/tree/main/supabase-js-v2/user-management/vue3-user-management). +Whenever you get stuck at any point, take a look at [this repo](https://github.com/supabase/supabase/tree/master/examples/user-management/vue3-user-management). ## Project set up @@ -182,7 +182,7 @@ const supabaseAnonKey = import.meta.env.VITE_SUPABASE_ANON_KEY export const supabase = createClient(supabaseUrl, supabaseAnonKey) ``` -Optionally, update [src/style.css](https://raw.githubusercontent.com/supabase/examples/main/supabase-js-v2/user-management/vue3-user-management/src/style.css) to style the app. +Optionally, update [src/style.css](https://raw.githubusercontent.com/supabase/supabase/master/examples/user-management/vue3-user-management/src/style.css) to style the app. ### Set up a Login component diff --git a/apps/reference/nav/supabase_js_sidebars.js b/apps/reference/nav/supabase_js_sidebars.js index 990a6b04951..f354bb7cbd1 100644 --- a/apps/reference/nav/supabase_js_sidebars.js +++ b/apps/reference/nav/supabase_js_sidebars.js @@ -26,6 +26,7 @@ const sidebars = { 'generated/initializing', 'typescript-support', 'release-notes', + 'upgrade-guide', ], collapsed: false, }, diff --git a/apps/www/_blog/2022-08-16-supabase-js-v2.mdx b/apps/www/_blog/2022-08-16-supabase-js-v2.mdx index b327552f6b7..f195da5b5c6 100644 --- a/apps/www/_blog/2022-08-16-supabase-js-v2.mdx +++ b/apps/www/_blog/2022-08-16-supabase-js-v2.mdx @@ -1,6 +1,6 @@ --- -title: 'supabase-js v2 Release Candidate' -description: First peek of supabase-js v2, which focuses on quality-of-life improvements for developers. +title: 'supabase-js v2' +description: A look at supabase-js v2, which brings type support and focuses on quality-of-life improvements for developers. author: inian,alaister image: lw5-supabase-js/thumb.jpg thumb: lw5-supabase-js/thumb.jpg @@ -10,6 +10,13 @@ date: '2022-08-16' toc_depth: 3 --- +
+
⚠️ UPDATED 20/10: supabase-js v2 is fully released 🥳
+ +Check the updated docs and migration guide. + +
+ Today we're publishing a release candidate for [supabase-js v2](https://github.com/supabase/supabase-js), which focuses on “quality-of-life” improvements for developers. Try it out by running `npm i @supabase/supabase-js@rc` @@ -299,10 +306,10 @@ Special shout outs to: [@vejja](https://github.com/vejja), [@pixtron](https://gi Update today by running: ```bash -npm i @supabase/supabase-js@rc +npm i @supabase/supabase-js@2 ``` -You can find a full list of updates, breaking changes, and a migration guide in our [Release Notes](https://supabase.com/docs/reference/javascript/release-notes). +[Migration guide](https://supabase.com/docs/reference/javascript/upgrade-guide) We'll continuing merging security fixes to v1, with maintenance patches for the next three months. @@ -319,18 +326,9 @@ We'll continuing merging security fixes to v1, with maintenance patches for the allowfullscreen > -## Links +## supabase-js v2 resources -- [v2 Release Candidate Documentation](https://supabase.com/docs/reference/javascript) -- [Release Notes & Migration Guide](https://supabase.com/docs/reference/javascript/release-notes) - - ## More Launch Week 5 - -- [Launch Week Page](https://supabase.com/launch-week) -- [Launch Week 5 Hackathon](https://supabase.com/blog/launch-week-5-hackathon) -- [Supabase Series B](https://supabase.com/blog/supabase-series-b) -- [Open Source at Supabase - Founders Fireside Chat](https://www.youtube.com/watch?v=4t_63HT3rZY) -- [Day 1 - Supabase CLI v1 and Admin API Beta](https://supabase.com/blog/supabase-cli-v1-and-admin-api-beta) -- [Youtube video - Supabase CLI v1 and Admin API Beta](https://www.youtube.com/watch?v=OpPOaJI_Z28&feature=emb_title) -- [Day 3 - Supabase is SOC2 compliant](https://supabase.com/blog/supabase-soc2) -- [Youtube video - Security Day](https://www.youtube.com/watch?v=6bGQotxisoY) +- [v2 Documentation](https://supabase.com/docs/reference/javascript) +- [Migration guide](https://supabase.com/docs/reference/javascript/upgrade-guide) +- [Next.js quickstart guide](/docs/guides/with-nextjs) +- [Examples](https://github.com/supabase/supabase/tree/master/examples) diff --git a/apps/www/_blog/2022-10-20-supabase-js-v2-released.mdx b/apps/www/_blog/2022-10-20-supabase-js-v2-released.mdx new file mode 100644 index 00000000000..d6cebe4b7f8 --- /dev/null +++ b/apps/www/_blog/2022-10-20-supabase-js-v2-released.mdx @@ -0,0 +1,49 @@ +--- +title: 'supabase-js v2 Released' +description: We've released supabase-js v2. Updated examples, quickstarts, and an improved experience. +author: thor_schaeff +image: supabase-js-v2-release/supabase-js.jpg +thumb: supabase-js-v2-release/supabase-js.jpg +tags: + - launch-week +date: '2022-10-20' +toc_depth: 3 +--- + +During our [last Launch Week](/launch-week) we presented the [release candidate for supabase-js v2](/blog/supabase-js-v2). Since then we've been busy incorporating your feedback, [updating the docs](/docs/reference/javascript/), [examples](https://github.com/supabase/supabase/tree/master/examples), [quickstart guides](/docs/guides/with-nextjs), and putting a [migration guide](/docs/reference/javascript/upgrade-guide) together. + +## What is new in v2? + +TypeScript support was the big one: types can be generated via the CLI and are generated directly from your database. + +Plus v2 comes with lots of improvements that solved some of the largest pain-points highlighted by our users. Your feedback help us improve: you speak, we listen. + +Read all the updates and the differences with v1 on the [announcement blog post](/blog/supabase-js-v2) + +## Acknowledgements + +It truly takes a village, well, in this case an entire community, and we want to thank you all for your feedback, and contributions! + +Version 2.0 is the result of the combined work of several Supatroopers (Alaister, Andrew, Inian, Joel, Jon, Kang, Bobbie, and Tyler), over 100 contributors to our libraries, and over 450 contributors to our docs and websites. + +If you're one of those contributors, thank you! + +- [`functions-js`](https://github.com/supabase/functions-js/graphs/contributors) (4) +- [`gotrue-js`](https://github.com/supabase/gotrue-js/graphs/contributors) (47) +- [`postgrest-js`](https://github.com/supabase/postgrest-js/graphs/contributors) (30) +- [`realtime-js`](https://github.com/supabase/realtime-js/graphs/contributors) (16) +- [`storage-js`](https://github.com/supabase/storage-js/graphs/contributors) (17) +- [`supabase-js`](https://github.com/supabase/supabase-js/graphs/contributors) (39) + +Special shout outs to: [@vejja](https://github.com/vejja), [@pixtron](https://github.com/pixtron), [@bnjmnt4n](https://github.com/pixtron), and [@karlseguin](https://github.com/karlseguin). + +## Links + +- [Documentation](/docs/reference/javascript) +- [Migration Guide](/docs/reference/javascript/upgrade-guide) +- [Quickstart Guides](/docs/guides/with-nextjs) +- [Examples (GitHub)](https://github.com/supabase/supabase/tree/master/examples) +- [Release Notes](/docs/reference/javascript/release-notes) +- [Release Candidate Blogpost](/blog/supabase-js-v2) +- [Auth Helpers](/docs/guides/auth/auth-helpers/) +- [Auth UI](https://supabase.com/docs/guides/auth/auth-helpers/auth-ui) diff --git a/apps/www/package.json b/apps/www/package.json index 058d02f2861..28b9b9c5036 100644 --- a/apps/www/package.json +++ b/apps/www/package.json @@ -52,7 +52,7 @@ "uuid": "^8.3.2" }, "devDependencies": { - "@tailwindcss/typography": "^0.5.2", + "@tailwindcss/typography": "^0.5.7", "@types/classnames": "^2.3.1", "@types/jest": "^25.2.2", "@types/marked": "^4.0.3", @@ -64,9 +64,9 @@ "@types/react-copy-to-clipboard": "^4.3.0", "@types/react-dom": "^17.0.11", "@types/react-syntax-highlighter": "^13.5.2", - "autoprefixer": "^10.4.2", + "autoprefixer": "^10.4.12", "file-loader": "^6.2.0", - "postcss": "^8.4.16", + "postcss": "^8.4.18", "postcss-preset-env": "^6.7.0", "prettier": "^2.2.1", "tailwindcss": "^3.1.8" diff --git a/apps/www/public/images/blog/supabase-js-v2-release/supabase-js.jpg b/apps/www/public/images/blog/supabase-js-v2-release/supabase-js.jpg new file mode 100644 index 00000000000..a11c49e8ec6 Binary files /dev/null and b/apps/www/public/images/blog/supabase-js-v2-release/supabase-js.jpg differ diff --git a/package-lock.json b/package-lock.json index 08e865cff4a..381b1694ebd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -158,7 +158,7 @@ "uuid": "^8.3.2" }, "devDependencies": { - "@tailwindcss/typography": "^0.5.2", + "@tailwindcss/typography": "^0.5.7", "@types/classnames": "^2.3.1", "@types/jest": "^25.2.2", "@types/marked": "^4.0.3", @@ -170,9 +170,9 @@ "@types/react-copy-to-clipboard": "^4.3.0", "@types/react-dom": "^17.0.11", "@types/react-syntax-highlighter": "^13.5.2", - "autoprefixer": "^10.4.2", + "autoprefixer": "^10.4.12", "file-loader": "^6.2.0", - "postcss": "^8.4.16", + "postcss": "^8.4.18", "postcss-preset-env": "^6.7.0", "prettier": "^2.2.1", "tailwindcss": "^3.1.8" @@ -249,20 +249,6 @@ "react-dom": "^16.13.1 || ^17.0.1" } }, - "apps/www/node_modules/@tailwindcss/typography": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/@tailwindcss/typography/-/typography-0.5.7.tgz", - "integrity": "sha512-JTTSTrgZfp6Ki4svhPA4mkd9nmQ/j9EfE7SbHJ1cLtthKkpW2OxsFXzSmxbhYbEkfNIyAyhle5p4SYyKRbz/jg==", - "dependencies": { - "lodash.castarray": "^4.4.0", - "lodash.isplainobject": "^4.0.6", - "lodash.merge": "^4.6.2", - "postcss-selector-parser": "6.0.10" - }, - "peerDependencies": { - "tailwindcss": ">=3.0.0 || insiders" - } - }, "apps/www/node_modules/@types/istanbul-reports": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-1.1.2.tgz", @@ -8904,7 +8890,18 @@ "react-dom": "^16.13.1 || ^17.0.1" } }, - "node_modules/@supabase/ui/node_modules/@tailwindcss/typography": { + "node_modules/@tailwindcss/forms": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@tailwindcss/forms/-/forms-0.4.1.tgz", + "integrity": "sha512-gS9xjCmJjUBz/eP12QlENPLnf0tCx68oYE3mri0GMP5jdtVwLbGUNSRpjsp6NzLAZzZy3ueOwrcqB78Ax6Z84A==", + "dependencies": { + "mini-svg-data-uri": "^1.2.3" + }, + "peerDependencies": { + "tailwindcss": ">=3.0.0 || >= 3.0.0-alpha.1" + } + }, + "node_modules/@tailwindcss/typography": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/@tailwindcss/typography/-/typography-0.5.7.tgz", "integrity": "sha512-JTTSTrgZfp6Ki4svhPA4mkd9nmQ/j9EfE7SbHJ1cLtthKkpW2OxsFXzSmxbhYbEkfNIyAyhle5p4SYyKRbz/jg==", @@ -8918,17 +8915,6 @@ "tailwindcss": ">=3.0.0 || insiders" } }, - "node_modules/@tailwindcss/forms": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@tailwindcss/forms/-/forms-0.4.1.tgz", - "integrity": "sha512-gS9xjCmJjUBz/eP12QlENPLnf0tCx68oYE3mri0GMP5jdtVwLbGUNSRpjsp6NzLAZzZy3ueOwrcqB78Ax6Z84A==", - "dependencies": { - "mini-svg-data-uri": "^1.2.3" - }, - "peerDependencies": { - "tailwindcss": ">=3.0.0 || >= 3.0.0-alpha.1" - } - }, "node_modules/@testdeck/core": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/@testdeck/core/-/core-0.2.1.tgz", @@ -26317,9 +26303,9 @@ } }, "node_modules/postcss": { - "version": "8.4.17", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.17.tgz", - "integrity": "sha512-UNxNOLQydcOFi41yHNMcKRZ39NeXlr8AxGuZJsdub8vIb12fHzcq37DTU/QtbI6WLxNg2gF9Z+8qtRwTj1UI1Q==", + "version": "8.4.18", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.18.tgz", + "integrity": "sha512-Wi8mWhncLJm11GATDaQKobXSNEYGUHeQLiQqDFG1qQ5UTDPTEvKw0Xt5NsTpktGTwLps3ByrWsBrG0rB8YQ9oA==", "funding": [ { "type": "opencollective", @@ -36011,19 +35997,6 @@ "tailwindcss": ">=3.0.0 || >= 3.0.0-alpha.1" } }, - "packages/config/node_modules/@tailwindcss/typography": { - "version": "0.5.7", - "license": "MIT", - "dependencies": { - "lodash.castarray": "^4.4.0", - "lodash.isplainobject": "^4.0.6", - "lodash.merge": "^4.6.2", - "postcss-selector-parser": "6.0.10" - }, - "peerDependencies": { - "tailwindcss": ">=3.0.0 || insiders" - } - }, "packages/config/node_modules/tailwindcss-radix": { "version": "2.6.0", "license": "MIT" @@ -36064,19 +36037,6 @@ "typescript": "4.3.4" } }, - "packages/ui/node_modules/@tailwindcss/typography": { - "version": "0.5.7", - "license": "MIT", - "dependencies": { - "lodash.castarray": "^4.4.0", - "lodash.isplainobject": "^4.0.6", - "lodash.merge": "^4.6.2", - "postcss-selector-parser": "6.0.10" - }, - "peerDependencies": { - "tailwindcss": ">=3.0.0 || insiders" - } - }, "packages/ui/node_modules/typescript": { "version": "4.3.4", "dev": true, @@ -36377,20 +36337,6 @@ "node": ">= 10" } }, - "studio/node_modules/@tailwindcss/typography": { - "version": "0.5.7", - "dev": true, - "license": "MIT", - "dependencies": { - "lodash.castarray": "^4.4.0", - "lodash.isplainobject": "^4.0.6", - "lodash.merge": "^4.6.2", - "postcss-selector-parser": "6.0.10" - }, - "peerDependencies": { - "tailwindcss": ">=3.0.0 || insiders" - } - }, "studio/node_modules/@types/react": { "version": "17.0.11", "dev": true, @@ -42904,19 +42850,6 @@ "prop-types": "^15.7.2", "tailwindcss": "^3.0.15", "tailwindcss-radix": "^1.6.0" - }, - "dependencies": { - "@tailwindcss/typography": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/@tailwindcss/typography/-/typography-0.5.7.tgz", - "integrity": "sha512-JTTSTrgZfp6Ki4svhPA4mkd9nmQ/j9EfE7SbHJ1cLtthKkpW2OxsFXzSmxbhYbEkfNIyAyhle5p4SYyKRbz/jg==", - "requires": { - "lodash.castarray": "^4.4.0", - "lodash.isplainobject": "^4.0.6", - "lodash.merge": "^4.6.2", - "postcss-selector-parser": "6.0.10" - } - } } }, "@tailwindcss/forms": { @@ -42927,6 +42860,17 @@ "mini-svg-data-uri": "^1.2.3" } }, + "@tailwindcss/typography": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/@tailwindcss/typography/-/typography-0.5.7.tgz", + "integrity": "sha512-JTTSTrgZfp6Ki4svhPA4mkd9nmQ/j9EfE7SbHJ1cLtthKkpW2OxsFXzSmxbhYbEkfNIyAyhle5p4SYyKRbz/jg==", + "requires": { + "lodash.castarray": "^4.4.0", + "lodash.isplainobject": "^4.0.6", + "lodash.merge": "^4.6.2", + "postcss-selector-parser": "6.0.10" + } + }, "@testdeck/core": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/@testdeck/core/-/core-0.2.1.tgz", @@ -46137,15 +46081,6 @@ "mini-svg-data-uri": "^1.2.3" } }, - "@tailwindcss/typography": { - "version": "0.5.7", - "requires": { - "lodash.castarray": "^4.4.0", - "lodash.isplainobject": "^4.0.6", - "lodash.merge": "^4.6.2", - "postcss-selector-parser": "6.0.10" - } - }, "tailwindcss-radix": { "version": "2.6.0" } @@ -56323,9 +56258,9 @@ "devOptional": true }, "postcss": { - "version": "8.4.17", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.17.tgz", - "integrity": "sha512-UNxNOLQydcOFi41yHNMcKRZ39NeXlr8AxGuZJsdub8vIb12fHzcq37DTU/QtbI6WLxNg2gF9Z+8qtRwTj1UI1Q==", + "version": "8.4.18", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.18.tgz", + "integrity": "sha512-Wi8mWhncLJm11GATDaQKobXSNEYGUHeQLiQqDFG1qQ5UTDPTEvKw0Xt5NsTpktGTwLps3ByrWsBrG0rB8YQ9oA==", "requires": { "nanoid": "^3.3.4", "picocolors": "^1.0.0", @@ -60781,16 +60716,6 @@ "integrity": "sha512-1c/sxp/4Qz4F6rCxiYqAnrmghCOFt5hHZ9Kd+rXFW5Mqev4C4XDOUMHdBH55HgnJZqngYhOE0r/XNkCtsIojig==", "optional": true }, - "@tailwindcss/typography": { - "version": "0.5.7", - "dev": true, - "requires": { - "lodash.castarray": "^4.4.0", - "lodash.isplainobject": "^4.0.6", - "lodash.merge": "^4.6.2", - "postcss-selector-parser": "6.0.10" - } - }, "@types/react": { "version": "17.0.11", "dev": true, @@ -62195,15 +62120,6 @@ "typescript": "4.3.4" }, "dependencies": { - "@tailwindcss/typography": { - "version": "0.5.7", - "requires": { - "lodash.castarray": "^4.4.0", - "lodash.isplainobject": "^4.0.6", - "lodash.merge": "^4.6.2", - "postcss-selector-parser": "6.0.10" - } - }, "typescript": { "version": "4.3.4", "dev": true @@ -63874,7 +63790,7 @@ "@supabase/auth-ui-react": "^0.1.6", "@supabase/supabase-js": "^2.0.0", "@supabase/ui": "v0.37.0-alpha.80", - "@tailwindcss/typography": "^0.5.2", + "@tailwindcss/typography": "0.5.7", "@types/classnames": "^2.3.1", "@types/jest": "^25.2.2", "@types/marked": "^4.0.3", @@ -63886,7 +63802,7 @@ "@types/react-copy-to-clipboard": "^4.3.0", "@types/react-dom": "^17.0.11", "@types/react-syntax-highlighter": "^13.5.2", - "autoprefixer": "^10.4.2", + "autoprefixer": "^10.4.12", "classnames": "^2.3.1", "date-fns": "2.10.0", "dayjs": "^1.11.4", @@ -63900,7 +63816,7 @@ "next-seo": "^4.20.0", "nodemailer": "^6.7.3", "parse-numeric-range": "^1.3.0", - "postcss": "^8.4.16", + "postcss": "^8.4.18", "postcss-preset-env": "^6.7.0", "prettier": "^2.2.1", "react": "^17.0.2", @@ -63977,17 +63893,6 @@ "tailwindcss-radix": "^1.6.0" } }, - "@tailwindcss/typography": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/@tailwindcss/typography/-/typography-0.5.7.tgz", - "integrity": "sha512-JTTSTrgZfp6Ki4svhPA4mkd9nmQ/j9EfE7SbHJ1cLtthKkpW2OxsFXzSmxbhYbEkfNIyAyhle5p4SYyKRbz/jg==", - "requires": { - "lodash.castarray": "^4.4.0", - "lodash.isplainobject": "^4.0.6", - "lodash.merge": "^4.6.2", - "postcss-selector-parser": "6.0.10" - } - }, "@types/istanbul-reports": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-1.1.2.tgz", diff --git a/spec/supabase_js_v2.yml b/spec/supabase_js_v2.yml index 35a485d7ca9..5010da72008 100644 --- a/spec/supabase_js_v2.yml +++ b/spec/supabase_js_v2.yml @@ -81,6 +81,23 @@ pages: `supabase-js` uses the [`cross-fetch`](https://www.npmjs.com/package/cross-fetch) library to make HTTP requests, but an alternative `fetch` implementation can be provided as an option. This is most useful in environments where `cross-fetch` is not compatible (for instance Cloudflare Workers). + - name: React Native options + js: | + ```js + import { createClient } from '@supabase/supabase-js' + import AsyncStorage from "@react-native-async-storage/async-storage"; + + const supabase = createClient("https://xyzcompany.supabase.co", "public-anon-key" { + auth: { + storage: AsyncStorage, + autoRefreshToken: true, + persistSession: true, + detectSessionInUrl: false, + }, + }); + ``` + + For React Native we recommend using `AsyncStorage` as the storage implementation for Supabase Auth. auth.signUp(): title: 'signUp()' $ref: '@supabase/gotrue-js.GoTrueClient.signUp'