@izonder/nuxt-intercom
v0.0.13
Published
Intercom Module for Nuxt.js
Readme
nuxt-intercom
This module is for Nuxt 2 only. For a Nuxt 3 version, please see https://github.com/devonik/nuxt-3-intercom
Setup
- Add
@izonder/nuxt-intercomdependency to your project
yarn add @izonder/nuxt-intercom # or npm install @izonder/nuxt-intercomAdd @izonder/nuxt-intercom to the buildModules section of nuxt.config.js
{
buildModules: [
'@izonder/nuxt-intercom',
],
publicRuntimeConfig: {
intercom: {
appId: 'XXXXXXXXXX',
debug: true,
},
}
}Options
Defaults:
const defaults = {
appId: null, // Intercom ID
autoBoot: true, // True to boot messenger widget and show UI on page load, false to allow manually booting later
debug: false, // True to show debug messages in the console, useful for development, false to not show them
config: {}, // Object to specify messenger attributes to configure when booting. see https://developers.intercom.com/installing-intercom/docs/javascript-api-attributes-objects#section-messenger-attributes
scriptId: 'intercom-script', // String to identfy the script tag, for vue-meta
scriptDefer: false, // True to defer loading intercom widget javascript until page loads, false to async load it in document flow
updateOnPageRoute: true // True to call intercom's 'update' method on route change, false to not do this
};Usage
Development
- Clone this repository
- Install devDependencies using
yarn install - Start development server using
yarn devorINTERCOM_ID=<your intercom id> yarn devif you want to provide customer INTERCOM_ID.
License
Copyright (c) Hex Digital
