Skip to content

@hibira-io/node 0.1.0: Chat API, Live Chat verified visitors, Approvals - #1

Merged
deflinhec merged 1 commit into
mainfrom
claude/project-thread-y7499h
Nov 26, 2026
Merged

deflinhec merged 1 commit into
mainfrom
claude/project-thread-y7499h

Conversation

@deflinhec

Copy link
Copy Markdown
Member

Requested by Danny · project thread

Summary

The first version of @hibira-io/node, a dependency-free Node.js server SDK. It covers the products the pusher package doesn't:

  • Chat API (hibira.chat): conversations, members, messages, read receipts, system messages, a user's conversations, plus request() for any other route. Requests are signed with auth_version 1.0, so they work with PUT and DELETE.
  • Live Chat:
    • liveChatUserHash, liveChatIdentity and liveChatScriptTag (HTML-escaped, with CSP nonce support).
    • Express, Koa and Fastify middleware that set { identity, scriptTag } on the request.
  • Approvals (hibira.approvals):
    • request, get (wait capped at 25 s), wait and reply.
    • verifyCallback / verifyApprovalCallback for Hibira-Signature callbacks. This uses the same algorithm as the Go module.
  • CI: Node 18, 20, 22 and 24.
  • Publishing:
    • The npm publish workflow runs when a GitHub Release is published. It needs the org secret NPM_TOKEN added for this repo, and the tag must match the package version.
    • A release-notify workflow posts each release.
  • README in English with a 中文摘要 section.

Notes:

  • main was empty, so it now holds a single LICENSE-only commit as the base for this PR.
  • Realtime is still handled by pusher, and waiting rooms by @hibira-io/waiting-room.

Test plan

  • npm test: 11 tests pass. They run against a local HTTP server and check the method, path encoding, JSON body, HMAC signature, body_md5, error mapping, callback signature/timestamp and middleware output.
  • npm run build and npm pack --dry-run

Generated by Claude Code

A dependency-free server SDK for the products the pusher package does not
cover: the Chat API client, Live Chat user hash/identity/script tag with
Express, Koa and Fastify middleware, and the hosted Approvals API with
callback verification. CI on Node 18-24 and npm publish on release.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SHtsCCKScUUX9khSrU2wij
@deflinhec deflinhec self-assigned this Nov 26, 2026
@deflinhec
deflinhec marked this pull request as ready for review November 26, 2026 08:57
@deflinhec
deflinhec merged commit 1822bf0 into main Nov 26, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants