Docs

Deploy an Expo app to production

There are a few caveats to deploying production Expo applications with Clerk. This guide will walk you through the steps to deploy your Expo app to production.

Acquire a domain

Before deploying your Expo app to production, you must acquire a domain. Even though there may not be a web application associated with an Expo app, Clerk still requires a domain for production instances.

Configure your Expo app

With Clerk, you can add OAuth flows in your Expo applications.

Clerk ensures that security critical nonces will be passed only to allowlisted URLs when the OAuth flow is complete in native browsers or webviews.

So for maximum security in your production instances, you need to allowlist your custom redirect URLs:

  1. In the Clerk Dashboard, navigate to the SSO connections page.
  2. Scroll to the Allowlist for mobile OAuth redirect section and add your redirect URLs.
    1. The default is <INSERT-YOUR-APP-SCHEME>://oauth-native-callback
    2. If you'd like to pass a custom redirect URL, make sure you add that to the allowlist. The format is <INSERT-YOUR-APP-SCHEME>/{PATH}. For example, the redirect URL for the following code example is myapp://dashboard.
      const { startOAuthFlow } = useOAuth({ strategy: `oauth_apple` })
      
      const onPress = React.useCallback(async () => {
        const { createdSessionId, setActive } = await startOAuthFlow({
          redirectUrl: Linking.createURL('dashboard', { scheme: 'myapp' }),
        })
      
        // The rest of your code...
      }, [])

Tip

You can also add redirect URLs via the Backend API.

Deploy to production

Now that you have acquired a domain and configured your Expo app, you can follow the Clerk deployment guide.

Feedback

What did you think of this content?

Last updated on