Dynamically change the widget logo per app

Hi, How can we update the page template to dynamically render widget logos per application. Below is a sample code that only changes the background per application fetching the images from S3. Can you share some sample code on updating the widget logo. Should it be done using javascript ??

<html lang="{{locale}}">

    <title>Welcome to {{ application.name }}</title>

    {%- auth0:head -%}


      #custom-prompt-logo {

          background-image: url('https://your-s3-bucket-url/{{ application.name | replace(" ", "%20") }}.png');



<body class="_widget-auto-layout _use-custom-prompt-logo">

    {%- auth0:widget -%}