npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@better-auth/expo

v1.4.10

Published

Better Auth integration for Expo and React Native applications.

Readme

Better Auth Expo Plugin

This plugin integrates Better Auth with Expo, allowing you to easily add authentication to your Expo (React Native) applications. It supports both Expo native and web apps.

Installation

To get started, install the necessary packages:

# Using npm
npm install better-auth @better-auth/expo

# Using yarn
yarn add better-auth @better-auth/expo

# Using pnpm
pnpm add better-auth @better-auth/expo

# Using bun
bun add better-auth @better-auth/expo

You will also need to install expo-secure-store for secure session and cookie storage in your Expo app:

npm install expo-secure-store
# or
yarn add expo-secure-store
# or
pnpm add expo-secure-store
# or
bun add expo-secure-store

Basic Usage

Configure the Better Auth Backend

Ensure you have a Better Auth backend set up. You can follow the main Installation Guide.

Then, add the Expo plugin to your Better Auth server configuration (e.g., in your auth.ts or lib/auth.ts file):

// lib/auth.ts
import { betterAuth } from "better-auth";
import { expo } from "@better-auth/expo"; // Import the server plugin

export const auth = betterAuth({
    // ...your other Better Auth options
    baseURL: "http://localhost:8081", // The base URL of your application server where the routes are mounted.
    plugins: [expo()], // Add the Expo server plugin
    emailAndPassword: { 
        enabled: true,
    },
    // Add other configurations like trustedOrigins
    trustedOrigins: ["myapp://"] // Replace "myapp" with your app's scheme
});

Initialize the Better Auth Client in Expo

In your Expo app, initialize the client (e.g., in lib/auth-client.ts):

// lib/auth-client.ts
import { createAuthClient } from "better-auth/react";
import { expoClient } from "@better-auth/expo/client"; // Import the client plugin
import * as SecureStore from "expo-secure-store";

export const authClient = createAuthClient({
    baseURL: "http://localhost:8081", // Your Better Auth backend URL
    plugins: [
        expoClient({
            scheme: "myapp", // Your app's scheme (defined in app.json)
            storagePrefix: "myapp", // A prefix for storage keys
            storage: SecureStore, // Pass SecureStore for token storage
        })
    ]
});

// You can also export specific methods if you prefer:
// export const { signIn, signUp, useSession } = authClient;

Make sure your app's scheme (e.g., "myapp") is defined in your app.json.

Documentation

For more detailed information and advanced configurations, please refer to the documentation:

License

MIT