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

@greatstore/react

v0.2.0

Published

React component for embedding GreatStore chat, with typed props and clean mount/unmount.

Readme

@greatstore/react

A React component for embedding GreatStore chat, with typed props and lifecycle that follows your component tree instead of managing it by hand.

npm install @greatstore/react
import { GreatStore } from "@greatstore/react";

<GreatStore store="my-store" />

Renders no visible DOM of its own. Unmounting fully tears the embed down (script tag, mounted UI, listeners) rather than leaking it. Works in Server Component trees (no "use client" needed in your own file).

Props

| Prop | Type | Default | Notes | |---|---|---|---| | store | string | — required | Tenant slug. | | host | string | "greatstore.ai" | Apex domain the embed loads from. | | theme | GreatStoreTheme | undefined | See below. Unset fields fall back to the store's admin config. | | aiDisclaimer | { enabled?: boolean; text?: string } | undefined | text up to 200 chars; implies enabled: true unless enabled: false is also set. | | pushSwPath | string | undefined | Path to a self-hosted gs.js, if not at site root. Only relevant with enableNotifications(). | | onError | (error: Error) => void | undefined | Fires on load/mount failure (bad domain, network, or a stalled mount after 15s). Never thrown. |

Not overridable via props: sales guide, display name, assistant name, logo, icons — always the store's admin config.

Props are read once, at mount — not watched reactively. Changing theme/aiDisclaimer/pushSwPath after mount has no effect; changing store/host unmounts and remounts with a fresh script.

GreatStoreTheme

| Field | Type | Notes | |---|---|---| | mode | "auto" \| "light" \| "dark" \| "custom" | | | radius | "sharp" \| "default" \| "rounded" | | | panelPosition | "left" \| "right" \| "middle" | Desktop only. | | mobileBottomBar | boolean | | | zIndex | number | Stacking order of the chat overlay, 02147483647. Lower it if page UI must stay on top. | | fontFamily | string | CSS font-family value. | | secondaryFontFamily | string | CSS font-family value. | | brandColor | string | CSS color. Only used when mode: "custom". | | surfaceColor | string | CSS color. Only used when mode: "custom". | | textColor | string | CSS color. Only used when mode: "custom". |

Ref (GreatStoreHandle)

const ref = useRef<GreatStoreHandle>(null);
<GreatStore store="my-store" ref={ref} />
ref.current?.sendMessage("What's on sale?");

| Member | Signature | |---|---| | open | () => void | | close | () => void | | toggle | () => void | | sendMessage | (text: string) => void | | updateModelContext | (text: string) => void | | on | (event: "open" \| "close", handler: (...args: unknown[]) => void) => () => void (unsubscribe) | | generateStructuredContent | <T>(schema: object, prompt: string) => Promise<T> | | enableNotifications | () => Promise<{ ok: boolean }> | | ready | Promise<void> — fresh promise per mount, rejects on mount failure |

Calls made before the embed finishes loading are queued and replayed once ready.

Constraints

  • One <GreatStore> at a time — window.GreatStore is a page-level singleton; a second concurrent mount won't create an independent panel.