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

@original-land/shopify-headless-chatbot

v0.2.5

Published

Shopify Headless Chatbot

Readme

Shopify Headless Chatbot

A ready-to-use chat widget component for Shopify Hydrogen storefronts with built-in customer order tracking and context integration.

Installation

npm install @original-land/shopify-headless-chatbot

Usage

1. Import the ChatWidget component

In your Hydrogen project, import the ChatWidget component inside the <App /> component in the root.tsx file:

import { ChatWidget } from '@original-land/shopify-headless-chatbot';

export default function App() {
  return (
    <html>
      <head>{/* ... */}</head>
      <body>
        {/* ... other components ... */}
        
        {/* Add the ChatWidget */}
        <ChatWidget />
        <Scripts />
      </body>
    </html>
  );
}

2. Configure API endpoints

In your Hydrogen project, create the files to re-export the API loaders:

Endpoint for widget data

// app/routes/api.original.widget-data.ts
export { dataLoader as loader } from "@original-land/shopify-headless-chatbot";

This will automatically create the /api/original/widget-data endpoint that the ChatWidget component uses to retrieve customer order data.

Endpoint for the Customer Account API URL

// app/routes/api.original.widget-url.ts
export { urlLoader as loader } from "@original-land/shopify-headless-chatbot";

This will create the /api/original/widget-url endpoint that returns the URL configured in the PUBLIC_ORIGINAL_URL_WIDGET_SCRIPT environment variable.

3. Configure Content Security Policy

To allow loading the widget script, you must add the script domain to the Content Security Policy in the entry.server.tsx file:

// app/entry.server.tsx
import {createContentSecurityPolicy} from '@shopify/hydrogen';

const {nonce, header, NonceProvider} = createContentSecurityPolicy({
  scriptSrc: [
    "'self'",
    'https://cdn.shopify.com',
    // Add the following domain
    'https://ai-dashboard.original.land', 
  ],
  defaultSrc: [
    "'self'",
    'https://cdn.shopify.com',
    // Add the following domain
    'https://static.noku.io', 
  ],
  connectSrc: [
    "'self'",
    'https://cdn.shopify.com',
    // Add the following domain
    'https://ai-api.original.land',
  ],
  mediaSrc: [
    "'self'",
    'https://cdn.shopify.com',
    // Add the following domain and blob, data
    'https://static.noku.io',
    'blob:',
    'data:',
  ],
});

Note: The ChatWidget component uses the Hydrogen Script component that automatically adds the necessary nonce for Content Security Policy.

Features

  • 🚀 TypeScript support with full type definitions
  • 📦 ESM and CommonJS module formats
  • 🛠 Built for modern JavaScript environments
  • 🔌 Easy integration with Shopify headless commerce
  • 💬 Ready-to-use chat widget component
  • 🛒 Automatic order information display for logged-in customers

Development

Prerequisites

  • Node.js (see .nvmrc for version)
  • pnpm

Setup

  1. Clone the repository
git clone https://github.com/noku-team/shopify-headless-chatbot.git
cd shopify-headless-chatbot
  1. Install dependencies
pnpm install

Scripts

  • pnpm build - Build the library for production
  • pnpm lint - Type-check the code with TypeScript
  • pnpm release - Build and publish the package

Building

The project uses tsup to bundle the TypeScript code into both CommonJS and ESM formats with TypeScript declarations.

pnpm build

Publishing

This project uses Changesets for version management and automated publishing via GitHub Actions.

Release Process

  1. Create a changeset:
npx changeset
  1. Commit the changeset and merge to main

  2. The CI pipeline will automatically:

    • Version the package
    • Update the CHANGELOG
    • Publish to npm
    • Create a GitHub release

Project Structure

shopify-headless-chatbot/
├── index.ts              # Main entry point
├── package.json          # Package configuration
├── tsconfig.json         # TypeScript configuration
├── .changeset/           # Changeset configuration
└── .github/
    └── workflows/        # CI/CD workflows

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT © Original Land SA

Author

Original Land SA


Built with ❤️ for the Shopify ecosystem