PricingBlog

Integrating Chatwoot user data

  • okgo.-1198971223997161512

    okgo

    2 years ago

    Hi all! I'm trying to integrate the Chatwood chat widget into my Toddle application. Adding the Javascript code into the editor wasn't an issue, all this is working as expected. Now I would like to add some additional dynamic Javascript code that pulls user data from Supabase and passes it to the Chatwoot widget.

    There's a code snippet for this in the Chatwoot documentation, but within Toddle I cannot seem to tie this to the API output. I tried making a custom script with associated attributes, but I cannot seem to use this as part of an API "on success" or "on load" and then load the Javascript in the frontend.

    Code snippet: https://www.chatwoot.com/docs/product/channels/live-chat/sdk/setup#set-the-user-in-the-widget

    What would be the best way to do this? Thanks in advance. 🙂
  • andreasmoller-1199019339555295323

    Andreas Møller

    2 years ago

    If you know how to write the code you can create a custom action: https://docs.nordcraft.com
    👍1
  • If chatwood is already loaded, you can find it on the window object.
  • okgo.-1199037788734095450

    okgo

    2 years ago

    I will look into that, thanks for the hint. 🙂