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

eliciteer-chat-sdk

v0.1.3

Published

SDK for conducting AI-powered interviews with Eliciteer

Readme

Eliciteer Chat SDK

A lightweight TypeScript SDK for conducting AI-powered interviews with Eliciteer.

Installation

npm install eliciteer-chat-sdk
# or
yarn add eliciteer-chat-sdk
# or
pnpm add eliciteer-chat-sdk

Quick Start

Vanilla JavaScript/TypeScript

import { EliciteerClient } from 'eliciteer-chat-sdk';

const client = new EliciteerClient();
// or with custom URL:
// const client = new EliciteerClient({ baseUrl: 'https://your-backend.com' });

// Load an interview by ID
const interview = await client.getInterview('interview-id');
console.log(interview.briefing);
console.log(interview.clientName);

// Send messages
let response = await client.sendMessage('interview-id', 'Hello, I am ready!');
console.log(response.response); // AI's reply

while (!response.isComplete) {
  const userInput = await getUserInput(); // Your input method
  response = await client.sendMessage('interview-id', userInput);
  console.log(response.response);
}

console.log('Interview complete!', response.interviewSummary);

React

import { EliciteerProvider, useInterview } from 'eliciteer-chat-sdk/react';

// Wrap your app with the provider
function App() {
  return (
    <EliciteerProvider config={{}}>
      <InterviewPage interviewId="abc-123" />
    </EliciteerProvider>
  );
}

// Use the hook in your components
function InterviewPage({ interviewId }) {
  const {
    interview,
    messages,
    isLoading,
    isInitializing,
    isComplete,
    error,
    progress,
    uiOptions,
    sendMessage,
  } = useInterview(interviewId);

  const [input, setInput] = useState('');

  if (isInitializing) {
    return <div>Loading...</div>;
  }

  if (isComplete) {
    return (
      <div>
        <h1>Thank you!</h1>
        {interview?.interviewSummary && <p>{interview.interviewSummary}</p>}
      </div>
    );
  }

  const handleSubmit = async (e) => {
    e.preventDefault();
    if (!input.trim()) return;
    setInput('');
    await sendMessage(input);
  };

  return (
    <div>
      {/* Progress */}
      <div>Topic {progress.current + 1} of {progress.total}</div>

      {/* Messages */}
      <div>
        {messages.map((msg, i) => (
          <div key={i} className={msg.role}>
            {msg.content}
          </div>
        ))}
      </div>

      {/* Input */}
      {uiOptions?.type === 'boolean' ? (
        <div>
          <button onClick={() => sendMessage('Yes')} disabled={isLoading}>
            Yes
          </button>
          <button onClick={() => sendMessage('No')} disabled={isLoading}>
            No
          </button>
        </div>
      ) : (
        <form onSubmit={handleSubmit}>
          <input
            value={input}
            onChange={(e) => setInput(e.target.value)}
            disabled={isLoading}
          />
          <button type="submit" disabled={isLoading}>
            Send
          </button>
        </form>
      )}
    </div>
  );
}

API Reference

EliciteerClient

The main client for interacting with the Eliciteer API.

const client = new EliciteerClient({
  baseUrl?: string;     // Optional: Backend URL (default: 'https://api.eliciteer.ai')
  debug?: boolean;      // Optional: Enable debug logging (default: false)
  timeout?: number;     // Optional: Request timeout in ms (default: 30000)
  retries?: number;     // Optional: Number of retry attempts (default: 3)
  fetch?: typeof fetch; // Optional: Custom fetch implementation
});

Methods

getInterview(interviewId: string): Promise<Interview>

Load an interview by ID.

const interview = await client.getInterview('abc-123');
sendMessage(interviewId: string, message: string, options?: ChatOptions): Promise<ChatResponse>

Send a message in the interview.

const response = await client.sendMessage('abc-123', 'Hello!');
console.log(response.response);     // AI's reply
console.log(response.isComplete);   // Whether interview is done
console.log(response.uiOptions);    // UI hints (text or boolean input)

React Hooks

useInterview(interviewId: string, options?: UseInterviewOptions)

Main hook for conducting interviews.

const {
  interview,      // Interview state
  messages,       // Message array
  isLoading,      // Request in progress
  isInitializing, // Initial load
  isComplete,     // Interview done
  error,          // Error if any
  notFound,       // 404 status
  progress,       // { current, total }
  uiOptions,      // Input type hints
  debugInfo,      // Debug data (if enabled)
  sendMessage,    // Send a message
  reload,         // Reload interview
} = useInterview(interviewId, {
  debug: false,                    // Enable debug info
  onComplete: (summary) => {},     // Completion callback
  onError: (error) => {},          // Error callback
});

Types

Interview

interface Interview {
  interviewId: string;
  topicId: string;
  briefing: string;
  clientName?: string;
  status: 'in_progress' | 'completed';
  messages: Message[];
  plan: TopicPlan[];
  currentTopicIndex: number;
  collectedInfo: string;
  interviewSummary?: string;
  createdAt: string;
  completedAt?: string;
}

ChatResponse

interface ChatResponse {
  response: string;
  status: 'continue' | 'completed';
  isComplete: boolean;
  interviewSummary?: string;
  currentTopicIndex: number;
  totalTopics: number;
  uiOptions?: UIOptions;
  debugInfo?: DebugInfo;
}

UIOptions

interface UIOptions {
  type: 'text' | 'boolean';
  options?: string[];
}

Error Handling

The SDK provides typed errors for common scenarios:

import {
  EliciteerError,
  NotFoundError,
  NetworkError,
  TimeoutError,
} from 'eliciteer-chat-sdk';

try {
  await client.sendMessage(interviewId, message);
} catch (error) {
  if (error instanceof NotFoundError) {
    console.log('Interview not found');
  } else if (error instanceof NetworkError) {
    console.log('Network issue');
  } else if (error instanceof TimeoutError) {
    console.log('Request timed out');
  }
}

Getting an Interview ID

Interview IDs are created through the Eliciteer platform. To get an interview ID programmatically, call your backend's topic start endpoint:

// This is NOT part of the SDK - call your backend directly
const response = await fetch('https://your-backend.com/topic/{topicId}/start', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ participantName: 'John Doe' }),
});
const { interview_id } = await response.json();

// Now use the SDK
const { messages, sendMessage } = useInterview(interview_id);

License

Apache-2.0