Giter Site home page Giter Site logo

privat1 / wechaty-plugin-intercom Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 709 KB

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

Home Page: https://npmjs.com/package/wechaty-plugin-intercom

License: Apache License 2.0

JavaScript 0.53% Shell 9.28% TypeScript 90.20%

wechaty-plugin-intercom's Introduction

wechaty-plugin-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-plugin-intercom'

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

  at: 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.at: 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-plugin-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

master

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

wechaty-plugin-intercom's People

Contributors

huan avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.