Lite fullscreen channel-web URL parameters for proactive action

Is there a way I can add URL parameters to the lite channel-web URL for a proactive action? I know how to do a proactive action while embedding the chat into a web page, but I’d like to call the chat directly from URL into it’s own browser window, but would like to do it with a proactive action.

Using a URL similar to: https://bp-botpress.mydomain.com/lite/welcome-bot/?m=channel-web&v=Fullscreen&options={"hideWidget"%3Atrue%2C"config"%3A{"botConvoTitle"%3A"Bot%20Emulator"%2C"enableReset"%3Atrue%2C"enableTranscriptDownload"%3Atrue}}

1 Like

Same question!:frowning:

Out of the box, that’s not possible. However, it seems to be a frequent request so it may be an interesting feature to add!

We will talk about it and let you know soon

Is this now possible? Or is this feature added?

Any ideas on how to solve this? Maybe sending a payload from a hook on web-channel? How could this be done?

Solved creating a hook before incoming middleware, now I just have to check when the user has entered the chat so that it doesn’t jump to the node every time the user inputs

/** If you want to send a custom message **/
    const payload = {
    type: 'text', 
    platform: 'web', 
    text: 'smth'
  }

  bp.events.replyToEvent(event, [payload])
  if (event.type == ('session_reset') || event.type == ('visit')) {
    bp.logger.info('entry')
    /** If you want to jump to a node **/
    async function hook() {
      //event.setFlag(bp.IO.WellKnownFlags.SKIP_DIALOG_ENGINE, true)
      const sessionId = bp.dialog.createId(event)
      await bp.dialog.jumpTo(sessionId, event, 'main.flow.json', 'proactive')
      await bp.dialog.processEvent(sessionId, event)
      event.state.user.proactive = 1
    }
    return hook()
  }

If you notice I declare a variable event.state.user.proactive = 1 because later on, in the flow, I create conditionals, so that I don’t get problems with duplicated messages as this solution doesn’t continue with the flow. I’ve tried several solutions such as event.setFlag(bp.IO.WellKnownFlags.SKIP_DIALOG_ENGINE, true) but every time keeps going to the entry flow after the jumpto, so I did the variable workaround