Skip to content

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

add initialzing to list of common functions

Jonathan Summers-Muir90245cd58a09
diff --git a/apps/docs/components/index.tsx b/apps/docs/components/index.tsx
index 4351050cbf0..c5a5aa3752a 100644
--- a/apps/docs/components/index.tsx
+++ b/apps/docs/components/index.tsx
@@ -27,6 +27,9 @@ import RefHeaderSection from './reference/RefHeaderSection'
// Ref version specific
import CliGlobalFlagsHandler from '~/components/reference/enrichments/cli/CliGlobalFlagsHandler'
+import Options from '~/components/Options'
+import Param from '~/components/Params'
+
const components = {
Admonition,
Button,
@@ -68,6 +71,8 @@ const components = {
code: (props: any) => <CodeBlock {...props} />,
RefHeaderSection: (props: any) => <RefHeaderSection {...props} />,
CliGlobalFlagsHandler: () => <CliGlobalFlagsHandler />,
+ Options,
+ Param,
}
export default components
diff --git a/apps/docs/docs/ref/javascript/v1/initializing.mdx b/apps/docs/docs/ref/javascript/v1/initializing.mdx
deleted file mode 100644
index 7ea5f5cf164..00000000000
--- a/apps/docs/docs/ref/javascript/v1/initializing.mdx
+++ /dev/null
@@ -1,136 +0,0 @@
----
-id: initializing
-title: 'Initializing'
-slug: initializing
-custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_js_v1.yml
----
-
-import Tabs from '@theme/Tabs'
-import TabItem from '@theme/TabItem'
-
-You can initialize a new Supabase client using the `createClient()` 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.
-
-## Parameters
-
-<ul className="method-list-group">
-
-<li className="method-list-item">
- <h4 className="method-list-item-label">
- <span className="method-list-item-label-name">
- supabaseUrl
- </span>
- <span className="method-list-item-label-badge required">
- required
- </span>
- <span className="method-list-item-validation">
- <code>string</code>
- </span>
- </h4>
- <div className="method-list-item-description">
-
-The unique Supabase URL which is supplied when you create a new project in your project dashboard.
-
- </div>
-
-</li>
-
-<li className="method-list-item">
- <h4 className="method-list-item-label">
- <span className="method-list-item-label-name">
- supabaseKey
- </span>
- <span className="method-list-item-label-badge required">
- required
- </span>
- <span className="method-list-item-validation">
- <code>string</code>
- </span>
- </h4>
- <div className="method-list-item-description">
-
-The unique Supabase Key which is supplied when you create a new project in your project dashboard.
-
- </div>
-
-</li>
-
-<li className="method-list-item">
- <h4 className="method-list-item-label">
- <span className="method-list-item-label-name">
- options
- </span>
- <span className="method-list-item-label-badge false">
- optional
- </span>
- <span className="method-list-item-validation">
- <code>SupabaseClientOptions</code>
- </span>
- </h4>
- <div className="method-list-item-description">
-
-No description provided.
-
- </div>
-
-</li>
-
-</ul>
-
-## Examples
-
-### createClient()
-
-```js
-import { createClient } from '@supabase/supabase-js'
-
-// Create a single supabase client for interacting with your database
-const supabase = createClient('https://xyzcompany.supabase.co', 'public-anon-key')
-```
-
-### With additional parameters
-
-```js
-import { createClient } from '@supabase/supabase-js'
-
-const options = {
- schema: 'public',
- headers: { 'x-my-custom-header': 'my-app-name' },
- autoRefreshToken: true,
- persistSession: true,
- detectSessionInUrl: true,
-}
-const supabase = createClient('https://xyzcompany.supabase.co', 'public-anon-key', options)
-```
-
-### API schemas
-
-```js
-import { createClient } from '@supabase/supabase-js'
-
-// Provide a custom schema. Defaults to "public".
-const supabase = createClient('https://xyzcompany.supabase.co', 'public-anon-key', {
- schema: 'other_schema',
-})
-```
-
-By default the API server points to the `public` schema. You can enable other database schemas within the Dashboard.
-Go to `Settings > API > Schema` and add the schema which you want to expose to the API. You also need to grant `USAGE` on your new schema with the grants you desire, such as `SELECT, INSERT, UPDATE, DELETE`.
-
-Note: each client connection can only access a single schema, so the code above can access the `other_schema` schema but cannot access the `public` schema.
-
-### Custom `fetch` implementation
-
-```js
-import { createClient } from '@supabase/supabase-js'
-
-const supabase = createClient('https://xyzcompany.supabase.co', 'public-anon-key', {
- fetch: fetch.bind(globalThis),
-})
-```
-
-`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).
diff --git a/apps/docs/docs/ref/javascript/initializing.mdx b/apps/docs/docs/ref/javascript/v1/initializinggg.mdx
similarity index 94%
rename from apps/docs/docs/ref/javascript/initializing.mdx
rename to apps/docs/docs/ref/javascript/v1/initializinggg.mdx
index 7ea5f5cf164..a4dc650a969 100644
--- a/apps/docs/docs/ref/javascript/initializing.mdx
+++ b/apps/docs/docs/ref/javascript/v1/initializinggg.mdx
@@ -1,13 +1,7 @@
---
-id: initializing
title: 'Initializing'
-slug: initializing
-custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_js_v1.yml
---
-import Tabs from '@theme/Tabs'
-import TabItem from '@theme/TabItem'
-
You can initialize a new Supabase client using the `createClient()` method.
The Supabase client is your entrypoint to the rest of the Supabase functionality
@@ -117,7 +111,7 @@ const supabase = createClient('https://xyzcompany.supabase.co', 'public-anon-key
```
By default the API server points to the `public` schema. You can enable other database schemas within the Dashboard.
-Go to `Settings > API > Schema` and add the schema which you want to expose to the API. You also need to grant `USAGE` on your new schema with the grants you desire, such as `SELECT, INSERT, UPDATE, DELETE`.
+Go to `Settings > API > Schema` and add the schema which you want to expose to the API. You also need to grant `USAGE` on your new schema with the grants you desire, such as `SELECT, INSERT, UPDATE, DELETE`.
Note: each client connection can only access a single schema, so the code above can access the `other_schema` schema but cannot access the `public` schema.
diff --git a/apps/docs/lib/refGenerator/helpers.ts b/apps/docs/lib/refGenerator/helpers.ts
index ed8f18f5e4e..ed93760b293 100644
--- a/apps/docs/lib/refGenerator/helpers.ts
+++ b/apps/docs/lib/refGenerator/helpers.ts
@@ -65,6 +65,7 @@ function recurseThroughParams(paramDefinition: any) {
} else if (Object.keys(dereferenced).length === 0) {
// skip: {} have no children
} else {
+ console.warn('param', param)
throw new Error('unexpected case for dereferenced param type')
}
} else if (param.type?.type === 'reflection') {
diff --git a/spec/common-client-libs-sections.json b/spec/common-client-libs-sections.json
index 7aa270c1eaa..03d1559bc35 100644
--- a/spec/common-client-libs-sections.json
+++ b/spec/common-client-libs-sections.json
@@ -13,13 +13,6 @@
"type": "markdown",
"libs": ["js", "js_v1", "dart", "dart_v0"]
},
- {
- "title": "Initializing",
- "id": "initializing",
- "slug": "initializing",
- "type": "markdown",
- "libs": ["dart", "dart_v0"]
- },
{
"title": "Typescript Support",
"id": "typescript-support",
@@ -27,6 +20,12 @@
"type": "markdown",
"libs": ["js", "js_v1"]
},
+ {
+ "title": "Initializing",
+ "id": "initializing",
+ "slug": "initializing",
+ "type": "function"
+ },
{
"title": "Database",
"libs": ["js", "js_v1", "dart", "dart_v0"],