Widgets

Two widgets are provided to enable users quickly provide access to an app, get verified by Traity and enjoy proving their trustworthiness to protect their transactions.

In order to embed the widgets, a signature needs to be provided. Implementations to build the JWT signature can be found at the languages section.

A signature can be generated by providing your app's key, app's secret, and your app's internal user id that is logged in (current_user_id), and it needs to be embedded in every widget call for security purposes:

signature(APP_KEY, APP_SECRET, CURRENT_USER_ID)

All widgets are resizable and vector-based to be positioned and scaled freely in your site.

Last but not least, Traity's widget JavaScript needs to be embedded in your HTML document:

<script src="https://developers.traity.com/api.js"></script>

Badge widget

The badge widget shows a badge for a specific user in the case the user is Traity-verified. It shows nothing in the case the user is not verified, so it's a good indicator to show in listings and user profiles.

Clicking on the widget shows a popup with information on the user who has been verified and the guarantee.

<img class='traity-widget' src="https://developers.traity.com/badges/USER_ID?s=SIGNATURE" onclick="Traity.click(event)" style="cursor: pointer;"/>

USER_ID is your app's internal user id, and SIGNATURE is the generated signature for the widget.

Connection widget

The connection widget enables a user to get verified using Traity. It's the way users can show the badge widget in their profiles. It shows an empty checkbox when not verified, and the badge when the user is verified. Clicking the checkbox enables the user to get verified or remove the verification.

<img class='traity-widget' src="https://developers.traity.com/badges/USER_ID/connect?s=SIGNATURE" onclick="Traity.click(event)" style="cursor: pointer;"/>

USER_ID is your app's internal user id, and SIGNATURE is the generated signature for the widget.