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

apidaze-js

v3.0.0

Published

APIdaze JavaScript API

Downloads

21

Readme

APIdaze Javascript API

This library provides audio conferences, automated voice responses, selecting dialtone option and more.
User will not be able to select phone number. Instead he will call an "External Script" which is a XML definition of what will happen during the call. External Scripts are stored on APIdaze server.

For use cases where user can type phone number consider REST API.

Installation

Either execute in your project directory
npm install apidaze-js
and add to your code
const APIdaze = require('apidaze-js')

or add a html tag
<script src="https://api4.apidaze.io/javascript/releases/APIdaze-3.0.0-dev-master.js" />

Usage

Make sure you can access this page that is used to define External Scripts.
If you don't have account, you can create one here.
To initialize a client, follow these instructions.
And to read more about possibilites of External Scripts, go here.

Advanced Usage

Configuration

Available arguments in the Client object

| Name | Default value | Type | Possible values | Description | |------------ |---------------------------------------------- |---------------- |--------------------------------------------------------------- |------------------------------------------------------------------------------------------- | | apiKey | undefined | string | A valid API key | The API key of the application on the dashboard to use | | region | undefined | string | us-east, us-west, eu-central, eu-west, ap-southeast | Defines the region for the client to connect. | | iceServers | [{ urls: "stun:stun.l.google.com:19302" }] | RTCIceServer[] | An array of RTCIceServers | Defines how to connect to ICE servers | | wsurl | undefined | string | A valid secure WebSocket server URL for server communication | Defines which server to connect. This argument has precedence over the region argument. |

Available arguments in the Call object

| Name | Default value | Type | Possible values | Description | |--------------------- |--------------------------------------------------- |---------------- |-------------------------------------------------------------- |----------------------------------------------------------------------- | | audioInputDeviceId | undefined | string | Any audio input device ID | The ID of the audio input device to use for the specified call. | | audioOutputDeviceId | undefined | string | Any audio output device ID | The ID of the audio output device to use for the specified call. | | iceServers | [{ urls: "stun:stun.l.google.com:19302" }] | RTCIceServer[] | An array of RTCIceServers | Defines how to connect to ICE servers for the specified call. | | tagId | apidaze-audio-video-container-id-{randomString} | string | A valid secure WebSocket server URL for server communication | The ID of the element where the HTMLMediaElement will be appended to. |

Media updates

Apart from what's shared below, one may check the example in samples/audio_conference/index.html that demonstrates the followings;

  • Instantiating a client
  • Joining a conference call with initial audio media tracks for input as well as output
  • Updating the audio media track for input and output after the call is initiated
  • Enumerating the media devices

Updating the media track for audio input in an ongoing call

Once a call object is instantiated, one may use the method that resides at Call#setAudioInputDevice with an argument of valid audio input device ID as the following;

const call = Client.call();
call.setAudioInputDevice(deviceId);

Then the audio input media track will be respectively updated.

Updating the media track for audio output in an ongoing call

As in updating the audio input, one may use the method at Call#setAudioOutputDevice with an argument of valid audio output device ID as the following;

const call = Client.call();
call.setAudioOutputDevice(deviceId);

How to run examples

  1. Visit https://backoffice.voipinnovations.com/ProgrammableTelco/ExternalScripts.aspx
  2. Click create new script button
  3. Enter name of your choice and this content of External Script
<document>
  <work>
    <answer />
    <wait>1</wait>
    <speak>Welcome, you are joining the conference.</speak>
    <conference>test</conference>
    <hangup />
  </work>
</document>

4. Click create script, wait for cofirmation, close the editor
5. Find script by the name and copy the visible apiKey (c7fee939 on screenshot) 6. Clone repository git clone https://github.com/apidaze/apidaze-js.git
7. Install npm dependencies cd apidaze-js and npm install
8. Start a webserver npm run start
9. Open https://localhost:9000
10. Warning about missing certificate will be displayed, click "advanced" and "proceed to localhost (unsafe)"
11. Select "API key check" from list of examples
12. Type apiKey from step 4. and click "check" button

If all went good, result should look like this

How to contribute

  1. Fork this repository
  2. Make a copy of file cypress/config.template.js named cypress/config.js and inside its content write apiKey from step 4. of How to run examples
  3. Work on your change
  4. When ready, please verify that code is matching linter and tests are passing by running npm run start and in separate console: npm run test:all
  5. If integration tests are failing use npm run cypress to find a reason
  6. When all tests are passing create a pull request