Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
185 changes: 155 additions & 30 deletions docs/migration/rownd/sdk-integration-guide.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,7 @@

<NodePackageManagerCard>

<NodePackageManagerCard.Content value="npm7+">

```bash
npm install supertokens-node @supertokens-plugins/rownd-nodejs
```

</NodePackageManagerCard.Content>

<NodePackageManagerCard.Content value="npm6">
<NodePackageManagerCard.Content value="npm">

```bash
npm install supertokens-node @supertokens-plugins/rownd-nodejs
Expand Down Expand Up @@ -160,7 +152,15 @@
thirdPartyId: "apple",
clients: [
{
clientId: process.env.APPLE_CLIENT_ID!,
// Browser/Hub Apple login uses the Apple Services ID.
clientType: "web",
clientId: process.env.APPLE_WEB_CLIENT_ID!,
clientSecret: process.env.APPLE_CLIENT_SECRET!,
},
{
// Native iOS Apple login returns authorization codes for the app bundle ID.
clientType: "ios",
clientId: process.env.APPLE_IOS_BUNDLE_ID!,
clientSecret: process.env.APPLE_CLIENT_SECRET!,
},
],
Expand Down Expand Up @@ -188,7 +188,13 @@
{ method: "email" },
{ method: "phone" },
{ method: "google", clientId: process.env.GOOGLE_CLIENT_ID },
{ method: "apple", clientId: process.env.APPLE_CLIENT_ID },
{
method: "apple",
clientId: process.env.APPLE_WEB_CLIENT_ID,
// These map Rownd platforms to the SuperTokens Apple clients above.
webClientType: "web",
iosClientType: "ios",
},
{ method: "anonymous", type: "guest", displayName: "Continue as guest" },
],
profile: {
Expand Down Expand Up @@ -375,6 +381,25 @@
)
],
)
),
ProviderInput(
config=ProviderConfig(
third_party_id="apple",
clients=[
# Browser/Hub Apple login uses the Apple Services ID.
ProviderClientConfig(
client_type="web",
client_id="<APPLE_WEB_CLIENT_ID>",
client_secret="<APPLE_CLIENT_SECRET>",
),
# Native iOS Apple login returns authorization codes for the app bundle ID.
ProviderClientConfig(
client_type="ios",
client_id="<APPLE_IOS_BUNDLE_ID>",
client_secret="<APPLE_CLIENT_SECRET>",
),
],
)
)
]
)
Expand Down Expand Up @@ -402,7 +427,13 @@
{"method": "email"},
{"method": "phone"},
{"method": "google", "clientId": "<GOOGLE_CLIENT_ID>"},
{"method": "apple", "clientId": "<APPLE_CLIENT_ID>"},
{
"method": "apple",
"clientId": "<APPLE_WEB_CLIENT_ID>",
# These map Rownd platforms to the SuperTokens Apple clients above.
"webClientType": "web",
"iosClientType": "ios",
},
{"method": "anonymous", "type": "guest", "displayName": "Continue as guest"},
],
},
Expand Down Expand Up @@ -471,6 +502,116 @@

</BackendTabs>

#### 1.5 Configure Apple login for iOS {{optional}}

Check warning on line 505 in docs/migration/rownd/sdk-integration-guide.mdx

View workflow job for this annotation

GitHub Actions / vale-lint

[vale] reported by reviewdog 🐶 [SuperTokens.headings] '1.5 Configure Apple login for iOS ************' should use sentence-style capitalization. Raw Output: {"message": "[SuperTokens.headings] '1.5 Configure Apple login for iOS ************' should use sentence-style capitalization.", "location": {"path": "docs/migration/rownd/sdk-integration-guide.mdx", "range": {"start": {"line": 505, "column": 1}}}, "severity": "WARNING"}

If your iOS app uses native Sign in with Apple, configure Apple as multiple SuperTokens clients.
Browser and Hub Apple login use the Apple Services ID, but native iOS Apple login returns authorization codes for your app bundle ID.
The iOS bundle ID must therefore be configured as a separate Apple client in the SuperTokens backend SDK.

Check warning on line 509 in docs/migration/rownd/sdk-integration-guide.mdx

View workflow job for this annotation

GitHub Actions / vale-lint

[vale] reported by reviewdog 🐶 [SuperTokens.passive] 'be configured' looks like passive voice. Raw Output: {"message": "[SuperTokens.passive] 'be configured' looks like passive voice.", "location": {"path": "docs/migration/rownd/sdk-integration-guide.mdx", "range": {"start": {"line": 509, "column": 34}}}, "severity": "INFO"}

The Rownd plugin maps the Apple sign-in method to those SuperTokens client types. The plugin setting is `iosClientType`, which becomes `ios_client_type` in the Rownd app config. The iOS SDK reads that value and sends it as `clientType` when it exchanges the Apple authorization code with `/signinup`.

Check warning on line 511 in docs/migration/rownd/sdk-integration-guide.mdx

View workflow job for this annotation

GitHub Actions / vale-lint

[vale] reported by reviewdog 🐶 [SuperTokens.words] Use 'configuration' instead of 'config'. Raw Output: {"message": "[SuperTokens.words] Use 'configuration' instead of 'config'.", "location": {"path": "docs/migration/rownd/sdk-integration-guide.mdx", "range": {"start": {"line": 511, "column": 171}}}, "severity": "WARNING"}

Check failure on line 511 in docs/migration/rownd/sdk-integration-guide.mdx

View workflow job for this annotation

GitHub Actions / vale-lint

[vale] reported by reviewdog 🐶 [SuperTokens.spelling] This word is not recognized: 'Rownd' Raw Output: {"message": "[SuperTokens.spelling] This word is not recognized: 'Rownd'", "location": {"path": "docs/migration/rownd/sdk-integration-guide.mdx", "range": {"start": {"line": 511, "column": 161}}}, "severity": "ERROR"}

Check failure on line 511 in docs/migration/rownd/sdk-integration-guide.mdx

View workflow job for this annotation

GitHub Actions / vale-lint

[vale] reported by reviewdog 🐶 [SuperTokens.spelling] This word is not recognized: 'Rownd' Raw Output: {"message": "[SuperTokens.spelling] This word is not recognized: 'Rownd'", "location": {"path": "docs/migration/rownd/sdk-integration-guide.mdx", "range": {"start": {"line": 511, "column": 5}}}, "severity": "ERROR"}

<BackendTabs exclude={["go"]}>

<BackendTabs.TabItem value="nodejs">

```ts
ThirdParty.init({
signInAndUpFeature: {
providers: [
{
config: {
thirdPartyId: "apple",
clients: [
{
// Browser/Hub Apple login uses the Apple Services ID.
clientType: "web",
clientId: process.env.APPLE_WEB_CLIENT_ID!,
clientSecret: process.env.APPLE_CLIENT_SECRET!,
},
{
// Native iOS Apple login returns authorization codes for the app bundle ID.
clientType: "ios",
clientId: process.env.APPLE_IOS_BUNDLE_ID!,
clientSecret: process.env.APPLE_CLIENT_SECRET!,
},
],
},
},
],
},
});

RowndMigrationPlugin.init({
rowndAppKey: process.env.ROWND_APP_KEY!,
rowndAppSecret: process.env.ROWND_APP_SECRET!,
appConfig: {
signInMethods: [
{
method: "apple",
clientId: process.env.APPLE_WEB_CLIENT_ID,
// These map Rownd platforms to the SuperTokens Apple clients above.
webClientType: "web",
iosClientType: "ios",
},
],
},
});
```

</BackendTabs.TabItem>

<BackendTabs.TabItem value="python">

```python
thirdparty.init(
sign_in_and_up_feature=thirdparty.SignInAndUpFeature(
providers=[
ProviderInput(
config=ProviderConfig(
third_party_id="apple",
clients=[
# Browser/Hub Apple login uses the Apple Services ID.
ProviderClientConfig(
client_type="web",
client_id="<APPLE_WEB_CLIENT_ID>",
client_secret="<APPLE_CLIENT_SECRET>",
),
# Native iOS Apple login returns authorization codes for the app bundle ID.
ProviderClientConfig(
client_type="ios",
client_id="<APPLE_IOS_BUNDLE_ID>",
client_secret="<APPLE_CLIENT_SECRET>",
),
],
)
)
]
)
)

RowndPluginConfig(
rownd_app_key="<ROWND_APP_KEY>",
rownd_app_secret="<ROWND_APP_SECRET>",
app_config={
"signInMethods": [
{
"method": "apple",
"clientId": "<APPLE_WEB_CLIENT_ID>",
# These map Rownd platforms to the SuperTokens Apple clients above.
"webClientType": "web",
"iosClientType": "ios",
}
],
},
)
```

</BackendTabs.TabItem>

</BackendTabs>

If Android uses a separate Apple client, add another SuperTokens Apple client with `clientType: "android"` and set `androidClientType: "android"` on the Rownd Apple sign-in method.

Check failure on line 613 in docs/migration/rownd/sdk-integration-guide.mdx

View workflow job for this annotation

GitHub Actions / vale-lint

[vale] reported by reviewdog 🐶 [SuperTokens.spelling] This word is not recognized: 'Rownd' Raw Output: {"message": "[SuperTokens.spelling] This word is not recognized: 'Rownd'", "location": {"path": "docs/migration/rownd/sdk-integration-guide.mdx", "range": {"start": {"line": 613, "column": 154}}}, "severity": "ERROR"}

### 2. Configure the frontend SDK

After the backend plugin is deployed and reachable, configure each client application to use the SuperTokens Rownd-compatible Hub.
Expand All @@ -490,15 +631,7 @@

<NodePackageManagerCard>

<NodePackageManagerCard.Content value="npm7+">

```bash
npm install @supertokens/rownd-react
```

</NodePackageManagerCard.Content>

<NodePackageManagerCard.Content value="npm6">
<NodePackageManagerCard.Content value="npm">

```bash
npm install @supertokens/rownd-react
Expand Down Expand Up @@ -853,15 +986,7 @@

<NodePackageManagerCard>

<NodePackageManagerCard.Content value="npm7+">

```bash
npm install @supertokens/rownd-react-native
```

</NodePackageManagerCard.Content>

<NodePackageManagerCard.Content value="npm6">
<NodePackageManagerCard.Content value="npm">

```bash
npm install @supertokens/rownd-react-native
Expand Down
21 changes: 3 additions & 18 deletions docs/quickstart/frontend-setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,11 @@ Run the following command in your terminal to install the package.
<FrontendPrebuiltUITabs>
<FrontendPrebuiltUITabs.TabItem value="reactjs">
<NodePackageManagerCard>
<NodePackageManagerCard.Content value="npm7+">
<NodePackageManagerCard.Content value="npm">
```bash
npm i -s supertokens-auth-react
```
</NodePackageManagerCard.Content>
<NodePackageManagerCard.Content value="npm6">
```bash
npm i -s supertokens-auth-react supertokens-web-js
```
</NodePackageManagerCard.Content>
<NodePackageManagerCard.Content value="yarn">
```bash
yarn add supertokens-auth-react supertokens-web-js
Expand All @@ -82,12 +77,7 @@ Run the following command in your terminal to install the package.
</FrontendPrebuiltUITabs.TabItem>
<FrontendPrebuiltUITabs.TabItem value="angular">
<NodePackageManagerCard>
<NodePackageManagerCard.Content value="npm7+">
```bash
npm i -s supertokens-web-js
```
</NodePackageManagerCard.Content>
<NodePackageManagerCard.Content value="npm6">
<NodePackageManagerCard.Content value="npm">
```bash
npm i -s supertokens-web-js
```
Expand All @@ -111,12 +101,7 @@ Run the following command in your terminal to install the package.
</FrontendPrebuiltUITabs.TabItem>
<FrontendPrebuiltUITabs.TabItem value="vue">
<NodePackageManagerCard>
<NodePackageManagerCard.Content value="npm7+">
```bash
npm i -s supertokens-web-js
```
</NodePackageManagerCard.Content>
<NodePackageManagerCard.Content value="npm6">
<NodePackageManagerCard.Content value="npm">
```bash
npm i -s supertokens-web-js
```
Expand Down
5 changes: 2 additions & 3 deletions src/components/Select/NodePackageManagerSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Select } from "@radix-ui/themes";
import { useSelectionStore } from "@site/src/hooks";

const NodePackageManagerSelectioName = "node-package-manager";
const NodePackageManagerDefaultValue = "npm7+";
const NodePackageManagerDefaultValue = "npm";

export function useNodePackageManagerSelection() {
return useSelectionStore(NodePackageManagerSelectioName, NodePackageManagerDefaultValue);
Expand All @@ -15,8 +15,7 @@ export function NodePackageManagerSelect() {
<Select.Root value={value} onValueChange={setValue}>
<Select.Trigger />
<Select.Content>
<Select.Item value="npm7+">{`NPM>=7`}</Select.Item>
<Select.Item value="npm6">{`NPM6`}</Select.Item>
<Select.Item value="npm">npm</Select.Item>
<Select.Item value="yarn">yarn</Select.Item>
<Select.Item value="pnpm">pnpm</Select.Item>
<Select.Item value="bun">bun</Select.Item>
Expand Down
Loading