Implementing Talla's Customer Assist Widget

The Talla Widget provides one-click access to Talla.  It allows you to create a button or link on your Customer facing portal that gives access to Talla. 


Installing the Talla Widget in your webapp is easy. You'll be including a snippet of JavaScript that makes an init call to our API. The init process requires two parameters: an app_id provided by Talla, and a JWT token you'll need to generate.  Next, we'll cover the details for initializing Talla.

Initializing Talla

Here is an example of initializing Talla via a Javascript call.  In the head section, the page includes a JS script provided by Talla.  In the script section after the body, the client calls Talla.init, passing in a JWT authentication token and the app_id, which is a unique identifier provided by Talla.  


    <title>Embedded JS Test</title>
    <script src=""></script>
      body {
        font-family: 'Open Sans', Arial, sans-serif;
        margin: 0px;
    <div id="example">
      <button onclick="start()">click me</button>
    <div id="talla-widget" style="width: 100%; height: 100%;"></div>
  <script type="text/javascript">
    var appID = {appID};
    var token = {token};
    talla.widget = talla.init(
    function start() {
      talla.widget.display(talla.OptionJWTCredentials(token), talla.OptionParent(document.getElementById('talla-widget')))


You need to authenticate by calling Talla.init with a JWT token, that token should include the following attributes: first_name, last_name, email, user_id, nickname and timezone. Talla will use this data to identify users and user interactions across sessions.

How to Generate JWT Tokens Containing Your Attributes

JSON Web Token (JWT) is an open standard ( RFC 7519) for transmitting JSON objects in a secure and compact way.  The information in the JSON object can be verified because it is digitally signed with a secret.  For the purpose of authenticating the Talla Beacon, the JWT should be signed using a secret value provided by Talla, and contain the needed identification attributes (first_name, last_name, email, user_id, nickname and timezone) in encoded form.

More details and many open source implementations for the JWT standard can be found at (  The site includes instructions for downloading and installing the necessary libraries, gems, or packages in Java, Go, JS, Python, Ruby and other languages, as well as links to their repositories on GitHub.  Most of these repositories also contain their own documentation and example code for generating JWT tokens and using them in a web app.

The call to generate the JWT token with all these attributes is straightforward.  The code snippets below are for Ruby and Javascript, but in other languages the code would be similar:


:exp =>,
:account => {
  first_name: [a string],
  last_name: [another string],
  email: [email address],
  uid: [a uuid string]}),
[the app secret string], #Secret is the APP_SECRET

Note: `exp` expiration date is in unix timestamp


let account = {
  uid: md5(""),
  first_name: "john",
  last_name: "doe",
  email: "",
let token = jwt.sign({account: account}, this.state.secret, {algorithm: 'HS256'})

Still need help? Contact Us Contact Us