clerk-expo-patterns

Persist Clerk session tokens and configure OAuth deep linking in Expo apps.

66|4|Updated Jan 6, 2026
One-click install
npx skills add https://github.com/clerk/skills --skill clerk-expo-patterns-clerk
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clerk-expo-patterns
Source: https://github.com/clerk/skills/tree/main/skills/frameworks/clerk-expo-patterns
Command: npx skills add https://github.com/clerk/skills --skill clerk-expo-patterns-clerk

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Mobile Expo and React Native apps often lose Clerk session state on app restart and require complex setup for OAuth deep linking, protected routes, push notification registration, and organization switching. This Skill provides clear patterns to persist tokens securely, configure OAuth redirects, guard routes with Expo Router, and manage user and organization state so authentication flows behave reliably on mobile devices.

Core Features & Use Cases

  • Persist session tokens securely using expo-secure-store so users remain signed in across app restarts.
  • Configure OAuth deep linking with a custom app scheme and ensure WebBrowser.maybeCompleteAuthSession is called for proper redirects.
  • Protect screens and route groups using Expo Router with useAuth guards to prevent flashes and incorrect redirects.
  • Register and store Expo push tokens in user metadata and demonstrate server-side notification sends.
  • Example use case: Add Clerk to an Expo app, persist the token cache, enable Google sign-in via deep links, and protect a tab group that only signed-in users can access.

Quick Start

Add Clerk to my Expo app by wrapping the root layout with ClerkProvider that reads EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY from environment and passes the tokenCache from @clerk/expo/token-cache to persist sessions across restarts.

Frequently Asked Questions about clerk-expo-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I persist Clerk session tokens in an Expo app across restarts?

Persist Clerk session tokens by passing the tokenCache from @clerk/expo/token-cache to ClerkProvider, which securely stores session state in expo-secure-store and keeps users signed in across app restarts.

How do I configure OAuth deep linking with Clerk in React Native?

Configure OAuth deep linking in React Native by setting a custom app scheme and calling WebBrowser.maybeCompleteAuthSession to properly handle OAuth redirects back to your Clerk app.

What's the best way to protect Expo Router routes with Clerk authentication?

Protect Expo Router routes by applying useAuth guards to screen groups to prevent unauthorized access, avoiding visual flashes and incorrect redirects for unauthenticated users.

Does Clerk work with Expo for push notification token registration?

Clerk works with Expo push notifications by registering Expo push tokens and storing them in user metadata, enabling server-side notification sends for authenticated React Native users.

Can I manage organization switching in a Clerk Expo app?

Manage organization switching in a Clerk Expo app using hooks like useAuth, useUser, and useSSO to handle user and organization state reliably during mobile authentication flows.

Why does my Clerk OAuth flow fail to redirect in my Expo app?

Clerk OAuth flows fail to redirect when the custom app scheme is misconfigured or WebBrowser.maybeCompleteAuthSession is not called to properly complete the authentication session.