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

@gymmymac/bob-widget

v2.0.0

Published

Bob - AI-powered automotive parts assistant widget with full immersive experience and GA4 analytics

Downloads

1,628

Readme

@gymmymac/bob-widget

AI-powered automotive parts assistant widget for integration into partner websites.

Installation

npm install @gymmymac/bob-widget

Quick Start (Recommended)

The easiest way to integrate Bob - just use the BobWidget component:

import { BobWidget } from '@gymmymac/bob-widget';

function App() {
  return (
    <BobWidget
      bobConfig={{
        supabaseUrl: 'https://gjoguxzstsihhxvdgpto.supabase.co',
        supabaseKey: 'eyJhbGciOiJI...', // Bob's public anon key
      }}
      hostApiConfig={{
        baseUrl: 'https://api.yoursite.com',
        apiKey: process.env.API_KEY!,
        partnerCode: 'YOUR_PARTNER_CODE',
      }}
      hostContext={{
        user: { id: user?.id, email: user?.email },
        vehicle: { selectedVehicle: currentVehicle },
      }}
      callbacks={{
        onVehicleIdentified: (vehicle) => saveVehicle(vehicle),
        onAddToCart: (item) => addToCart(item),
      }}
      variant="mobile"
    />
  );
}

That's it! No QueryClientProvider wrapping needed - Bob handles everything internally.

Alternative: BobProvider + Bob

If you need access to Bob's context in other components:

import { BobProvider, Bob, useHostContext } from '@gymmymac/bob-widget';

function App() {
  return (
    <BobProvider
      bobConfig={{
        supabaseUrl: 'https://gjoguxzstsihhxvdgpto.supabase.co',
        supabaseKey: 'eyJhbGciOiJI...',
      }}
      hostApiConfig={{
        baseUrl: 'https://api.yoursite.com',
        apiKey: process.env.API_KEY!,
        partnerCode: 'YOUR_PARTNER_CODE',
      }}
      hostContext={{
        user: { id: user?.id, email: user?.email },
      }}
      callbacks={{
        onAddToCart: (item) => addToCart(item),
      }}
    >
      <YourApp />
      <Bob variant="mobile" />
    </BobProvider>
  );
}

Checking Bob's Version

Ask Bob directly: "What version are you running?"

Or programmatically:

import { BOB_VERSION, getBobVersion } from '@gymmymac/bob-widget';

console.log(`Bob Widget Version: ${getBobVersion()}`); // e.g., "1.1.4"

Check the console for startup logs:

[BobWidget] Package loaded - v1.1.4
[BobWidget] v1.1.4 initialized
[BobWidget] QueryClient: internal

Configuration

BobWidget / BobProvider Props

| Prop | Type | Description | |------|------|-------------| | bobConfig | BobConfig | Bob's Supabase credentials (for animations, TTS) | | hostApiConfig | HostApiConfig | Your API credentials for product/vehicle lookups | | hostContext | HostContext | Current user, vehicle, cart, and purchase history | | callbacks | BobCallbacks | Event handlers for Bob actions | | queryClient | QueryClient | Optional: share your app's QueryClient |

BobWidget Additional Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | variant | 'mobile' \| 'inline' \| 'floating' \| 'fullscreen' | 'mobile' | Display variant | | showChat | boolean | true | Show chat interface | | className | string | '' | Additional CSS classes |

Host Context

Pass your app's state to Bob for personalized interactions:

const hostContext = useMemo(() => ({
  user: {
    id: user?.id,
    email: user?.email,
    name: user?.name,
    isAuthenticated: !!user,
  },
  vehicle: {
    selectedVehicle: currentVehicle,
    garageVehicles: userVehicles,
  },
  cart: {
    items: cartItems,
    totalValue: cartTotal,
  },
  history: {
    purchases: orderHistory,
    lastOrderDate: lastOrder?.date,
  },
  currentPage: location.pathname,
}), [user, currentVehicle, userVehicles, cartItems, cartTotal, orderHistory]);

Callbacks

Handle Bob's actions in your app:

const callbacks = {
  onVehicleIdentified: (vehicle) => {
    dispatch(setCurrentVehicle(vehicle));
  },
  onPartsFound: (parts) => {
    dispatch(setParts(parts));
  },
  onAddToCart: (item) => {
    dispatch(addToCart(item));
  },
  onCheckoutRequested: (url) => {
    window.location.href = url;
  },
};

Hooks

Access Bob's context from anywhere in your app (when using BobProvider):

import { 
  useBobContext,
  useHostContext,
  useBobCallbacks,
} from '@gymmymac/bob-widget';

function MyComponent() {
  const { hostContext, updateHostContext } = useBobContext();
  
  // Update context when your app state changes
  useEffect(() => {
    updateHostContext({ user: { email: newEmail } });
  }, [newEmail]);
}

Advanced: Shared QueryClient

If you want Bob to share your app's React Query cache:

import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { BobProvider, Bob } from '@gymmymac/bob-widget';

const queryClient = new QueryClient();

function App() {
  return (
    <QueryClientProvider client={queryClient}>
      <BobProvider
        bobConfig={...}
        hostApiConfig={...}
        queryClient={queryClient} // Share the cache
      >
        <Bob variant="mobile" />
      </BobProvider>
    </QueryClientProvider>
  );
}

Dependencies

Bob Widget v1.1.4+ bundles its own dependencies. You only need:

  • react ^18.0.0
  • react-dom ^18.0.0

Integration Guide

For detailed integration instructions, see CARFIX-INTEGRATION.md.

License

MIT