New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@mathieustan/vue-intercom

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mathieustan/vue-intercom

A wrapper for Intercom

  • 0.0.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.7K
increased by2.99%
Maintainers
1
Weekly downloads
 
Created
Source

vue-intercom

A wrapper for Intercom.

This package is to replace vue-intercom which is not maintained anymore.

Demo

To view a demo online: https://vue-intercom.netlify.app/

Install

npm install --save @mathieustan/vue-intercom

or

yarn add @mathieustan/vue-intercom
import Vue from 'vue';
import VueIntercom from '@mathieustan/vue-intercom';

Vue.use(VueIntercom, { appId: 'your-app-id' });

Usage

vue-intercom handles the injection of Intercom's script into your html and wraps calls to the Intercom API with methods and exposes them through the $intercom object in your components.

new Vue({
  el: '#app',
  data() {
    return {
      userId: 1,
      name: 'Foo Bar',
      email: 'foo@bar.com',
    };
  },
  mounted() {
    this.$intercom.boot({
      user_id: this.userId,
      name: this.name,
      email: this.email,
    });
    this.$intercom.show();
  },
  watch: {
    email(email) {
      this.$intercom.update({ email });
    },
  }
});

API

Values

$intercom.ready

Set to true once the Intercom script has been loaded.

$intercom.isBooted

Set to true once the Intercom boot method has been called.

$intercom.visible

Set via the onShow/onHide events.

$intercom.unreadCount

Set via the onUnreadCountChange event.

Methods

$intercom.boot(/* optional */options)

Calls Intercom('boot'). Automatically sets the app_id unless specified in the options object.

$intercom.shutdown()

Calls Intercom('shutdown').

$intercom.update(/* optional */options)

Calls Intercom('update'). If the options object is set, calls Intercom('update', options)

$intercom.show()

Calls Intercom('show').

$intercom.hide()

Calls Intercom('hide').

$intercom.showMessages()

Calls Intercom('showMessages').

$intercom.showNewMessage(/* optional */content)

Calls Intercom('showNewMessage') with pre-populated content if provided.

$intercom.trackEvent(name, /* optional */metadata)

Calls Intercom('trackEvent') with extra metadata if provided.

$intercom.startTour(name, /* optional */metadata)

Calls Intercom('startTour') with extra metadata if provided.

$intercom.getVisitorId()

Calls Intercom('getVisitorId').

Keywords

FAQs

Package last updated on 08 Sep 2020

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