Embedding

You are here:
Estimated reading time: 2 min

In Slemma, there are two types of sharing: Public Sharing and Private Sharing.

  • In general, Public Sharing does not cost beyond your plan, however, it allows your dashboards to be discoverable by search.
  • Private Sharing is done between users in Slemma.

Private Embedding (as a part of Private Sharing) is one way to share dashboards by embedding them in your website or portal. This powerful feature enables you to provide analytics to your customers, increasing the overall value of your product offerings with minimal development effort.

NOTE: Private Embedding is available starting from Standard plan.

NOTE: You have to be a Team Owner or an Admin to use this feature.

Get the Embed Code

NOTE: For safety purposes, please don’t send the embed code with your SIG to anyone!

Embedding allows you to insert a dashboard or saved chart into your webpage or portal. Because we are talking about Private Sharing, each viewer must have the object shared with them inside Slemma. The entire embed process can be split into three parts as explained below.

Getting Embed Code

From the main navigation page (https://slemma.com), find the object you wish to embed and right click it. From the drop-down menu, click Share & export and select the Get embed code option. Slemma will provide you with both script and iframe.

NOTE: If you use White Label option, script embed will work only for pages with White label domain.

The generated embed code includes a security access parameter SIG for the user that is currently logged to Slemma. SIG is HMAC value (using Sha1) using the access_token as the value and the client_secret as the secret. This parameter is used to authorize the user to see the embedded dashboard.

What does that mean? It means that if you share your SIG with anyone, that person will be able to log into your Slemma account. You need to use our API to replace your own SIG with the SIG of the viewer!

Authentication

As stated previously, the Embed Code generated contains the SIG of the current user. This is not very securely way to share dashboards. You must use the Slemma API to replace the SIG with that of the current user.

To generate SIG parameter for each user, get temporary access token using our REST API.  If the user does not exist in Slemma yet, you can create them using our REST API beforehand and then authorize them.

To complete the SIG parameter for each user, you will also need the Team Secret. You can get it by going to your API Settings (Admin page> API section).

Sharing

The object you are embedding must be shared with the user in order for them to access it. If it is not, you will identify the user and Slemma will still not grant them access. Sharing can be done in a number of ways.

You can share manually via the interface to individuals, groups, and teams. You can also share a dashboard to a user via the API. This is useful if the user was recently created.

Slemma has the ability to automatically filter data in your charts by who is seeing them. Please, head over to this article for more info.

Embedding an Entire Slemma Application

You can embed the entire Slemma application into your environment. To do so, follow the steps below:

  1. Navigate to the Admin page > Embed section.
  2. Select what parts of Slemma are available when embedding in your environment. Provide custom names if needed. Click the Save embed settings button.
  3. Find the embed code at the bottom of the window. The generated code includes access token for the currently logged in user. You have to authenticate each of your end users. To successfully authorize users, generate and replace the access token (SIG parameter) using our REST API.
  4. Paste the configured code into your HTML before inserting it into your application.

NOTE: The user MUST be added into your Slemma team. If the user does not exist in Slemma, you can create them using our REST API.

Was this article helpful?
Dislike 1
Views: 1831