Kik Integration without Kik NPM

Create a bot API key

Each bot needs its own API key for tracking.

Create a bot to get an API key.

Install Dashbot via NPM

npm install --save dashbot

Include Dashbot

Use the API key created above.

const dashbot = require('dashbot')(process.env.DASHBOT_API_KEY).kik;

Log all incoming messages

Send the full message to Dashbot.

Example Message

{
type: 'text',
body: 'pat me',
from: 'someuser',
timestamp: 1470024587572,
mention: null,
participants: [
'someuser'
],
readReceiptRequested: true,
id: '987654321',
chatId: '123456789'
}

Send Message

dashbot.logIncoming(process.env.KIK_API_KEY, process.env.KIK_USERNAME, message)

Where process.env.KIK_API_KEY is the API_KEY from Kik and process.env.KIK_USERNAME is the username for the bot from Kik.

Log all outgoing messages

Send the full message to Dashbot.

Example Message

{
type: 'text',
body: 'My Test Message',
to: 'someuser',
chatId: '123456789'
}

Send Message

dashbot.logOutgoing(process.env.KIK_API_KEY, process.env.KIK_USERNAME, message)

Where process.env.KIK_API_KEY is the API_KEY from Kik and process.env.KIK_USERNAMEis the username for the bot from Kik.

Close Menu