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

@fellow.work/client

v0.1.7

Published

Fellow SDK — headless Gateway client, AG-UI streaming, and optional React embed UI

Readme

@fellow.work/client

Fellow SDK — headless Gateway client (Thread/Run + AG-UI streaming) and optional React embed UI.

Install

npm install @fellow.work/client
# React widget (optional):
npm install react react-dom

Requires Node 22+ or a modern browser with fetch and ReadableStream.

Quick start (server)

Create an Integration App in Fellow Console and copy the API key (fkey_…).

import { createClient, EventType } from '@fellow.work/client';

const client = createClient({
  baseUrl: 'https://your-fellow-host/api',
  apiKey: process.env.FELLOW_APP_API_KEY!,
});

const { id: threadId } = await client.createThread();
const { events } = await client.run(threadId, { content: 'Hello' }, { reconnect: true });

for await (const event of events) {
  if (event.type === EventType.TEXT_MESSAGE_CONTENT) {
    process.stdout.write(event.delta);
  }
}

See examples/app-key.mjs.

Browser (access token)

Never ship fkey_ to the browser. Your backend exchanges it for a short-lived OAuth-style token:

// Backend
const { access_token } = await serverClient.createAccessToken({
  origin: 'https://your-app.com',
  external_user_id: userId,
});

// Frontend — headless
const client = createClient({
  baseUrl: 'https://your-fellow-host/api',
  accessToken: access_token,
});

See examples/access-token.mjs.

React UI (same package)

Full UI (FellowChat)

Embedded in a host app (first-party web/desktop): styles load automatically — wrap chat UI in .fellow-web-chat (done inside FellowChat / ChatInputPanel usage).

import { FellowChat } from '@fellow.work/client/react';

<FellowChat baseUrl="https://your-fellow-host/api" accessToken={token} host />

Import styles once (Full UI + Widget + site preset):

import '@fellow.work/client/ui.css';
import { FellowChat } from '@fellow.work/client/react';

<FellowChat baseUrl="https://your-fellow-host/api" accessToken={token} host />

Lite widget (FellowChatWidget)

import '@fellow.work/client/ui.css';
import { FellowChatWidget } from '@fellow.work/client/react';

<FellowChatWidget
  baseUrl="https://your-fellow-host/api"
  accessToken={token}
  externalUserId={userId}
  labels={{
    title: 'Support',
    launcher: 'Help',
    placeholder: 'How can we help?',
    empty: 'Start a conversation.',
    send: 'Send',
    stop: 'Stop',
    close: 'Close chat',
  }}
  theme={{
    accent: '#0f172a',
    userMessageBg: '#0f172a',
    launcherBg: '#0f172a',
  }}
  classNames={{ sendButton: 'my-send-btn' }}
  components={{
    Launcher: ({ label, onClick, className }) => (
      <button type="button" className={className} onClick={onClick}>{label}</button>
    ),
  }}
/>

Also available: FellowChatLite (inline lite panel), useFellowChat (headless hook).

Customization props: labels (i18n copy), theme (CSS variables), classNames, components (launcher / send / stop / close).

Script embed (no React required)

For plain HTML, WordPress, PHP, or any site without a React build step, load the self-contained IIFE bundle. React is bundled inside embed.js.

<link rel="stylesheet" href="https://your-cdn/fellow-widget.css" />
<script src="https://your-cdn/fellow-embed.js"></script>
<script>
  Fellow.init({
    mode: 'widget', // default — floating launcher + popup panel
    baseUrl: 'https://your-fellow-host/api',
    accessToken: tokenFromYourBackend,
    locale: 'zh',
  });
</script>

Inline mode mounts into a container:

<div id="support-chat" style="height:520px"></div>
<script>
  Fellow.init({
    mode: 'inline',
    container: '#support-chat',
    baseUrl: 'https://your-fellow-host/api',
    accessToken: tokenFromYourBackend,
  });
</script>

Declarative auto-mount:

<div
  data-fellow-widget
  data-fellow-base-url="https://your-fellow-host/api"
  data-fellow-access-token="..."
  style="height:520px"
></div>
<script src="https://your-cdn/fellow-embed.js"></script>

Build artifacts: dist/embed.js (~400KB minified, ~125KB gzip), dist/widget.css.

Local demo (same dev server as the playground):

cp packages/client/.env.example packages/client/.env
# set FELLOW_APP_API_KEY=fkey_…  (allowedOrigins must include http://localhost:5180)

pnpm dev:client
# → http://localhost:5180

Print an access token from the CLI (server-side):

pnpm --filter @fellow.work/client fetch-token

Queue calls before the script loads:

<script>
  window.Fellow = { q: [] };
  window.Fellow.init = (cfg) => window.Fellow.q.push(cfg);
</script>
<script src="https://your-cdn/fellow-embed.js"></script>

hostContext, tools, and onToolCall are supported via Fellow.init({ ... }) for page-context integrations.

Local dev playground

Debug React UI inside the package with Vite (hot-reloads src/, no dist/ build):

cp packages/client/.env.example packages/client/.env.local
# set FELLOW_APP_API_KEY + Gateway running

pnpm dev:client
# → http://localhost:5180

The playground exercises FellowChat (full chat) and FellowChatWidget (lite floating embed). Toggle previewMode, features, labels, and theme live.

Uses a dev-only /dev/access-token route (reads FELLOW_APP_API_KEY server-side). Integration App allowed_origins must include http://localhost:5180.

Monorepo consumers in development can also resolve development export conditions to src/ (Next.js transpilePackages).

Publish to npm

pnpm publish:client

Build only (no upload): pnpm dist:client

Published dist/*.js is obfuscated. Type declarations and CSS stay readable.

License

See LICENSE in the repository root.