Line Platform
Receive events and send messages through LINE messaging API.
Install
npm install @sociably/core @sociably/http @sociably/line
# or with yarn
yarn add @sociably/core @sociably/http @sociably/line
Docs
Check the platform document and the package reference.
Setup
import Sociably from '@sociably/core';
import Http from '@sociably/http';
import Line from '@sociably/line';
const {
LINE_PROVIDER_ID,
LINE_CHANNEL_ID,
LINE_ACCESS_TOKEN,
LINE_CHANNEL_SECRET,
} = process.env;
const app = Sociably.createApp({
modules: [
Http.initModule({ /* ... */ }),
],
platforms: [
Line.intiModule({
webhookPath: '/webhook/line',
agentSettings: {
providerId: LINE_PROVIDER_ID,
channelId: LINE_CHANNEL_ID,
accessToken: LINE_ACCESS_TOKEN,
channelSecret: LINE_CHANNEL_SECRET,
},
}),
],
});