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

seedypea-client

v0.0.5

Published

Browser client helpers for Seedy Pea profiles.

Downloads

959

Readme

seedypea-client

Browser collector for Seedy Pea events.

The browser API reports occurrences. It does not assert profile traits. Include identifiers naturally in event details when they appear; Seedy Pea ranks identifiers, resolves profiles, and derives traits from event history.

Preferred with a first-party edge collector:

import { init, pageView, track, trackInteractionSignal } from "seedypea-client";

init({ endpoint: "/sp/events" });

pageView();

trackInteractionSignal();

track("AddToCart", {
  item: "pants",
  size: "xxl"
});

track("LeadEmailCaptured", {
  email,
  source: "exit_intent_modal"
});

trackInteractionSignal() samples local browser interaction for a short window and emits one InteractionSignalObserved event with coarse likelihood evidence:

const signal = trackInteractionSignal({
  sampleMs: 1800,
  detail: { source: "homepage" }
});

await signal.done;

The payload includes likelihood_score, likelihood_bucket, modalities, event counts, and coarse pointer entropy/distance buckets. It does not send raw pointer coordinates or movement trails. Treat the score as weak interaction evidence, not proof that a visitor is a real person.

Declarative bindings are available when HTML is the cleanest API:

<button sp-event="PersonaSelected" sp-prop-persona="developer">
  Developer
</button>

<a
  href="mailto:[email protected]"
  sp-tactic="lead-capture"
  sp-prop-source="hero"
  sp-prevent-default="true">
  Get early access
</a>
import "seedypea-client/seedy-lead-modal";
import { bind } from "seedypea-client";

bind(document);

Mount the element once anywhere in the document:

<seedy-lead-modal></seedy-lead-modal>

For a Fungal site, make a small component cowpath:

// site/component/seedy-lead-modal/component.js
import "seedypea-client/seedy-lead-modal";

The element registers the lead-capture tactic, opens a native <dialog>, and tracks LeadEmailCaptured with the captured email in the event detail. Copy can be overridden with kicker, title, body, and action attributes. Links can pass source context with sp-prop-source.

Segment-aware CTAs can choose a variant from the current profile fold:

<seedy-cta class="button primary">
  <seedy-variant segment="known" href="/manifesto/receipts">
    Read the receipts doctrine
  </seedy-variant>
  <seedy-variant
    segment="anonymous"
    href="mailto:[email protected]"
    sp-tactic="lead-capture"
    sp-prop-source="enterprise-hero"
    sp-prevent-default="true">
    Bring us your ugliest workflow
  </seedy-variant>
</seedy-cta>

Import seedypea-client/seedy-cta once to register <seedy-cta> and <seedy-variant>. Variants are evaluated in source order against profile.segments, with known and anonymous derived from profile.fold.known.

sp-event emits one event. sp-tactic runs a local program. sp-prop-* values are passed through as strings. This package intentionally uses short sp-* attributes instead of data-sp-*; they are a convenience layer over the event substrate, not a separate workflow system.

There is intentionally no browser identify() API. Browser code should use track() for observed behavior, include identifiers such as email or cart IDs when they naturally occur, and let the project topology derive traits from the event history.

Toast notifications: seedy-toast

Generic toast renderer that listens for substrate events via DOM bubbling and reads a child registry to decide what to show.

<seedy-toast>
  <seedy-lead-modal></seedy-lead-modal>
  <seedy-event on="lead-captured" type="success" message="You're on the list."></seedy-event>
  <seedy-event on="lead-error"    type="error"   message="Could not save that email."></seedy-event>
</seedy-toast>
import "seedypea-client/seedy-toast";

Dispatchers anywhere inside the toast subtree fire a single normalized event:

this.dispatchEvent(new CustomEvent("seedy-toast", {
  bubbles: true,
  composed: true,
  detail: { name: "lead-captured", type: "success" }
}));

The toast uses one addEventListener and looks up the matching child config at event time, so adding or removing <seedy-event> rows requires no listener coordination. seedy-lead-modal already dispatches this alongside its semantic seedy-lead-captured / seedy-lead-error events.

Per-row attributes:

  • on — discriminator that matches detail.name.
  • typesuccess | error | warn | info. Drives styling. Defaults to info.
  • message — text shown.
  • duration — ms before auto-dismiss. Defaults to 4000. Set 0 to disable.

A single toast stack is rendered at the body level. Multiple <seedy-toast> instances on the same page share the stack. For code paths without a bubbling event source, the library exports pushSeedyToast({ message, type, duration }).

Direct-to-Seedy-Pea fallback:

import { init, pageView, track } from "seedypea-client";

init({
  projectId: "proj_...",
  writeKey: "wk_..."
});

pageView();

track("AddToCart", {
  item: "pants",
  size: "xxl"
});

In edge mode, the site's seedypea edge helper owns the first-party HttpOnly visitor cookie and forwards events. In direct mode, the client mints an anonymous_id, stores it in localStorage, and includes it with each event. Seedy Pea validates the project write key and request origin before appending events.

Ships vanilla ESM .js plus .d.ts types.