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

@bbtfe/bbt-call

v1.0.3

Published

外呼sdk

Downloads

5

Readme

宝宝树前端外呼 SDK

引入外部服务-天润外呼服务,做了宝宝树自己的包装,主要包含功能:根据业务编码登录宝宝树外呼,进行绑定手机号、分配座席;外呼完成后释放座席等。

天润外呼工具页

https://ws-bj.clink.cn/#

npm 引用

npm i @bbtfe/bbt-call
import BbtCall from '@bbtfe/bbt-call';

script 引用

(具有全局类 bbtCall, 使用 new bbtCall() )

支持 HTTPS 和 HTTP,建议在通常页面中使用下面去掉协议头的形式引用即可。

<script
  src="//h5cdn.babytreeimg.com/h5_fe_lib/release/bbt-call/1.0.0/index.min.js"
  crossorigin="anonymous"
></script>

注意事项:

  1. 因天润的 sdk 不兼容 safari 浏览器, 请调用外呼时,做浏览器判断
  2. 因接口请求有域名限制,请在本地设置 host: 127.0.0.1 xxx.babytree-test.com, 并用此域名访问

API

初始化

this.bbtCall = new BbtCall({
 businessCode: "local", //businessCode 必填 外呼系统定义的业务码,为后续请求企业编码
 env: process.env.BUILD_ENV || "online" //env 选填 请求哪个环境接口,默认 线上
});

外呼调用

this.bbtCall.call({
  tel: '13212121212',//必填 呼叫的号码
  bindTel:'13112121212',//必填 绑定的电话
  businessParam: '000123', //可选  string  业务自定义参数
  cityCode: '北京市',//可选 外显号码城市名称
  success: () => {
      //外呼成功(表示客服已接电话,客户状态随便)
    console.log("外呼成功结束");
  },
  fail: () => {
      //外呼成功(表示客服未接电话)
    console.log("外呼失败");
  }
});