# 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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developer.konverse.ai/platform/embedded-functions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
