Skip to content

@gj-kit/expo-auth

Token lifecycle primitives for Expo, React Native, and the web, including coordinated refresh and storage adapters.

Current npm latest: 0.1.1

Use it when an app needs one reusable token refresh and persistence boundary across mobile and browser clients.

Do not put application routes, identity-provider policy, telemetry, or API client ownership in the package.

Outcome: One app-owned session that persists login state and coordinates concurrent refreshes.

Terminal window
pnpm add @gj-kit/expo-auth

Choose the storage adapter once and connect only your refresh-endpoint callback.

Copy this first, then replace only the app-owned values named above.

import { createAuthSession, type RefreshRequest } from '@gj-kit/expo-auth';
import { createTokenStorage, createWebLocksRefreshLock } from '@gj-kit/expo-auth/storage';
declare const refresh: RefreshRequest; // Your API client classifies rotated, invalid, or transient.
export const session = createAuthSession({
storage: createTokenStorage({ keyPrefix: 'myapp.auth' }),
lock: createWebLocksRefreshLock({ name: 'myapp.auth' }),
refresh,
});

Engines: node >=20

Peer Supported range Required for
expo-secure-store >=14.0.0 documented optional subpaths only
Entry Exported symbols
Root entry 19
./storage 3
./testing 8

Treat tokens as secrets: use the supplied error contracts and never log token strings or raw authorization responses.

complete API reference contains every public function, class, type, constant, and error contract generated from release declarations. Each item shows its import path, release signature, and package version.

@gj-kit/expo-media, @gj-kit/expo-ui

npm · GitHub