GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - NdoleStudio/httpsms-node: Node client for the httpSMS API https://httpsms.com

BranchesTags
Open more actions menu

Latest commit

 

History

79 Commits
79 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
src
src
 
 
tests
tests
 
 
.editorconfig
.editorconfig
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
.npmrc
.npmrc
 
 
index.ts
index.ts
 
 
license
license
 
 
package.json
package.json
 
 
readme.md
readme.md
 
 
tsconfig.json
tsconfig.json
 
 

Repository files navigation

httpsms-node

Version Build GitHub contributors GitHub license Downloads

This library provides a server side client for the httpSMS API to help you send and receive SMS messages from your Node.js applications in TypeScript or JavaScript.

Install

pnpm install httpsms
# or
yarn install httpsms

Implemented

  • Messages
    • POST /v1/messages/send: Send a new SMS
  • Cipher
    • Encrypt: Encrypt the content of a message to cipher text
    • Decrypt: Decrypt an encrypted message content to plain text

Usage

Initializing the Client

An instance of the client can be created using httpsms.New().

import HttpSms from "httpsms"

const client = new HttpSms(""/* Get API Key from https://httpsms.com/settings */);

Error handling

All API calls return a Promise<T> as the return object. You can handle the response in the then and catch methods.

Messages

POST /v1/messages/send: Send an SMS Message

await client.messages.postSend({
	content: 'This is a sample text message',
	from: '+18005550199',
	to: '+18005550100',
})
.then((message) => {
	console.log(message.id);
})
.catch((err) => {
	console.error(err);
});

Encrypt an SMS message before sending

const encryptionKey = "Password123";
const encryptedContent = await client.cipher.encrypt("This is a sample text message", encryptionKey);

await client.messages.postSend({
	content: encryptedContent,
	from: '+18005550199',
	encrypted: true,
	to: '+18005550100',
})
.then((message) => {
	console.log(message.id);
})
.catch((err) => {
	console.error(err);
});

Testing

You can run the unit tests for this client from the root directory using the command below:

pnpm run test

License

This project is licensed under the MIT License - see the LICENSE file for details

About

Node client for the httpSMS API https://httpsms.com

Resources

Readme
MIT license
Activity
Custom properties

Stars

33 stars

Watchers

1 watching

Forks

16 forks
Report repository

Releases

Used by

Contributors

Languages

Generated from sindresorhus/node-module-boilerplate
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.