npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

wechaty-intercom

v1.0.1

Published

Wechaty Intercom Plugin helps you build better customer relationships through WeChat across the customer journey.

Downloads

5

Readme

wechaty-intercom Wechaty Plugin Intercom

NPM Version NPM

Intercom is a Conversational Relationship Platform (CRP).

Wechaty Intercom Plugin helps you build better customer relationships through WeChat across the customer journey.

Wechaty Plugin Intercom

Powered by Wechaty TypeScript

Introduction

Wechaty Intercom Plugin helps you to manage your customers/leads/users in the WeChat Room, with the power of the Intercom service.

Usage

import { WechatyIntercom } from 'wechaty-intercom'

const config = {
  room: 'room_id@chatroom',

  mention: true,
  webhookProxyUrl : 'https://smee.io/your_smee_io_proxy_url',
  intercomToken   : 'your_intercom_authorization_token',
}

const IntercomPlugin = WechatyIntercom(config)

const wechaty = new Wechaty()
wechaty.use(IntercomPlugin)
  1. config.room: The room id of your service WeChat room.
  2. config.mention: If set to true, customers need to use @ to mention the bot when they want to ask questions.
  3. config.webhookProxyUrl: A semee.io link that you need to set it to receive the Intercom Webhook events.
    1. Intercom Developer Hub - Webhook Topics
    2. smee.io - Webhook payload delivery service - Receives payloads then sends them to your locally running application.
  4. config.intercomToken: The Authorization Token for your Intercom account.
    1. Intercom Developer Hub - How to get your Access Token

Configure Intercom Webhooks

In order to receive the reply and close events from Intercom, we need to configure two webhooks:

  1. conversation.admin.replied
  2. conversation.admin.closed

The request endpoint URL must be as same as the webhookProxyUrl setting in the config.

Intercom Webhooks

Do not forget to click [Save] button after you set them.

Environment Variables

The following two environment variables will be used if the required information is not provided by the config.

1 WECHATY_PLUGIN_INTERCOM_TOKEN

process.env.WECHATY_PLUGIN_INTERCOM_TOKEN will be used if the config.intercomToken is not provided.

Learn more about the authorization token of intercom: Intercom Developers - How to get your Access Token

2 WECHATY_PLUGIN_INTERCOM_WEBHOOK_PROXY_URL

We receive webhook payloads with the help from <smee.io>, by proxy them to our locally running Wechaty Plugin application.

process.env.WECHATY_PLUGIN_INTERCOM_WEBHOOK_PROXY_URL will be used if the config.webhookProxyUrl is not provided.

See:

  1. Intercom Developer Hub - Webhook Topics
  2. smee.io - Webhook payload delivery service - Receives payloads then sends them to your locally running application.

Screenshot

Wechaty Intercom Conversation

Example

Our Friday BOT are using wechaty-intercom to connect our WeChat customers to Intercom.

You can read the source code from: https://github.com/wechaty/friday/blob/master/src/plugins/intercom.ts

History

v1.0 (Oct 23, 2021)

Release v1.0 of Wechaty Intercom Plugin.

v0.4 master

  1. Renamed from wechaty-plugin-intercom to wechaty-intercom.
  2. Rename at to mention in config.

v0.2 (Jun 2020)

  1. Init code base
  2. Room message to Intercom
  3. Intercom message to Room (Powered by Smee.io)

Contributors

contributor contributor contributor contributor contributor contributor contributor contributor

Author

Huan LI (李卓桓), Tencent TVP of Chatbot, <[email protected]>

Profile of Huan LI (李卓桓) on StackOverflow

Copyright & License

  • Code & Docs © 2020 Huan LI <[email protected]>
  • Code released under the Apache-2.0 License
  • Docs released under Creative Commons