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

react-native-shared-container

v1.0.0

Published

Cross-app shared session storage for React Native (iOS App Group + Android signature-protected ContentProvider).

Readme

react-native-shared-container

shared session storage for React Native.

Share a small key/value store (auth tokens, user id, feature flags, …) between multiple apps published by the same team / signed with the same key, plus a per-app private store.

| Platform | shared scope backed by | local scope backed by | | -------- | ------------------------ | ----------------------- | | iOS | App Group container (NSUserDefaults suite) | NSUserDefaults.standard | | Android | Exported, signature-protected ContentProvider | private SharedPreferences |

Only apps signed with the same key (Android) or sharing the same App Group (iOS) can read each other's shared data, so the store is safe from third-party apps.

Installation

npm install react-native-shared-container
# or
yarn add react-native-shared-container

iOS

cd ios && pod install

Then, for every app that should share data:

  1. Add the App Groups capability and enable the same group id in each app target (e.g. group.com.technoidentity.shared.container).
  2. Either add that id as SharedAppGroupID in each app's Info.plist, or pass it at runtime via configure({ appGroupId }).

Android

Autolinking registers the module and its ContentProvider. The provider authority and the signature-level permission are scoped to each app's applicationId automatically — no manifest edits are needed in the common case. All participating apps must be signed with the same key.

Usage

import {
  configure,
  getItem,
  setItem,
  removeItem,
  appId,
  type Scope,
} from 'react-native-shared-container';

// Call once at app start-up, before reading/writing the `shared` scope.
await configure({
  // Android: the OTHER apps that share the session (your own id is added automatically).
  peerAppIds: ['com.technoidentity.shared.container', 'com.technoidentity.shared.container.two'],
  // iOS: the App Group container (optional if set via SharedAppGroupID in Info.plist).
  appGroupId: 'group.com.technoidentity.shared.container',
});

// Cross-app, shared between all signed-together apps:
await setItem('shared', 'authToken', 'abc123');
const token = await getItem('shared', 'authToken'); // -> 'abc123' in every sibling app

// Per-app private:
await setItem('local', 'lastTab', 'home');

await removeItem('shared', 'authToken');

console.log('Running inside app:', appId);

API

configure(config?): Promise<boolean>

| Field | Platform | Description | | ------------ | -------- | ----------- | | peerAppIds | Android | applicationIds of the sibling apps that share the session. Your own id is always included. | | appGroupId | iOS | App Group container id for the shared scope. Falls back to SharedAppGroupID in Info.plist. |

getItem(scope, key): Promise<string | null>

setItem(scope, key, value): Promise<boolean>

removeItem(scope, key): Promise<boolean>

scope is 'local' (per-app private) or 'shared' (cross-app).

appId: string

The applicationId / bundle identifier of the running app.

How it works

  • iOS — the shared scope opens an NSUserDefaults suite for the configured App Group. Every app target that declares the same group reads and writes the same container.
  • Android — each app exposes an exported ContentProvider at content://<applicationId>.sharedsession, locked behind a signature-level permission. On write, the value is fanned out to every configured peer's provider; on read, peers are queried in turn. Apps that aren't installed are skipped safely.

Example

A runnable two-app demo (App A / App B) lives in example/.

License

MIT