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

@heejun/platform-bridge

v0.1.0

Published

웹 ↔ 토스인앱(AppsInToss) 공통 플랫폼 능력 추상화 — share·haptic·clipboard·외부링크·익명식별키·딥링크. headless(디자인시스템 무관), React 컨텍스트로 주입.

Downloads

14

Readme

@heejun/platform-bridge

웹 ↔ 토스인앱(AppsInToss/Granite) 공통 플랫폼 능력 추상화. 같은 서비스를 웹과 토스 미니앱으로 동시에 낼 때, 두 버전의 코드 차이를 최소화하기 위한 헤드리스 레이어다.

원칙: "화면이 무엇을 보여줄지(what)는 공유하고, 어떻게 그리는지(how)와 네이티브 호출만 갈라진다." 전체 표준: heejun/docs/TOSS-MINIAPP-PLAYBOOK.md

무엇을 추상화하나

공유·햅틱·클립보드·외부링크·익명식별키·딥링크 — 웹엔 없고 토스엔 있는(또는 구현이 다른) 네이티브 능력을 단일 PlatformBridge 인터페이스로 묶는다. 공유 코드는 usePlatform()만 호출하고 if (isToss) 분기를 하지 않는다.

설치

pnpm add @heejun/platform-bridge
# 토스 앱은 추가로(optional peer):
pnpm add @apps-in-toss/web-framework

react는 peer. @apps-in-toss/web-framework는 optional peer — @heejun/platform-bridge/toss를 import할 때만 필요하므로 웹 전용 앱은 설치하지 않아도 된다.

사용

웹 앱 (apps/web)

import { PlatformContext, webPlatformBridge } from '@heejun/platform-bridge'

<PlatformContext.Provider value={webPlatformBridge}>
  <App />
</PlatformContext.Provider>

토스 앱 (apps/toss)

import { PlatformContext } from '@heejun/platform-bridge'
import { createTossPlatformBridge } from '@heejun/platform-bridge/toss'

// 앱별 차이(음소거 연동·공유 문구)만 옵션으로 주입, 나머지는 표준.
const bridge = createTossPlatformBridge({ hapticEnabled: () => !isSoundMuted() })

<PlatformContext.Provider value={bridge}>
  <App />
</PlatformContext.Provider>

공유 코드 (packages/client 뷰모델 등)

import { usePlatform } from '@heejun/platform-bridge'

function useUpdateDetailModel(id: string) {
  const platform = usePlatform()
  const onShare = () => platform.share({ title: '[AI다이제스트]', text: update.title })
  return { onShare }
}

API

PlatformBridge: env · isInToss · share(input) · haptic(type?) · copyText(text) · openExternal(url) · getStableUserKey() · getEntryRoute().

  • share 반환: 'shared' | 'copied' | 'dismissed' | 'unsupported' (네이티브 → 웹 공유 → 클립보드 폴백)
  • webPlatformBridge: 웹 표준 구현(토스 의존 없음)
  • createTossPlatformBridge(options?): 토스 구현(토스 밖에서는 웹 폴백)
  • copyTextToClipboard(text): 단독 사용 가능한 클립보드 유틸

빌드

tsup ESM+CJS+dts. react/react-dom/@apps-in-toss/web-framework는 external.