clerk-expo-patterns

Implement persistent Clerk authentication in Expo and React Native apps.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/awfixers-stuff/opencode-config --skill clerk-expo-patterns-awfixers-stuff
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clerk-expo-patterns
Source: https://github.com/awfixers-stuff/opencode-config/tree/main/skills/clerk-expo-patterns
Command: npx skills add https://github.com/awfixers-stuff/opencode-config --skill clerk-expo-patterns-awfixers-stuff

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill documents patterns and guidance to implement secure, persistent Clerk authentication in Expo and React Native apps to prevent session loss, broken OAuth redirects, and insecure token storage.

Core Features & Use Cases

  • Secure token persistence using expo-secure-store and the tokenCache pattern so sessions survive app restarts.
  • OAuth deep-link flows using useSSO with custom URL schemes and top-level callback completion to reliably sign users in via Google, Apple, GitHub, and others.
  • Expo Router protected routes and layout-level guards that check isLoaded and isSignedIn to avoid flashes and unauthorized access.
  • Push notification registration tied to user metadata and organization switching examples for multi-tenant apps.
  • Use Case: Add persistent Clerk auth, Google sign-in, protected navigation, and push token registration to an Expo app.

Quick Start

Wrap your Expo app root with ClerkProvider using EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY and pass tokenCache from @clerk/expo/token-cache after installing expo-secure-store.

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 authentication sessions in Expo across app restarts?

Clerk authentication sessions persist in Expo by passing the tokenCache from @clerk/expo/token-cache to ClerkProvider, backed by expo-secure-store to securely store tokens across app restarts.

How do I set up Google OAuth deep links with Clerk in a React Native app?

Google OAuth deep links with Clerk in React Native use the useSSO hook combined with custom URL schemes and expo-web-browser to handle the OAuth redirect and complete the sign-in flow reliably.

How do I create protected routes with Expo Router and Clerk?

Protected routes with Expo Router and Clerk are created by adding layout-level guards that check the isLoaded and isSignedIn states, preventing unauthorized access and avoiding unauthenticated screen flashes.

Can I register Expo push notifications tied to Clerk user metadata?

Yes, you can register Expo push notifications tied to Clerk user metadata by integrating expo-notifications within the authenticated user context to link device push tokens to specific users.

Does Clerk support organization switching in multi-tenant Expo apps?

Clerk supports organization switching in multi-tenant Expo apps by managing multi-tenant state within the authenticated context, allowing users to switch between organizations seamlessly.

Why do my Clerk OAuth redirects fail in my Expo app?

Clerk OAuth redirects fail in Expo apps when custom URL schemes are misconfigured or the top-level callback completion is missing, which are required to properly catch the deep link and finish the flow.