Socket
Socket
Sign inDemoInstall

releans

Package Overview
Dependencies
24
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    releans

A node library to implement Releans SMS Api Service


Version published
Weekly downloads
0
Maintainers
1
Install size
2.72 MB
Created
Weekly downloads
 

Readme

Source

Releans Logo Releans

A node library to implement Releans SMS API. License MIT


Releans Docs


SMS API

Read doc

Send a message
        import { SMS } from 'releans';
        const config: IConfig = {
            apiKey: 'your-key',
        }
        const data: IMessageData = {
            sender: 'SenderName',
            mobile: 'E164FormatNumber',
            content: 'Your content'
        };
        const sms = new SMS(config);
        const result = await sms.send(data);

        if (result.data) {
            console.dir(result.data)
        }

        if(result.error) {
            console.log(result.error);
        }
Retrieve all messages
        import { SMS } from 'releans';
        const config: IConfig = {
            apiKey: 'your-key',
        }
 
        const sms = new SMS(config);
        const result = await sms.retrieveAll();

        if (result.data) {
            console.dir(result.data)
        }

        if(result.error) {
            console.log(result.error);
        }
Retrieve messages by date
        import { SMS } from 'releans';
        const config: IConfig = {
            apiKey: 'your-key',
        }
        const date = '2023-05-16' //'yyyy-MM-dd'
        const sms = new SMS(config);
        const result = await sms.retrieveByDate(date);

        if (result.data) {
            console.dir(result.data)
        }

        if(result.error) {
            console.log(result.error);
        }
Retrieve a message by messageId
        import { SMS } from 'releans';
        const config: IConfig = {
            apiKey: 'your-key',
        }
        const messageId = 12345678
        const sms = new SMS(config);
        const result = await sms.retrieveByMessageId(messageId);

        if (result.data) {
            console.dir(result.data)
        }

        if(result.error) {
            console.log(result.error);
        }

OTP / Verify API

Read doc

Send OTP Code
        import { OTP } from 'releans';
        const config: IConfig = {
            apiKey: 'your-key',
        }
         const data: IOTPSendData = {
            sender: 'Sender Name',
            mobile: 'E164FormatNumber',
            channel: 'sms' // sms or voice
        };
        const otp = new OTP(config);
        const result = await otp.send(data);

        if (result.data) {
            console.dir(result.data)
        }

        if(result.error) {
            console.log(result.error);
        }
Verify OTP Code
        import { OTP } from 'releans';
        const config: IConfig = {
            apiKey: 'your-key',
        }
         const data: IOTPVerifyData = {
            mobile: 'E164FormatNumber',
            code: '123456'
        };
        const otp = new OTP(config);
        const result = await otp.verify(data);

        if (result.data) {
            console.dir(result.data)
        }

        if(result.error) {
            console.log(result.error);
        }

Balance API

Read doc

        import { Balance } from 'releans';
        const config: IConfig = {
            apiKey: 'your-key',
        }
 
        const balance = new Balance(config);
        const result = await balance.retrieve();

        if (result.data) {
            console.dir(result.data)
        }

        if(result.error) {
            console.log(result.error);
        }

Bug report

https://github.com/Drunkenpilot/releans/issues

Keywords

FAQs

Last updated on 17 May 2023

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc