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

@channlize/core

v0.1.0-alpha.1

Published

Channlize Core SDK - TypeScript API wrapper for Channlize platform

Readme

@channlize/core

Core TypeScript SDK for the Channlize platform. Provides API client functionality for submitting contact forms and managing chat sessions.

Installation

npm install @channlize/core

Usage

Basic Setup

import { ChannlizeClient } from '@channlize/core';

const client = new ChannlizeClient({
  apiKey: 'your-api-key',
  projectId: 'your-project-id',
  baseUrl: 'https://api.channlize.com', // optional
  timeout: 10000, // optional, default 10s
});

Contact Forms

// Submit a contact form
const response = await client.submitContactForm({
  name: 'John Doe',
  email: '[email protected]',
  subject: 'Support Request',
  message: 'I need help with my account',
  customFields: {
    department: 'support',
    priority: 'high',
  },
});

console.log('Submission ID:', response.id);
console.log('Slack thread:', response.slackThreadUrl);

Chat Sessions

// Create a new chat session
const sessionResponse = await client.createChatSession({
  userAgent: navigator.userAgent,
  pageUrl: window.location.href,
});

const session = sessionResponse.session;

// Send a message
await client.sendMessage(session.id, 'Hello, I need help!');

// Send message with file attachments
const files = [document.querySelector('input[type="file"]').files[0]];
await client.sendMessage(session.id, 'Please see attached file', files);

// Get session details
const updatedSession = await client.getChatSession(session.id);

// Get messages
const messages = await client.getChatMessages(session.id, 50, 0);

// Close session
await client.closeChatSession(session.id);

Error Handling

import {
  ChannlizeError,
  ValidationError,
  AuthenticationError,
  RateLimitError,
} from '@channlize/core';

try {
  await client.submitContactForm(formData);
} catch (error) {
  if (error instanceof ValidationError) {
    console.error('Validation failed:', error.message, error.field);
  } else if (error instanceof AuthenticationError) {
    console.error('Authentication failed:', error.message);
  } else if (error instanceof RateLimitError) {
    console.error('Rate limit exceeded:', error.message);
  } else if (error instanceof ChannlizeError) {
    console.error('API error:', error.message, error.statusCode);
  } else {
    console.error('Unknown error:', error);
  }
}

API Reference

ChannlizeClient

Constructor Options

interface ChannlizeConfig {
  apiKey: string;           // Required: Your API key
  projectId: string;        // Required: Your project ID
  baseUrl?: string;         // Optional: API base URL
  timeout?: number;         // Optional: Request timeout in ms
}

Methods

  • submitContactForm(data: ContactFormData): Promise<CreateContactResponse>
  • createChatSession(metadata?: Record<string, unknown>): Promise<CreateChatSessionResponse>
  • sendMessage(sessionId: string, content: string, attachments?: File[]): Promise<SendMessageResponse>
  • getChatSession(sessionId: string): Promise<ChatSession>
  • getChatMessages(sessionId: string, limit?: number, offset?: number): Promise<ChatMessage[]>
  • closeChatSession(sessionId: string): Promise<ChatSession>

Types

All TypeScript types are exported from the package:

import type {
  ChannlizeConfig,
  ContactFormData,
  ChatMessage,
  ChatSession,
  FileAttachment,
  CreateContactResponse,
  CreateChatSessionResponse,
  SendMessageResponse,
  ChannlizeError,
  ValidationError,
  AuthenticationError,
  RateLimitError,
} from '@channlize/core';

License

MIT