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

@agoodway/goodleads-web

v0.1.0

Published

Browser SDK for GoodLeads lead capture widgets. Provides the client-side runtime for quiz funnels, video calls, live chat, session recording, consent tracking, and ad platform attribution — all as vanilla TypeScript with zero framework dependencies.

Readme

@agoodway/goodleads-web

Browser SDK for GoodLeads lead capture widgets. Provides the client-side runtime for quiz funnels, video calls, live chat, session recording, consent tracking, and ad platform attribution — all as vanilla TypeScript with zero framework dependencies.

Installation

npm install @agoodway/goodleads-web
# or
bun add @agoodway/goodleads-web

Entry Points

| Import | Description | |--------|-------------| | @agoodway/goodleads-web | Main SDK (quiz API, video, chat, tracking, consent) | | @agoodway/goodleads-web/recording | Session recording module (rrweb wrapper) |

Usage

Quiz Funnel API Integration

Connect a quiz engine to the GoodLeads Lead Collection API:

import { initQuizFunnel } from "@agoodway/goodleads-web";

initQuizFunnel({
  container: document.getElementById("quiz")!,
  accountSlug: "acme-roofing",
  apiBaseUrl: "https://api.goodleads.com",
  // Optional: pre-fetched questionnaire (skips network fetch)
  questionnaire: questionnaireData,
  // Optional: campaign targeting
  campaignSlug: "spring-2025",
  // Optional: session recording
  recordingSessionId: "rec_abc123",
});

Ad Platform Attribution

Automatically captures UTM parameters and ad platform click IDs from the URL:

import { collectTrackingMetadata, collectPlatformCookies } from "@agoodway/goodleads-web";

// Collects from URL params: utm_*, gclid, fbclid, ttclid, msclkid, etc.
const metadata = collectTrackingMetadata();
// { utm_source: "google", gclid: "abc123", ... }

// Collects platform cookies (_fbc, _fbp, etc.)
const cookies = collectPlatformCookies();

Supported platforms:

  • Google Ads (gclid, gbraid, wbraid, ValueTrack params)
  • Meta/Facebook (fbclid, campaign_id, adset_id, ad_id, placement)
  • TikTok (ttclid)
  • Microsoft Ads (msclkid)
  • UTM parameters (source, medium, campaign, content, term)

Consent Proof

Build cryptographic consent proof for TCPA compliance:

import { buildConsentProof } from "@agoodway/goodleads-web";
import type { ConsentProofContext } from "@agoodway/goodleads-web";

const proof = buildConsentProof({
  consentText: "I agree to be contacted...",
  consentVersion: "v2.1",
  questionId: "tcpa_consent",
  ipAddress: "192.168.1.1",
  userAgent: navigator.userAgent,
  pageUrl: window.location.href,
});

Session Recording

Initialize session recording with rrweb:

import { initSessionRecording } from "@agoodway/goodleads-web/recording";

const recording = initSessionRecording({
  sessionId: "rec_abc123",
  eventsUrl: "https://api.goodaudit.com/api/v1/session-recordings/rec_abc123/events",
  sessionToken: "token-from-start-flow",
});

// Later: stop recording
recording.stop();

Video Calls

The SDK manages WebRTC video call state including consent, ringing, active call, and ended states:

import { LeadVideoManager } from "@agoodway/goodleads-web";

const video = new LeadVideoManager({
  container: document.getElementById("video-widget")!,
  socket: leadSocket,
  buyer: { name: "John's Roofing", phone: "555-0123" },
});

video.start(); // Shows consent modal → rings buyer → connects call

Live Chat

Real-time chat widget connected via Phoenix WebSocket:

import { LeadChatManager } from "@agoodway/goodleads-web";

const chat = new LeadChatManager({
  container: document.getElementById("chat-widget")!,
  socket: leadSocket,
  buyer: { name: "John's Roofing" },
});

Phoenix WebSocket Connection

Manages the real-time connection to the GoodLeads backend:

import { LeadSocket } from "@agoodway/goodleads-web";

const socket = new LeadSocket({
  url: "wss://api.goodleads.com/socket",
  leadId: "lead-uuid",
  leadToken: "bearer-token",
});

socket.connect();
socket.onPresence((payload) => {
  console.log("Buyer presence:", payload);
});

Dependencies

  • @agoodway/goodleads-quiz-core — Quiz engine and question types
  • phoenix — Phoenix WebSocket client for real-time features
  • rrweb — Session recording (only in the /recording entry point)

Browser Support

Works in all modern browsers (ES2022+). No polyfills required.

License

MIT