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

transactional-react

v0.1.1

Published

Official React SDK for Transactional - Auth, Chat, Knowledge Base, and Forms components

Readme

transactional-react

Official React SDK for Transactional - Auth, Chat, Knowledge Base, and Forms components for React and Next.js applications.

npm version License: MIT

Installation

npm install transactional-react
# or
yarn add transactional-react
# or
pnpm add transactional-react

Features

  • Chat Widget - Embeddable support chat for your application
  • Knowledge Base - Self-service help center components
  • Forms - Customizable form components with validation
  • Auth Components - Pre-built authentication UI (coming soon)
  • Full TypeScript support
  • Works with React 18+ and Next.js 13+
  • Customizable styling with CSS variables

Quick Start

Chat Widget

Add a support chat widget to your application:

import { ChatWidget } from 'transactional-react/chat';

function App() {
  return (
    <div>
      <h1>My App</h1>
      <ChatWidget
        projectId="your_project_id"
        // Optional: identify the user
        user={{
          id: 'user_123',
          email: '[email protected]',
          name: 'John Doe',
        }}
      />
    </div>
  );
}

Knowledge Base

Embed a searchable knowledge base:

import { KnowledgeBase } from 'transactional-react/kb';

function HelpPage() {
  return (
    <KnowledgeBase
      projectId="your_project_id"
      theme="light"
    />
  );
}

Or use individual components:

import {
  KBSearch,
  KBArticle,
  KBCollections
} from 'transactional-react/kb';

function CustomHelpCenter() {
  return (
    <div>
      <KBSearch projectId="your_project_id" />
      <KBCollections projectId="your_project_id" />
    </div>
  );
}

Forms

Create embeddable forms:

import { TransactionalForm } from 'transactional-react/forms';

function ContactPage() {
  return (
    <TransactionalForm
      formId="form_xxxxx"
      onSubmit={(data) => {
        console.log('Form submitted:', data);
      }}
      onError={(error) => {
        console.error('Form error:', error);
      }}
    />
  );
}

Components

Chat

| Component | Description | |-----------|-------------| | ChatWidget | Floating chat widget with launcher button | | ChatWindow | Standalone chat window component | | ChatProvider | Context provider for chat state |

Knowledge Base

| Component | Description | |-----------|-------------| | KnowledgeBase | Full knowledge base with search and navigation | | KBSearch | Search input with results dropdown | | KBArticle | Single article display | | KBCollections | Collection list/grid view | | KBProvider | Context provider for KB state |

Forms

| Component | Description | |-----------|-------------| | TransactionalForm | Complete form with all fields | | FormField | Individual form field | | FormProvider | Context provider for form state |

Configuration

Chat Widget Options

<ChatWidget
  projectId="your_project_id"
  // Identify the current user
  user={{
    id: 'user_123',
    email: '[email protected]',
    name: 'John Doe',
    avatar: 'https://example.com/avatar.jpg',
  }}
  // Custom metadata
  metadata={{
    plan: 'pro',
    company: 'Acme Inc',
  }}
  // Positioning
  position="bottom-right" // or "bottom-left"
  // Custom launcher
  launcher={<button>Need help?</button>}
  // Callbacks
  onOpen={() => console.log('Chat opened')}
  onClose={() => console.log('Chat closed')}
  onNewMessage={(message) => console.log('New message:', message)}
/>

Knowledge Base Options

<KnowledgeBase
  projectId="your_project_id"
  // Theme
  theme="light" // or "dark" or "system"
  // Custom header
  header={<h1>Help Center</h1>}
  // Hide specific sections
  hideSearch={false}
  hideCollections={false}
  // Callbacks
  onArticleView={(article) => console.log('Viewed:', article.title)}
  onSearch={(query) => console.log('Searched:', query)}
/>

Styling

CSS Variables

Customize the appearance using CSS variables:

:root {
  --transactional-primary: #3b82f6;
  --transactional-primary-hover: #2563eb;
  --transactional-background: #ffffff;
  --transactional-foreground: #09090b;
  --transactional-muted: #f4f4f5;
  --transactional-muted-foreground: #71717a;
  --transactional-border: #e4e4e7;
  --transactional-radius: 0.5rem;
}

Import Styles

Import the default styles in your app:

import 'transactional-react/styles.css';

Or import component-specific styles:

import 'transactional-react/chat/styles.css';
import 'transactional-react/kb/styles.css';
import 'transactional-react/forms/styles.css';

Next.js App Router

For Next.js 13+ with the App Router, use the client directive:

'use client';

import { ChatWidget } from 'transactional-react/chat';

export function Chat() {
  return <ChatWidget projectId="your_project_id" />;
}

TypeScript

Full TypeScript support is included. Import types as needed:

import type {
  ChatWidgetProps,
  KnowledgeBaseProps,
  TransactionalFormProps,
  User,
  Message,
  Article,
} from 'transactional-react';

Requirements

  • React 18.0.0 or later
  • React DOM 18.0.0 or later
  • Next.js 13.0.0 or later (optional, for Next.js features)

Documentation

Full documentation is available at usetransactional.com/docs/react-sdk

License

MIT - see LICENSE for details.