# SharinPix Token Viewer

{% hint style="info" %}
The **SharinPix Token Viewer** component permits the user to open any component using a token.
{% endhint %}

{% hint style="warning" %}
**Note:**

The SharinPix Token Viewer component works **only** with the [SharinPix Online Tokens](/documentation/best-practices/working-with-sharinpix-tokens.md#sharinpix-online-token).

For more information on the type of SharinPix Tokens, refer to the following article: [Working with SharinPix Tokens](/documentation/best-practices/working-with-sharinpix-tokens.md)
{% endhint %}

{% hint style="info" %}
**Information:**

This feature is only available on Lightning. It can be used:

* On Page Builder
* On Desktop
* On Mobile
* On Community Builder
  {% endhint %}

## Getting Started

To use the SharinPix Token Viewer component, you simply need to drag and drop the component from the Lightning App Builder onto your page layout.

<figure><img src="/files/jJEwAwFAJgYCO7Lr9C8u" alt=""><figcaption></figcaption></figure>

## Lightning Component Parameters

<figure><img src="/files/v4lmpqz85H6Z2DmUxFjG" alt=""><figcaption></figcaption></figure>

* **Token Field API Name:** The API name of the field containing the SharinPix token.
* **SharinPix Secured Token Name:** The name of the 'SharinPix Secured Token' Custom Metadata configured for the token viewer component. More information on how to configure the SharinPix Secured Token below.
* **Height:** Used to specify the component's height. The default height is **500** (px).

{% hint style="warning" %}
**Note:**

If the **SharinPix Secured Token Name** is set, the **Token Field API Name** is ignored.
{% endhint %}

### SharinPix Secured Token Setting

The SharinPix Secured Token will be used to create a token that expires. The expired token will be used on the token viewer component. Using the SharinPix Secured Token, the Token Viewer component will not use the token stored in the Salesforce field directly; instead, it will generate a new token that expires. This adds a layer of security as the token stored on Salesforce, which may be non-expiring, is not exposed in the user's browser.

Steps to configure the SharinPix Secured Token:

1. Go to Salesforce Setup
2. Open Custom Metadata Types
3. Click on Manage Records for **SharinPix Secured Token** Custom metadata type
4. Insert a label and name
5. For the **Object name** parameter, insert the object API name on which the SharinPix Token Viewer component has been added.
6. For the **Field name** parameter, insert the field API name of the field containing the token to be expired.
7. In the **Expiration** parameter, enter the number of minutes the token will live. The maximum allowed is 100.
8. Check the **Active** checkbox to activate the setting.

![](/files/tSWXYqW8Z8aWhZC6Ky50)

## Demo

A token of the SharinPix Album has been generated and inserted in the field 'token' as shown below:

{% hint style="success" %}
**Tip:**

Learn how to [generate tokens](/documentation/cookbook/generate-token-from-sharinpix-permission-with-apex.md) automatically.
{% endhint %}

![](/files/vJUdIFo0mV5OLNz1kTyw)

The picture below depicts a *SharinPix Album* in the *SharinPix Token Viewer* component:

![](/files/Gh36etQtBWh7J6Q5fDxh)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sharinpix.com/documentation/lightning-web-component/sharinpix-token-viewer.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
