ibridge-webphone
v1.1.4
Published
### Get Started `npm i ibridge-webphone`
Downloads
22
Readme
iBridge Webphone
Get Started
npm i ibridge-webphone
Import lib to the project
import { Webphone } from "ibridge-webphone"
Init Webphone:
Webphone.init({
token: LOGGED_TOKEN_HERE,
environment: ENVIRONMENT_ID
}).then((webphone) => {
// your code here
});
Actions:
| Function | Description | |---------------------|-----------------------| | openWebphone | Open webphone window | | closeWebphone | Close webphone window | | call("number_here") | Init call | | acceptCall | Accept incoming call | | declineCall | Decline incoming call |
Infos
| Function | Description | |----------|------------------------------------| | isOpened | Check if webphone window is opened | | isClosed | Check if webphone window is closed |
Acceptable Params
| Key | Type | Required | Description | |-------------|--------|----------|-----------------------| | token | string | yes | Login token from user | | environment | string | yes | User's Environment | | profile | string | no | Profile Logged |
Example:
Webphone.init({
token: LOGGED_TOKEN_HERE,
environment: ENVIRONMENT_ID
}).then((webphone) => {
document.getElementById("accept-call-btn").onclick(function() {
webphone.acceptCall();
});
}).catch(() => {
console.error("Error on init webphone");
});