cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv


A Pen By Captain Anonymous

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

Quick-add: + add another resource

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

Quick-add: + add another resource

Code Indentation


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

    <title>Qismo Widget Sample</title>
    <link rel="stylesheet" type="text/css" href="https://qiscus-sdk.s3-ap-southeast-1.amazonaws.com/web/v2.5.11/qiscus-sdk.2.5.11.css">
<div id="qiscus-widget"></div>
<script src="https://code.jquery.com/jquery-3.1.0.js"></script>
<script src="https://qiscus-sdk.s3-ap-southeast-1.amazonaws.com/web/v2.5.11/qiscus-sdk.2.5.11.js"></script>
    $(function () {
        // Required vars. Suggested to put all vars in the env vars
      var userID = null
      var userName = null
      var ls = JSON.parse(localStorage.getItem('data'));
      if (ls !== null) {
        userID = ls.user_id
        userName = ls.user_name
      } else {
        var randomID = null;
        var possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
        for (var i = 0; i < 5; i++)
        randomID += possible.charAt(Math.floor(Math.random() * 
          var randomKey = Date.now();
          var userData = {
            user_id : randomID + '@guestqiscus.com',
            user_name : 'Guest - ' + randomKey
          localStorage.setItem('data', JSON.stringify(userData));
          userID = userData.user_id
          userName = userData.user_name
        var baseURL = 'https://qismo.herokuapp.com'
            appId = 'rus-2xgngx0zigegfxyk4',
            userId = userID;

        // Initiate Qiscus User
        var initUser = $.post(`${baseURL}/api/v1/qiscus/initiate_chat`,
                'app_id'  : appId,
                'user_id' : userId,
                'name'    : userName

        initUser.done(function (data) {
            var roomId = data.data.room_id;
            var password = data.data.sdk_user.password;
            var sdkEmail = data.data.sdk_user.email;
                AppId: appId,
                options: {
                    loginSuccessCallback: function (userData) {
            // live avatar from https://www.flaticon.com/free-icons/user-avatar_117234
            QiscusSDK.core.setUser(sdkEmail, password, userName, 'https://image.flaticon.com/icons/svg/145/145867.svg');

Loading ..................