Registry / messaging / textmagic-rest-client

textmagic-rest-client

JSON →
library1.0.11jsnpmunverified

A Node.js client for the TextMagic REST API (v2), enabling SMS sending and receipt via TextMagic platform. Current stable is v1.0.11, released sporadically with minimal updates. Lightweight alternative to full SDKs; supports Node >=0.10. No native TypeScript types, no ESM exports. Primarily used in older Node projects.

npm install textmagic-rest-client
INSTALL
IMPORT
SIG · TEXTMAGIC-REST-CLI
T
textmagic-rest-client
messagingjavascriptv1.0.11
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.

TextMagic
✓ const TextMagic = require('textmagic-rest-client'); const client = new TextMagic('username', 'apikey');
✗ import TextMagic from 'textmagic-rest-client';
Package uses CommonJS only; ES import will fail. Instantiate with constructor using username and API key.
default import
✓ const TextMagic = require('textmagic-rest-client');
✗ const { TextMagic } = require('textmagic-rest-client');
The default export is the constructor; named destructuring yields undefined.
sendSms
✓ client.Messages.send({ text: 'Hello', phones: '+1234567890' }, callback);
✗ client.sendSms('Hello', '+1234567890');
API uses nested resource objects (e.g., Messages); individual methods not exposed directly. Callback-style, no promises.

Demonstrates creating a TextMagic client and sending an SMS with callback.

const TextMagic = require('textmagic-rest-client'); const username = process.env.TEXTMAGIC_USERNAME ?? ''; const apikey = process.env.TEXTMAGIC_APIKEY ?? ''; const client = new TextMagic(username, apikey); client.Messages.send({ text: 'Hello from Node.js', phones: '+1234567890' }, function(err, res) { if (err) { console.error('Error sending SMS:', err); } else { console.log('Message sent:', res.id); } });
Debug
Known issues
breakingCallback-based API only, no Promise support.
fix
Promisify manually or use async/await via util.promisify.
affects: >=0.0.0
gotchaRequires Node >= 0.10, may fail on modern Node versions due to removed APIs.
fix
Use a compatibility layer or switch to a maintained SDK.
affects: >=1.0.0
deprecatedPackage not actively maintained; last release 2016.
fix
Consider using the official TextMagic SDK or direct REST calls.
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: TextMagic is not a constructor
Incorrect import style (ES import or destructured from CommonJS).
fix
Use const TextMagic = require('textmagic-rest-client');
Error: Cannot find module 'textmagic-rest-client'
Package not installed or Node version incompatible.
fix
Run npm install textmagic-rest-client --save
Upgrade
Version history
1.0.11latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
17 hits · last 30 days
node
16
OpenAI (training)
1
Resources
textmagic-rest-client — npm install textmagic-rest-client · libregistry