Herald

SDKs

Herald has two categories of SDKs: WebSocket clients for real-time connections in browsers and mobile apps, and HTTP admin clients for server-side management. Admin SDKs are codegen-managed from the OpenAPI spec.

WebSocket SDKs

These run in the browser or mobile app. They handle connection management, reconnect with catch-up, deduplication, and optional ack mode.

PackageDescription
herald-sdk-typescriptCore WebSocket client. Auto-reconnect, sequence-based catch-up, deduplication.
herald-chat-sdk-typescriptChat extensions. Edit, delete, reactions, read cursors, typing, blocking.
herald-presence-sdk-typescriptPresence extensions. Manual overrides, expiry, presence clearing.
herald-chat-coreFramework-agnostic chat state machine. Messages, members, presence, typing, cursors.
herald-chat-reactReact hooks and headless components built on herald-chat-core.

Browser example

import { HeraldClient } from "herald-sdk-typescript";

const client = new HeraldClient({
  url: "wss://herald.skeptik.io/ws",
  key: "YOUR_KEY",
  token: "SIGNED_TOKEN",
  userId: "alice",
  streams: ["stream_1"],
});

client.on("event.new", (event) => {
  console.log(event.body);
});

client.connect();

React example

import { useHeraldChat } from "herald-chat-react";

function ChatRoom({ streamId }: { streamId: string }) {
  const { messages, sendMessage } = useHeraldChat(streamId);

  return (
    <div>
      {messages.map((msg) => (
        <div key={msg.id}>{msg.body.text}</div>
      ))}
    </div>
  );
}

Admin SDKs

These run on your backend for stream management, member operations, event injection, and token generation.

LanguagePackageInstall
TypeScriptherald-admin-typescriptnpm install herald-admin-typescript
Goherald-admin-gogo get github.com/skeptik-io/herald-admin-go
Pythonherald-admin-pythonpip install herald-admin-python
Rubyherald-admin-rubygem install herald-admin-ruby
PHPherald-admin-phpcomposer require skeptik-io/herald-admin-php
C#herald-admin-csharpdotnet add package HeraldAdmin

Server-side example

import { HeraldAdmin } from "herald-admin-typescript";

const herald = new HeraldAdmin({
  baseUrl: "https://herald.skeptik.io",
  key: "YOUR_KEY",
  secret: "YOUR_SECRET",
});

// Create a stream
const stream = await herald.streams.create({
  name: "general",
  meta: { topic: "General discussion" },
});

// Add a member
await herald.members.add(stream.id, {
  userId: "alice",
  role: "member",
});

// Generate a connection token
const token = await herald.tokens.create({
  userId: "alice",
  streams: [stream.id],
  ttl: 3600,
});