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

@securecall/client-api

v0.1.3

Published

SecureCall Client API Javascript library

Downloads

281

Readme

SecureCall Client API Library

This library provides helper functions to make consuming the SecureCall Client API easier from Javascript/Typescript. It provides the following

  • sets up the SSE stream for status updates
  • emits Events on session, authentication and configuration updates
  • has helper functions for each of the APIs

Install

npm install --save @securecall/client-api

Usage

<body>
<script type="module">
    import {SecureCallClientAPI} from "https://unpkg.com/@securecall/client-api";

    let api = new SecureCallClientAPI('https://client.<region>.securecallapi.cloud')

    api.addEventListener('authentication',(evt) => {
        if(evt.success) {
            console.log('Authentication Success message: ', evt)
        } else {
            console.log('Authentication Failure message: ', evt)
        }
    })

    api.addEventListener('session',(evt) => {
        console.log('Session message: ', evt)
    })

    api.addEventListener('configuration',(evt) => {
        console.log('Configuration message: ', evt)
        console.log('  gateways: ', evt.gateways)
    })

    api.authenticate(<email>, <password>, true)
    console.debug('connecting')
</script>

Authentication

There are multiple ways to authenticating to SecureCall using this library. Further details are in the Client API OpenAPI spec found here https://client.au.securecallapi.cloud/v1/

The SecureCallClientAPI class has members for email, password and useCookie. These can be set manually and then connect() called or passed via authenticate() which will set them and then call connect().

:factory: SecureCallClientAPI

Methods

:gear: authenticate

| Method | Type | | ---------- | ---------- | | authenticate | (email?: string or undefined, password?: string or undefined, useCookie?: boolean or undefined) => Promise<void> |

Parameters:

  • email: - email address of the user
  • password: - password of the user. This could be a Webex Org ID, SecureCall API Key or a password
  • useCookie: - true if cookies will be used for all API requests or false to send the email/password each time

:gear: login

login uses the email/password to log into the Client API. Typically only used when cookies are used.

| Method | Type | | ---------- | ---------- | | login | () => Promise<void> |

:gear: logout

Logs out of the SecureCall Client API and disconnects the event stream

| Method | Type | | ---------- | ---------- | | logout | () => Promise<void> |

:gear: secure

Attempts to secure the call. All updates come through the event stream and will be emitted as Events

| Method | Type | | ---------- | ---------- | | secure | () => Promise<void> |

:gear: reset

| Method | Type | | ---------- | ---------- | | reset | (v?: string or string[] or undefined) => Promise<void> |

Parameters:

  • v: - if empty, will attempt to reset all the PCI fields, if a string will attempt to reset just that field or can be an array of field name

:gear: submit

| Method | Type | | ---------- | ---------- | | submit | (data: IPaymentValues) => Promise<void> |

Parameters:

  • data: - submits payment data

:gear: telephony

| Method | Type | | ---------- | ---------- | | telephony | (data: ITelephony) => Promise<void> |

Parameters:

  • data: - update telephony state for Client Telephony

:gear: connect

connects the event stream using email/password/useCookie

| Method | Type | | ---------- | ---------- | | connect | () => Promise<void> |

:gear: disconnect

disconnects the event stream connection

| Method | Type | | ---------- | ---------- | | disconnect | () => void |

Who do I talk to?