Skip to content

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

docs(csharp): add C# snippets (#48537)

Guillaume Faas94bc3f8d0743
diff --git a/apps/docs/content/guides/api/creating-routes.mdx b/apps/docs/content/guides/api/creating-routes.mdx
index 5f503a8e3aa..154d9811c3e 100644
--- a/apps/docs/content/guides/api/creating-routes.mdx
+++ b/apps/docs/content/guides/api/creating-routes.mdx
@@ -101,6 +101,20 @@ const { data: todos, error } = await supabase.from('todos').select('*')
```
</TabPanel>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+// Initialize the client
+var supabase = new Supabase.Client(SUPABASE_URL, SUPABASE_PUBLISHABLE_KEY);
+await supabase.InitializeAsync();
+
+// Make a request
+var todos = await supabase.From<Todo>().Get();
+```
+
+</TabPanel>
+</$Show>
<TabPanel id="curl" label="cURL">
```bash
diff --git a/apps/docs/content/guides/api/quickstart.mdx b/apps/docs/content/guides/api/quickstart.mdx
index 018001142be..c6117a49820 100644
--- a/apps/docs/content/guides/api/quickstart.mdx
+++ b/apps/docs/content/guides/api/quickstart.mdx
@@ -269,6 +269,31 @@ let response = try await supabase
.order("score", ascending: false)
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+[Table("leaderboard")]
+class Leaderboard : BaseModel
+{
+ [PrimaryKey("id", false)]
+ public int Id { get; set; }
+
+ [Column("player")]
+ public string Player { get; set; }
+
+ [Column("score")]
+ public int Score { get; set; }
+}
+
+var result = await supabase
+ .From<Leaderboard>()
+ .Order(x => x.Score, Ordering.Descending)
+ .Get();
+```
+
</TabPanel>
</$Show>
</Tabs>
diff --git a/apps/docs/content/guides/api/using-custom-schemas.mdx b/apps/docs/content/guides/api/using-custom-schemas.mdx
index f53299c0e0d..9b431d22385 100644
--- a/apps/docs/content/guides/api/using-custom-schemas.mdx
+++ b/apps/docs/content/guides/api/using-custom-schemas.mdx
@@ -75,6 +75,24 @@ final data = await supabase.from('todos').select();
final data = await supabase.schema('myschema').from('todos').select();
````
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+// Initialize the client with a custom schema
+var supabase = new Supabase.Client(
+ SUPABASE_URL,
+ SUPABASE_PUBLISHABLE_KEY,
+ new SupabaseOptions { Schema = "myschema" }
+);
+await supabase.InitializeAsync();
+
+// Make a request
+var todos = await supabase.From<Todo>().Get();
+```
+
</TabPanel>
</$Show>
<TabPanel id="curl" label="cURL">
diff --git a/apps/docs/content/guides/auth/auth-anonymous.mdx b/apps/docs/content/guides/auth/auth-anonymous.mdx
index 2f69c770fcc..d3d764d45f5 100644
--- a/apps/docs/content/guides/auth/auth-anonymous.mdx
+++ b/apps/docs/content/guides/auth/auth-anonymous.mdx
@@ -107,6 +107,17 @@ Call the [`sign_in_anonymously()`](/docs/reference/python/auth-signinanonymously
response = supabase.auth.sign_in_anonymously()
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+Call the [`SignInAnonymously()`](/docs/reference/csharp/sign-in-anonymously) method:
+
+```c#
+var session = await supabase.Auth.SignInAnonymously();
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -204,6 +215,23 @@ response = supabase.auth.update_user({
})
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+You can use the [`Update()`](/docs/reference/csharp/update-user) method to link an email or phone identity to the anonymous user. To add a password for the anonymous user, the user's email or phone number needs to be verified first.
+
+```c#
+var updateEmail = await supabase.Auth.Update(new UserAttributes { Email = "[email protected]" });
+
+// verify the user's email by clicking on the email change link
+// or entering the 6-digit OTP sent to the email address
+
+// once the user has been verified, update the password
+var updatePassword = await supabase.Auth.Update(new UserAttributes { Password = "password" });
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -273,6 +301,18 @@ You can use the [`link_identity()`](/docs/reference/python/auth-linkidentity) me
response = supabase.auth.link_identity({'provider': 'google'})
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+You can use the [`LinkIdentity()`](/docs/reference/csharp/link-identity) method to link an OAuth identity to the anonymous user.
+
+```c#
+var state = await supabase.Auth.LinkIdentity(Provider.Google, new SignInOptions { FlowType = OAuthFlowType.PKCE });
+var authorizeUrl = state.Uri;
+```
+
</TabPanel>
</$Show>
</Tabs>
diff --git a/apps/docs/content/guides/auth/auth-email-passwordless.mdx b/apps/docs/content/guides/auth/auth-email-passwordless.mdx
index cb3bec49641..97c8c160899 100644
--- a/apps/docs/content/guides/auth/auth-email-passwordless.mdx
+++ b/apps/docs/content/guides/auth/auth-email-passwordless.mdx
@@ -134,6 +134,16 @@ response = supabase.auth.sign_in_with_otp({
})
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+var options = new SignInOptions { RedirectTo = "https://example.com/welcome" };
+var didSendMagicLink = await supabase.Auth.SendMagicLink("[email protected]", options);
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -274,6 +284,15 @@ response = supabase.auth.sign_in_with_otp({
})
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+await supabase.Auth.SendMagicLink("[email protected]");
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -355,6 +374,15 @@ response = supabase.auth.verify_otp({
})
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+var session = await supabase.Auth.VerifyOTP("[email protected]", "123456", EmailOtpType.Email);
+```
+
</TabPanel>
</$Show>
</Tabs>
diff --git a/apps/docs/content/guides/auth/auth-identity-linking.mdx b/apps/docs/content/guides/auth/auth-identity-linking.mdx
index 22bb73a074b..abc0bc9dd0f 100644
--- a/apps/docs/content/guides/auth/auth-identity-linking.mdx
+++ b/apps/docs/content/guides/auth/auth-identity-linking.mdx
@@ -89,6 +89,18 @@ Supabase Auth allows a user to initiate identity linking with a different email
response = supabase.auth.link_identity({'provider': 'google'})
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+Supabase Auth allows a user to initiate identity linking with a different email address when they are logged in. To link an OAuth identity to the user, call [`LinkIdentity()`](/docs/reference/csharp/link-identity):
+
+```c#
+var state = await supabase.Auth.LinkIdentity(Provider.Google, new SignInOptions { FlowType = OAuthFlowType.PKCE });
+var authorizeUrl = state.Uri;
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -258,6 +270,24 @@ if google_identity:
response = supabase.auth.unlink_identity(google_identity.identity_id)
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+Use `CurrentUser.Identities` to get all the identities linked to a user. Then, call [`UnlinkIdentity()`](/docs/reference/csharp/unlink-identity) to unlink the identity. The user needs to be logged in and have at least 2 linked identities in order to unlink an existing identity.
+
+```c#
+// get all identities linked to the user
+var identities = supabase.Auth.CurrentUser.Identities;
+
+// find the google identity linked to the user
+var googleIdentity = identities.First(x => x.Provider == "google");
+
+// unlink the google identity from the user
+await supabase.Auth.UnlinkIdentity(googleIdentity);
+```
+
</TabPanel>
</$Show>
</Tabs>
diff --git a/apps/docs/content/guides/auth/debugging/error-codes.mdx b/apps/docs/content/guides/auth/debugging/error-codes.mdx
index 9e0b429fcfc..9d738585ac3 100644
--- a/apps/docs/content/guides/auth/debugging/error-codes.mdx
+++ b/apps/docs/content/guides/auth/debugging/error-codes.mdx
@@ -76,6 +76,17 @@ Rest exceptions are split into a few classes:
All instances and subclasses of a `AuthRestException` have a `errorCode` property that can be used to identify the error returned by the server.
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+All exceptions originating from the `supabase.Auth` namespace of the C# client library are wrapped by the `GotrueException` class.
+
+`GotrueException` exposes:
+
+- `StatusCode` -- the HTTP status code returned by the Supabase Auth API.
+- `Reason` -- a `FailureHint.Reason` value that categorizes the error, so you can branch on it without parsing the message.
+
</TabPanel>
</$Show>
diff --git a/apps/docs/content/guides/auth/enterprise-sso/auth-sso-saml.mdx b/apps/docs/content/guides/auth/enterprise-sso/auth-sso-saml.mdx
index bcf19cffc81..c839c206fee 100644
--- a/apps/docs/content/guides/auth/enterprise-sso/auth-sso-saml.mdx
+++ b/apps/docs/content/guides/auth/enterprise-sso/auth-sso-saml.mdx
@@ -244,6 +244,18 @@ supabase.auth.signInWith(SSO) {
Calling [`signInWith(SSO)`](/docs/reference/kotlin/auth-signinwithsso) starts the sign-in process using the identity provider registered for the `company.com` domain name. It is not required that identity providers be assigned one or multiple domain names, in which case you can use the provider's unique ID instead.
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+var response = await supabase.Auth.SignInWithSSO("company.com");
+var ssoUrl = response.Uri;
+```
+
+Calling [`SignInWithSSO`](/docs/reference/csharp/sign-in-with-sso) starts the sign-in process using the identity provider registered for the `company.com` domain name. It is not required that identity providers be assigned one or multiple domain names, in which case you can use the provider's unique ID instead.
+
</TabPanel>
</$Show>
</Tabs>
diff --git a/apps/docs/content/guides/auth/managing-user-data.mdx b/apps/docs/content/guides/auth/managing-user-data.mdx
index d703563143c..92fdf3789f7 100644
--- a/apps/docs/content/guides/auth/managing-user-data.mdx
+++ b/apps/docs/content/guides/auth/managing-user-data.mdx
@@ -137,6 +137,22 @@ val data = supabase.auth.signUpWith(Email) {
}
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+var session = await supabase.Auth.SignUp("[email protected]", "example-password", new SignUpOptions
+{
+ Data = new Dictionary<string, object>
+ {
+ { "first_name", "John" },
+ { "age", 27 }
+ }
+});
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -194,6 +210,16 @@ val user = supabase.auth.currentUserOrNull()
val metadata = user?.userMetadata
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+var user = supabase.Auth.CurrentUser;
+var metadata = user?.UserMetadata;
+```
+
</TabPanel>
</$Show>
</Tabs>
diff --git a/apps/docs/content/guides/auth/passwords.mdx b/apps/docs/content/guides/auth/passwords.mdx
index 2bd22944496..c1ff484751b 100644
--- a/apps/docs/content/guides/auth/passwords.mdx
+++ b/apps/docs/content/guides/auth/passwords.mdx
@@ -142,6 +142,18 @@ data = await supabase.auth.sign_up({
})
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+To sign up the user, call [`SignUp()`](/docs/reference/csharp/sign-up) with their email address and password. You can optionally specify a URL to redirect to after the user clicks the confirmation link.
+
+```c#
+var options = new SignUpOptions { RedirectTo = "https://example.com/welcome" };
+var session = await supabase.Auth.SignUp("[email protected]", "example-password", options);
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -476,6 +488,17 @@ data = supabase.auth.sign_up({
})
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+To sign up the user, call [`SignUp()`](/docs/reference/csharp/sign-up) with their email address and password:
+
+```c#
+var session = await supabase.Auth.SignUp("[email protected]", "example-password");
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -569,6 +592,17 @@ data = client.auth.sign_in_with_password({
})
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+When your user signs in, call [`SignIn()`](/docs/reference/csharp/sign-in-with-password) with their email address and password:
+
+```c#
+var session = await supabase.Auth.SignIn("[email protected]", "example-password");
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -658,6 +692,19 @@ await supabase.auth.resetPasswordForEmail(
);
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+var options = new ResetPasswordForEmailOptions("[email protected]")
+{
+ RedirectTo = "http://example.com/account/update-password",
+};
+await supabase.Auth.ResetPasswordForEmail(options);
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -962,6 +1009,15 @@ supabase.auth.reset_password_email('[email protected]')
await supabase.auth.resetPasswordForEmail('[email protected]');
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+await supabase.Auth.ResetPasswordForEmail("[email protected]");
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -1029,6 +1085,15 @@ final UserResponse res = await supabase.auth.updateUser(
);
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+await supabase.Auth.Update(new UserAttributes { Password = "new_password" });
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -1185,6 +1250,15 @@ final AuthResponse res = await supabase.auth.signUp(
);
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+var session = await supabase.Auth.SignUp(SignUpType.Phone, "+13334445555", "some-password");
+```
+
</TabPanel>
</$Show>
<TabPanel id="http" label="HTTP">
@@ -1290,6 +1364,15 @@ final AuthResponse res = await supabase.auth.verifyOTP(
);
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+var session = await supabase.Auth.VerifyOTP("+13334445555", "123456", MobileOtpType.SMS);
+```
+
</TabPanel>
</$Show>
<TabPanel id="http" label="HTTP">
@@ -1380,6 +1463,15 @@ final AuthResponse res = await supabase.auth.signInWithPassword(
);
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+var session = await supabase.Auth.SignIn(SignInType.Phone, "+13334445555", "some-password");
+```
+
</TabPanel>
</$Show>
<TabPanel id="http" label="HTTP">
diff --git a/apps/docs/content/guides/auth/phone-login.mdx b/apps/docs/content/guides/auth/phone-login.mdx
index 7e450eb4b2f..7700b558b68 100644
--- a/apps/docs/content/guides/auth/phone-login.mdx
+++ b/apps/docs/content/guides/auth/phone-login.mdx
@@ -98,6 +98,15 @@ response = supabase.auth.sign_in_with_otp({
})
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+await supabase.Auth.SignIn(SignInType.Phone, "+13334445555");
+```
+
</TabPanel>
</$Show>
<TabPanel id="http" label="HTTP">
@@ -191,6 +200,17 @@ response = supabase.auth.verify_otp({
})
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+You should present a form to the user so they can input the 6 digit pin, then send it along with the phone number to `VerifyOTP`:
+
+```c#
+var session = await supabase.Auth.VerifyOTP("+13334445555", "123456", MobileOtpType.SMS);
+```
+
</TabPanel>
</$Show>
<TabPanel id="http" label="HTTP">
@@ -280,6 +300,15 @@ response = supabase.auth.update_user({
})
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+var response = await supabase.Auth.Update(new UserAttributes { Phone = "123456789" });
+```
+
</TabPanel>
</$Show>
</Tabs>
diff --git a/apps/docs/content/guides/auth/signout.mdx b/apps/docs/content/guides/auth/signout.mdx
index a5834f284eb..dd932904e60 100644
--- a/apps/docs/content/guides/auth/signout.mdx
+++ b/apps/docs/content/guides/auth/signout.mdx
@@ -66,6 +66,15 @@ suspend fun logout() {
supabase.auth.sign_out()
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+await supabase.Auth.SignOut();
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -127,6 +136,19 @@ await supabase.auth.signOut();
supabase.auth.signOut(SignOutScope.GLOBAL)
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+// defaults to the global scope
+await supabase.Auth.SignOut();
+
+// sign out from the current session only
+await supabase.Auth.SignOut(SignOutScope.Local);
+```
+
</TabPanel>
</$Show>
</Tabs>
diff --git a/apps/docs/content/guides/auth/social-login/auth-azure.mdx b/apps/docs/content/guides/auth/social-login/auth-azure.mdx
index d56fbcf4298..5d0dd8a3b60 100644
--- a/apps/docs/content/guides/auth/social-login/auth-azure.mdx
+++ b/apps/docs/content/guides/auth/social-login/auth-azure.mdx
@@ -207,6 +207,18 @@ suspend fun signInWithAzure() {
}
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+When your user signs in, call [`SignIn()`](/docs/reference/csharp/sign-in-with-oauth) with `Provider.Azure` as the provider. Request the `email` scope:
+
+```c#
+var state = await supabase.Auth.SignIn(Provider.Azure, new SignInOptions { Scopes = "email" });
+var signInUrl = state.Uri;
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -258,6 +270,17 @@ suspend fun signOut() {
}
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+When your user signs out, call [SignOut()](/docs/reference/csharp/sign-out) to remove them from the browser session and any objects from local storage:
+
+```c#
+await supabase.Auth.SignOut();
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -315,6 +338,16 @@ suspend fun signInWithAzure() {
}
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+var state = await supabase.Auth.SignIn(Provider.Azure, new SignInOptions { Scopes = "offline_access" });
+var signInUrl = state.Uri;
+```
+
</TabPanel>
</$Show>
</Tabs>
diff --git a/apps/docs/content/guides/auth/social-login/auth-bitbucket.mdx b/apps/docs/content/guides/auth/social-login/auth-bitbucket.mdx
index e0fbb356f89..45c9dc8a3b2 100644
--- a/apps/docs/content/guides/auth/social-login/auth-bitbucket.mdx
+++ b/apps/docs/content/guides/auth/social-login/auth-bitbucket.mdx
@@ -100,6 +100,18 @@ suspend fun signInWithBitbucket() {
}
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+When your user signs in, call [`SignIn()`](/docs/reference/csharp/sign-in-with-oauth) with `Provider.Bitbucket` as the provider:
+
+```c#
+var state = await supabase.Auth.SignIn(Provider.Bitbucket);
+var signInUrl = state.Uri;
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -151,6 +163,17 @@ suspend fun signOut() {
}
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+When your user signs out, call [SignOut()](/docs/reference/csharp/sign-out) to remove them from the browser session and any objects from local storage:
+
+```c#
+await supabase.Auth.SignOut();
+```
+
</TabPanel>
</$Show>
</Tabs>
diff --git a/apps/docs/content/guides/auth/social-login/auth-discord.mdx b/apps/docs/content/guides/auth/social-login/auth-discord.mdx
index 4f34e09facd..b35c4d2fac0 100644
--- a/apps/docs/content/guides/auth/social-login/auth-discord.mdx
+++ b/apps/docs/content/guides/auth/social-login/auth-discord.mdx
@@ -117,6 +117,18 @@ suspend fun signInWithDiscord() {
}
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+When your user signs in, call [`SignIn()`](/docs/reference/csharp/sign-in-with-oauth) with `Provider.Discord` as the provider:
+
+```c#
+var state = await supabase.Auth.SignIn(Provider.Discord);
+var signInUrl = state.Uri;
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -170,6 +182,17 @@ suspend fun signOut() {
}
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+When your user signs out, call [SignOut()](/docs/reference/csharp/sign-out) to remove them from the browser session and any objects from local storage:
+
+```c#
+await supabase.Auth.SignOut();
+```
+
</TabPanel>
</$Show>
</Tabs>
diff --git a/apps/docs/content/guides/auth/social-login/auth-facebook.mdx b/apps/docs/content/guides/auth/social-login/auth-facebook.mdx
index 05c9b31f226..2ebb3a8fd19 100644
--- a/apps/docs/content/guides/auth/social-login/auth-facebook.mdx
+++ b/apps/docs/content/guides/auth/social-login/auth-facebook.mdx
@@ -259,6 +259,18 @@ suspend fun signInWithFacebook() {
}
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+When your user signs in, call [`SignIn()`](/docs/reference/csharp/sign-in-with-oauth) with `Provider.Facebook` as the provider:
+
+```c#
+var state = await supabase.Auth.SignIn(Provider.Facebook);
+var signInUrl = state.Uri;
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -330,6 +342,17 @@ suspend fun signOut() {
}
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+When your user signs out, call [SignOut()](/docs/reference/csharp/sign-out) to remove them from the browser session and any objects from local storage:
+
+```c#
+await supabase.Auth.SignOut();
+```
+
</TabPanel>
</$Show>
</Tabs>
diff --git a/apps/docs/content/guides/auth/social-login/auth-figma.mdx b/apps/docs/content/guides/auth/social-login/auth-figma.mdx
index 1204263579c..1c3a0864d31 100644
--- a/apps/docs/content/guides/auth/social-login/auth-figma.mdx
+++ b/apps/docs/content/guides/auth/social-login/auth-figma.mdx
@@ -100,6 +100,18 @@ suspend fun signInWithFigma() {
}
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+When your user signs in, call [`SignIn()`](/docs/reference/csharp/sign-in-with-oauth) with `Provider.Figma` as the provider:
+
+```c#
+var state = await supabase.Auth.SignIn(Provider.Figma);
+var signInUrl = state.Uri;
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -151,6 +163,17 @@ suspend fun signOut() {
}
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+When your user signs out, call [SignOut()](/docs/reference/csharp/sign-out) to remove them from the browser session and any objects from local storage:
+
+```c#
+await supabase.Auth.SignOut();
+```
+
</TabPanel>
</$Show>
</Tabs>
diff --git a/apps/docs/content/guides/auth/social-login/auth-github.mdx b/apps/docs/content/guides/auth/social-login/auth-github.mdx
index 88839c3a01c..7a0605c2572 100644
--- a/apps/docs/content/guides/auth/social-login/auth-github.mdx
+++ b/apps/docs/content/guides/auth/social-login/auth-github.mdx
@@ -128,6 +128,18 @@ suspend fun signInWithGithub() {
}
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+When your user signs in, call [`SignIn()`](/docs/reference/csharp/sign-in-with-oauth) with `Provider.Github` as the provider:
+
+```c#
+var state = await supabase.Auth.SignIn(Provider.Github);
+var signInUrl = state.Uri;
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -179,6 +191,17 @@ suspend fun signOut() {
}
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+When your user signs out, call [SignOut()](/docs/reference/csharp/sign-out) to remove them from the browser session and any objects from local storage:
+
+```c#
+await supabase.Auth.SignOut();
+```
+
</TabPanel>
</$Show>
</Tabs>
diff --git a/apps/docs/content/guides/auth/social-login/auth-gitlab.mdx b/apps/docs/content/guides/auth/social-login/auth-gitlab.mdx
index e6974a4ddbf..3b187fc18ac 100644
--- a/apps/docs/content/guides/auth/social-login/auth-gitlab.mdx
+++ b/apps/docs/content/guides/auth/social-login/auth-gitlab.mdx
@@ -97,6 +97,18 @@ suspend fun signInWithGitLab() {
}
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+When your user signs in, call [`SignIn()`](/docs/reference/csharp/sign-in-with-oauth) with `Provider.Gitlab` as the provider:
+
+```c#
+var state = await supabase.Auth.SignIn(Provider.Gitlab);
+var signInUrl = state.Uri;
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -148,6 +160,17 @@ suspend fun signOut() {
}
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+When your user signs out, call [SignOut()](/docs/reference/csharp/sign-out) to remove them from the browser session and any objects from local storage:
+
+```c#
+await supabase.Auth.SignOut();
+```
+
</TabPanel>
</$Show>
</Tabs>
diff --git a/apps/docs/content/guides/auth/social-login/auth-kakao.mdx b/apps/docs/content/guides/auth/social-login/auth-kakao.mdx
index dc228ac5ccf..73efc6fdb48 100644
--- a/apps/docs/content/guides/auth/social-login/auth-kakao.mdx
+++ b/apps/docs/content/guides/auth/social-login/auth-kakao.mdx
@@ -143,6 +143,18 @@ suspend fun signInWithKakao() {
}
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+When your user signs in, call [`SignIn()`](/docs/reference/csharp/sign-in-with-oauth) with `Provider.Kakao` as the provider:
+
+```c#
+var state = await supabase.Auth.SignIn(Provider.Kakao);
+var signInUrl = state.Uri;
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -189,6 +201,17 @@ suspend fun signOut() {
}
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+When your user signs out, call [SignOut()](/docs/reference/csharp/sign-out) to remove them from the browser session and any objects from local storage:
+
+```c#
+await supabase.Auth.SignOut();
+```
+
</TabPanel>
</$Show>
</Tabs>
diff --git a/apps/docs/content/guides/auth/social-login/auth-keycloak.mdx b/apps/docs/content/guides/auth/social-login/auth-keycloak.mdx
index 16996d93fcf..2d94a3146b7 100644
--- a/apps/docs/content/guides/auth/social-login/auth-keycloak.mdx
+++ b/apps/docs/content/guides/auth/social-login/auth-keycloak.mdx
@@ -120,6 +120,18 @@ suspend fun signInWithKeycloak() {
}
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+When your user signs in, call [`SignIn()`](/docs/reference/csharp/sign-in-with-oauth) with `Provider.KeyCloak` as the provider:
+
+```c#
+var state = await supabase.Auth.SignIn(Provider.KeyCloak, new SignInOptions { Scopes = "openid" });
+var signInUrl = state.Uri;
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -170,6 +182,17 @@ suspend fun signOut() {
}
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+When your user signs out, call [SignOut()](/docs/reference/csharp/sign-out) to remove them from the browser session and any objects from local storage:
+
+```c#
+await supabase.Auth.SignOut();
+```
+
</TabPanel>
</$Show>
</Tabs>
diff --git a/apps/docs/content/guides/auth/social-login/auth-linkedin.mdx b/apps/docs/content/guides/auth/social-login/auth-linkedin.mdx
index e80d89cb7aa..fdbf6a2df13 100644
--- a/apps/docs/content/guides/auth/social-login/auth-linkedin.mdx
+++ b/apps/docs/content/guides/auth/social-login/auth-linkedin.mdx
@@ -120,6 +120,18 @@ suspend fun signInWithKaLinkedIn() {
}
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+When your user signs in, call [`SignIn()`](/docs/reference/csharp/sign-in-with-oauth) with `Provider.LinkedInOIDC` as the provider:
+
+```c#
+var state = await supabase.Auth.SignIn(Provider.LinkedInOIDC);
+var signInUrl = state.Uri;
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -171,6 +183,17 @@ suspend fun signOut() {
}
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+When your user signs out, call [SignOut()](/docs/reference/csharp/sign-out) to remove them from the browser session and any objects from local storage:
+
+```c#
+await supabase.Auth.SignOut();
+```
+
</TabPanel>
</$Show>
</Tabs>
diff --git a/apps/docs/content/guides/auth/social-login/auth-notion.mdx b/apps/docs/content/guides/auth/social-login/auth-notion.mdx
index 0dfaed05f6f..6eb346f9aa3 100644
--- a/apps/docs/content/guides/auth/social-login/auth-notion.mdx
+++ b/apps/docs/content/guides/auth/social-login/auth-notion.mdx
@@ -100,6 +100,18 @@ suspend fun signInWithNotion() {
}
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+When your user signs in, call [`SignIn()`](/docs/reference/csharp/sign-in-with-oauth) with `Provider.Notion` as the provider:
+
+```c#
+var state = await supabase.Auth.SignIn(Provider.Notion);
+var signInUrl = state.Uri;
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -151,6 +163,17 @@ suspend fun signOut() {
}
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+When your user signs out, call [SignOut()](/docs/reference/csharp/sign-out) to remove them from the browser session and any objects from local storage:
+
+```c#
+await supabase.Auth.SignOut();
+```
+
</TabPanel>
</$Show>
</Tabs>
diff --git a/apps/docs/content/guides/auth/social-login/auth-slack.mdx b/apps/docs/content/guides/auth/social-login/auth-slack.mdx
index 86342c537e8..bf1da8d5886 100644
--- a/apps/docs/content/guides/auth/social-login/auth-slack.mdx
+++ b/apps/docs/content/guides/auth/social-login/auth-slack.mdx
@@ -136,6 +136,18 @@ suspend fun signInWithSlack() {
}
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+When your user signs in, call [`SignIn()`](/docs/reference/csharp/sign-in-with-oauth) with `Provider.Slack` as the provider:
+
+```c#
+var state = await supabase.Auth.SignIn(Provider.Slack);
+var signInUrl = state.Uri;
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -187,6 +199,17 @@ suspend fun signOut() {
}
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+When your user signs out, call [SignOut()](/docs/reference/csharp/sign-out) to remove them from the browser session and any objects from local storage:
+
+```c#
+await supabase.Auth.SignOut();
+```
+
</TabPanel>
</$Show>
</Tabs>
diff --git a/apps/docs/content/guides/auth/social-login/auth-spotify.mdx b/apps/docs/content/guides/auth/social-login/auth-spotify.mdx
index f3eced1be8f..0c23a338041 100644
--- a/apps/docs/content/guides/auth/social-login/auth-spotify.mdx
+++ b/apps/docs/content/guides/auth/social-login/auth-spotify.mdx
@@ -130,6 +130,18 @@ suspend fun signInWithSpotify() {
}
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+When your user signs in, call [`SignIn()`](/docs/reference/csharp/sign-in-with-oauth) with `Provider.Spotify` as the provider:
+
+```c#
+var state = await supabase.Auth.SignIn(Provider.Spotify);
+var signInUrl = state.Uri;
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -181,6 +193,17 @@ suspend fun signOut() {
}
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+When your user signs out, call [SignOut()](/docs/reference/csharp/sign-out) to remove them from the browser session and any objects from local storage:
+
+```c#
+await supabase.Auth.SignOut();
+```
+
</TabPanel>
</$Show>
</Tabs>
diff --git a/apps/docs/content/guides/auth/social-login/auth-twitch.mdx b/apps/docs/content/guides/auth/social-login/auth-twitch.mdx
index 370dd8ff342..a2d52a41387 100644
--- a/apps/docs/content/guides/auth/social-login/auth-twitch.mdx
+++ b/apps/docs/content/guides/auth/social-login/auth-twitch.mdx
@@ -115,6 +115,18 @@ suspend fun signInWithTwitch() {
}
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+When your user signs in, call [`SignIn()`](/docs/reference/csharp/sign-in-with-oauth) with `Provider.Twitch` as the provider:
+
+```c#
+var state = await supabase.Auth.SignIn(Provider.Twitch);
+var signInUrl = state.Uri;
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -166,6 +178,17 @@ suspend fun signOut() {
}
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+When your user signs out, call [SignOut()](/docs/reference/csharp/sign-out) to remove them from the browser session and any objects from local storage:
+
+```c#
+await supabase.Auth.SignOut();
+```
+
</TabPanel>
</$Show>
</Tabs>
diff --git a/apps/docs/content/guides/auth/social-login/auth-twitter.mdx b/apps/docs/content/guides/auth/social-login/auth-twitter.mdx
index e5be7d9475e..871e48fd17b 100644
--- a/apps/docs/content/guides/auth/social-login/auth-twitter.mdx
+++ b/apps/docs/content/guides/auth/social-login/auth-twitter.mdx
@@ -146,6 +146,18 @@ suspend fun signInWithX() {
}
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+When your user signs in, call [`SignIn()`](/docs/reference/csharp/sign-in-with-oauth) with `Provider.Twitter` as the provider:
+
+```c#
+var state = await supabase.Auth.SignIn(Provider.Twitter);
+var signInUrl = state.Uri;
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -210,6 +222,17 @@ suspend fun signOut() {
}
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+When your user signs out, call [SignOut()](/docs/reference/csharp/sign-out) to remove them from the browser session and any objects from local storage:
+
+```c#
+await supabase.Auth.SignOut();
+```
+
</TabPanel>
</$Show>
</Tabs>
diff --git a/apps/docs/content/guides/auth/social-login/auth-zoom.mdx b/apps/docs/content/guides/auth/social-login/auth-zoom.mdx
index 5f7ddbdfec2..ceea61c6ab8 100644
--- a/apps/docs/content/guides/auth/social-login/auth-zoom.mdx
+++ b/apps/docs/content/guides/auth/social-login/auth-zoom.mdx
@@ -131,6 +131,18 @@ suspend fun signInWithZoom() {
}
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+When your user signs in, call [`SignIn()`](/docs/reference/csharp/sign-in-with-oauth) with `Provider.Zoom` as the provider:
+
+```c#
+var state = await supabase.Auth.SignIn(Provider.Zoom);
+var signInUrl = state.Uri;
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -182,6 +194,17 @@ suspend fun signOut() {
}
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+When your user signs out, call [SignOut()](/docs/reference/csharp/sign-out) to remove them from the browser session and any objects from local storage:
+
+```c#
+await supabase.Auth.SignOut();
+```
+
</TabPanel>
</$Show>
</Tabs>
diff --git a/apps/docs/content/guides/database/arrays.mdx b/apps/docs/content/guides/database/arrays.mdx
index c185c08e352..cf9639fadcb 100644
--- a/apps/docs/content/guides/database/arrays.mdx
+++ b/apps/docs/content/guides/database/arrays.mdx
@@ -116,6 +116,29 @@ supabase.from_('arraytest').insert(
.execute()
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+Insert a record from the C# client:
+
+```c#
+[Table("arraytest")]
+class ArrayTest : BaseModel
+{
+ [PrimaryKey("id", false)]
+ public int Id { get; set; }
+
+ [Column("textarray")]
+ public List<string> Textarray { get; set; }
+}
+
+await supabase
+ .From<ArrayTest>()
+ .Insert(new ArrayTest { Id = 2, Textarray = new List<string> { "one", "two", "three", "four" } });
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -232,6 +255,20 @@ returns:
]
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+This returns the entire array field:
+
+```c#
+var result = await supabase
+ .From<ArrayTest>()
+ .Select(x => new object[] { x.Textarray })
+ .Get();
+```
+
</TabPanel>
</$Show>
</Tabs>
diff --git a/apps/docs/content/guides/database/extensions/plv8.mdx b/apps/docs/content/guides/database/extensions/plv8.mdx
index 219f98acc81..ae6e896b6ac 100644
--- a/apps/docs/content/guides/database/extensions/plv8.mdx
+++ b/apps/docs/content/guides/database/extensions/plv8.mdx
@@ -97,6 +97,15 @@ const { data, error } = supabase.rpc('function_name')
val data = supabase.postgrest.rpc("function_name")
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+await supabase.Rpc("function_name", null);
+```
+
</TabPanel>
</$Show>
</Tabs>
diff --git a/apps/docs/content/guides/database/extensions/postgis.mdx b/apps/docs/content/guides/database/extensions/postgis.mdx
index c02e5f9c9ae..6d3e077f1eb 100644
--- a/apps/docs/content/guides/database/extensions/postgis.mdx
+++ b/apps/docs/content/guides/database/extensions/postgis.mdx
@@ -188,6 +188,37 @@ val data = supabase.from("restaurants").insert(listOf(
))
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+[Table("restaurants")]
+class Restaurant : BaseModel
+{
+ [PrimaryKey("id", false)]
+ public long Id { get; set; }
+
+ [Column("name")]
+ public string Name { get; set; }
+
+ [Column("location")]
+ public string Location { get; set; }
+}
+```
+
+```c#
+var restaurants = new List<Restaurant>
+{
+ new Restaurant { Name = "Supa Burger", Location = "POINT(-73.946823 40.807416)" },
+ new Restaurant { Name = "Supa Pizza", Location = "POINT(-73.94581 40.807475)" },
+ new Restaurant { Name = "Supa Taco", Location = "POINT(-73.945826 40.80629)" }
+};
+
+await supabase.From<Restaurant>().Insert(restaurants);
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -293,6 +324,19 @@ val data = supabase.postgrest.rpc(
)
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+await supabase.Rpc("nearby_restaurants", new Dictionary<string, object>
+{
+ { "lat", 40.807313 },
+ { "long", -73.946713 }
+});
+```
+
</TabPanel>
</$Show>
<TabPanel id="result" label="Result">
@@ -425,6 +469,21 @@ val data = supabase.postgrest.rpc(
)
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+await supabase.Rpc("restaurants_in_view", new Dictionary<string, object>
+{
+ { "min_lat", 40.807 },
+ { "min_long", -73.946 },
+ { "max_lat", 40.808 },
+ { "max_long", -73.945 }
+});
+```
+
</TabPanel>
</$Show>
<TabPanel id="result" label="Result">
diff --git a/apps/docs/content/guides/database/full-text-search.mdx b/apps/docs/content/guides/database/full-text-search.mdx
index 5104d8bb33c..43dffce6031 100644
--- a/apps/docs/content/guides/database/full-text-search.mdx
+++ b/apps/docs/content/guides/database/full-text-search.mdx
@@ -171,6 +171,18 @@ val data = supabase.from("books").select {
data = supabase.from_('books').select().eq('title', 'Harry').execute()
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+var result = await supabase
+ .From<Book>()
+ .Where(x => x.Title == "Harry")
+ .Get();
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -235,6 +247,18 @@ val data = supabase.from("books").select {
}
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+var result = await supabase
+ .From<Book>()
+ .Filter("title", Operator.FTS, new FullTextSearchConfig("'Harry'", null))
+ .Get();
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -316,6 +340,18 @@ val data = supabase.from("books").select {
data = supabase.from_('books').select().text_search('description', "'big'").execute()
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+var result = await supabase
+ .From<Book>()
+ .Filter("description", Operator.FTS, new FullTextSearchConfig("'big'", null))
+ .Get();
+```
+
</TabPanel>
</$Show>
@@ -444,6 +480,24 @@ $$ language sql immutable;
data = supabase.from_('books').select().text_search('title_description', "little").execute()
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```sql
+create function title_description(books) returns text as $$
+ select $1.title || ' ' || $1.description;
+$$ language sql immutable;
+```
+
+```c#
+var result = await supabase
+ .From<Book>()
+ .Filter("title_description", Operator.FTS, new FullTextSearchConfig("little", null))
+ .Get();
+```
+
</TabPanel>
</$Show>
<TabPanel id="data" label="Data">
@@ -539,6 +593,18 @@ val data = supabase.from("books").select {
data = supabase.from_('books').select().text_search('description', "'little' & 'big'").execute()
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+var result = await supabase
+ .From<Book>()
+ .Filter("description", Operator.FTS, new FullTextSearchConfig("'little' & 'big'", null))
+ .Get();
+```
+
</TabPanel>
</$Show>
<TabPanel id="data" label="Data">
@@ -633,6 +699,18 @@ val data = supabase.from("books").select {
response = client.from_('books').select().text_search('description', "'little' | 'big'").execute()
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+var result = await supabase
+ .From<Book>()
+ .Filter("description", Operator.FTS, new FullTextSearchConfig("'little' | 'big'", null))
+ .Get();
+```
+
</TabPanel>
</$Show>
<TabPanel id="data" label="Data">
@@ -735,6 +813,15 @@ val result = supabase.postgrest.rpc("search_books_by_title_prefix", rpcParams)
data = client.rpc('search_books_by_title_prefix', { 'prefix': 'Lit' }).execute()
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+await supabase.Rpc("search_books_by_title_prefix", new Dictionary<string, object> { { "prefix", "Lit" } });
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -781,6 +868,18 @@ const { data, error } = await supabase
```
</TabPanel>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+var result = await supabase
+ .From<Book>()
+ .Filter("description", Operator.WFTS, new FullTextSearchConfig("green eggs", null))
+ .Get();
+```
+
+</TabPanel>
+</$Show>
</Tabs>
### Quoted phrases
@@ -949,6 +1048,18 @@ val data = supabase.from("books").select {
data = client.from_('books').select().text_search('fts', "'little' & 'big'").execute()
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+var result = await supabase
+ .From<Book>()
+ .Filter("fts", Operator.FTS, new FullTextSearchConfig("'little' & 'big'", null))
+ .Get();
+```
+
</TabPanel>
</$Show>
<TabPanel id="data" label="Data">
@@ -1048,6 +1159,18 @@ val data = supabase.from("books").select {
data = client.from_('books').select().text_search('description', "'big' <-> 'dreams'").execute()
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+var result = await supabase
+ .From<Book>()
+ .Filter("description", Operator.FTS, new FullTextSearchConfig("'big' <-> 'dreams'", null))
+ .Get();
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -1128,6 +1251,18 @@ val data = supabase.from("books").select {
data = client.from_('books').select().text_search('description', "'year' <2> 'school'").execute()
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+var result = await supabase
+ .From<Book>()
+ .Filter("description", Operator.FTS, new FullTextSearchConfig("'year' <2> 'school'", null))
+ .Get();
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -1211,6 +1346,18 @@ val data = supabase.from("books").select {
data = client.from_('books').select().text_search('description', "'big' & !'little'").execute()
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+var result = await supabase
+ .From<Book>()
+ .Filter("description", Operator.FTS, new FullTextSearchConfig("'big' & !'little'", null))
+ .Get();
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -1273,6 +1420,15 @@ final result = await client
data = client.rpc('search_books', { 'search_query': 'big' }).execute()
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+await supabase.Rpc("search_books", new Dictionary<string, object> { { "search_query", "big" } });
+```
+
</TabPanel>
</$Show>
<TabPanel id="sql" label="SQL">
@@ -1398,6 +1554,19 @@ data = client.rpc('search_books_weighted', { 'search_query': 'Harry' }).execute(
custom_data = client.rpc('search_books_custom_weights', { 'search_query': 'Harry' }).execute()
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+// Search with standard weighted ranking
+await supabase.Rpc("search_books_weighted", new Dictionary<string, object> { { "search_query", "Harry" } });
+
+// Search with custom weights
+await supabase.Rpc("search_books_custom_weights", new Dictionary<string, object> { { "search_query", "Harry" } });
+```
+
</TabPanel>
</$Show>
<TabPanel id="sql" label="SQL">
@@ -1474,6 +1643,15 @@ final result = await client
data = client.rpc('search_books_fts', { 'search_query': 'little & big' }).execute()
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+await supabase.Rpc("search_books_fts", new Dictionary<string, object> { { "search_query", "little & big" } });
+```
+
</TabPanel>
</$Show>
<TabPanel id="sql" label="SQL">
@@ -1523,6 +1701,16 @@ const { data, error } = await supabase.rpc('websearch_books', {
```
</TabPanel>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+// Support natural search syntax
+await supabase.Rpc("websearch_books", new Dictionary<string, object> { { "search_text", "\"little puppy\" or train -vegetables" } });
+```
+
+</TabPanel>
+</$Show>
<TabPanel id="sql" label="SQL">
```sql
diff --git a/apps/docs/content/guides/database/functions.mdx b/apps/docs/content/guides/database/functions.mdx
index 3c9c3511177..e02dfed95a6 100644
--- a/apps/docs/content/guides/database/functions.mdx
+++ b/apps/docs/content/guides/database/functions.mdx
@@ -134,6 +134,17 @@ data = supabase.rpc('hello_world').execute()
Reference: [`rpc()`](../../reference/python/rpc)
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+await supabase.Rpc("hello_world", null);
+```
+
+Reference: [`Rpc()`](../../reference/csharp/rpc)
+
</TabPanel>
</$Show>
</Tabs>
@@ -392,6 +403,15 @@ val data = supabase.postgrest.rpc(
data = supabase.rpc('add_planet', params={'name': 'Jakku'}).execute()
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+await supabase.Rpc("add_planet", new Dictionary<string, object> { { "name", "Jakku" } });
+```
+
</TabPanel>
</$Show>
</Tabs>
diff --git a/apps/docs/content/guides/database/joins-and-nesting.mdx b/apps/docs/content/guides/database/joins-and-nesting.mdx
index f9b372ab745..efd989ff246 100644
--- a/apps/docs/content/guides/database/joins-and-nesting.mdx
+++ b/apps/docs/content/guides/database/joins-and-nesting.mdx
@@ -178,6 +178,18 @@ val data = supabase.from("orchestral_sections").select(Columns.raw("id, name, in
data = supabase.from_('orchestral_sections').select('id, name, instruments(id, name)').execute()
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+var result = await supabase
+ .From<OrchestralSection>()
+ .Select("id, name, instruments(id, name)")
+ .Get();
+```
+
</TabPanel>
</$Show>
<TabPanel id="graphql" label="GraphQL">
@@ -766,6 +778,18 @@ val data = supabase.from("teams").select(Columns.raw("id, team_name, users(id, n
data = supabase.from_('teams').select('id, team_name, users(id, name)').execute()
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+var result = await supabase
+ .From<Team>()
+ .Select("id, team_name, users(id, name)")
+ .Get();
+```
+
</TabPanel>
</$Show>
<TabPanel id="graphql" label="GraphQL">
@@ -982,6 +1006,30 @@ data = supabase.from_('shifts').select("""
""").execute()
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+var result = await supabase
+ .From<Shift>()
+ .Select(@"
+ *,
+ start_scan:scans!scan_id_start (
+ id,
+ user_id,
+ badge_scan_time
+ ),
+ end_scan:scans!scan_id_end (
+ id,
+ user_id,
+ badge_scan_time
+ )
+ ")
+ .Get();
+```
+
</TabPanel>
</$Show>
<TabPanel id="graphql" label="GraphQL">
diff --git a/apps/docs/content/guides/database/json.mdx b/apps/docs/content/guides/database/json.mdx
index e4191087163..962ed08135b 100644
--- a/apps/docs/content/guides/database/json.mdx
+++ b/apps/docs/content/guides/database/json.mdx
@@ -390,6 +390,51 @@ supabase.from_('books').insert([
]).execute()
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+[Table("books")]
+class Book : BaseModel
+{
+ [Column("title")]
+ public string Title { get; set; }
+
+ [Column("author")]
+ public string Author { get; set; }
+
+ [Column("metadata")]
+ public BookMetadata Metadata { get; set; }
+}
+
+class BookMetadata
+{
+ [JsonProperty("description")]
+ public string Description { get; set; }
+
+ [JsonProperty("price")]
+ public double Price { get; set; }
+
+ [JsonProperty("ages")]
+ public List<int> Ages { get; set; }
+}
+```
+
+```c#
+var books = new List<Book>
+{
+ new Book { Title = "The Poky Little Puppy", Author = "Janette Sebring Lowrey", Metadata = new BookMetadata { Description = "Puppy is slower than other, bigger animals.", Price = 5.95, Ages = new List<int> { 3, 6 } } },
+ new Book { Title = "The Tale of Peter Rabbit", Author = "Beatrix Potter", Metadata = new BookMetadata { Description = "Rabbit eats some vegetables.", Price = 4.49, Ages = new List<int> { 2, 5 } } },
+ new Book { Title = "Tootle", Author = "Gertrude Crampton", Metadata = new BookMetadata { Description = "Little toy train has big dreams.", Price = 3.99, Ages = new List<int> { 2, 5 } } },
+ new Book { Title = "Green Eggs and Ham", Author = "Dr. Seuss", Metadata = new BookMetadata { Description = "Sam has changing food preferences and eats unusually colored food.", Price = 7.49, Ages = new List<int> { 4, 8 } } },
+ new Book { Title = "Harry Potter and the Goblet of Fire", Author = "J.K. Rowling", Metadata = new BookMetadata { Description = "Fourth year of school starts, big drama ensues.", Price = 24.95, Ages = new List<int> { 10, 99 } } }
+};
+
+await supabase.From<Book>().Insert(books);
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -482,6 +527,18 @@ data = supabase.from_('books').select("""
).execute()
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+var result = await supabase
+ .From<Book>()
+ .Select("title, description:metadata->>description, price:metadata->price, low_age:metadata->ages->0, high_age:metadata->ages->1")
+ .Get();
+```
+
</TabPanel>
</$Show>
<TabPanel id="result" label="Result">
diff --git a/apps/docs/content/guides/database/tables.mdx b/apps/docs/content/guides/database/tables.mdx
index 8a2e24b6750..b185d17a191 100644
--- a/apps/docs/content/guides/database/tables.mdx
+++ b/apps/docs/content/guides/database/tables.mdx
@@ -307,6 +307,44 @@ supabase
))
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+[Table("movies")]
+class Movie : BaseModel
+{
+ [PrimaryKey("id", false)]
+ public long Id { get; set; }
+
+ [Column("name")]
+ public string Name { get; set; }
+
+ [Column("description")]
+ public string Description { get; set; }
+}
+```
+
+```c#
+var movies = new List<Movie>
+{
+ new Movie
+ {
+ Name = "The Empire Strikes Back",
+ Description = "After the Rebels are brutally overpowered by the Empire on the ice planet Hoth, Luke Skywalker begins Jedi training with Yoda."
+ },
+ new Movie
+ {
+ Name = "Return of the Jedi",
+ Description = "After a daring mission to rescue Han Solo from Jabba the Hutt, the Rebels dispatch to Endor to destroy the second Death Star."
+ }
+};
+
+await supabase.From<Movie>().Insert(movies);
+```
+
</TabPanel>
</$Show>
</Tabs>
diff --git a/apps/docs/content/guides/realtime/broadcast.mdx b/apps/docs/content/guides/realtime/broadcast.mdx
index 20a23ed37ba..150c86309ca 100644
--- a/apps/docs/content/guides/realtime/broadcast.mdx
+++ b/apps/docs/content/guides/realtime/broadcast.mdx
@@ -122,6 +122,19 @@ Get the Project URL and key from [the project's **Connect** dialog](/dashboard/p
</TabPanel>
</$Show>
+ <$Show if="sdk:csharp">
+ <TabPanel id="csharp" label="C#">
+
+ ```c#
+ var supabase = new Supabase.Client(
+ "https://<project>.supabase.co",
+ "<sb_publishable_... key>"
+ );
+ await supabase.InitializeAsync();
+ ```
+
+ </TabPanel>
+ </$Show>
</Tabs>
### Receive Broadcast messages
@@ -253,6 +266,32 @@ Binary payloads (`ArrayBuffer` / `ArrayBufferView`) are received automatically f
</TabPanel>
</$Show>
+ <$Show if="sdk:csharp">
+ <TabPanel id="csharp" label="C#">
+
+ ```c#
+ class ShoutBroadcast : BaseBroadcast
+ {
+ [JsonProperty("message")]
+ public string Message { get; set; }
+ }
+
+ // Join a room/topic. Can be anything except for 'realtime'.
+ var myChannel = supabase.Realtime.Channel("test-channel");
+
+ // Register a typed broadcast and log any messages we receive
+ var broadcast = myChannel.Register<ShoutBroadcast>();
+ broadcast.AddBroadcastEventHandler((sender, _) =>
+ {
+ Console.WriteLine(broadcast.Current());
+ });
+
+ // Subscribe to the channel
+ await myChannel.Subscribe();
+ ```
+
+ </TabPanel>
+ </$Show>
</Tabs>
## Send messages
@@ -436,6 +475,21 @@ Broadcast payloads can be binary (`ArrayBuffer` or `ArrayBufferView`, e.g. `Uint
</TabPanel>
</$Show>
+ <$Show if="sdk:csharp">
+ <TabPanel id="csharp" label="C#">
+
+ ```c#
+ var myChannel = supabase.Realtime.Channel("test-channel");
+ var broadcast = myChannel.Register<ShoutBroadcast>();
+
+ await myChannel.Subscribe();
+
+ // Send a broadcast message over the WebSocket
+ await broadcast.Send("shout", new ShoutBroadcast { Message = "Hi" });
+ ```
+
+ </TabPanel>
+ </$Show>
</Tabs>
{/* supa-mdx-lint-disable-next-line Rule001HeadingCase */}
@@ -719,6 +773,26 @@ You can pass configuration options while initializing the Supabase Client.
</TabPanel>
</$Show>
+ <$Show if="sdk:csharp">
+ <TabPanel id="csharp" label="C#">
+
+ By default, broadcast messages are only sent to other clients. You can broadcast messages back to the sender by setting the `broadcastSelf` parameter to `true`.
+
+ ```c#
+ var myChannel = supabase.Realtime.Channel("room-2");
+ var broadcast = myChannel.Register<ShoutBroadcast>(broadcastSelf: true);
+ broadcast.AddBroadcastEventHandler((sender, _) =>
+ {
+ Console.WriteLine(broadcast.Current());
+ });
+
+ await myChannel.Subscribe();
+
+ await broadcast.Send("test-my-messages", new ShoutBroadcast { Message = "talking to myself" });
+ ```
+
+ </TabPanel>
+ </$Show>
</Tabs>
### Acknowledge messages
@@ -826,6 +900,23 @@ You can pass configuration options while initializing the Supabase Client.
Unsupported in Python yet.
</TabPanel>
</$Show>
+ <$Show if="sdk:csharp">
+ <TabPanel id="csharp" label="C#">
+
+ You can confirm that the Realtime servers have received your message by setting the `broadcastAck` parameter to `true`. `Send` then returns `true` once the server acknowledges the message.
+
+ ```c#
+ var myChannel = supabase.Realtime.Channel("room-3");
+ var broadcast = myChannel.Register<ShoutBroadcast>(broadcastAck: true);
+
+ await myChannel.Subscribe();
+
+ var acknowledged = await broadcast.Send("acknowledge", new ShoutBroadcast { Message = "Hi" });
+ Console.WriteLine(acknowledged);
+ ```
+
+ </TabPanel>
+ </$Show>
</Tabs>
Use this to guarantee that the server has received the message before resolving `channelD.send`'s promise. If the `ack` config is not set to `true` when creating the channel, the promise returned by `channelD.send` will resolve immediately.
diff --git a/apps/docs/content/guides/realtime/getting_started.mdx b/apps/docs/content/guides/realtime/getting_started.mdx
index a8312185de5..477f21740fb 100644
--- a/apps/docs/content/guides/realtime/getting_started.mdx
+++ b/apps/docs/content/guides/realtime/getting_started.mdx
@@ -76,6 +76,15 @@ pip install supabase
conda install -c conda-forge supabase
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```bash
+dotnet add package Supabase
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -145,6 +154,21 @@ key: str = "<sb_publishable_key>"
supabase: Client = create_client(url, key)
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+using Supabase;
+
+var supabase = new Client(
+ "https://<project>.supabase.co",
+ "<sb_publishable_key>"
+);
+await supabase.InitializeAsync();
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -200,6 +224,18 @@ let channel = supabase.channel("room:lobby:messages") {
channel = supabase.channel('room:lobby:messages', params={'config': {'private': True }})
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+// Create a channel with a descriptive topic name.
+// Note: The C# SDK does not yet support private channel configuration,
+// so this connects to a public channel.
+var channel = supabase.Realtime.Channel("room:lobby:messages");
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -326,6 +362,42 @@ channel.send_broadcast_message(
)
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+class MessageBroadcast : BaseBroadcast
+{
+ [JsonProperty("text")]
+ public string Text { get; set; }
+
+ [JsonProperty("user")]
+ public string User { get; set; }
+
+ [JsonProperty("timestamp")]
+ public string Timestamp { get; set; }
+}
+
+// Listen for messages
+var broadcast = channel.Register<MessageBroadcast>();
+broadcast.AddBroadcastEventHandler((sender, _) =>
+{
+ Console.WriteLine($"New message: {broadcast.Current()}");
+});
+
+await channel.Subscribe();
+
+// Send a message
+await broadcast.Send("message_sent", new MessageBroadcast
+{
+ Text = "Hello, world!",
+ User = "john_doe",
+ Timestamp = DateTime.UtcNow.ToString("o")
+});
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -640,6 +712,16 @@ with RealtimeManager() as channel:
pass
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+// Remove the channel when you are done with it to free up resources
+supabase.Realtime.Remove(channel);
+```
+
</TabPanel>
</$Show>
</Tabs>
diff --git a/apps/docs/content/guides/realtime/postgres-changes.mdx b/apps/docs/content/guides/realtime/postgres-changes.mdx
index 702d7bd8810..2443e3f8c03 100644
--- a/apps/docs/content/guides/realtime/postgres-changes.mdx
+++ b/apps/docs/content/guides/realtime/postgres-changes.mdx
@@ -314,6 +314,24 @@ changes = supabase.channel('schema-db-changes').on_postgres_changes(
.subscribe()
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+var channel = supabase.Realtime.Channel("schema-db-changes");
+
+// Subscribes to the "public" schema in Postgres
+channel.Register(new PostgresChangesOptions("public"));
+channel.AddPostgresChangeHandler(ListenType.All, (sender, change) =>
+{
+ Console.WriteLine(change.Payload);
+});
+
+await channel.Subscribe();
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -706,6 +724,82 @@ changes = supabase.channel('schema-db-changes').on_postgres_changes(
</TabPanel>
</Tabs>
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+Pass the `ListenType` to select the event.
+
+<Tabs
+ scrollable
+ size="small"
+ type="underlined"
+ defaultActiveId="insert"
+ queryGroup="pg-changes-event"
+>
+<TabPanel id="insert" label="Insert">
+
+```c#
+var channel = supabase.Realtime.Channel("schema-db-changes");
+
+channel.Register(new PostgresChangesOptions("public", eventType: ListenType.Inserts));
+channel.AddPostgresChangeHandler(ListenType.Inserts, (sender, change) =>
+{
+ Console.WriteLine(change.Payload);
+});
+
+await channel.Subscribe();
+```
+
+</TabPanel>
+<TabPanel id="update" label="Update">
+
+```c#
+var channel = supabase.Realtime.Channel("schema-db-changes");
+
+channel.Register(new PostgresChangesOptions("public", eventType: ListenType.Updates));
+channel.AddPostgresChangeHandler(ListenType.Updates, (sender, change) =>
+{
+ Console.WriteLine(change.Payload);
+});
+
+await channel.Subscribe();
+```
+
+</TabPanel>
+<TabPanel id="delete" label="Delete">
+
+```c#
+var channel = supabase.Realtime.Channel("schema-db-changes");
+
+channel.Register(new PostgresChangesOptions("public", eventType: ListenType.Deletes));
+channel.AddPostgresChangeHandler(ListenType.Deletes, (sender, change) =>
+{
+ Console.WriteLine(change.Payload);
+});
+
+await channel.Subscribe();
+```
+
+</TabPanel>
+<TabPanel id="all" label="All events">
+
+```c#
+var channel = supabase.Realtime.Channel("schema-db-changes");
+
+channel.Register(new PostgresChangesOptions("public", eventType: ListenType.All));
+channel.AddPostgresChangeHandler(ListenType.All, (sender, change) =>
+{
+ Console.WriteLine(change.Payload);
+});
+
+await channel.Subscribe();
+```
+
+</TabPanel>
+</Tabs>
+
</TabPanel>
</$Show>
</Tabs>
@@ -813,6 +907,23 @@ changes = supabase.channel('db-changes').on_postgres_changes(
.subscribe()
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+var channel = supabase.Realtime.Channel("table-db-changes");
+
+channel.Register(new PostgresChangesOptions("public", "todos"));
+channel.AddPostgresChangeHandler(ListenType.All, (sender, change) =>
+{
+ Console.WriteLine(change.Payload);
+});
+
+await channel.Subscribe();
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -925,6 +1036,23 @@ changes = supabase.channel('db-changes').on_postgres_changes(
).subscribe()
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+var channel = supabase.Realtime.Channel("db-changes");
+
+channel.Register(new PostgresChangesOptions("public", "messages"));
+channel.Register(new PostgresChangesOptions("public", "users", eventType: ListenType.Inserts));
+
+channel.AddPostgresChangeHandler(ListenType.All, (sender, change) => Console.WriteLine(change.Payload));
+channel.AddPostgresChangeHandler(ListenType.Inserts, (sender, change) => Console.WriteLine(change.Payload));
+
+await channel.Subscribe();
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -1038,6 +1166,23 @@ changes = supabase.channel('db-changes').on_postgres_changes(
.subscribe()
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+var channel = supabase.Realtime.Channel("table-filter-changes");
+
+channel.Register(new PostgresChangesOptions("public", "todos", ListenType.Inserts, "id=eq.1"));
+channel.AddPostgresChangeHandler(ListenType.Inserts, (sender, change) =>
+{
+ Console.WriteLine(change.Payload);
+});
+
+await channel.Subscribe();
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -1219,6 +1364,23 @@ changes = supabase.channel('db-changes').on_postgres_changes(
.subscribe()
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+var channel = supabase.Realtime.Channel("changes");
+
+channel.Register(new PostgresChangesOptions("public", "messages", ListenType.Updates, "body=eq.hey"));
+channel.AddPostgresChangeHandler(ListenType.Updates, (sender, change) =>
+{
+ Console.WriteLine(change.Payload);
+});
+
+await channel.Subscribe();
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -1366,6 +1528,23 @@ changes = supabase.channel('db-changes').on_postgres_changes(
.subscribe()
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+var channel = supabase.Realtime.Channel("changes");
+
+channel.Register(new PostgresChangesOptions("public", "messages", ListenType.Inserts, "body=neq.bye"));
+channel.AddPostgresChangeHandler(ListenType.Inserts, (sender, change) =>
+{
+ Console.WriteLine(change.Payload);
+});
+
+await channel.Subscribe();
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -1512,6 +1691,23 @@ changes = supabase.channel('db-changes').on_postgres_changes(
.subscribe()
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+var channel = supabase.Realtime.Channel("changes");
+
+channel.Register(new PostgresChangesOptions("public", "profiles", ListenType.Inserts, "age=lt.65"));
+channel.AddPostgresChangeHandler(ListenType.Inserts, (sender, change) =>
+{
+ Console.WriteLine(change.Payload);
+});
+
+await channel.Subscribe();
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -1658,6 +1854,23 @@ changes = supabase.channel('db-changes').on_postgres_changes(
.subscribe()
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+var channel = supabase.Realtime.Channel("changes");
+
+channel.Register(new PostgresChangesOptions("public", "profiles", ListenType.Updates, "age=lte.65"));
+channel.AddPostgresChangeHandler(ListenType.Updates, (sender, change) =>
+{
+ Console.WriteLine(change.Payload);
+});
+
+await channel.Subscribe();
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -1804,6 +2017,23 @@ changes = supabase.channel('db-changes').on_postgres_changes(
.subscribe()
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+var channel = supabase.Realtime.Channel("changes");
+
+channel.Register(new PostgresChangesOptions("public", "products", ListenType.Inserts, "quantity=gt.10"));
+channel.AddPostgresChangeHandler(ListenType.Inserts, (sender, change) =>
+{
+ Console.WriteLine(change.Payload);
+});
+
+await channel.Subscribe();
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -1950,6 +2180,23 @@ changes = supabase.channel('db-changes').on_postgres_changes(
.subscribe()
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+var channel = supabase.Realtime.Channel("changes");
+
+channel.Register(new PostgresChangesOptions("public", "products", ListenType.Inserts, "quantity=gte.10"));
+channel.AddPostgresChangeHandler(ListenType.Inserts, (sender, change) =>
+{
+ Console.WriteLine(change.Payload);
+});
+
+await channel.Subscribe();
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -2096,6 +2343,23 @@ changes = supabase.channel('db-changes').on_postgres_changes(
.subscribe()
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+var channel = supabase.Realtime.Channel("changes");
+
+channel.Register(new PostgresChangesOptions("public", "colors", ListenType.Inserts, "name=in.(red,blue,yellow)"));
+channel.AddPostgresChangeHandler(ListenType.Inserts, (sender, change) =>
+{
+ Console.WriteLine(change.Payload);
+});
+
+await channel.Subscribe();
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -2243,6 +2507,23 @@ changes = supabase.channel('db-changes').on_postgres_changes(
.subscribe()
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+var channel = supabase.Realtime.Channel("changes");
+
+channel.Register(new PostgresChangesOptions("public", "articles", ListenType.Inserts, "title=ilike.%breaking%"));
+channel.AddPostgresChangeHandler(ListenType.Inserts, (sender, change) =>
+{
+ Console.WriteLine(change.Payload);
+});
+
+await channel.Subscribe();
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -2390,6 +2671,23 @@ changes = supabase.channel('db-changes').on_postgres_changes(
.subscribe()
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+var channel = supabase.Realtime.Channel("changes");
+
+channel.Register(new PostgresChangesOptions("public", "posts", ListenType.Inserts, @"slug=match.^post-\d+$"));
+channel.AddPostgresChangeHandler(ListenType.Inserts, (sender, change) =>
+{
+ Console.WriteLine(change.Payload);
+});
+
+await channel.Subscribe();
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -2537,6 +2835,23 @@ changes = supabase.channel('db-changes').on_postgres_changes(
.subscribe()
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+var channel = supabase.Realtime.Channel("changes");
+
+channel.Register(new PostgresChangesOptions("public", "todos", ListenType.Updates, "completed_at=is.null"));
+channel.AddPostgresChangeHandler(ListenType.Updates, (sender, change) =>
+{
+ Console.WriteLine(change.Payload);
+});
+
+await channel.Subscribe();
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -2684,6 +2999,23 @@ changes = supabase.channel('db-changes').on_postgres_changes(
.subscribe()
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+var channel = supabase.Realtime.Channel("changes");
+
+channel.Register(new PostgresChangesOptions("public", "orders", ListenType.Updates, "status=isdistinct.shipped"));
+channel.AddPostgresChangeHandler(ListenType.Updates, (sender, change) =>
+{
+ Console.WriteLine(change.Payload);
+});
+
+await channel.Subscribe();
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -2830,6 +3162,23 @@ changes = supabase.channel('db-changes').on_postgres_changes(
.subscribe()
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+var channel = supabase.Realtime.Channel("changes");
+
+channel.Register(new PostgresChangesOptions("public", "posts", ListenType.All, "status=not.in.(draft,archived)"));
+channel.AddPostgresChangeHandler(ListenType.All, (sender, change) =>
+{
+ Console.WriteLine(change.Payload);
+});
+
+await channel.Subscribe();
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -2987,6 +3336,23 @@ changes = supabase.channel('db-changes').on_postgres_changes(
.subscribe()
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+var channel = supabase.Realtime.Channel("changes");
+
+channel.Register(new PostgresChangesOptions("public", "orders", ListenType.Inserts, "amount=gt.100,status=eq.open"));
+channel.AddPostgresChangeHandler(ListenType.Inserts, (sender, change) =>
+{
+ Console.WriteLine(change.Payload);
+});
+
+await channel.Subscribe();
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -3233,6 +3599,26 @@ changes = supabase.channel('db-changes').on_postgres_changes(
.subscribe()
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+// Set your custom JWT after instantiating the client and before subscribing to a channel
+supabase.Realtime.SetAuth("your-custom-jwt");
+
+var channel = supabase.Realtime.Channel("db-changes");
+
+channel.Register(new PostgresChangesOptions("public", "messages", ListenType.All, "body=eq.bye"));
+channel.AddPostgresChangeHandler(ListenType.All, (sender, change) =>
+{
+ Console.WriteLine(change.Payload);
+});
+
+await channel.Subscribe();
+```
+
</TabPanel>
</$Show>
</Tabs>
diff --git a/apps/docs/content/guides/realtime/presence.mdx b/apps/docs/content/guides/realtime/presence.mdx
index 2cecc485a81..db10f3f9089 100644
--- a/apps/docs/content/guides/realtime/presence.mdx
+++ b/apps/docs/content/guides/realtime/presence.mdx
@@ -125,6 +125,19 @@ SUPABASE_KEY = '<sb_publishable_... key>'
supabase = create_client(SUPABASE_URL, SUPABASE_KEY)
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+var supabase = new Supabase.Client(
+ "https://<project>.supabase.co",
+ "<sb_publishable_... key>"
+);
+await supabase.InitializeAsync();
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -239,6 +252,36 @@ room_one
.subscribe()
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+Listen to the `Sync`, `Join`, and `Leave` events triggered whenever any client joins or leaves the channel or changes their slice of state:
+
+```c#
+class UserStatus : BasePresence
+{
+ [JsonProperty("user")]
+ public string User { get; set; }
+
+ [JsonProperty("online_at")]
+ public string OnlineAt { get; set; }
+}
+
+var roomOne = supabase.Realtime.Channel("room_01");
+var presence = roomOne.Register<UserStatus>(Guid.NewGuid().ToString());
+
+presence.AddPresenceEventHandler(EventType.Sync, (sender, type) =>
+{
+ Console.WriteLine($"sync: {presence.CurrentState}");
+});
+presence.AddPresenceEventHandler(EventType.Join, (sender, type) => Console.WriteLine("join"));
+presence.AddPresenceEventHandler(EventType.Leave, (sender, type) => Console.WriteLine("leave"));
+
+await roomOne.Subscribe();
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -364,6 +407,24 @@ def on_subscribe(status, err):
room_one.subscribe(on_subscribe)
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+var roomOne = supabase.Realtime.Channel("room_01");
+var presence = roomOne.Register<UserStatus>(Guid.NewGuid().ToString());
+
+await roomOne.Subscribe();
+
+await presence.Track(new UserStatus
+{
+ User = "user-1",
+ OnlineAt = DateTime.UtcNow.ToString("o")
+});
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -444,6 +505,15 @@ untrackPresence()
room_one.untrack()
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+await presence.Untrack();
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -529,6 +599,16 @@ channel_c = supabase.channel('test', {
})
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+var channelC = supabase.Realtime.Channel("test");
+var presence = channelC.Register<UserStatus>("userId-123");
+```
+
</TabPanel>
</$Show>
</Tabs>
diff --git a/apps/docs/content/guides/storage/buckets/creating-buckets.mdx b/apps/docs/content/guides/storage/buckets/creating-buckets.mdx
index 987e24c8598..ea2623bbeff 100644
--- a/apps/docs/content/guides/storage/buckets/creating-buckets.mdx
+++ b/apps/docs/content/guides/storage/buckets/creating-buckets.mdx
@@ -95,6 +95,17 @@ supabase.storage.create_bucket(
[Reference.](/docs/reference/python/storage-createbucket)
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+var bucket = await supabase.Storage.CreateBucket("avatars", new BucketUpsertOptions { Public = true });
+```
+
+[Reference.](/docs/reference/csharp/create-bucket)
+
</TabPanel>
</$Show>
</Tabs>
diff --git a/apps/docs/content/guides/storage/cdn/purge-cdn-cache.mdx b/apps/docs/content/guides/storage/cdn/purge-cdn-cache.mdx
index 81627a48985..afc5fac930c 100644
--- a/apps/docs/content/guides/storage/cdn/purge-cdn-cache.mdx
+++ b/apps/docs/content/guides/storage/cdn/purge-cdn-cache.mdx
@@ -56,6 +56,17 @@ async function purgeCachedObject() {
```
</TabPanel>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+var response = await supabase.Storage
+ .From("bucket_name")
+ .PurgeCache("folder_name/file_name.png");
+```
+
+</TabPanel>
+</$Show>
<TabPanel id="curl" label="cURL">
```bash
@@ -101,6 +112,15 @@ async function purgeBucketCache() {
```
</TabPanel>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+var response = await supabase.Storage.PurgeBucketCache("bucket_name");
+```
+
+</TabPanel>
+</$Show>
<TabPanel id="curl" label="cURL">
```bash
diff --git a/apps/docs/content/guides/storage/debugging/error-codes.mdx b/apps/docs/content/guides/storage/debugging/error-codes.mdx
index 089f20b8fff..0b7bb363137 100644
--- a/apps/docs/content/guides/storage/debugging/error-codes.mdx
+++ b/apps/docs/content/guides/storage/debugging/error-codes.mdx
@@ -48,6 +48,25 @@ except Exception as error:
# The SDK now handles bad responses from the server gracefully
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+try
+{
+ var bytes = await supabase.Storage.From("avatars").Download("avatar.png");
+}
+catch (SupabaseStorageException error)
+{
+ // Access error details
+ Console.WriteLine($"Error message: {error.Message}");
+ Console.WriteLine($"HTTP status: {error.StatusCode}");
+ Console.WriteLine($"Reason: {error.Reason}");
+}
+```
+
</TabPanel>
</$Show>
</Tabs>
diff --git a/apps/docs/content/guides/storage/quickstart.mdx b/apps/docs/content/guides/storage/quickstart.mdx
index 18175bee714..7e3664283d1 100644
--- a/apps/docs/content/guides/storage/quickstart.mdx
+++ b/apps/docs/content/guides/storage/quickstart.mdx
@@ -109,6 +109,17 @@ response = supabase.storage.create_bucket('avatars')
[Reference.](/docs/reference/python/storage-createbucket)
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+var bucket = await supabase.Storage.CreateBucket("avatars");
+```
+
+[Reference.](/docs/reference/csharp/create-bucket)
+
</TabPanel>
</$Show>
</Tabs>
@@ -163,6 +174,21 @@ void main() async {
[Reference.](https://pub.dev/documentation/storage_client/latest/storage_client/SupabaseStorageClient/createBucket.html)
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+var imagePath = Path.Combine("Assets", "avatar1.png");
+
+await supabase.Storage
+ .From("avatars")
+ .Upload(imagePath, "public/avatar1.png");
+```
+
+[Reference.](/docs/reference/csharp/from-upload)
+
</TabPanel>
</$Show>
</Tabs>
@@ -235,6 +261,17 @@ response = supabase.storage.from_('avatars').download('public/avatar1.png')
[Reference.](/docs/reference/python/storage-from-download)
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+var bytes = await supabase.Storage.From("avatars").Download("public/avatar1.png");
+```
+
+[Reference.](/docs/reference/csharp/from-download)
+
</TabPanel>
</$Show>
</Tabs>
diff --git a/apps/docs/content/guides/storage/serving/image-transformations.mdx b/apps/docs/content/guides/storage/serving/image-transformations.mdx
index 549a9e663eb..59362f6d45f 100644
--- a/apps/docs/content/guides/storage/serving/image-transformations.mdx
+++ b/apps/docs/content/guides/storage/serving/image-transformations.mdx
@@ -107,6 +107,19 @@ url = supabase.storage.from_('avatars').get_public_url(
)
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+var url = supabase.Storage.From("bucket").GetPublicUrl("image.jpg", new TransformOptions
+{
+ Width = 500,
+ Height = 600
+});
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -187,6 +200,19 @@ val url = supabase.storage.from("bucket").createSignedUrl("image.jpg", 60.second
}
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+var url = await supabase.Storage.From("bucket").CreateSignedUrl("image.jpg", 60000, new TransformOptions
+{
+ Width = 200,
+ Height = 200
+});
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -286,6 +312,19 @@ response = supabase.storage.from_('bucket').download(
)
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+var data = await supabase.Storage.From("bucket").Download("image.jpg", new TransformOptions
+{
+ Width = 800,
+ Height = 300
+});
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -403,6 +442,20 @@ response = supabase.storage.from_('bucket').download(
)
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+var data = await supabase.Storage.From("bucket").Download("image.jpeg", new TransformOptions
+{
+ Width = 200,
+ Height = 200,
+ Format = "origin"
+});
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -539,6 +592,18 @@ response = supabase.storage.from_('bucket').download(
)
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+var data = await supabase.Storage.From("bucket").Download("image.jpg", new TransformOptions
+{
+ Quality = 50
+});
+```
+
</TabPanel>
</$Show>
</Tabs>
@@ -658,6 +723,20 @@ response = supabase.storage.from_('bucket').download(
)
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+var data = await supabase.Storage.From("bucket").Download("image.jpg", new TransformOptions
+{
+ Width = 800,
+ Height = 300,
+ Resize = TransformOptions.ResizeType.Contain // Cover | Fill
+});
+```
+
</TabPanel>
</$Show>
</Tabs>
diff --git a/apps/docs/content/guides/storage/uploads/resumable-uploads.mdx b/apps/docs/content/guides/storage/uploads/resumable-uploads.mdx
index 1cb5ba06123..5e1a20c8342 100644
--- a/apps/docs/content/guides/storage/uploads/resumable-uploads.mdx
+++ b/apps/docs/content/guides/storage/uploads/resumable-uploads.mdx
@@ -281,6 +281,20 @@ Instead of `https://project-id.supabase.co` use `https://project-id.storage.supa
</TabPanel>
</$Show>
+
+<$Show if="sdk:csharp">
+
+ <TabPanel id="csharp" label="C#">
+
+ C# supports resumable uploads natively via `UploadOrResume`:
+
+ ```c#
+ await supabase.Storage.From("bucket_name")
+ .UploadOrResume("local_file_path", "file_path", new FileOptions { Upsert = true });
+ ```
+
+ </TabPanel>
+ </$Show>
</Tabs>
## Upload URL
@@ -346,6 +360,19 @@ response = supabase.storage.from_('bucket_name').create_signed_upload_url(
# Include response.token in the x-signature header
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+// Create a signed upload URL
+var signedUrl = await supabase.Storage.From("bucket_name").CreateUploadSignedUrl("file_path");
+
+// Use the signed URL token in resumable upload headers
+// Include signedUrl.Token in the x-signature header
+```
+
</TabPanel>
</$Show>
</Tabs>
diff --git a/apps/docs/content/guides/storage/uploads/standard-uploads.mdx b/apps/docs/content/guides/storage/uploads/standard-uploads.mdx
index d5204d21eca..6bc8bd56a8d 100644
--- a/apps/docs/content/guides/storage/uploads/standard-uploads.mdx
+++ b/apps/docs/content/guides/storage/uploads/standard-uploads.mdx
@@ -93,6 +93,15 @@ supabase.storage.from("bucket_name").upload("file_path", file)
response = supabase.storage.from_('bucket_name').upload('file_path', file)
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+await supabase.Storage.From("bucket_name").Upload("local_file_path", "file_path");
+```
+
</TabPanel>
</$Show>
<TabPanel id="curl" label="cURL">
@@ -190,6 +199,17 @@ response = supabase.storage.from_('bucket_name').upload('file_path', file, {
})
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+await supabase.Storage
+ .From("bucket_name")
+ .Upload("local_file_path", "file_path", new FileOptions { Upsert = true });
+```
+
</TabPanel>
</$Show>
<TabPanel id="curl" label="cURL">
@@ -290,6 +310,21 @@ response = supabase.storage.from_('bucket_name').upload('file_path', file, {
})
```
+</TabPanel>
+</$Show>
+<$Show if="sdk:csharp">
+<TabPanel id="csharp" label="C#">
+
+```c#
+await supabase.Storage
+ .From("bucket_name")
+ .Upload(
+ "local_file_path",
+ "file_path",
+ new FileOptions { ContentType = "image/jpeg" },
+ inferContentType: false);
+```
+
</TabPanel>
</$Show>
<TabPanel id="curl" label="cURL">