Authdog

Expo

Last updated Jul 11, 2026
View as Markdown

The @authdog/react-native SDK brings Authdog to React Native and Expo apps: a provider, session and user hooks, sign-in/out helpers, and a secure-storage adapter. Sign-in uses a deep-link redirect that lands with a token. It reads the session Authdog issues.

Install

Bash
npm install @authdog/react-native
npx expo install expo-secure-store

Requires React 18/19 and React Native >=0.74. There's no hard Expo dependency — expo-secure-store is only for persistent storage. Set EXPO_PUBLIC_PK_AUTHDOG to your publishable pk_... key.

Wrap your app

Pass the public key and a storage adapter. Without one, sessions are held in memory and don't survive a restart, so use the SecureStore adapter in real apps:

TSX
import * as SecureStore from "expo-secure-store"
import {
  AuthdogProvider,
  createSecureStoreAdapter,
} from "@authdog/react-native"

export default function App() {
  return (
    <AuthdogProvider
      publicKey={process.env.EXPO_PUBLIC_PK_AUTHDOG!}
      storage={createSecureStoreAdapter(SecureStore)}
    >
      <RootNavigator />
    </AuthdogProvider>
  )
}

useSignIn opens the hosted flow; useRedirectHandler extracts and validates the token when your app is reopened via its callback URL:

TSX
import { Linking } from "react-native"
import { useSignIn, useRedirectHandler } from "@authdog/react-native"

const { signIn } = useSignIn()
const { handleRedirect } = useRedirectHandler()

Linking.getInitialURL().then((url) => url && handleRedirect(url))
// trigger sign-in
signIn("myapp://callback")

Read the session

  • useUser(){ user, fetchUser, isAuthenticated, isLoading, error }
  • useSession(){ session: { token, isAuthenticated }, isLoading }
  • useSignUp(), useSignOut(){ signUp/signOut, isLoading, error }
  • useAuthz({ permissionsUrl }){ fetchPermissions, hasPermission } for UI hints

useAuthz is for showing and hiding UI only — enforce access on your backend with your authorization model.

Next steps