Konverse AI Developer Hub
  • Konverse AI Developer Hub
  • Getting Started
    • Authentication
    • Errors
    • Rate Limit
  • Webhooks
    • Webhook Endpoints
  • Platform
    • Embedded Functions
      • Send Text Message
      • Send Quick Reply
      • Set Variables
      • Send Choice
      • Send Cards
      • Stop Propagation
      • Query a Dataset
      • Jump To Story
      • Query a Google Sheet
    • Datasets
    • Bot Webhooks
  • Messaging Channels
    • Introduction to Channels
    • Web Chat
    • Facebook Messenger
    • WhatsApp
      • Send WhatsApp Notifications
      • Send Session Message
    • Line
  • App Integration
    • Android App Integration
Powered by GitBook
On this page

Was this helpful?

  1. Platform

Embedded Functions

Our Platform allows you to send embed functions written in node JS which allows you integrate third-party APIs directly inside your chatbot

let { ExtendedLogger } = require("@function-logger");
let logger = new ExtendedLogger("default", "bot_id", "functionNamespace");
module.exports = async (ctx) => {
    let session = ctx.session;
    let config = ctx.config;
    let metadata = ctx.metadata;
    let params = ctx.params;
    let visitor = ctx.visitor;
    return new Promise((resolve, reject) => {
        //...your code goes here
        resolve(ctx);		//Always resolve ctx variable
    })
}

Embedded functions as a services pass the conversation context (ctx) into your function allows to to return response, and process information that the chatbot has collected about the visitor and their sessions

PreviousWebhook EndpointsNextSend Text Message

Last updated 3 years ago

Was this helpful?