title: External JS in Vue.js
body: <p>I'm trying to setup a custom chat
  and it expects something like this:</p>
  
  <pre><code>&lt;script&gt;
    window.fcSettings = {
      token: "737838-363673273278-782828",
      host: "https://wchat.freshchat.com",
      externalId: "john.doe1987",     // user’s id unique to your system
      firstName: "John",              // user’s first name
      lastName: "Doe",                // user’s last name
      email: "john.doe@gmail.com",    // user’s email address
      phone: "8668323090",            // phone number without country code
      phoneCountryCode: "+1"          // phone’s country code
    };
  &lt;/script&gt;
  &lt;script src="https://wchat.freshchat.com/js/widget.js" async&gt;&lt;/script&gt;
  </code></pre>
  
  <p>I created a simple vue component and under created() I have the following function:</p>
  
  <pre><code>    updateChat() {
          axios.get('/api/user-info')
              .then((resp) =&gt; {
                  const user = resp.data
  
          window.fcSettings = {
                  token: "737838-363673273278-782828",
                  host: "https://wchat.freshchat.com",
                  externalId: user['id'],
                  firstName: user['name'],
                  lastName: user['surname'],
                  email: user['email'],
                };
  
              })
              .catch((err) =&gt; {alert(err); console.log(err);})
      },
  </code></pre>
  
  <p>I'm not sure however on how to load <code>https://wchat.freshchat.com/js/widget.js</code> after this function run. I tried to ad it as a normal  tag under my bundle.js  tag but it didn't work. How can I do it? Thanks.</p>