Getting started

To add comments to your website you need to add the following code snippet to your website

  
    <div 
      class="just-comments"
      data-allowguests="true"
      data-apikey="YOUR_API_KEY">
    </div>
    <script async src="https://just-comments.com/w.js"></script>
  

Replace YOUR_API_KEY with an actual API key of your account. To obtain the API key go to your account.

The snippet above consists of two tags. Place the div to the location on your website where you want comments to be shown. The script has be included after the div tag and the best place would right before the closing </body> tag.

Configuration

You can control the behavior of the comments widget using data- attributes. Two common attributes:

Additional options available will be shown in the next sections describing more complex integrations.

Widget Language

The default language of the widget is English. You can change it by specifying data-locale attribute:

  
    <div 
      class="just-comments"
      data-locale="en_US"
      data-allowguests="true"
      data-apikey="YOUR_API_KEY">
    </div>
    <script async src="https://just-comments.com/w.js"></script>
  
The following attributes are available at the moment: en, en_GB, en_US, ru_RU. Contact us if you need an additional language.

Integration with Recaptcha

To protect your comments from bots, you can opt-in for Recaptcha. For this you need to add an additional script tag and define the corresponding data attribute.

  
    <div 
      class="just-comments"
      data-allowguests="true"
      data-recaptcha="true"
      data-apikey="YOUR_API_KEY">
    </div>
    <script async src="https://just-comments.com/w.js"></script>
    <script src='https://www.google.com/recaptcha/api.js?onload=jcOnRecaptchaLoad&render=explicit'
      async defer>
    </script>
  
With Recaptcha integration enabled the widget will ask users to solve a challenge if Recaptcha suspects that the user is a robot.

Integration with own user database

If you have your own user database and your own authentication mechanism, you can integrate it with Just Comments seamlessly. To make it work your need to create a JWT token for every user that wants to comment. For example, on your NodeJS backend you can do it like this:

  
    const jwt = require('jsonwebtoken');
    const user = {
      apiKey: 'YOUR_API_KEY',
      userId: 'alex',
      userPic: '/widget/no-pic.png',
      userUrl: '/profile/alex',
      username: 'Alex Rudenko',
    };
    var token = jwt.sign(user, 'YOUR_API_KEY_SECRET', {
      algorithm: 'HS256',
    });
  
the token generated on the backend needs to be provided to Just Comments via a data attribute on the client side:
  
    <div 
      class="just-comments"
      data-jwt="TOKEN_HERE"
      data-allowguests="true"
      data-apikey="YOUR_API_KEY">
    </div>
    <script async src="https://just-comments.com/w.js"></script>