Socket
Book a DemoInstallSign in
Socket

@wisersolutions/intercom

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wisersolutions/intercom

Utils for integrating [Intercom](https://www.intercom.com/) into web applications.

latest
Source
npmnpm
Version
0.0.3
Version published
Maintainers
2
Created
Source

intercom

Utils for integrating Intercom into web applications.

Use

To use Intercom in a React application, use the provided useIntercom hook in some app root component to load and initialize Intercom. Provide settings containing user identification if/when inside a sign-in barrier.

import { useIntercom } from '@wisersolutions/intercom'

export const AppRoot = ({ intercomId: appId, ...props }) => {
  useIntercom(appId)
  // or
  // useIntercom(appId, { user_id: '12345', email: 'john.doe@company.com', name: 'John Doe', created_at: 1575205778963 })
  
  // … (render the app)
}

To integrate Intercom into an app that's not using React, import just the loader code and load it.

import { loadIntercom, startIntercom } from '@wisersolutions/intercom/lib/intercom'

loadIntercom(appId).then(() => startIntercom(appId, { /* settings or user identity if needed */ }))

Development

Install

Install dependencies using:

npm install

Develop

After you modify sources, run the following (or set up your IDE to do it for you):

  • format the code using npm run format
  • lint it using npm run lint

and fix the errors, if there are any.

Publish

Publishing is done in two steps:

  • Create a new version tag and push it to the repository:
    npm version <patch|minor|major>
    git push --follow-tags
    
  • Build and publish the new version as a npm package:
    npm publish --access public
    

FAQs

Package last updated on 01 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