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

nudge-sdk

v0.1.2

Published

Embeddable in-app guided walkthroughs — an AI-guided cursor walks your users through flows you recorded, inside your own app.

Downloads

198

Readme

nudge-sdk

Embeddable in-app walkthroughs. Drop it into any web app — React, Vue, Svelte, or vanilla — and an AI-guided cursor walks users through flows you've recorded.

  • Zero host-app pollution — UI lives in a closed shadow DOM, so it can't leak styles in or out
  • Shadow cursor + instruction bar — points at real DOM, reacts to real events
  • Authoring built in — click-record flows from inside the app with AI-assisted instruction writing
  • Semantic goal matching — users type "export csv", SDK finds the right flow via pgvector + LLM fallback
  • Privacy-first — password and credit-card fields are never recorded, even by accident
  • ~17 KB gzipped

Install

npm install nudge-sdk
# or
pnpm add nudge-sdk

You'll see the welcome banner once on install. To reprint it any time:

npx nudge          # banner + quick start
npx nudge docs     # open docs
npx nudge --help   # all commands

Set NUDGE_NO_BANNER=1 to silence the install banner.

Use

import { NudgeSDK } from "nudge-sdk";

const nudge = NudgeSDK.init({
  apiKey: process.env.NEXT_PUBLIC_NUDGE_API_KEY!,
  apiBase: "https://your-nudge-backend.example.com/api",
  defaultProjectKey: "onboarding",          // optional: click-trigger starts this
  endUserIdHash: hashedUserId,               // optional: stable hash for analytics
  theme: {
    trigger: { position: "bottom-right", bg: "#7c3aed", fg: "#fff" },
  },
  onEvent: (event) => console.log(event),
}).mount();

That's it. A floating "Ask your buddy" trigger appears in the corner.

Programmatic start

await nudge.start({ projectKey: "your-flow-key" });

Opening the goal input

nudge.openInput(); // shows the free-form "what would you like to do?" modal

Authoring (recording new flows)

const nudge = NudgeSDK.init({
  apiKey, apiBase,
  authoring: { enabled: true, aiAssist: true },
}).mount();

// Later, gated behind `user.role === 'admin'`:
nudge.startRecording();  // shows a red record FAB + captures clicks
nudge.stopRecording();   // opens the review modal — edit instructions, publish

The API key must carry the authoring capability (granted in the dashboard).

Privacy controls

NudgeSDK.init({
  apiKey, apiBase,
  privacy: {
    redactSelectors: [".billing-history tr", "[data-internal]"],
    // built-in defaults already cover input[type=password], cc-* autocompletes,
    // and [data-nudge-skip]
  },
});

See docs/privacy.md for the full data-flow writeup.

Config reference

| Option | Type | Notes | | --- | --- | --- | | apiKey | string | Required. The pk_live_... key from your dashboard. | | apiBase | string | Required. Your Nudge backend base URL. | | defaultProjectKey | string? | Trigger-button click starts this flow. Omit to always open the goal modal. | | endUserIdHash | string? | Stable opaque id (hash your user id; never raw PII). | | theme | NudgeTheme? | Runtime CSS custom properties. See NudgeTheme in types. | | trigger.mode | "button" \| "programmatic" | Default button. | | authoring.enabled | boolean | Mounts the record FAB. Default off. | | authoring.aiAssist | boolean | Default true — AI writes instruction copy on publish. | | privacy.redactSelectors | string[]? | Extra selectors the recorder must never capture. | | privacy.replaceDefaults | boolean? | Disable the built-in redact list. Not recommended. | | onEvent | (e: NudgeEvent) => void | Observe session + authoring + matching lifecycle. |

Events

Every meaningful transition emits an event:

  • session_started, step_started, step_completed, wrong_click, session_completed
  • goal_matched (carries source: 'exact' | 'fuzzy' | 'semantic' | 'llm'), goal_unmatched
  • authoring_started, step_recorded, authoring_stopped, flow_published
  • click_redacted — the recorder refused to capture a click (password field, etc.)
  • error — unrecoverable SDK error

License

MIT