Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

telesignsdk

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

telesignsdk

Official TeleSign SDK for Rest APIs including Messaging (SMS), Score, PhoneID, Voice, and AppVerify

  • 2.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.2K
increased by6.33%
Maintainers
1
Weekly downloads
 
Created
Source

TeleSign Node.js SDK

TeleSign is a communications platform as a service (CPaaS) company, founded on security. Since 2005, TeleSign has been a trusted partner to the world’s leading websites and mobile applications, helping secure billions of end-user accounts. Today, TeleSign’s data-driven, cloud communications platform is changing the way businesses engage with customers and prevent fraud.

For more information about TeleSign, visit our website.

Documentation

Code documentation is included in the SDK. Complete documentation, quick start guides and reference material for the TeleSign API is available within the TeleSign Developer Center.

Installation

To add the TeleSign Node.js SDK using NPM to your Node.js project:

npm install telesignsdk -save

If you have already cloned this SDK, you can using the following command

npm install /path/to/sdk -save

Authentication

You will need a Customer ID and API Key in order to use TeleSign’s API. If you already have an account you can retrieve them from your account dashboard within the Portal. If you have not signed up yet, sign up here.

Dependencies

We make use of popular, feature-rich and well-tested open-source libraries to perform the underlying functionality of the SDK. These dependencies are managed by the community accepted package manager. If you are unable to add these additional third party dependencies to your project we have ensured that the SDK code is easy to read and can serve as sample code. We have also made sure that more complicated functions such as generate_telesign_headers can be easily extracted from the SDK and used 'as is' in your project.

Examples

How to Run

  1. Edit file and replace values for API Key, Customer ID, and mobile_number
  2. Run the file via : node filename.js

Example: You can run the 1_send_message.js with the following command

node examples/appverify/1_send_message.js

Sample code: Messaging (SMS)

After installing the SDK, begin by including the telesign SDK and declaring customerId, apiKey, restEndpoint, and timeout variables.

Setup Telesign Client

    var TeleSignSDK = require('telesignsdk');
    var customerId = "FFFFFFFF-EEEE-DDDD-1234-AB1234567890"; // find in portal.telesign.com
    var apiKey = "EXAMPLE----TE8sTgg45yusumoN4BYsBVkh+yRJ5czgsnCehZaOYldPJdmFh6NeX8kunZ2zU1YWaUw/0wV6xfw==";
    var restEndpoint = "https://rest-api.telesign.com";
    var timeout = 10*1000; // 10 secs

    var telesign = new TeleSignSDK( customerId,
                                    apiKey,
                                    restEndpoint,
                                    timeout // optional
                                  );

Send an SMS

    var phoneNumber = "phone_number"; // Your end user’s phone number, as a string of digits without spaces or
    // punctuation, beginning with the country dialing code (for example, “1” for North America)
    var message = "You're scheduled for a dentist appointment at 2:30PM.";
    var messageType = "ARN"; // ARN = Alerts, Reminders, and Notifications; OTP = One time password; MKT = Marketing
    var referenceId = null; // need this to check status later

    telesign.sms.message(function(err, reply){
            if(err){
                console.log("Error: Could not reach TeleSign's servers");
                console.error(err); // network failure likely cause for error
            }
            else{
                console.log("YAY!, the SMS message is being sent now by TeleSign!");
                console.log(reply);
                referenceId=reply.reference_id; // save the reference_id to check status of the message
            }
        },
        phoneNumber,
        message,
        messageType
    );

Further reading

  • If you are using the trial account, make sure you understand it has some limitations. Use only the phone number you have verified.
  • The definitions of the parameters are best documented in the REST API documentation located here.
  • Code examples can be found here.

Keywords

FAQs

Package last updated on 15 Aug 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc