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

atoms-widget-sdk

v1.2.0

Published

Atoms Widget SDK for React applications

Downloads

9

Readme

Atoms Widget SDK

A React-based widget SDK for integrating Atoms AI chat and voice functionality into web applications.

🚀 Current Status

✅ Implemented Features

  • Chat Functionality: Full chat implementation using atoms-client-sdk
  • React Component: <AtomsWidget /> component for React/Next.js projects
  • HTML Embedding: <atoms-widget> custom element for vanilla HTML
  • TypeScript Support: Full type safety and IntelliSense
  • Multiple Themes: Light/dark theme support
  • Customizable UI: Colors, sizes, positioning options
  • Auto Token Management: Automatic access token retrieval from Atoms API

⏳ Planned Features

  • Voice Calling: Currently skeleton implementation only
  • Hybrid Mode: Switch between chat and voice seamlessly
  • Advanced Customization: More UI customization options

📦 Installation

For React/Next.js Projects

npm install atoms-widget-sdk
import { AtomsWidget } from "atoms-widget-sdk";

function App() {
  return (
    <AtomsWidget
      assistantId="your-assistant-id"
      mode="chat"
      theme="light"
      accentColor="#2d9d9f"
      title="AI Assistant"
    />
  );
}

For HTML/Vanilla JS Projects

<!DOCTYPE html>
<html>
  <head>
    <!-- Include the widget (CSS is automatically injected) -->
    <script src="https://unpkg.com/atoms-widget-sdk/dist/embed/widget.umd.js"></script>
  </head>
  <body>
    <!-- Add the widget -->
    <atoms-widget
      assistant-id="your-assistant-id"
      mode="chat"
      theme="light"
      size="full"
      accent-color="#3B82F6"
      cta-button-color="#1F2937"
      cta-button-text-color="#FFFFFF"
      title="AI Assistant"
      cta-title="Chat with us"
      cta-subtitle="24/7 Support"
      chat-placeholder="How can I help you today?"
    ></atoms-widget>
  </body>
</html>

🔧 Configuration Options

| Property | Type | Default | Description | | ----------------- | ------------------------------------------------------------ | ---------------------- | --------------------------------------- | | assistantId | string | required | Your assistant ID | | mode | "chat" | "voice" | "hybrid" | "chat" | Widget mode (only chat works currently) | | theme | "light" | "dark" | "light" | UI theme | | size | "tiny" | "compact" | "full" | "full" | Widget size | | position | "bottom-right" | "bottom-left" | "top-right" | "top-left" | "bottom-right" | Widget position | | accentColor | string | "#2d9d9f" | Accent color (hex) | | title | string | "Talk with AI" | Widget title | | chatPlaceholder | string | "Type your message..." | Chat input placeholder |

🏗️ Development

Build Commands

# Install dependencies
npm install

# Build React library
npm run build

# Build HTML embedding
npm run build:widget

# Build both
npm run build:all

Project Structure

atoms-widget-sdk/
├── src/
│   ├── components/          # UI components
│   │   ├── AtomsWidget.tsx  # Main widget component
│   │   └── widget/          # UI subcomponents
│   ├── hooks/               # React hooks
│   │   ├── useAtomsWidget.ts # Main orchestrator hook
│   │   ├── useAtomsChat.ts   # Chat functionality
│   │   └── useAtomsCall.ts   # Voice functionality (skeleton)
│   ├── utils/               # Utility functions
│   │   └── apiClient.ts     # API integration
│   └── widget/              # HTML embedding
│       └── index.ts         # Widget loader for HTML
├── dist/                    # Built library
│   ├── index.js            # React library
│   └── embed/              # HTML embedding
│       └── widget.umd.js   # Widget bundle
└── test-chat.html          # Demo page

🔌 API Integration

The widget automatically handles:

  1. Token Management: Fetches access tokens from https://atoms-api.smallest.ai/api/v1/conversation/{mode}
  2. Session Management: Manages connection lifecycle with atoms-client-sdk
  3. Event Handling: Processes transcript, error, and connection events
  4. Message State: Maintains conversation history and typing indicators

🎯 Usage Examples

Chat Mode Demo

Open test-chat.html in your browser to see the chat functionality in action.

React Integration

import { AtomsWidget } from "atoms-widget-sdk";

export default function ChatSupport() {
  return (
    <AtomsWidget
      publicKey={process.env.NEXT_PUBLIC_ATOMS_KEY}
      assistantId={process.env.NEXT_PUBLIC_ASSISTANT_ID}
      mode="chat"
      theme="dark"
      accentColor="#3B82F6"
      ctaTitle="Need Help?"
      ctaSubtitle="Chat with our AI assistant"
      onMessage={(message) => console.log("New message:", message)}
      onError={(error) => console.error("Chat error:", error)}
    />
  );
}

🔄 Architecture

The widget follows a clean architecture:

  • AtomsWidget: Main UI component
  • useAtomsWidget: Orchestrates chat and voice hooks
  • useAtomsChat: Manages chat functionality with atoms-client-sdk
  • useAtomsCall: Voice functionality (skeleton for future implementation)
  • apiClient: Handles API communication for token management

📄 License

MIT

🤝 Contributing

This is currently a focused implementation for chat functionality. Voice calling and hybrid mode will be added in future iterations.