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 🙏

© 2026 – Pkg Stats / Ryan Hefner

workano-js-sdk

v0.5.19

Published

Workano Communications SDK - A modern JavaScript SDK for WebRTC and VoIP integration.

Downloads

52

Readme

Workano JS SDK

Workano

Workano JavaScript SDK is a simplified solution for communications.

Website

https://workano.com

Installation

npm i workano-js-sdk

Modules overview

The SDK exposes a friendly facade under workano-js-sdk with these modules:

  • Auth: Authentication helpers (login, validateToken, refreshToken, logout, session)
  • Phone: WebRTC phone controls (connect, call, accept, hangup, mute, transfer, conference, devices)
  • CallLog: Call history, recordings, voicemails, and related events
  • User: User management helpers (addUser, getExtensions)
  • Contact: Directory sources, favorites, phonebooks, personal contacts
  • Chat: Rooms, messages, presence, and chat file transfer
  • Config: User call forward options
  • Agent: Call-center agent controls and events
  • Api: Access the underlying low-level API client
  • Websocket: Handy wrappers for common call events

Below are quick-start snippets for the most used modules. Explore src/modules/*/index.ts for full surface.

Auth

Login

import workano from "workano-js-sdk";

const session = await workano.Auth.login({
    server: "https://your.workano.host",
    username: "[email protected]",
    password: "••••••••",
    appId: "your-app-id",
    tokenExpiration: 3600, // seconds
    isMobile: false,
    onTokenRefreshed(newSession) {
        // Persist updated tokens/session as needed
    },
});

Validate token

const session = await workano.Auth.validateToken({
    server: "https://your.workano.host",
    token, // access token
    appId: "your-app-id",
    tokenExpiration: 3600,
    isMobile: false,
    onTokenRefreshed(newSession) {
        // Called automatically when the SDK refreshes the token
    },
});

Refresh token explicitly

// When you only have a refresh token and need a new session
const newSession = await workano.Auth.refreshToken(refreshToken);
if (newSession) {
    // you are authenticated again
}

Get current session

const current = workano.Auth.session();

Logout

await workano.Auth.logout();

Phone

import workano from "workano-js-sdk";

// Connect once (e.g., on app start)
await workano.Phone.connect({
  sipLine?: SipLine | null;
  onIncomingCall: (callSession: CallSession) => {};
  onCallFailed: (callSession: CallSession) => {};
  onCallEnded: (callSession: CallSession) => {};
  onCallCanceled: (callSession: CallSession) => {};
  onCallAccepted: (callSession: CallSession) => {};
  onCallHeld?: (callSession: CallSession) => {};
  onCallResumed?: (callSession: CallSession) => {};
  onCallRejected?: (callSession: CallSession) => {};
  onCallMuted?: (callSession: CallSession) => {};
  onCallUnMuted?: (callSession: CallSession) => {};
  onAdhocParticipantLeft?: (data: {
    callId: string;
    conferenceId: string;
  }) => {};
  onAdhocDeleted?: (conferenceId: string) => {};
  onDisconnected?: () => {};
  onNetworkStats?: (
    callSession: CallSession,
    stats: any,
    prevStats: any
  ) => {};
  onProgress?: () => {};
  onPlayProgressSound?: (data?: any) => {};
  onPlayHangupSound?: () => {};
  onSignal?: () => {};
  onMessage?: () => {};
});

// Place a call
const withVideo = true;
await workano.Phone.call("1001", withVideo);

Selected helpers:

  • accept/hangup/mute/unmute/hold/resume
  • directTransfer(number) and indirectTransfer(number)
  • startConference(hostCall, otherCalls)
  • toggleRecording(callId, enable)
  • sendDTMF(tone, callSession)
  • changeAudioDevice/changeAudioInputDevice/changeVideoInputDevice/changeRingDevice

Call logs

const offset = 0;
const limit = 20;
const callLogs = await workano.CallLog.list(offset, limit);

Extras:

  • CallLog.voicemails()
  • CallLog.voicemailUrl(voicemail)
  • CallLog.recordingFileUrl(cdrId, recordingUuid)
  • CallLog.search({ contactUuid?, query?, pageSize })
  • CallLog.onCallLogCreated(listener)

User

Get extensions

const availableNumbers = await workano.User.getExtensions();
// [
//   { context: "default", contextLabel: "Default Context", numbers: ["1001", "1002"] },
//   { context: "webrtc", contextLabel: "WebRTC Context", numbers: ["2001"] }
// ]

Add user

const user = {
    subscription_type: 1, // 0: Normal, 1: Integrated Phone System, 2: Meeting, 3: Call Center
    firstname: "Jane",
    lastname: "Smith",
    firstname_english: "Jane",
    lastname_english: "Smith",
    language: "en_US",
    mobile_phone_number: "0987654321",
    email: "[email protected]",
    password: "securepassword",
    lines: [
        { extensions: [{ context: "default", exten: "1004" }] },
    ],
};

const newUser = await workano.User.addUser(user);

Contact

  • sources(): list directory sources (workano, conference, phonebook)
  • workanoContactsAndPresence(source, params)
  • conferenceContacts(source, params?)
  • personalContacts(params?)
  • phonebookContacts(source, params?)
  • addPhonebookContact(phonebookUuid, contact)
  • editPhonebookContact(phonebookUuid, contact)
  • addContact(newContact), editContact(contact)
  • favorites(), markAsFavorite(sourceName, sourceId), removeFavorite(sourceName, sourceId)

Chat

  • updateStatus(state, status)
  • rooms(), messages(opts), roomMessages(roomUuid, opts?)
  • createRoom(name, targetUserUuid, workano_uuid)
  • sendMessage(alias, roomUuid, text)
  • uploadFile(roomUuid, file), download(roomUuid, fileUuid)
  • onNewRoom(listener), onNewMessage(listener), onPresenceChanged(listener), onLineStateChanged(listener), off()

Config

  • updateForwardOption(userUuid, key, destination, enabled)

Agent

  • getStatus(), loginWithLineId(lineId), logout()
  • pause(reason?), resume()
  • onStatusUpdate(listener), onPaused(listener), onUnpaused(listener), off()

Api client

const apiClient = workano.Api.client();

Websocket helpers

  • onCallAnswered(listener, forAll?)
  • onCallEnded(listener, forAll?)
  • onCallCreated(listener, forAll?)
  • onCallUpdated(listener, forAll?)
  • off()

Support

For questions or support, contact: [email protected]

License

MIT License