Config

Orb configuration settings

Orb allows you to set a number configuration settings to control things like when the Orb connects, to which integration it connects, static string etc. Here is an example of snippet of Orb being initialized with a number of custom settings.

window.orbConfig = {
    connectionOptions: {
        gridUrl: "https://grid.meya.ai",
        appId: "app-xxxxx",
        integrationId: "integration.orb",
    },
    theme: { "brandColor": "#4989ea" },
    composer: {
        placeholderText: "Digite uma mensagem",
        collapsePlaceholderText: "Mais alguma coisa a dizer?",
        fileButtonText: "Arquivo",
        imageButtonText: "Foto"
    },
    drop: {
        dragAndDropText: "Arraste para enviar o arquivo",
    },
    launcher: {
        type: "message",
        icon: "streamline-regular/21-messages-chat-smileys/02-messages-speech-bubbles/messages-bubble-question.svg",
        text: "Help",
    },
    container: document.querySelector("#orb-mount"),
    windowApi: true,
};
(function () {
    var script = document.createElement("script")
    script.type = "text/javascript"
    script.async = true
    script.src = "https://cdn.meya.ai/v2/orb.js"
    document.body.appendChild(script)
    var fontStyleSheet = document.createElement("link")
    fontStyleSheet.rel = "stylesheet"
    fontStyleSheet.href = "https://cdn.meya.ai/font/inter.css"
    document.body.appendChild(fontStyleSheet)
})()

Connection config

Setting

Type

Default

gridUrl

Required

The URL of the Meya grid platform the Orb will connect to.

Usually this is set to https://grid.meya.ai

appId

Required

The ID of Meya app that Orb will connect to. You can find your app ID under you app's Settings page in the Meya Console.

integrationId

Required

The ID of the integration that the Orb will connect to. This ID is set in BFML when you added the Orb integration to your app.

When adding an integration to an app the ID can either be set manually using the id property or it will be the dot path of the integration YAML file e.g. integration.orb when the file path is integration/orb.yaml.

connect


Important!

This specifies whether the Orb should automatically connect when it is initialized.

Note, if you are deploying the Orb to a web page with a lot of user traffic, it is recommended to set this to false so that the Orb will only connect when a user clicks the Orb launcher.

This will allow you reduce your MAU (Monthly Active Users) usage.

true

onFirstConnect

This is a custom callback that will be run when the Orb first connects to the Grid.

Note, that this is only run the first time the Orb successfully connects but won't run again when the Orb is in a connection retry loop.

null

pageContext

The custom page context object that can be used to send custom data to the bot.

See the Page context page for more detail.

null

eventStream

A list of Orb event entries to initialize the Orb with.

This setting is mainly for advanced and debugging use cases. By default the Orb will always receive a list of event entries from the Orb integration.

null

gridUserId

The unique Meya ID of the current user connecting to the app.

A user's ID can be found in your app's Users view.

This setting is mainly for advanced and debugging use cases. By default the Orb will generate a unique integraiton user ID, which is stored in local storage, and the Orb integration will generate a unique user ID for the given integration user ID.

null

userData

An object that stores each user's meta data e.g. name, avatar, type.

This setting is mainly for advanced and debugging use cases. By default the Orb will always receive the active user data from the Orb integration.

null

magicLinkId

This allows you to initialize the Orb with a specific magic link ID.

See the Magic Links page for more detail.

null

userId

This allows you to set a custom Orb integration user ID.

This setting is mainly for advanced and debugging use cases. By default the Orb will always generate a random integration user ID and store it in local storage.

null

threadId

This allows you to set a custom Orb integration thread ID.

This setting is mainly for advanced and debugging use cases. By default the Orb will always generate a random integration thread ID and store it in local storage.

null

sessionToken

This allows you to set a custom Orb session token.

This setting is mainly for advanced and debugging use cases. By default the Orb will always generate a random session token and store it in local storage.

null

useLocalStorage

When set to true the Orb will store the integration user ID, integration thread ID and session token in the browser's local storage.

This allows the Orb to identify an existing user when they return to the same page/s.

true

Theme config

Setting

Type

Default

brandColor

This is a string containing a standard HEX color code.

#4989EA

Composer config

Setting

Type

Default

placeHolderText

The string that appears in the Orb's text input box.

Type a message

collapsedPlaceHolderText

The bot can specify that the Orb's text input
box can be hidden in BFML. This text will appear when the Orb's text input
is hidden and the bot did not specify any placeholder text in BFML.

Have something else to say?

fileButtonText

The text of file upload button

File

imageButtonText

The text of the image/photo upload button.

Photo

galleryButtonText

The text of the button to open the phone's image
gallery.

Gallery

Drop config

Setting

Type

Default

dragAndDropText

The text of the drop area when a file is dragged onto the Orb.

Drop to send file