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

@scryme/chat

v2.91.178

Published

A high-performance, developer-friendly, fully typed TypeScript/JavaScript SDK for interacting with the Scryme Chat V2 and V3 Enterprise APIs.

Readme

Scryme Chat TypeScript SDK (@scryme/chat)

A high-performance, developer-friendly, fully typed TypeScript/JavaScript SDK for interacting with the Scryme Chat V2 and V3 Enterprise APIs.

Designed primarily for backend integrations, servers, and automated Machine-to-Machine (M2M) environments, this SDK provides unmatched DX with automatic OAuth2 token management, dynamic API proxying, custom message builders, and fluent nested helper chains.


Features

  • OAuth2 Client Credentials Grant: Built-in, fully automated caching and renewal of M2M access tokens with timing-safe, proactive expiration buffers.
  • Dynamic Method Proxying (sdk.raw): Automatic injection of Bearer token and Base URL headers into any of the generated V3 API endpoints with complete TypeScript autocompletion.
  • Fluent Nested Namespaces: High-level, developer-friendly helper routes (sdk.workspace, sdk.channel, sdk.message, sdk.webhooks, sdk.bot) for seamless workspace, department, team, and member administration.
  • Custom Message Builders: Type-safe helpers (createCustomMessageSchema, createFormCustomMessageSchema) for generating node-based interactive in-chat forms, surveys, and approval cards.
  • Isomorphic Support: Works out-of-the-box in Node.js, Next.js (server/client), Vite, and React Native.

Installation

npm install @scryme/chat
# or
pnpm add @scryme/chat
# or
yarn add @scryme/chat

Getting Started

1. Initialize the SDK

You can initialize ScrymeSDK using a static bearer token or using M2M client credentials (clientId and clientSecret) to enable auto-authentication.

import { ScrymeSDK } from '@scryme/chat';

// Option A: Machine-to-Machine (M2M) Auth (Highly recommended for servers/bots)
const sdk = new ScrymeSDK({
  baseURL: 'https://api.chat.scryme.tech',
  clientId: 'm2m_client_abc123',
  clientSecret: 'sk_m2m_secret_xyz789',
});

// Option B: Static Bearer Token Auth
const sdkWithToken = new ScrymeSDK({
  baseURL: 'https://api.chat.scryme.tech',
  token: 'oat_your_token_here',
});

Usage Guide

High-Level Fluent Namespaces (Excellent DX)

For standard CRUD workflows, utilize our intuitive nested namespace chains:

Workspaces

// List all workspaces associated with the organization
const workspaces = await sdk.workspace.list();

// Provision/Create a new tenant workspace
const newWorkspace = await sdk.workspace.create({
  name: 'Acme Corp',
  slug: 'acme-corp',
  ownerEmail: '[email protected]',
  channels: ['general', 'engineering'],
});

// Retrieve detailed workspace metadata
const workspace = await sdk.workspace.get('acme-corp');

// Update workspace branding or details
await sdk.workspace.update('acme-corp', {
  name: 'Acme Corp International',
  description: 'Updated team workspace',
});

// Delete a workspace
await sdk.workspace.delete('acme-corp');

Workspace Members

// List workspace members
const members = await sdk.workspace.members.list('acme-corp');

// Invite/Add a new member
await sdk.workspace.members.add('acme-corp', {
  email: '[email protected]',
  role: 'member',
});

// Remove a member
await sdk.workspace.members.delete('acme-corp', 'member_id_xyz');

Channels & Messaging

// List channels in a workspace
const channels = await sdk.workspace.channels.list('acme-corp');

// Create a new channel with custom visibility, icon, metadata, and initial members
const channel = await sdk.workspace.channels.create('acme-corp', {
  name: 'engineering',
  description: 'Engineering discussion channel',
  type: 'private',
  isPrivate: true,
  icon: 'code',
  metadata: { department: 'eng' },
});

// Send a message to a channel with interactive buttons
await sdk.channel.message.create('channel_id_123', {
  content: 'Please approve the deployment request',
  messageType: 'approval',
  metadata: {
    callbackUrl: 'https://my-app.example.com/api/actions/callback',
  },
  actions: [
    { actionId: 'approve', label: 'Approve', style: 'primary' },
    { actionId: 'reject', label: 'Reject', style: 'danger' }
  ]
});

// Fetch channel messages
const messages = await sdk.channel.message.list('channel_id_123', { limit: 10 });

Webhooks Management

// List workspace webhooks
const webhooks = await sdk.webhooks.list('acme-corp');

// Create outgoing workspace webhook
const newWebhook = await sdk.webhooks.create('acme-corp', {
  name: 'CI Notifier',
  url: 'https://my-app.example.com/api/webhooks',
  events: ['message.sent', 'message.action_response'],
});

Custom Message Builders

Use @scryme/chat custom message builders to construct rich, interactive forms and surveys to attach to messages:

import { createFormCustomMessageSchema } from '@scryme/chat';

const feedbackSchema = createFormCustomMessageSchema({
  title: 'Quarterly Team Feedback',
  description: 'Please submit your thoughts on team performance',
  icon: 'HelpCircle',
  inputs: [
    {
      id: 'rating',
      label: 'Performance Rating (1-5)',
      placeholder: 'Enter 1 to 5',
      required: true,
    },
    {
      id: 'comments',
      label: 'Additional Comments',
      placeholder: 'Optional feedback...',
      multiline: true,
    }
  ],
  submitLabel: 'Send Feedback',
  callbackId: 'team-feedback-submit',
});

// Send the custom form message to a channel
await sdk.channel.message.create('channel_id_123', {
  content: 'New feedback survey',
  messageType: 'custom',
  metadata: feedbackSchema,
});

Dynamic API Proxying (sdk.raw)

If you need lower-level control or need to access raw Orval/Axios endpoints not wrapped in our helper namespaces, use sdk.raw.

Every raw endpoint:

  1. Offers full TypeScript types for parameters, request body, and response.
  2. Automatically injects the required Bearer Authorization header (fetching or refreshing the M2M token on the fly).
  3. Resolves to the correct configured API Base URL.
// Access lower-level generated controller methods directly
const health = await sdk.raw.appControllerGetHealth();

// User search
const users = await sdk.raw.usersControllerSearchUsers({ q: 'alice' });

// Fully typed update workspace webhook call
const webhook = await sdk.raw.v3WebhooksControllerCreateWebhook('acme-corp', {
  name: 'Slack Sync',
  url: 'https://hooks.slack.com/services/...',
  events: ['message.created'],
});

Development

Compile the SDK

pnpm build

Run Unit Tests

pnpm test

License

MIT © Scryme Chat Enterprise