Skip to Content
Support Hub
Integrations & ActionsConfiguring Your First External Script

Integrations & Actions

Configuring Your First External Script

External Scripts for Web and App Touchpoints

  1. Add the External Script Node
    Place it on the canvas with a valid JSON input (e.g., {}).

  2. Define the Script in Embedding Code
    Add the script to the externalScripts property in the embedding script.

External scripts in Sites

External Scripts added to the Mavenoid Assistant embedding script for a website are not automatically available in the Sites. To enable these scripts in Sites, the external script must be defined in a separate script file and meet the following requirements:

  • Structure

window.mavenoidExternalScripts = {
    async myExternalScript(input) {
        // Insert logic here
    }
}
  • Reference in Sites Touchoint: The script must be added in the Sites configuration.

  • Script hosting

    • The .js file can be hosted on your own domain, OR

    • By Mavenoid, in which case Mavenoid controls the deployment/update of the script.

Input and Output Management

  • Input Format: JSON, with references to session info (e.g., $sessionId, $language-iso).

  • Output Format: Script can return form data objects to pass data back to the flow.

mavenoid.push({
  event: "assistant-mount",
  clientId: "YOUR_CLIENT_ID",
  externalScripts: {
    async sayHello(input) {
      var customerName = input.customerName;
      alert(`Hello ${customerName}!`);
      return {
        formData: [
          {
            id: "result",
            value: {
              type: "string",
              value: "ok",
            },
          },
        ],
      };
    },
  },
});

Need more help?

Ask a different questionIntegrations & Actions
Select a different product
© 2024 Mavenoid ABSitemap
Terms of servicePrivacy policyCookie policyData processing agreement