Registry / messaging / signal-rest-ts

signal-rest-ts

JSON →
library0.2.5jsnpmunverified

TypeScript wrapper around signal-cli-rest-api (v0.2.5) enabling programmatic control of Signal Messenger via REST. Provides typed classes for sending/receiving messages, managing accounts and groups. Current stable release is 0.2.5 with low release cadence. Supports both Node.js and browser (ESM, CJS, and DOM bundle). Alternative to signal-cli-rest-api's raw HTTP endpoints, adding TypeScript safety and streamlined API. Requires external signal-cli-rest-api instance running in JSON-RPC mode for receive functionality. Ships TypeScript types.

npm install signal-rest-ts
INSTALL
IMPORT
SIG · SIGNAL-REST-TS
S
signal-rest-ts
messagingjavascriptv0.2.5
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

SignalClient
import { SignalClient } from 'signal-rest-ts'
import SignalClient from 'signal-rest-ts'
Default export is not available; use named import.
AccountService
import { AccountService } from 'signal-rest-ts'
You can also access account service via SignalClient.account().
MessageService
import { MessageService } from 'signal-rest-ts'
const { MessageService } = require('signal-rest-ts')
Package is ESM-first; CommonJS require() may not work with default configuration.
GroupService
import { GroupService } from 'signal-rest-ts'
Group management operations.
ReceiveService
import { ReceiveService } from 'signal-rest-ts'
For handling incoming messages; requires signal-cli-rest-api in json-rpc mode.

Demonstrates basic usage: initialize SignalClient, fetch accounts, send a text message to a recipient.

import { SignalClient } from 'signal-rest-ts'; const signal = new SignalClient('http://localhost:8080'); async function main() { const accounts = await signal.account().getAccounts(); if (accounts.length === 0) { console.log('No accounts registered.'); return; } const msg = await signal.message().sendMessage({ number: accounts[0], message: 'Hello from signal-rest-ts!', recipients: ['+1234567890'] }); console.log('Message sent:', msg); } main().catch(console.error);
Debug
Known issues
gotchaReceive service requires signal-cli-rest-api to be started in JSON-RPC mode (--json-rpc flag), otherwise registerHandler and startReceiving will fail.
fix
Start signal-cli-rest-api with the --json-rpc flag.
affects: >=0.1.0
gotchaEach account requires a separate WebSocket connection for receiving messages; forgetting to call startReceiving for each account will miss messages.
fix
Iterate over all accounts and call startReceiving for each one.
affects: >=0.1.0
gotchaWebSocket connections are not automatically closed on process exit; can cause resource leaks.
fix
Call signal.receive().stopAllReceiving() on process exit (e.g., SIGINT handler).
affects: >=0.1.0
gotchaCORS must be configured on the signal-cli-rest-api reverse proxy when using in browser; otherwise requests will be blocked.
fix
Add appropriate CORS headers to the nginx/Apache config proxying to signal-cli-rest-api.
affects: >=0.1.0
Errors
Common errors & fixes
ERR_MODULE_NOT_FOUND: Cannot find module 'signal-rest-ts'
Using CommonJS require() instead of ESM import, or missing package installation.
fix
Use import syntax: import { SignalClient } from 'signal-rest-ts'. Ensure package is installed: npm install signal-rest-ts
TypeError: signal.receive is not a function
Trying to use ReceiveService without importing it or calling a method incorrectly.
fix
Import ReceiveService: import { ReceiveService } from 'signal-rest-ts'. Then call signal.receive() after instantiating SignalClient.
Error: signal-cli-rest-api must be started with json-rpc mode enabled
Receive functions require signal-cli-rest-api to be launched with --json-rpc flag.
fix
Restart signal-cli-rest-api with the --json-rpc flag: e.g., signal-cli-rest-api --json-rpc
Upgrade
Version history
0.2.5latest on npm
Audit
Dependencies
signal-cli-rest-apirequiredRequired backend service; signal-rest-ts is a wrapper and cannot function without a running instance of signal-cli-rest-api.
Agent activity
18 hits · last 30 days
node
16
Amazon
1
OpenAI (training)
1
Resources
signal-rest-ts — npm install signal-rest-ts · libregistry