Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

adds another key section

Copple560390114f1a
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 e27f337418e..904d3e44799 100644
--- a/apps/www/_blog/2022-08-16-supabase-js-v2.mdx
+++ b/apps/www/_blog/2022-08-16-supabase-js-v2.mdx
@@ -165,6 +165,42 @@ const { data } = supabase.auth.session()
This solves the “getting logged out” issue, which has been a recurring issue in our GitHub Discussions.
+### Scoped constructor config
+
+We're being much more explicit about the modular approach that `supabase-js` uses:
+
+```ts
+const supabase = createClient(apiURL, apiKey, {
+ db: {
+ schema: 'public',
+ },
+ auth: {
+ autoRefreshToken: true,
+ persistSession: true,
+ },
+ realtime: {
+ channels,
+ endpoint,
+ },
+ // common across all libraries
+ global: {
+ fetch: customFetch,
+ headers: DEFAULT_HEADERS,
+ },
+})
+```
+
+This is clearer for developers - if you're only using some parts of Supabase, you only recieve the hints for those parts.
+
+<details>
+
+<summary>ℹ️ Improvements from v1</summary>
+
+We noticed a lot of confusion for the variable naming between each library.
+For example, Auth has a config parameter called "storageKey", which was was often confused with the `storage-js` library bundled in the `supabase-js` library.
+
+</details>
+
## Community
Version 2.0 is the result of the combined work of over 100 contributors to our libraries, and over 450 contributors to our docs and websites.