Skip to content

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

Fit new docs structure expected on current state of `master`

Joseph Schultzb6e2140ea7b4
diff --git a/apps/docs/components/reference/RefFunctionSection.tsx b/apps/docs/components/reference/RefFunctionSection.tsx
index 296e19ef9c7..8b228a6bfa6 100644
--- a/apps/docs/components/reference/RefFunctionSection.tsx
+++ b/apps/docs/components/reference/RefFunctionSection.tsx
@@ -123,7 +123,7 @@ const RefFunctionSection: React.FC<IRefFunctionSection> = (props) => {
: example?.code?.startsWith('```dart')
? 'dart'
: example?.code?.startsWith('```c#')
- ? 'c#'
+ ? 'csharp'
: 'js'
// `
// import { createClient } from '@supabase/supabase-js'
@@ -156,7 +156,8 @@ const RefFunctionSection: React.FC<IRefFunctionSection> = (props) => {
.replace(/```/g, '')
.replace('js', '')
.replace('ts', '')
- .replace('dart', ''))}
+ .replace('dart', '')
+ .replace('c#', ''))}
</CodeBlock>
{((tables && tables.length > 0) || sql) && (
diff --git a/apps/docs/docs/reference/csharp/generated/.gitkeep b/apps/docs/docs/reference/csharp/generated/.gitkeep
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/apps/docs/docs/reference/csharp/initializing.mdx b/apps/docs/docs/reference/csharp/initializing.mdx
new file mode 100644
index 00000000000..ca29a5605a3
--- /dev/null
+++ b/apps/docs/docs/reference/csharp/initializing.mdx
@@ -0,0 +1,67 @@
+---
+id: initializing
+title: 'Initializing'
+slug: initializing
+custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
+---
+
+### Initializing a new Client
+
+<RefSubLayout.EducationRow>
+ <RefSubLayout.Details>
+
+Initializing a new client is pretty straightforward. Find your project url and public key from the
+admin panel and pass it into your client initialization function.
+
+ </RefSubLayout.Details>
+
+ <RefSubLayout.Examples>
+
+ <Tabs
+ size="small"
+ type="underlined"
+ defaultActiveId="csharp-init-standard">
+ <TabPanel id="csharp-init-standard" label="Standard">
+
+ ```csharp
+ var url = Environment.GetEnvironmentVariable("SUPABASE_URL");
+ var key = Environment.GetEnvironmentVariable("SUPABASE_KEY");
+
+ var options = new Supabase.SupabaseOptions
+ {
+ AutoConnectRealtime = true
+ };
+
+ var supabase = new Supabase.Client(url, key, options);
+ await supabase.InitializeAsync();
+ ```
+
+ </TabPanel>
+
+ <TabPanel id="csharp-init-maui" label="Dependency Injection (Maui-like)">
+
+ ```csharp
+ public static MauiApp CreateMauiApp()
+ {
+ // ...
+ var builder = MauiApp.CreateBuilder();
+
+ var url = Environment.GetEnvironmentVariable("SUPABASE_URL");
+ var key = Environment.GetEnvironmentVariable("SUPABASE_KEY");
+ var options = new SupabaseOptions
+ {
+ AutoRefreshToken = true,
+ AutoConnectRealtime = true,
+ SessionHandler = new SupabaseSessionHandler()
+ };
+
+ // Note the creation as a singleton.
+ builder.Services.AddSingleton(provider => new Supabase.Client(url, key, options));
+ }
+ ```
+
+ </TabPanel>
+ </Tabs>
+
+ </RefSubLayout.Examples>
+</RefSubLayout.EducationRow>
diff --git a/apps/docs/docs/reference/csharp/installing.mdx b/apps/docs/docs/reference/csharp/installing.mdx
new file mode 100644
index 00000000000..e274af8e280
--- /dev/null
+++ b/apps/docs/docs/reference/csharp/installing.mdx
@@ -0,0 +1,33 @@
+---
+id: installing
+title: 'Installing & Initialization'
+slug: installing
+custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
+---
+
+### Install from NuGet
+
+<RefSubLayout.EducationRow>
+ <RefSubLayout.Details>
+
+ You can install Supabase package from [nuget.org](https://www.nuget.org/packages/supabase-csharp/)
+
+ </RefSubLayout.Details>
+
+ <RefSubLayout.Examples>
+
+ <Tabs
+ size="small"
+ type="underlined"
+ defaultActiveId="csharp">
+ <TabPanel id="csharp" label="Terminal">
+
+ ```sh Terminal
+ dotnet add package supabase-csharp
+ ```
+
+ </TabPanel>
+ </Tabs>
+
+ </RefSubLayout.Examples>
+</RefSubLayout.EducationRow>
diff --git a/apps/docs/docs/reference/csharp/introduction.mdx b/apps/docs/docs/reference/csharp/introduction.mdx
new file mode 100644
index 00000000000..6c699314937
--- /dev/null
+++ b/apps/docs/docs/reference/csharp/introduction.mdx
@@ -0,0 +1,20 @@
+---
+id: introduction
+title: Introduction
+hideTitle: true
+---
+
+<div className="flex items-start gap-6 not-prose" id="introduction">
+ <img src="/docs/img/icons/menu/reference-csharp.svg" className="w-8 h-8 rounded" />
+ <div className="flex flex-col gap-2">
+ <h1 className="text-3xl text-scale-1200 m-0">C# Client Library</h1>
+ <h2 className="text-base font-mono text-scale-1100">supabase-csharp</h2>
+ </div>
+</div>
+
+<div className="max-w-xl">
+ This reference documents every object and method available in Supabase's C#
+ library, [supabase-csharp](https://www.nuget.org/packages/supabase-csharp). You can
+ use supabase-csharp to interact with your Postgres database, listen to database changes, invoke
+ Deno Edge Functions, build login and user management functionality, and manage large files.
+</div>
diff --git a/apps/docs/docs/reference/csharp/v0/release-notes.mdx b/apps/docs/docs/reference/csharp/v0/release-notes.mdx
new file mode 100644
index 00000000000..2ecb0ef3990
--- /dev/null
+++ b/apps/docs/docs/reference/csharp/v0/release-notes.mdx
@@ -0,0 +1,6 @@
+---
+id: release-notes
+title: Release Notes
+---
+
+## dart v0 this is the release notes file.
diff --git a/apps/docs/package.json b/apps/docs/package.json
index 009c9759c91..c7a92350da2 100644
--- a/apps/docs/package.json
+++ b/apps/docs/package.json
@@ -25,8 +25,8 @@
"gen:supabase-dart:v0:ref": "ts-node ./generator/index.ts gen --type legacy --input ../../spec/supabase_dart_v0.yml --output ./docs/reference/dart/v0/generated",
"gen:supabase-dart:v1": "npm-run-all gen:supabase-dart:v1:ref",
"gen:supabase-dart:v1:ref": "ts-node ./generator/index.ts gen --type legacy --input ../../spec/supabase_dart_v1.yml --output ./docs/reference/dart/generated",
- "gen:supabase-csharp:v0": "npm-run-all gen:supabase-dart:v1:ref",
- "gen:supabase-csharp:v0:ref": "ts-node ./generator/index.ts gen --type legacy --input ../../spec/supabase_csharp_v1.yml --output ./docs/reference/csharp/generated",
+ "gen:supabase-csharp:v0": "npm-run-all gen:supabase-csharp:v0:ref",
+ "gen:supabase-csharp:v0:ref": "ts-node ./generator/index.ts gen --type legacy --input ../../spec/supabase_csharp_v0.yml --output ./docs/reference/csharp/generated",
"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 ./docs/reference/javascript/v1/generated",
"gen:supabase-js:v2": "npm-run-all gen:supabase-js:v2:ref",
@@ -93,4 +93,4 @@
"tsconfig": "*",
"typescript": "^4.5.3"
}
-}
+}
\ No newline at end of file
diff --git a/apps/docs/pages/reference/csharp/[...slug].tsx b/apps/docs/pages/reference/csharp/[...slug].tsx
index 04e731b5aeb..f3e510ece23 100644
--- a/apps/docs/pages/reference/csharp/[...slug].tsx
+++ b/apps/docs/pages/reference/csharp/[...slug].tsx
@@ -9,11 +9,11 @@ import handleRefStaticProps from '~/lib/mdx/handleRefStaticProps'
const sections = flattenSections(clientLibsCommonSections)
export default function JSReference(props) {
- return <RefSectionHandler sections={sections} spec={spec} pageProps={props} />
+ return <RefSectionHandler sections={sections} spec={spec} pageProps={props} type="client-lib" />
}
-export async function getStaticProps({ params }: { params: { slug: string[] } }) {
- return handleRefStaticProps(sections, params, '/csharp', '/csharp')
+export async function getStaticProps() {
+ return handleRefStaticProps(sections, '/csharp')
}
export function getStaticPaths() {
diff --git a/apps/docs/pages/reference/csharp/crawlers/[...slug].tsx b/apps/docs/pages/reference/csharp/crawlers/[...slug].tsx
index c12f3cabbf2..89d58eb1478 100644
--- a/apps/docs/pages/reference/csharp/crawlers/[...slug].tsx
+++ b/apps/docs/pages/reference/csharp/crawlers/[...slug].tsx
@@ -1,7 +1,7 @@
import clientLibsCommonSections from '~/../../spec/common-client-libs-sections.json'
import typeSpec from '~/../../spec/enrichments/tsdoc_v2/combined.json'
// @ts-expect-error
-import spec from '~/../../spec/supabase_dart_v1.yml' assert { type: 'yml' }
+import spec from '~/../../spec/supabase_csharp_v0.yml' assert { type: 'yml' }
import RefSectionHandler from '~/components/reference/RefSectionHandler'
import { flattenSections } from '~/lib/helpers'
import handleRefGetStaticPaths from '~/lib/mdx/handleRefStaticPaths'
@@ -29,13 +29,14 @@ export default function JSReference(props) {
spec={spec}
typeSpec={typeSpec}
pageProps={props}
+ type="client-lib"
/>
</>
)
}
-export async function getStaticProps({ params }: { params: { slug: string[] } }) {
- return handleRefStaticProps(sections, params, '/dart', '/dart')
+export async function getStaticProps() {
+ return handleRefStaticProps(sections, '/csharp')
}
export function getStaticPaths() {
diff --git a/apps/docs/pages/reference/csharp/v0/[...slug].tsx b/apps/docs/pages/reference/csharp/v0/[...slug].tsx
index a76c3f386be..41b28c0a1ef 100644
--- a/apps/docs/pages/reference/csharp/v0/[...slug].tsx
+++ b/apps/docs/pages/reference/csharp/v0/[...slug].tsx
@@ -9,11 +9,11 @@ import handleRefStaticProps from '~/lib/mdx/handleRefStaticProps'
const sections = flattenSections(clientLibsCommonSections)
export default function JSReference(props) {
- return <RefSectionHandler sections={sections} spec={spec} pageProps={props} />
+ return <RefSectionHandler sections={sections} spec={spec} pageProps={props} type="client-lib" />
}
-export async function getStaticProps({ params }: { params: { slug: string[] } }) {
- return handleRefStaticProps(sections, params, '/csharp/v0', '/csharp/v0')
+export async function getStaticProps() {
+ return handleRefStaticProps(sections, '/csharp/v0')
}
export function getStaticPaths() {
diff --git a/apps/docs/pages/reference/csharp/v0/crawlers/[...slug].tsx b/apps/docs/pages/reference/csharp/v0/crawlers/[...slug].tsx
index 4c78342f556..059df1c75b1 100644
--- a/apps/docs/pages/reference/csharp/v0/crawlers/[...slug].tsx
+++ b/apps/docs/pages/reference/csharp/v0/crawlers/[...slug].tsx
@@ -28,13 +28,14 @@ export default function JSReference(props) {
spec={spec}
typeSpec={typeSpec}
pageProps={props}
+ type="client-lib"
/>
</>
)
}
-export async function getStaticProps({ params }: { params: { slug: string[] } }) {
- return handleRefStaticProps(sections, params, '/csharp/v0', '/csharp/v0')
+export async function getStaticProps() {
+ return handleRefStaticProps(sections, '/csharp/v0')
}
export function getStaticPaths() {
diff --git a/package-lock.json b/package-lock.json
index 02ea0980a38..0feb28269d8 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -49498,7 +49498,7 @@
"@types/react": "17.0.39",
"algoliasearch": "^4.14.2",
"babel": "^6.23.0",
- "clsx": "*",
+ "clsx": "^1.2.1",
"common": "*",
"config": "*",
"dotenv": "^16.0.3",