# Auth and secure storage

> Auth and secure storage is an open-source agent skill for developer tools. Adds secure sign-in, token storage and session refresh to an Expo React Native app. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/zakariaf/ReactNative-Skills/tree/main/skills/auth-and-secure-storage
- **Repository:** https://github.com/zakariaf/reactnative-skills
- **GitHub stars:** 16
- **License:** MIT
- **Skill name:** auth-and-secure-storage
- **Collection:** https://github.com/zakariaf/ReactNative-Skills
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-04

## About

This skill builds a sign-in layer for Expo React Native apps on iOS and Android. Session tokens are kept only in expo-secure-store behind a single storage port, and a session manager restores, refreshes and ends the session without races. Protected route groups are guarded at the navigator level, and sign-out clears stored credentials, query caches and account data in two phases.

It covers OAuth with the authorization code flow and PKCE in an ephemeral system browser, plus Sign in with Apple using a hashed nonce. It also includes a guided account deletion route, Android backup exclusion for the secure store, and a fresh-install wipe that clears Keychain leftovers after reinstalling.

The skill ships templates, example adoption files and Jest tests, along with a zero-dependency checker script that verifies the structure. It expects an Expo app with expo-router and asks the developer to supply the OAuth issuer, client id and Apple team details.

## When your agent uses it

> Builds sign-in - tokens in expo-secure-store, shared refresh, protected routes, OAuth PKCE, Apple sign-in. Use when adding login, tokens, 401 retries, logout or account deletion. Not for API calls (networking-and-server-state).

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Runs JavaScript and TypeScript scripts](https://github.com/zakariaf/ReactNative-Skills/tree/HEAD/skills/auth-and-secure-storage)
- [No network calls found in its scripts](https://github.com/zakariaf/ReactNative-Skills/tree/HEAD/skills/auth-and-secure-storage)
- [License: MIT](https://github.com/zakariaf/ReactNative-Skills/tree/HEAD/skills/auth-and-secure-storage)

## Features

- **Secure token storage:** Keeps tokens only in expo-secure-store behind one port, with a fixed access option and no credentials in other storage.
- **Shared session refresh:** A session manager runs one refresh at a time and retries a 401 once before signing the person out.
- **Guarded protected routes:** Signed-in and signed-out route groups are guarded by the navigator, so deep links cannot open protected screens signed out.
- **Two-phase sign-out:** Runs server sign-out steps first, then wipes keys and clears caches, account stores and reminders.
- **OAuth with PKCE:** Implements the authorization code flow with S256 PKCE in an ephemeral browser session.
- **Sign in with Apple:** Adds iOS Apple sign-in with a SHA-256 nonce, silent cancel handling and credential revocation sign-out.
- **Checker and tests:** Includes Jest tests and a script that verifies the session structure against its rules.

## Good for

- Add email or social login to an Expo app
- Keep users signed in across app restarts and token refreshes
- Sign out fully and clear the previous user's data
- Add Sign in with Apple to an iOS app
- Let users delete their account inside the app

## Install

### Claude Code

This skill ships in the `react-native` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add zakariaf/ReactNative-Skills
/plugin install react-native@react-native-skills
```

Or copy only this skill to `~/.claude/skills/auth-and-secure-storage`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/zakariaf/ReactNative-Skills.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/auth-and-secure-storage &&
cp -R "$tmp/skills/auth-and-secure-storage" ~/.claude/skills/auth-and-secure-storage &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/auth-and-secure-storage` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/auth-and-secure-storage` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/zakariaf/ReactNative-Skills.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/auth-and-secure-storage &&
cp -R "$tmp/skills/auth-and-secure-storage" ~/.agents/skills/auth-and-secure-storage &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/auth-and-secure-storage` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/auth-and-secure-storage` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/zakariaf/ReactNative-Skills.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/auth-and-secure-storage &&
cp -R "$tmp/skills/auth-and-secure-storage" ~/.cursor/skills/auth-and-secure-storage &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/auth-and-secure-storage` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/zakariaf/ReactNative-Skills.git --path skills/auth-and-secure-storage
```

Or copy the folder to `~/.gemini/skills/auth-and-secure-storage` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/auth-and-secure-storage`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/zakariaf/ReactNative-Skills.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/auth-and-secure-storage &&
cp -R "$tmp/skills/auth-and-secure-storage" ~/.copilot/skills/auth-and-secure-storage &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/auth-and-secure-storage` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/zakariaf/ReactNative-Skills.git
```

Then copy `ReactNative-Skills/skills/auth-and-secure-storage` into your agent's skills folder as `auth-and-secure-storage`. Agents that support SKILL.md read one folder per skill.

## FAQ

### What does the skill need to be installed?

It expects an Expo app with expo-secure-store, and the developer must supply the OAuth issuer, client id and Apple team setup before release.

### Where are tokens stored?

Tokens live only in expo-secure-store, behind a single storage port, and are not kept in SQLite, AsyncStorage, stores or logs.

### Does a network failure sign the user out?

No. Only a server OAuth error such as invalid_grant ends the session; timeouts and 5xx responses keep it.

### Is the skill open source?

Yes, the repository is published under the MIT license.

### How do I install Auth and secure storage in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/auth-and-secure-storage to use it in all your projects, or to .claude/skills/auth-and-secure-storage in one project. Or install the react-native plugin, which includes it: /plugin marketplace add zakariaf/ReactNative-Skills, then /plugin install react-native@react-native-skills.

### Does Auth and secure storage run scripts?

Yes. It runs JavaScript and TypeScript scripts. No network calls were found in its scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Auth and secure storage?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Auth and secure storage?

The closest alternatives to Auth and secure storage are Expo data fetching, Analytics and consent, Crash reporting and observability, Expo data fetching and Debug menu and test hooks.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Expo data fetching](https://ai-powered.com/skills/expo-data-fetching-scaledockhq): Expo data fetching is an open-source agent skill for developer tools.
- [Analytics and consent](https://ai-powered.com/skills/analytics-and-consent): Analytics and consent is an open-source agent skill for developer tools.
- [Crash reporting and observability](https://ai-powered.com/skills/crash-reporting-and-observability): Crash reporting and observability is an open-source agent skill for developer tools.
- [Expo data fetching](https://ai-powered.com/skills/expo-data-fetching): Expo data fetching is an open-source agent skill for developer tools.
- [Debug menu and test hooks](https://ai-powered.com/skills/debug-menu-and-test-hooks): Debug menu and test hooks is an open-source agent skill for developer tools.
- [App startup and bootstrap](https://ai-powered.com/skills/app-startup-and-bootstrap): App startup and bootstrap is an open-source agent skill for developer tools.
- [Swift security expert](https://ai-powered.com/skills/swift-security-expert): Swift security expert is an open-source agent skill for security.
- [Expo native UI](https://ai-powered.com/skills/expo-native-ui): Expo native UI is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/auth-and-secure-storage
