KODA.AI Docs

KODA.AI Docs

  • Web JS SDK

›

  • Quick Start
  • Config

    • User Profile
    • Locales
    • Advanced Configuration
  • Browser Compatibility
  • SDK Methods
  • Analytics
  • CSS Properties

SDK Methods

Bot Accessible SDK

The SDK upon loading exposes a Javascript SDK that can then be used to programmatically control some of the behaviour of the SDK.

Methods

A Reference is similar to a page URL. It can take 2 possible formats:

  • block id (e.g. f60ea240-4cda-d1f9-032f-05eba5794059). You can get block id from dashboard`s URL: app.kodabots.com/bot/{bot_id}/create-bot/{block_id}
  • custom string set on promotion widget in a dashboard (e.g. lead-form). It's useful if You want to get additional analytics metrics.

open(reference?: string) => void

Open Chatbot Window with start reference

<script>
    window.initKBWebSDK = function (SDK) {
        const bot = SDK.initKBChatbot({
            "token": "TOKEN"
        });

        setTimeout(function() {
            bot.open('f60ea240-4cda-d1f9-032f-05eba5794059');
        }, 5000);
    }

</script>

trigger(triggerName?: string) => void

Execute the automation set from the dashboard.

<script>
    window.initKBWebSDK = function (SDK) {
        const bot = SDK.initKBChatbot({
            "token": "TOKEN"
        });

        bot.trigger("dark_mode")
    }

</script>

close() => void

Close chat window

setRef(reference: string) => void

Unlike the open method, this method doesn't open chat window, but only set reference block.

← Browser CompatibilityAnalytics →
  • Bot Accessible SDK
  • Methods
    • open(reference?: string) => void
    • trigger(triggerName?: string) => void
    • close() => void
    • setRef(reference: string) => void
Copyright © 2025 KODA sp. z o.o . Questions? Sent message to developers@koda.ai