
Security News
White House Authorizes Private Companies to Conduct Offensive Cyber Operations
A new federal program will let vetted U.S. cybersecurity firms help investigate and disrupt foreign cybercrime groups under government direction.
@authon/react-native
Advanced tools
English | 한국어
Drop-in React Native authentication with secure token storage — Auth0 alternative
Before installing the SDK, create an Authon project and get your API keys:
Create a project at Authon Dashboard
Get your API keys from Project Settings → API Keys
pk_live_...) — use in your frontend codepk_test_...) — for development, enables Dev TeleportConfigure OAuth providers (optional) in Project Settings → OAuth
https://api.authon.dev/v1/auth/oauth/redirectTest vs Live keys: Use
pk_test_...during development. Switch topk_live_...before deploying to production. Test keys use a sandbox environment with no rate limits.
npm install @authon/react-native react-native-svg
npx expo install expo-secure-store expo-web-browser
// App.tsx — complete working file
import React, { useState } from 'react';
import { View, Text, Button, TextInput, ActivityIndicator } from 'react-native';
import { AuthonProvider, useAuthon, useUser } from '@authon/react-native';
import * as SecureStore from 'expo-secure-store';
const storage = {
getItem: (key: string) => SecureStore.getItemAsync(key),
setItem: (key: string, value: string) => SecureStore.setItemAsync(key, value),
removeItem: (key: string) => SecureStore.deleteItemAsync(key),
};
function HomeScreen() {
const { isLoaded, isSignedIn, user, signIn, signOut } = useAuthon();
const [email, setEmail] = useState('');
const [password, setPassword] = useState('');
if (!isLoaded) return <ActivityIndicator />;
if (isSignedIn) {
return (
<View style={{ padding: 24 }}>
<Text>Welcome, {user?.displayName ?? user?.email}</Text>
<Button title="Sign Out" onPress={signOut} />
</View>
);
}
return (
<View style={{ padding: 24, gap: 12 }}>
<TextInput placeholder="Email" value={email} onChangeText={setEmail} autoCapitalize="none" />
<TextInput placeholder="Password" value={password} onChangeText={setPassword} secureTextEntry />
<Button title="Sign In" onPress={() => signIn({ strategy: 'email_password', email, password })} />
</View>
);
}
export default function App() {
return (
<AuthonProvider
publishableKey="pk_live_YOUR_PUBLISHABLE_KEY"
storage={storage}
>
<HomeScreen />
</AuthonProvider>
);
}
import { Linking } from 'react-native';
import { useAuthon } from '@authon/react-native';
function GoogleButton() {
const { startOAuth, completeOAuth } = useAuthon();
const handlePress = async () => {
const { url, state } = await startOAuth('google');
await Linking.openURL(url);
await completeOAuth(state);
};
return <Button title="Sign in with Google" onPress={handlePress} />;
}
import * as WebBrowser from 'expo-web-browser';
import { useAuthon } from '@authon/react-native';
function GoogleButton() {
const { startOAuth, completeOAuth } = useAuthon();
const handlePress = async () => {
const { url, state } = await startOAuth('google', {
flow: 'redirect',
returnTo: 'https://your-domain.com/mobile-callback',
});
const pollPromise = completeOAuth(state);
await WebBrowser.openAuthSessionAsync(url, 'myapp://oauth-callback');
await pollPromise;
};
return <Button title="Sign in with Google" onPress={handlePress} />;
}
import { useUser } from '@authon/react-native';
function Profile() {
const { isLoaded, isSignedIn, user } = useUser();
if (!isLoaded) return <ActivityIndicator />;
if (!isSignedIn) return <Text>Not signed in</Text>;
return <Text>Email: {user?.email}</Text>;
}
const { signIn } = useAuthon();
await signIn({ strategy: 'email_password', email: 'user@example.com', password: 'MyP@ssw0rd' });
const { signOut } = useAuthon();
await signOut();
| Variable | Required | Description |
|---|---|---|
AUTHON_PUBLISHABLE_KEY | Yes | Project publishable key (pk_live_... or pk_test_...) |
AUTHON_API_URL | No | Optional — defaults to api.authon.dev |
| Component | Description |
|---|---|
<AuthonProvider> | Provider with publishableKey, apiUrl, storage |
<SocialButtons> | Renders all enabled OAuth provider buttons |
<SocialButton> | Single OAuth provider button with icon |
| Hook | Returns |
|---|---|
useAuthon() | { isLoaded, isSignedIn, user, signIn, signUp, signOut, getToken, providers, branding, startOAuth, completeOAuth, on, client } |
useUser() | { isLoaded, isSignedIn, user } |
useAuthonWeb3() | Web3 wallet auth |
useAuthonPasswordless() | OTP and magic link |
useAuthonPasskeys() | Passkey registration and auth |
| Feature | Authon | Clerk | Auth0 |
|---|---|---|---|
| Pricing | Free | $25/mo+ | $23/mo+ |
| React Native | Yes | Yes | Yes |
| Secure token storage | Yes | Yes | Yes |
| Web3 auth | Yes | No | No |
| MFA/Passkeys | Yes | Yes | Yes |
MIT
FAQs
Authon React Native SDK — mobile authentication
The npm package @authon/react-native receives a total of 46 weekly downloads. As such, @authon/react-native popularity was classified as not popular.
We found that @authon/react-native demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
A new federal program will let vetted U.S. cybersecurity firms help investigate and disrupt foreign cybercrime groups under government direction.

Research
/Security News
The campaign amassed more than 75,000 installs by targeting Russian-speaking users seeking access to blocked services.

Company News
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.