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

@preeternal/react-native-cookie-manager

v6.3.1

Published

A modern, New Architecture–ready Cookie Manager for React Native.A drop-in replacement for @react-native-cookies/cookies, fully rewritten with TypeScript, TurboModules, and platform-native implementations for iOS and Android. Supports reading, writing, an

Downloads

14,800

Readme

@preeternal/react-native-cookie-manager

npm version npm downloads

A modern, New Architecture–ready Cookie Manager for React Native. This is a drop-in replacement for @react-native-cookies/cookies, rewritten with TypeScript, TurboModules, and platform-native implementations for iOS (Swift) and Android (Kotlin).

Upstream / credits

This package is based on the public API and behavior of @react-native-cookies/cookies. Big thanks to the upstream maintainers and contributors for the original implementation and long-term work on the project.

Installation

Using Bun

bun add @preeternal/react-native-cookie-manager

Using yarn

yarn add @preeternal/react-native-cookie-manager

Using npm

npm install @preeternal/react-native-cookie-manager

Then install iOS pods:

cd ios && bundle exec pod install

Supports both old (bridged) and New Architecture (TurboModule) builds out of the box. Works in bare RN apps and in Expo Dev Builds (custom native build).

Usage

import CookieManager from '@preeternal/react-native-cookie-manager';

// Set a cookie
try {
  await CookieManager.set('https://example.com', {
    name: 'session',
    value: 'abc123',
    domain: 'example.com',
    path: '/',
    secure: true,
    httpOnly: true,
  });

  // Set cookies from a Set-Cookie header
  await CookieManager.setFromResponse(
    'https://example.com',
    'user_session=abcdefg; path=/; expires=Thu, 1 Jan 2030 00:00:00 -0000; secure; HttpOnly'
  );

  // Get cookies for a URL
  const cookies = await CookieManager.get('https://example.com');

  // iOS only: get all cookies
  const allCookies = await CookieManager.getAll();

  // Clear by name (iOS only)
  await CookieManager.clearByName('https://example.com', 'session');

  // Clear everything
  await CookieManager.clearAll();

  // Android only: persist to storage
  await CookieManager.flush();

  // Android only: remove session cookies (no expires)
  await CookieManager.removeSessionCookies();
} catch (err) {
  console.warn('Cookie operation failed', err);
}

API (compatible with @react-native-cookies/cookies)

  • set(url, cookie, useWebKit?)
  • setFromResponse(url, cookieHeader)
  • get(url, useWebKit?)
  • getFromResponse(url)
  • clearAll(useWebKit?)
  • flush() — Android
  • removeSessionCookies() — Android
  • getAll(useWebKit?) — iOS
  • clearByName(url, name, useWebKit?) — iOS

useWebKit applies only to iOS (switches to WKHTTPCookieStore); on Android it is ignored because WebView and native share a single cookie store.

WebKit on iOS

  • iOS has two stores: NSHTTPCookieStorage (used by URLSession) and WKHTTPCookieStore (used by WKWebView / react-native-webview).
  • Pass useWebKit: true when you need cookies to sync with WKWebView. For network-only flows, omit it to use NSHTTPCookieStorage.
  • If your app mixes both (native requests and embedded web), call the same operation twice: once with useWebKit: true (for WKWebView), once with useWebKit: false (for URLSession).
  • On Android the flag is ignored; WebView and native use the same store.

Cookie shape

type Cookie = {
  name: string;
  value: string;
  path?: string;
  domain?: string;
  version?: string;
  expires?: string; // ISO 8601 string, e.g. 2015-05-30T12:30:00.00-05:00
  secure?: boolean;
  httpOnly?: boolean;
};

Contributing

License

MIT


Made with create-react-native-library