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

smart-intake-sdk

v0.2.10

Published

Smart Intake SDK - Embeddable conversational intake flow for applications

Readme

Smart Intake SDK

React + Vite + Tailwind v4 implementation of the Smart Intake split-pane experience. This package powers the applicant runtime, admin creation flow, and any embedded previews.

Installation

npm install smart-intake-sdk

Peer Dependencies: This package requires React 18+ or 19+:

npm install react react-dom

Quick Start

import { initSmartIntakeSDK } from 'smart-intake-sdk'
import 'smart-intake-sdk/style.css'

const { destroy } = initSmartIntakeSDK({
  target: '#smart-intake',
  config: {
    apiBaseUrl: 'https://your-api.example.com/api/v1',
    apiToken: 'your-api-token',
    flowPublicId: 'flow_abc123',
  },
})

// Clean up when done
destroy()

With React

import { useEffect, useRef } from 'react'
import { initSmartIntakeSDK } from 'smart-intake-sdk'
import 'smart-intake-sdk/style.css'

function SmartIntakeEmbed({ flowId, apiToken }) {
  const containerRef = useRef<HTMLDivElement>(null)
  const sdkRef = useRef<{ destroy: () => void } | null>(null)

  useEffect(() => {
    if (!containerRef.current) return

    sdkRef.current = initSmartIntakeSDK({
      target: containerRef.current,
      config: {
        apiBaseUrl: 'https://your-api.example.com/api/v1',
        apiToken,
        flowPublicId: flowId,
      },
    })

    return () => {
      sdkRef.current?.destroy()
    }
  }, [flowId, apiToken])

  return <div ref={containerRef} style={{ height: '100vh' }} />
}

Configuration

The SDK accepts these configuration options:

type SmartIntakeSDKConfig = {
  // Required
  apiBaseUrl: string      // Your Smart Intake API endpoint
  apiToken: string        // Authentication token
  flowPublicId: string    // The flow to render

  // Optional
  appearance?: 'light' | 'dark'           // Color scheme (default: 'light')
  previewTheme?: 'light' | 'dark' | 'hybrid'  // Preview mode theme
  hideDevHeader?: boolean                  // Hide the dev toolbar
  cableUrl?: string                        // WebSocket URL override
  initialMessage?: string                  // Seed the conversation
  locale?: string                          // Locale code (default: 'en-US')
  theme?: ThemeOverrides                   // Custom theme overrides
}

Theme Customization

Override colors and typography to match your brand:

initSmartIntakeSDK({
  target: '#smart-intake',
  config: {
    apiBaseUrl: '...',
    apiToken: '...',
    flowPublicId: '...',
    appearance: 'dark',
    theme: {
      colors: {
        primary: '#111e6c',
        accentGreen: '#1db954',
      },
      typography: {
        fontFamily: '"Source Sans 3", system-ui',
      },
    },
  },
})

Seeding Conversations

Pre-populate the conversation with an initial message:

initSmartIntakeSDK({
  target: '#smart-intake',
  config: {
    flowPublicId: 'flow_123',
    initialMessage: 'Hi! I need help refinancing my mortgage.',
  },
})

Development

Setup

cd code/smart-intake-sdk
npm install
npm run dev

Visit http://localhost:5173 to see the split-pane shell rendered with mock data.

Scripts

| Command | Description | | --- | --- | | npm run dev | Launch Vite dev server | | npm run build | Type-check + build production bundle | | npm run preview | Preview the production build | | npm run lint | Run ESLint | | npm run storybook | Launch Storybook playground on port 6006 | | npm run build-storybook | Build static Storybook | | npm run test | Run Vitest unit tests |

Storybook

Run npm run storybook to explore components:

  • Foundations/Theme Tokens – color palette, typography, spacing scale, icon set
  • Surfaces/Split Pane – default, loading skeleton, and dark-mode variants
  • Widgets/WidgetRenderer – renders any descriptor via the registry + chat host

API Reference

initSmartIntakeSDK(options)

Initialize and mount the SDK to a DOM element.

Parameters:

  • target: HTMLElement | string - DOM element or CSS selector
  • config: SmartIntakeSDKConfig - Configuration options

Returns: { destroy: () => void } - Cleanup function

SmartIntakeProvider

React context provider for advanced integrations:

import { SmartIntakeProvider } from 'smart-intake-sdk'

<SmartIntakeProvider config={{ apiBaseUrl: '...', apiToken: '...' }}>
  <YourApp />
</SmartIntakeProvider>

TypeScript

Full TypeScript support with exported types:

import type { SmartIntakeSDKConfig, SmartIntakeTheme, ThemeOverrides } from 'smart-intake-sdk'

Browser Support

  • Chrome/Edge 88+
  • Firefox 78+
  • Safari 14+

License

MIT