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

@webbridge-native/cookies

v0.6.0

Published

RFC 6265 cookie jar for WebBridge Native

Downloads

649

Readme

@webbridge-native/cookies

RN에서 브라우저처럼 쿠키를 자동 관리. RFC 6265 준수.

Problem

브라우저는 Set-Cookie를 자동 저장하고 다음 요청에 Cookie 헤더를 자동 첨부합니다. React Native는 이걸 안 합니다. RN 공식 문서: "Cookie based authentication is currently unstable."

Solution

RFC 6265 준수 CookieJar가 RN에서 브라우저와 동일하게 쿠키를 자동 관리합니다.

설치

pnpm add @webbridge-native/cookies @webbridge-native/core

사용법

인터셉터로 사용 (권장)

import { CookieJar, cookieInterceptor } from '@webbridge-native/cookies';

const jar = new CookieJar();
client.use(cookieInterceptor({ jar }));

// 이제 RN에서도 브라우저처럼:
// 1. 로그인 응답의 Set-Cookie → 자동 저장
// 2. 다음 요청에 Cookie 헤더 → 자동 첨부
await client.fetch('https://api.myapp.com/login', { method: 'POST', body: '...' });
await client.fetch('https://api.myapp.com/me'); // Cookie 자동 첨부됨

직접 사용

const jar = new CookieJar();
await jar.setCookie('session=abc; Path=/; HttpOnly; Secure', 'https://api.myapp.com');
const header = await jar.getCookieHeader('https://api.myapp.com/users');
// → 'session=abc'

영속 저장 (앱 재시작 후 세션 유지)

import { PersistentCookieStore } from '@webbridge-native/cookies';

const store = new PersistentCookieStore({
  getItem: (key) => mmkv.getString(key) ?? null,
  setItem: (key, value) => mmkv.set(key, value),
  removeItem: (key) => mmkv.delete(key),
});

브라우저 호환 기능

  • SameSite (Strict, Lax, None) — None은 Secure 강제
  • HttpOnly, Secure flag
  • Domain/Path 매칭 (RFC 6265 §5.1.3, §5.1.4)
  • Max-Age / Expires (Max-Age 우선)
  • Public Suffix 검증 (supercookie 공격 방지)
  • 다중 Set-Cookie 헤더 지원
  • 도메인별 50개, 전체 3000개 제한

License

MIT