Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

aircall-everywhere

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aircall-everywhere

Library to embed and communicate with aircall-phone in any webpage

  • 0.1.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.8K
decreased by-12.87%
Maintainers
1
Weekly downloads
 
Created
Source

How to use the Aircall Everywhere in any CRM ?

Include this project in your dependency

npm install aircall-everywhere

Constructor

You need to create an instance to use the library. The constructor has a settings argument:

  • afterPhoneLoaded: Callback function after the phone is fully loaded and the connexion between the phone and the CRM is established
  • integrationToLoad: You can specify a CRM from which specific settings can be retrieved. Only zendesk available for now.
  • domToLoadPhone: You must specify in which element you want to load the phone. Query selector string.

Example:

import AircallPhone from 'aircall-everywhere';

const aircallPhone = new AircallPhone({
  afterPhoneLoaded: () => {
    console.log('phone loaded');
    doStuff();
  },
  domToLoadPhone: '#phone',
  integrationToLoad: 'zendesk'
});

getSetting

You can retrieve specific integration settings with getSetting. Example with zendesk:

const redirectToTicket = aircallPhone.getSetting('display_ticket');

on & send

You can send messages to the phone and listen messages coming from it.

events from the phone:

  • incoming_call: the phone is ringing
  • call_end_ringtone: the ringtone has ended. It can mean the incoming call was taken or missed.
  • redirect_event: event coming from specific CRM settings if it has been enabled in the Aircall Dashboard. Only zendesk is supported for now. This event data has this schema:
    {
      type: 'Zendesk::User' | 'Zendesk::Ticket'
      id: <userId> | <ticketId>
    }
    

events the phone listens to:

  • dial_number: with {phone_number: <number>} argument, you can ask the phone to dial the number.
  • exit_keyboard: with no argument, you can ask the phone to exit the keyboard view if it is on.

Full Example:

import Aircall from 'aircall-everywhere';

const aircallPhone = new AircallPhone({
  afterPhoneLoaded: () => {
    console.log('phone loaded');
    doStuff();
  },
  domToLoadPhone: '#phone',
  integrationToLoad: 'zendesk'
});

aircallPhone.on('incoming_call', () => {
  putPhonePopupInFront();
});

myCRM.on('phone_button_clicked_event', number => {
  aircallPhone.send('dial_number', { phone_number: number });
});

more events to come...

Development

You can run the demo webpage with: npm start

tests are available: npm run test npm run test-watch npm run coverage

FAQs

Package last updated on 12 Jul 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc