JSPM

orange-connect

1.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q46167F
  • License MIT

Connect a NodeJs server to the Orange SMS API

Package Exports

  • orange-connect

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (orange-connect) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

orange-connect

Connect your NodeJs server to the Orange SMS API

Installing

Using npm:

npm install orange-connect

Using yarn:

yarn add orange-connect

Example

const { sendSMS } = require('orange-connect')

sendSMS({
      authorizationHeader: "Basic ******************************==", // Your Authorization Header that you get from your Orange SMS APP Settings
      from: "+21600000000", // Your Orange account's phone number
      to: "+21600000000",
      message: "Hello from orange-connect :)"
}).then(response => {
    console.log("response", response);
}).catch(error => {
    console.log("error", error)
})

// Want to use async/await? Add the `async` keyword to your outer function/method.
async function sendMessage() {
  try {
    const response = await sendSMS({
      authorizationHeader: "Basic ******************************==", // Your Authorization Header that you get from your Orange SMS APP Settings
      from: "+21600000000", // Your Orange account's phone number
      to: "+21600000000",
      message: "Hello from orange-connect :)"
    })
    console.log("response", response);
  } catch (error) {
    console.log("error", error);
  }
}

sendMessage() // Don't forget to invoke it

TypeScript

orange-connect includes TypeScript definitions.

import { sendSMS } from 'orange-connect';

License

MIT

Author