JSFiddle - React, Tailwind, and code Playground

by Decay15

HTML

<script src="https://cdn.botpress.cloud/webchat/v1/inject.js"></script>
<script src="https://mediafiles.botpress.cloud/addd9e90-1c78-475e-83df-02e9e5ec618a/webchat/config.js" defer></script>

JavaScript

window.botpressWebChat.onEvent(function (event) {
    if (event.type === 'LIFECYCLE.LOADED') {
        window.botpressWebChat.sendEvent({ type: 'show' });
        setTimeout(() => {
            window.botpressWebChat.sendPayload({
                type: 'trigger',
                payload: {
                    myCustomProperty: 'Hey',
                },
            });
        }, 5000);
    }
}, ['LIFECYCLE.LOADED']);