Skip to content

Commit d1ea808

Browse files
fadymakChrisChinchillagithub-actions[bot]
authored
feat(docs): update X / Twitter docs for OAuth 2.0 (supabase#41396)
* feat(docs): update X / Twitter docs for OAuth 2.0 * Update apps/docs/content/guides/auth/social-login/auth-twitter.mdx Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update apps/docs/content/guides/auth/social-login/auth-twitter.mdx Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Heading lint * Update apps/docs/content/guides/auth/social-login/auth-twitter.mdx Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * prettier * Prettier again * chore: cleanup dead link and deprecation warning * chore: lint for admnition --------- Co-authored-by: Chris Chinchilla <chris.ward@supabase.io> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent cf41629 commit d1ea808

File tree

3 files changed

+36
-30
lines changed

3 files changed

+36
-30
lines changed

apps/docs/content/_partials/social_provider_setup.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ The next step requires a callback URL, which looks like this: `https://<project-
77

88
<Admonition type="note">
99

10-
For testing OAuth locally with the Supabase CLI see the [local development docs](/docs/guides/cli/local-development#use-auth-locally).
10+
For testing OAuth locally with the Supabase CLI see the [local development docs](/docs/guides/local-development).
1111

1212
</Admonition>

apps/docs/content/guides/auth/social-login/auth-twitter.mdx

Lines changed: 34 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,36 @@
11
---
22
id: 'auth-twitter'
3-
title: 'Login with Twitter'
4-
description: 'Add Twitter OAuth to your Supabase project'
3+
title: 'Login with X / Twitter'
4+
description: 'Add X / Twitter OAuth to your Supabase project'
55
---
66

7-
To enable Twitter Auth for your project, you need to set up a Twitter OAuth application and add the application credentials in the Supabase Dashboard.
7+
To enable X / Twitter Auth for your project, you need to set up an X OAuth 2.0 application and add the application credentials in the Supabase Dashboard.
88

99
## Overview
1010

11-
Setting up Twitter logins for your application consists of 3 parts:
11+
<Admonition type="caution">
1212

13-
- Create and configure a Twitter Project and App on the [Twitter Developer Dashboard](https://developer.twitter.com/en/portal/dashboard).
14-
- Add your Twitter `API Key` and `API Secret Key` to your [Supabase Project](/dashboard).
13+
We recommend using the **X / Twitter (OAuth 2.0)** provider. The legacy **Twitter (OAuth 1.0a)**
14+
provider will be deprecated in future releases.
15+
16+
</Admonition>
17+
18+
Setting up X / Twitter logins for your application consists of 3 parts:
19+
20+
- Create and configure an X Project and App on the [X Developer Dashboard](https://developer.x.com/en/portal/dashboard).
21+
- Add your X `API Key` and `API Secret Key` to your [Supabase Project](/dashboard).
1522
- Add the login code to your [Supabase JS Client App](https://github.com/supabase/supabase-js).
1623

17-
## Access your Twitter Developer account
24+
## Access your X developer account
1825

19-
- Go to [developer.twitter.com](https://developer.twitter.com).
26+
- Go to [developer.x.com](https://developer.x.com).
2027
- Click on `Sign in` at the top right to log in.
2128

22-
![Twitter Developer Portal.](/docs/img/guides/auth-twitter/twitter-portal.png)
23-
2429
## Find your callback URL
2530

26-
<$Partial path="social_provider_setup.mdx" variables={{ "provider": "Twitter" }} />
31+
<$Partial path="social_provider_setup.mdx" variables={{ "provider": "X / Twitter (OAuth 2.0)" }} />
2732

28-
## Create a Twitter OAuth app
33+
## Create an X OAuth app
2934

3035
- Click `+ Create Project`.
3136
- Enter your project name, click `Next`.
@@ -46,25 +51,25 @@ Setting up Twitter logins for your application consists of 3 parts:
4651
- Enter your `Privacy policy URL`.
4752
- Click `Save`.
4853

49-
## Enter your Twitter credentials into your Supabase project
54+
## Enter your X credentials into your Supabase project
5055

51-
<$Partial path="social_provider_settings_supabase.mdx" variables={{ "provider": "Twitter" }} />
56+
<$Partial path="social_provider_settings_supabase.mdx" variables={{ "provider": "X / Twitter (OAuth 2.0)" }} />
5257

53-
You can also configure the Twitter auth provider using the Management API:
58+
You can also configure the X / Twitter (OAuth 2.0) auth provider using the Management API:
5459

5560
```bash
5661
# Get your access token from https://supabase.com/dashboard/account/tokens
5762
export SUPABASE_ACCESS_TOKEN="your-access-token"
5863
export PROJECT_REF="your-project-ref"
5964

60-
# Configure Twitter auth provider
65+
# Configure X / Twitter (OAuth 2.0) auth provider
6166
curl -X PATCH "https://api.supabase.com/v1/projects/$PROJECT_REF/config/auth" \
6267
-H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN" \
6368
-H "Content-Type: application/json" \
6469
-d '{
65-
"external_twitter_enabled": true,
66-
"external_twitter_client_id": "your-twitter-api-key",
67-
"external_twitter_secret": "your-twitter-api-secret-key"
70+
"external_x_enabled": true,
71+
"external_x_client_id": "your-x-api-key",
72+
"external_x_secret": "your-x-api-secret-key"
6873
}'
6974
```
7075

@@ -81,7 +86,7 @@ curl -X PATCH "https://api.supabase.com/v1/projects/$PROJECT_REF/config/auth" \
8186

8287
<$Partial path="create_client_snippet.mdx" />
8388

84-
When your user signs in, call [`signInWithOAuth()`](/docs/reference/javascript/auth-signinwithoauth) with `twitter` as the `provider`:
89+
When your user signs in, call [`signInWithOAuth()`](/docs/reference/javascript/auth-signinwithoauth) with `x` as the `provider`:
8590

8691
```js
8792
import { createClient } from '@supabase/supabase-js'
@@ -91,22 +96,22 @@ const supabase = createClient(
9196
)
9297

9398
// ---cut---
94-
async function signInWithTwitter() {
99+
async function signInWithX() {
95100
const { data, error } = await supabase.auth.signInWithOAuth({
96-
provider: 'twitter',
101+
provider: 'x',
97102
})
98103
}
99104
```
100105

101106
</TabPanel>
102107
<TabPanel id="flutter" label="Flutter">
103108

104-
When your user signs in, call [`signInWithOAuth()`](/docs/reference/dart/auth-signinwithoauth) with `twitter` as the `provider`:
109+
When your user signs in, call [`signInWithOAuth()`](/docs/reference/dart/auth-signinwithoauth) with `x` as the `provider`:
105110

106111
```dart
107-
Future<void> signInWithTwitter() async {
112+
Future<void> signInWithX() async {
108113
await supabase.auth.signInWithOAuth(
109-
OAuthProvider.twitter,
114+
OAuthProvider.x,
110115
redirectTo: kIsWeb ? null : 'my.scheme://my-host', // Optionally set the redirect link to bring back the user via deeplink.
111116
authScreenLaunchMode:
112117
kIsWeb ? LaunchMode.platformDefault : LaunchMode.externalApplication, // Launch the auth screen in a new webview on mobile.
@@ -118,11 +123,11 @@ Future<void> signInWithTwitter() async {
118123
<$Show if="sdk:kotlin">
119124
<TabPanel id="kotlin" label="Kotlin">
120125

121-
When your user signs in, call [signInWith(Provider)](/docs/reference/kotlin/auth-signinwithoauth) with `Twitter` as the `Provider`:
126+
When your user signs in, call [signInWith(Provider)](/docs/reference/kotlin/auth-signinwithoauth) with `X` as the `Provider`:
122127

123128
```kotlin
124-
suspend fun signInWithTwitter() {
125-
supabase.auth.signInWith(Twitter)
129+
suspend fun signInWithX() {
130+
supabase.auth.signInWith(X)
126131
}
127132
```
128133

@@ -187,4 +192,4 @@ suspend fun signOut() {
187192

188193
- [Supabase - Get started for free](https://supabase.com)
189194
- [Supabase JS Client](https://github.com/supabase/supabase-js)
190-
- [Twitter Developer Dashboard](https://developer.twitter.com/en/portal/dashboard)
195+
- [X Developer Dashboard](https://developer.x.com/en/portal/dashboard)

supa-mdx-lint/Rule001HeadingCase.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ may_uppercase = [
254254
"WorkOS",
255255
"Wrappers",
256256
"Write-Ahead Log(s|ging)?",
257+
"X",
257258
"Zoom",
258259
"Zoom Developers?",
259260
]

0 commit comments

Comments
 (0)