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

diversion-crumb

v0.1.1

Published

Crumb voice assistant SDK – connect your site to the Crumb IaaS backend via adapters

Downloads

192

Readme

diversion-crumb

Crumb voice assistant SDK. Install in your app, set your API key and adapters, and you get a full bakery-style experience: voice + chat widget, cart proposals, navigation, and discounts. The SDK fetches assistant config from the Crumb IaaS backend; later you can customise tools and system prompts via the provider.

Install

pnpm add diversion-crumb @vapi-ai/web

Env

  • NEXT_PUBLIC_CRUMB_API_KEY – Your Crumb API key (from the IaaS provider).
  • NEXT_PUBLIC_CRUMB_BACKEND_URL – Crumb backend base URL (e.g. https://api.crumb.example.com or http://localhost:3001 for dev).
  • NEXT_PUBLIC_VAPI_PUBLIC_KEY – Your VAPI public key (from the same provider or your own VAPI project).

Quick start (full UI)

Wrap your app with CrumbProvider, pass adapters, and render <CrumbWidget />. You get floating voice + chat buttons, sidebar with messages and cart proposal cards (Yes/No), mic selector, and call controls. No extra UI code.

import { CrumbProvider, CrumbWidget } from "diversion-crumb";
import { useRouter } from "next/navigation";

function App({ children }) {
  const router = useRouter();
  const adapters = {
    navigate: (path) => router.push(path),
    applyDiscount: (percent) => { /* update your cart */ },
    removeFromCart: async (cartItemId) => { /* call your API */ },
    onCartUpdated: () => { /* reload cart */ },
  };

  return (
    <CrumbProvider
      apiKey={process.env.NEXT_PUBLIC_CRUMB_API_KEY!}
      backendUrl={process.env.NEXT_PUBLIC_CRUMB_BACKEND_URL!}
      vapiPublicKey={process.env.NEXT_PUBLIC_VAPI_PUBLIC_KEY!}
      adapters={adapters}
    >
      {children}
      <CrumbWidget assistantName="Crumb" />
    </CrumbProvider>
  );
}

When the assistant calls proposeCartUpdate, the widget shows the proposal cards and Yes/No automatically. Optional: pass onCartProposal if you want to show your own UI and call approveProposal() / rejectProposal() from useCrumb().

Headless (custom UI)

Use useCrumb() and build your own UI:

import { CrumbProvider, useCrumb } from "diversion-crumb";

// Wrap with CrumbProvider and adapters, then:
const { status, startCall, endCall, messages, pendingProposal, approveProposal, rejectProposal } = useCrumb();

Adapters

| Adapter | Required | Description | |--------|----------|-------------| | navigate | Yes | Navigate to a path (e.g. router.push(path)). | | onCartProposal | No | Called when the assistant shows a cart update proposal; show your UI and use approveProposal() / rejectProposal() from useCrumb(). | | applyDiscount | No | Apply a discount percentage to the cart. | | removeFromCart | No | Remove a cart item by ID (async). | | onCartUpdated | No | Called after server-side cart tools run; reload your cart. |

Provider selection and env

Your IaaS provider may give you an env template based on selected providers (STT, TTS, LLM). Set the variables they provide; the SDK only needs NEXT_PUBLIC_CRUMB_API_KEY, NEXT_PUBLIC_CRUMB_BACKEND_URL, and NEXT_PUBLIC_VAPI_PUBLIC_KEY.

Scaffolding a new project

For a new Next.js app from scratch, you can use create-vapi-agent (packages/create-agent in this repo) to scaffold a project with Vapi, shadcn/ui, and a voice agent. For the Crumb IaaS flow (our backend + tools + system prompts), use this SDK instead: install diversion-crumb, add CrumbProvider + CrumbWidget and adapters, and point env at the Crumb backend.