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

@formmy.app/chat

v0.0.3

Published

Official React SDK for Formmy Chat - AI chatbot widgets and headless hooks

Readme

@formmy.app/chat

Official SDK for Formmy AI Chat - Build conversational AI experiences in your React applications.

Installation

npm install @formmy.app/chat

Peer Dependencies:

npm install react ai @ai-sdk/react

Quick Start

Backend (Node.js)

Use the Formmy client to manage agents and conversations from your server.

import { Formmy } from '@formmy.app/chat';

const formmy = new Formmy({ secretKey: 'formmy_sk_live_xxx' });

// List all agents
const agents = await formmy.agents.list();

// Create a new agent
const { agent } = await formmy.agents.create({
  name: 'Customer Support',
  instructions: 'You are a helpful customer support agent.',
  welcomeMessage: 'Hello! How can I help you today?',
});

// Send a message (non-streaming)
const response = await formmy.chat.send('Hello!', {
  agentId: agent.id,
  sessionId: 'user_123',
});

Frontend (React)

Use the provider and components to add chat to your React app.

import { FormmyProvider, ChatBubble } from '@formmy.app/chat/react';

function App() {
  return (
    <FormmyProvider publishableKey="formmy_pk_live_xxx">
      <YourApp />
      <ChatBubble
        agentId="agent_xxx"
        position="bottom-right"
        theme="light"
      />
    </FormmyProvider>
  );
}

Headless Hook

Build custom chat UIs with the useFormmyChat hook.

import { useFormmyChat } from '@formmy.app/chat/react';

function CustomChat({ agentId }: { agentId: string }) {
  const { messages, input, setInput, handleSubmit, isLoading } = useFormmyChat({
    agentId,
  });

  return (
    <div>
      {messages.map((msg) => (
        <div key={msg.id}>
          <strong>{msg.role}:</strong> {msg.content}
        </div>
      ))}

      <form onSubmit={handleSubmit}>
        <input
          value={input}
          onChange={(e) => setInput(e.target.value)}
          placeholder="Type a message..."
        />
        <button type="submit" disabled={isLoading}>
          Send
        </button>
      </form>
    </div>
  );
}

API Reference

Formmy Client

const formmy = new Formmy({ secretKey: 'formmy_sk_live_xxx' });

// Agents
formmy.agents.list()
formmy.agents.get(agentId)
formmy.agents.create({ name, instructions, welcomeMessage?, model? })
formmy.agents.update(agentId, { name?, instructions?, model? })
formmy.agents.delete(agentId)

// Chat
formmy.chat.send(message, { agentId, sessionId })
formmy.chat.history(sessionId, agentId)

React Components

FormmyProvider

<FormmyProvider
  publishableKey="formmy_pk_live_xxx"
  baseUrl="https://formmy.app"  // optional
>
  {children}
</FormmyProvider>

ChatBubble

<ChatBubble
  agentId="agent_xxx"           // required
  position="bottom-right"        // bottom-right | bottom-left
  theme="light"                  // light | dark
  welcomeMessage="Hello!"        // optional override
  buttonLabel="Chat with us"     // optional
/>

useFormmyChat

const {
  messages,      // Message[]
  input,         // string
  setInput,      // (value: string) => void
  handleSubmit,  // (e: FormEvent) => void
  isLoading,     // boolean
  error,         // Error | null
  reload,        // () => void
  stop,          // () => void
} = useFormmyChat({ agentId });

Keys

| Key Type | Prefix | Usage | Scope | |----------|--------|-------|-------| | Secret Key | formmy_sk_live_ | Backend only | Full API access | | Publishable Key | formmy_pk_live_ | Frontend safe | Chat only, domain-restricted |

Get your keys at formmy.app/dashboard/api-keys

TypeScript

Full TypeScript support included.

import type {
  FormmyMessage,
  Agent,
  FormmyConfig
} from '@formmy.app/chat';

Documentation

Full documentation at formmy.app/docs/sdk

License

MIT