Skip to content

docs(expo): update useSSO reference for core-3 and redirect URL requirements#3234

Open
chriscanin wants to merge 8 commits intomainfrom
chris/fix-expo-sso-core3
Open

docs(expo): update useSSO reference for core-3 and redirect URL requirements#3234
chriscanin wants to merge 8 commits intomainfrom
chris/fix-expo-sso-core3

Conversation

@chriscanin
Copy link
Copy Markdown
Member

Summary

Updates the useSSO() hook reference to reflect the core-3 migration in clerk/javascript#8140:

  • Updated return type (simplified — no more setActive, signIn, signUp)
  • Added authSessionOptions parameter documentation
  • Added redirect URL configuration section (required for SSO to work)
  • Added basic usage example showing the simplified API
  • Added guidance for both dev builds and Expo Go redirect URLs

Related

🤖 Generated with Claude Code

@chriscanin chriscanin requested a review from a team as a code owner March 20, 2026 16:01
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 20, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
clerk-docs Ready Ready Preview Mar 26, 2026 6:05pm

Request Review

@chriscanin
Copy link
Copy Markdown
Member Author

This docs PR relies on a JS change, status has been set to do not merge so that merge can be completed once JS has been merged in:
clerk/javascript#8140

Comment thread docs/reference/expo/native-hooks/use-sso.mdx Outdated
Comment on lines +9 to +10
> [!IMPORTANT]
> The redirect URL used by `useSSO()` must be registered in the Clerk Dashboard under **Redirect URLs**. If not registered, the OAuth flow will complete but the session will not be created. See [Redirect URL configuration](#redirect-url-configuration) for details.
Copy link
Copy Markdown
Member

@alexisintech alexisintech Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can remove this callout and instead put the link in the description of the redirectUrl prop, see the comment there!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed!

Comment thread docs/reference/expo/native-hooks/use-sso.mdx Outdated
Comment thread docs/reference/expo/native-hooks/use-sso.mdx Outdated
})
```

Then register `myapp://sso-callback` in the Dashboard. This works in both Expo Go and development builds.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Then register `myapp://sso-callback` in the Dashboard. This works in both Expo Go and development builds.
Then register `myapp://sso-callback` in the Clerk Dashboard. This works in both Expo Go and development builds.

Copy link
Copy Markdown
Member

@alexisintech alexisintech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here's a quick high level review after reading through it once.

that last section may need some reworking! we can hop on a call so you can explain it to me a little more - and we can loop @SarahSoutoul in as well so she can hear about it too! and we can all work on it together :)

@chriscanin
Copy link
Copy Markdown
Member Author

Thank you for the review @alexisintech , I will get this updated today and then maybe @SarahSoutoul can give it a readthrough as well for a final check.


- `setActive?`
- `(params: SetActiveParams) => Promise<void>`
## Redirect URL configuration
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chriscanin @alexisintech For this last section, here are my thoughts:

  • The section is technically correct, but the current structure is a bit confusing because it presents "development builds" and "Expo Go" as separate setups, when in practice we want users to follow a single consistent approach. Specifically, because the Expo Go solution actually works in both environment and seems to be the most reliable approach.
  • My suggested improvement is to restructure this section around one recommended setup (custom scheme + explicit redirectUrl). Sth like: here is the recommended setup and works everywhere (the primary path essentially) and then you can explain why this is needed especially for Expo Go (dynamic exp://)

I'm not sure if this is what you were referring to @alexisintech when you talked about restructuring this, but if we agree with this approach, I've got the changes locally that I could push as docs review.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what I'm thinking

Screenshot 2026-03-24 at 10 33 41 am

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah that looks awesome!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay great. @chriscanin how do you feel about this layout?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pushed here: docs review.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Layout looks good here!

@SarahSoutoul
Copy link
Copy Markdown
Contributor

here's a quick high level review after reading through it once.

that last section may need some reworking! we can hop on a call so you can explain it to me a little more - and we can loop @SarahSoutoul in as well so she can hear about it too! and we can all work on it together :)

See comment here on reworking last section.

This is looking good! I think there is a user that will benefit from these changes, I will make sure to connect with them and point this out (I think they are having an issue with useSSO and expo go).

Co-authored-by: Alexis Aguilar <98043211+alexisintech@users.noreply.github.com>
This did not get pushed through, doing so now.

Co-authored-by: Alexis Aguilar <98043211+alexisintech@users.noreply.github.com>
@alexisintech
Copy link
Copy Markdown
Member

looking at fix(expo): migrate useSSO to core-3 and fix browser dismissal for OAuth/SSO flows

  1. the description says that users no longer need to call setActive()
  2. also the "After (app code)" example removes the redirectUrl usage too - is that to show that it will automatically set the redirectUrl to redirect to the sso-callback route?

@chriscanin
Copy link
Copy Markdown
Member Author

  1. Correct. The hook now calls clerk.setActive() internally after the OAuth callback completes. The caller just awaits startSSOFlow() and the session is active when it resolves.

  2. Yes. If redirectUrl is not passed, the hook generates one automatically via AuthSession.makeRedirectUri({ path: 'sso-callback' }). The user can still pass a custom redirectUrl if they need to override it (e.g. to use a specific scheme for dev builds). The "After" example omits it to show the minimal usage.

@alexisintech
Copy link
Copy Markdown
Member

@chriscanin I've updated the existing examples to follow these new requirements, and updated the redirect URL configuration section to fully clarify why certain steps need to be done

Copy link
Copy Markdown
Member Author

@chriscanin chriscanin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good @alexisintech

for the response to the comment you had left:

Yes, the stable redirect URL using the scheme would be myapp://sso-callback (where myapp is whatever the user has set as their scheme in app.json). That's what they'd register in the Clerk Dashboard under Redirect URLs.

This works in both Expo Go and dev builds because ASWebAuthenticationSession intercepts the custom scheme regardless of whether it's registered in Info.plist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants