Blitzz Help Center

Starting a Cobrowse session with the click of a button

If desired, you can integrate a UI in your app to facilitate the generation of a 6-digit code. Visitors can then communicate the code via phone or chat, allowing agents to initiate the Cobrowse session.

It's crucial to note that 6-digit codes have an expiration period of approximately 30 minutes. Therefore, it's recommended to generate a code only when a user intends to start a session.

Below is the code sample through which you can display the manually generated 6-digit session code on your web app.

Important Note: As you can see in the code below, one important parameter that needs to be passed is "autoInitiate" and its value should be the same as shown in the sample. If this parameter and its value are not passed with the same value then the SDK will work on Auto-session generation mode and manual code generation will not work.

<script>
  let blitzz;
  let st = document.createElement("script");
  st.src = "https://media.blitzz.co/sdk/blitzzcobrowse.min.js";
  st.async = 1;
  let tx = document.getElementsByTagName("script")[0];
  tx.parentNode.insertBefore(st, tx);
  st.onload = function () {
    if (!blitzz) {
     blitzz = new BlitzzCobrowse({});
      blitzz.initialize({
        license:"your license key",
        autoInitiate:false,
      });
    }
  };
</script>

After adding this, you'll need to call the below function on-click of any link/button to display the 6-digit code.

 if (blitzz) {
     blitzz.getCode();
   }

On calling this function you will see a pop-up that displays the unique code. The visitor should share this code through chat, audio or video call. Once an agent received this code, they may input it into the cobrowse code field on the Agent Dashboard.

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.

Related Articles