npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@telefonica/opengateway-sandbox-sdk

v0.2.0-beta

Published

Reference guide to the Sandbox Node.js SDK on how to authorize, instantiate and use its service classes to access the Open Gateway APIs.

Downloads

6

Readme

Telefonica Opengateway Sandbox Node.js SDK

Reference guide to the Sandbox Node.js SDK on how to authorize, instantiate and use its service classes to access the Open Gateway APIs.

More info: https://developers.opengateway.telefonica.com/

Table of Contents


Installation

To install the SDK, run the following command:

npm install @telefonica/opengateway-sandbox-sdk

Authentication

The SDK uses Client Credentials for authentication. You will need the clientId and clientSecret to initialize each service.

More info: https://developers.opengateway.telefonica.com/docs/usethesandbox

Example credentials:

const credentials = {
  clientId: "your-client-id",
  clientSecret: "your-client-secret",
};

Some methods require an authorization code (code), while others may use CIBA (Client-Initiated Backchannel Authentication).

Methods | Service APIs

Number Verification

This method verifies if a given phone number is valid using an authentication code.

const client = new NumberVerification(credentials, code);
const result = await client.verify(phoneNumber);
console.log(result); // returns a boolean
  • Params:
    • phoneNumber: The phone number to verify.

Device Location

This method checks the device location either with an authentication code or using CIBA.

  1. With Auth Code:

    const client = new DeviceLocation(credentials, code);
    const result = await client.verify(latitude, longitude, radius, phoneNumber);
    console.log(result); // returns a boolean
  2. With CIBA:

    const client = new DeviceLocation(credentials, undefined, phoneNumber);
    const result = await client.verify(latitude, longitude, radius);
    console.log(result); // returns a boolean
  • Params:
    • latitude: The latitude of the location.
    • longitude: The longitude of the location.
    • radius: The radius to check around the given location.
    • phoneNumber: (Optional) The phone number for CIBA.

SIM Swap Check

Checks if a SIM swap has occurred for a given phone number.

  1. With Auth Code:

    const client = new Simswap(credentials.clientId, credentials.clientSecret, undefined, code);
    const result = await client.check(checkDays, phoneNumber);
    console.log(result); // returns a boolean
  2. With CIBA:

    const client = new Simswap(credentials.clientId, credentials.clientSecret, phoneNumber);
    const result = await client.check(checkDays);
    console.log(result); // returns a boolean
  • Params:
    • checkDays: The number of days to check for a SIM swap.
    • phoneNumber: (Optional for CIBA) The phone number to check.

SIM Swap Date Retrieval

Retrieves the date of the last SIM swap.

  1. With Auth Code:

    const client = new Simswap(credentials.clientId, credentials.clientSecret, undefined, code);
    const result = await client.retrieveDate(phoneNumber);
    console.log(result); // returns a Date object
  2. With CIBA:

    const client = new Simswap(credentials.clientId, credentials.clientSecret, phoneNumber);
    const result = await client.retrieveDate();
    console.log(result); // returns a Date object
  • Params:
    • phoneNumber: (Optional for CIBA) The phone number to check.

Device Status

Checks the roaming status of a device.

const client = new DeviceStatus(credentials, code);
const result = await client.roaming(externalId, msisdn, ipv4Addr, ipv6Addr, uePort);
console.log(result.roaming); // returns a boolean
  • Params:
    • externalId: The external ID of the device.
    • msisdn: The mobile number.
    • ipv4Addr: The IPv4 address of the device.
    • ipv6Addr: The IPv6 address of the device.
    • uePort: The port number used by the device.

QoD Mobile Sessions

Creates and manages QoD (Quality of Data) mobile sessions.

const client = new QoDMobile(credentials, code);
const result = await client.sessions(
  duration,
  externalId,
  msisdn,
  ipv4Addr,
  ipv6Addr,
  uePorts,
  undefined,
  qos,
  notificationUri,
  notificationAuthToken
);
console.log(result);
  • Params:
    • duration: Duration of the session in seconds.
    • externalId: The external ID of the user equipment (UE).
    • msisdn: The mobile number.
    • ipv4Addr: The IPv4 address of the user equipment.
    • ipv6Addr: The IPv6 address of the user equipment.
    • uePorts: The port range of the user equipment.
    • qos: Quality of service.
    • notificationUri: The URI for notifications.
    • notificationAuthToken: The token for notification authorization.