@exotel-npm-dev/exotel-ip-calling-crm-websdk

中文文档
2.0.0发布于 2026/10/22Apache-2.0TypeScriptESM + CJS构建来源已验证近 30 天下载 3573

Exotel's crm websdk for IP calling integration

原始使用文档
文档目录12 节
  1. 1. Using the Package in a Project:
  2. For npm users:
  3. TypeScript support
  4. Publishing (maintainers)
  5. Adding NPM_TOKEN for the publish workflow
  6. For Non-npm users:
  7. Non-npm users (recommended): download from GitHub Release
  8. 2. Configure crmWebSDK
  9. 3. ExotelCRMWebSDK
  10. 4. Initialize method
  11. 5. ExotelWebPhoneSDK
  12. License

ExotelCRMWebSDK (Beta)

The ExotelCRMWebSDK allows you to leverage Exotel's platform for making IP calls, with this easy to integrate feature.

Steps

1. Using the Package in a Project:

For npm users:

Refer to sample project here or read on.

Steps:

  1. You can install the package using npm:
npm install @exotel-npm-dev/exotel-ip-calling-crm-websdk

Or directly from GitHub:

npm install git+https://github.com/exotel/exotel-ip-calling-crm-websdk.git
  1. Simply import the ExotelCRMWebSDK in your code like this:
import ExotelCRMWebSDK from "@exotel-npm-dev/exotel-ip-calling-crm-websdk";

TypeScript support

The npm package publishes:

  • Compiled JavaScript in output/ (runtime)
  • Type declarations in output/*.d.ts (TypeScript typings)

If your build pipeline can compile TypeScript from dependencies, the TypeScript sources are also shipped under src/ and can be imported directly (advanced usage), e.g.:

import ExotelCRMWebSDK from "@exotel-npm-dev/exotel-ip-calling-crm-websdk/src/ExotelCRMWebSDK";

Publishing (maintainers)

This repo uses GitHub Actions for CI and optionally publishing to npm.

  • CI: A build runs on PRs and pushes to master/main. Make this workflow a required status check in GitHub branch protection to block merges if build fails.
  • Manual publish to npm: Run the GitHub Actions workflow "Publish to npm (manual)" and set publish=true (set publish=false to only build without publishing).

Adding NPM_TOKEN for the publish workflow

Add the token in GitHub:

  • Repo → Settings → Secrets and variables → Actions → New repository secret
  • Name: NPM_TOKEN
  • Value: your npm granular access token with permission to publish @exotel-npm-dev/exotel-ip-calling-crm-websdk (and any org policy requirements like 2FA/bypass-2FA as configured on npm).

For Non-npm users:

If you are not using a package manager like NPM, you can directly include the bundled JavaScript file that can be generated by webpack.

Steps:

  1. First, you should clone this repository.

  2. You can install the required packages using following npm command:

npm install
  1. Locate the 'webpack.config.js' file in the project directory, you can find this file in the root directory of the project.

  2. Run the following command to build the webpack from root directory:

npm run bundle
  1. Build command should create a folder called 'target' in the same directory.

    target preview:

    target/

     ├── beep.wav
     ├── dtmf.wav
     ├── ringbacktone.wav
     ├── ringtone.wav
     ├── crmBundle.js
     └── crmBundle.js.LICENSE.txt
    
  2. Simply copy & paste this 'target' folder into the project that requires CRMWebSDK.

  3. You can now utilize the 'crmBundle.js' file by including it as a script in your project..

<script src="./target/crmBundle.js"></script>

Every tagged release (tag format v*) automatically uploads the pre-built bundle as GitHub Release assets:

  • crm-websdk-target.zip
  • target/crmBundle.js (+ *.wav assets)

Download the zip from the latest GitHub Release and include it in your project:

<script src="./target/crmBundle.js"></script>

2. Configure crmWebSDK

You can configure crmWebSDK object like this:

const crmWebSDK = new ExotelCRMWebSDK(accessToken, userId, true);

3. ExotelCRMWebSDK

constructor

accessToken : This can be generated using the Create Authentication Token API

userId : You can get the userId using the Application user management APIs

autoConnectVOIP : If true, it will auto-connect device when the ExotelWebPhoneSDK is returned on initialization. (If you have passed false, then you must call DoRegister on ExotelWebPhoneSDK)

Initialize

Initializes the CRMWebSDK, sets up the phone object, and registers callbacks for various events.

Parameters:

sofPhoneListenerCallback (function): Callback for incoming calls.

softPhoneRegisterEventCallBack (function, optional): Callback for soft phone register events. Default is null.

softPhoneSessionCallback (function, optional): Callback for soft phone session events. Default is null.

Returns:

Promise<ExotelWebPhoneSDK | void>: A promise that resolves to an instance of ExotelWebPhoneSDK if successful, or void if unsuccessful.

4. Initialize method

Use the Initialize method on the ExotelCRMWebSDK object which returns Promise that resolves to ExotelWebPhoneSDK object. ExotelCRMWebSDK does all the work to get necessary details required for the ExotelWebPhoneSDK

const crmWebPhone = await crmWebSDK.Initialize(HandleCallEvents, RegisterationEvent);

You must pass call events handler, registeration event handler (optional) and session callback handler (optional) to the Initialize method

5. ExotelWebPhoneSDK

  1. RegisterDevice: Registers the device with the call server.

  2. UnRegisterDevice: Un-registers the device from the call server.

  3. AcceptCall: Accept call

  4. HangupCall: Disconnect call

  5. MakeCall: (async) Method that places a call

    Number: A number to dial

    dialCallback: It is called after the call request is made to the server (An actual call may start after this with a slight day).

    CustomField: String; Any application-specific value like order id that will be passed back as a parameter in status callback.

  6. ToggleHold: Toggle state hold/un-hold state of a call. This state needs to be maintained by the client

  7. ToggleMute Toggle state mute/un-mute state of a call. This state needs to be maintained by the client

License

This project is licensed under the Apache-2.0 License. See the LICENSE file for details.

版本与发布记录

@exotel-npm-dev/exotel-ip-calling-crm-websdk 共发布 2 个版本,首次发布于 2026/01/09;过去 12 个月发布了 2 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
2.0.0latest2026/10/2222 天前
1.2.22026/01/0910 个月前

关于 @exotel-npm-dev/exotel-ip-calling-crm-websdk 的常见问题

@exotel-npm-dev/exotel-ip-calling-crm-websdk 是什么?

Exotel's crm websdk for IP calling integration

如何安装 @exotel-npm-dev/exotel-ip-calling-crm-websdk?

在项目目录运行 npm install @exotel-npm-dev/exotel-ip-calling-crm-websdk,或使用 pnpm add / yarn add / bun add。

@exotel-npm-dev/exotel-ip-calling-crm-websdk 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@exotel-npm-dev/exotel-ip-calling-crm-websdk 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@exotel-npm-dev/exotel-ip-calling-crm-websdk 可以商用吗?

@exotel-npm-dev/exotel-ip-calling-crm-websdk 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@exotel-npm-dev/exotel-ip-calling-crm-websdk 的下载量有多少?

根据 npm 官方下载统计,@exotel-npm-dev/exotel-ip-calling-crm-websdk 在 2026/10/14 – 2026/11/12 这 30 天内被下载 3,573 次,日均约 119 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@exotel-npm-dev/exotel-ip-calling-crm-websdk 还在维护吗?

最新版本 2.0.0 发布于 2026/10/22(22 天前);至今共发布 2 个版本,其中过去 12 个月发布了 2 个;首次发布于 2026/01/09。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。