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

shopsense-mobile

v0.1.4

Published

Thin WebView shell for the ShopSense widget.

Readme

shopsense-mobile (React Native)

Thin WebView shell for the ShopSense widget.

Cursor: implement this package in one click

Click ⓘ Open integration prompt in Cursor to open Cursor with a pre-filled Agent prompt (official cursor.com/link/prompt deeplink). It includes the full checklist from CURSOR_INTEGRATION_PROMPT.md. If the link does not open the app, paste that file’s contents into Cursor Agent instead.

Goals

  • No UI owned by the package: all HTML/JS/CSS is served by your server.
  • Package only:
    • Renders a WebView pointing to your server page
    • Passes widget config (zone + optional params) via query params
    • Bridges product selections back to native (callback or default deep link)
    • Keeps the WebView persisted and toggles show/hide based on screen focus

Install

npm i shopsense-mobile

Peer deps (should already exist in an Expo app):

  • react-native-webview
  • expo-router

Usage

1) Wrap your app root once (and provide config)

import { ShopSenseRoot } from "shopsense-mobile";

export default function RootLayout() {
  return (
    <ShopSenseRoot
      widgetProps={{
        // Put these in env / remote config in production:
        baseUrl: YOUR_WIDGET_HOST_ORIGIN,
        apiBase: YOUR_WIDGET_API_BASE,
        zoneId: YOUR_ZONE_ID,
        extraParams: OPTIONAL_PARAMS_OBJECT,
        statusTimeoutMs: 10000,
        onProductSelect: (payload) => {
          // navigate to native product screen
        },
        onDebugMessage: (msg) => {
          // optionally toggle fallback UI
        },
      }}
      webViewTopInset={SAFE_AREA_TOP_PLUS_APP_BAR}
    >
      {/* your app routes */}
    </ShopSenseRoot>
  );
}

2) Render ShopSenseWidget on the screen where it should be active

ShopSenseWidget registers callbacks for the current screen and toggles show/hide based on focus. It inherits config from ShopSenseRoot.

import { ShopSenseWidget } from "shopsense-mobile";
import { View } from "react-native";

export default function SearchScreen() {
  return (
    <View style={{ flex: 1, minHeight: 0 }}>
      <ShopSenseWidget />
    </View>
  );
}

If you want the widget search input focused immediately on screen open:

<ShopSenseWidget focusSearchOnScreenFocus />

Configuration

ShopSenseRoot takes widgetProps (type: ShopSenseWidgetProps).

Only zoneId is required; everything else depends on your hosting setup.

Do not hardcode environment-specific values in docs; load them from env / remote config.

statusTimeoutMs

Optional. Maximum time (ms) to wait for the widget to report WIDGET_STATUS: succeeded after a WebView load starts.

  • default: 10000
  • behavior: on timeout, the package emits WIDGET_STATUS with payload.state = "failed" and payload.error.message = "timeout" so your app can conditionally render a fallback UI.

Server contract

Your server must host an HTML page (default path: /embed/widget.html) that:

  • Reads query params such as: zone (and any optional parameters you support)
  • Loads the ShopSense widget JS/CSS from your server/CDN
  • Posts NAVIGATE_TO_PRODUCT to the React Native WebView bridge when a product is tapped:
{ "type": "NAVIGATE_TO_PRODUCT", "payload": { "id": 123, "alias": "slug" } }

Default navigation behavior

If onProductSelect is not provided, the package opens:

app.shopsense://product/:id/:alias

Your app must register the deep link scheme for this to work.