sanity-plugin-aprimo
v0.4.2
Published
![aprimo gif](https://user-images.githubusercontent.com/3969996/136493868-9908e13d-e97e-4275-87e6-7a3ca3019d5b.gif)
Downloads
25
Readme
Aprimo asset selector for Sanity
This plugin allows you to open the Aprimo DAM asset selector from your studio and save those chosen assets and renditions in your Sanity documents.
NOTE: To take advantage of assets that aren't public renditions, you will need to authenticate requests from the studio. Because CORS isn't possible with Aprimo, you will need to set up a proxy to route authentication requests (this proxy endpoint can be configured from the studio). Your proxy endpoint should be able to route requests from the studio to https://your-tenant-name.aprimo.com/api/oauth/create-native-token. If you are using serverless functions or Next.js and would rather route all requests according to an X-URL
header, we've set up a quickstart example for that here.
Installation
- In your studio directory, run
sanity install aprimo
. - Declare a field to be
aprimo.asset
or anaprimo.cdnasset
(for public renditions) in your schema. For example:
{
type: "aprimo.asset",
name: "image",
description: "This asset is served from Aprimo",
}
- Navigate to that directory in your studio. There will be a plugin icon to the top left of that field, that will allow you to add the credentials for your Aprimo tenant. Enter in these details (they will be safely stored in your Sanity dataset as a private document. Remember to include these credentials across all your datasets!) If any of these fields are confusing, contact your Aprimo administrator.
Usage
After the above, you should be able to use the selector on any field declared as aprimo.asset
or aprimo.cdnasset
. By including the aprimo.asset
type in an array, you can use the multiple selector in Sanity as well.