Asset Viewer
An Asset Viewer extension makes it possible for users to augment assets with extra information or functionality.
Declare in Manifest
The first thing to do when adding an extension is to define it in the manifest.json
file:
"assetViewerExtensions": [
{
"extensionKey": "augment-asset",
"name": "My Asset Viewer Extension",
"description": "An app that augments assets with additional information.",
"icon": "asset-viewer-icon.png",
"resources": {
"folder": "asset-viewer-extension"
}
}
]
In this example, the following properties are defined:
Property | Description |
---|---|
extensionKey | Unique identifier for the extension. |
name | Descriptive name of the extension. |
description | Brief overview of the extension's functionality. |
icon | Icon representing the extension. For optimal rendering in the Asset Viewer sidebar, we recommend your icon be 48x48 pixels. |
resources | Location of resources associated with the extension. |
Required Files
The source code of your Asset Viewer extension lives in the resources folder that you defined in the manifest. This folder contains all of the files (JS, CS, images, etc.) of your extension. In particular, one main file:
index.html
- This is the entry point of your Asset viewer extension.
Query Parameters
The following query parameters will be appended to the URL of the extension:
assetId
assetSlug
assetName
You can access them in your code like this:
new URLSearchParams(window.location.search).get('assetId');