- Obtain a Secret API Key from the Sequence Builder Console
- Create Collection from a cURL request one time
- Create Token create a token using a tokenID
- Create Asset create an assetID
- Store an Image process and store an image
- Update to Non-private update an asset to be non-private
- Publish Collection from a cURL request one time
- Render Asset from API from a cURL request one time
1. Obtain a Secret API Key (JWT_ACCESS_KEY)
In order to use the backend service, aSecret API Key must be obtained to authenticate requests to your project
First start by accessing settings, and selecting the API Keys from the Sequence Builder Console

+ Add Admin API Secret Key

write and confirm by pressing + Add API Secret Key

copy the key and store it in your wrangler.toml as JWT_ACCESS_KEY, as you will not have access to this in the future from the Sequence Builder Console.
2. Create Collection from a cURL Request
As a one time requirement to uploading media to the service, a collection has to be first made. By using theSecret API Key and projectID retrieved from the Builder Console
We call the service to retrieve a collectionID
collectionID from the returned response in the wrangler.toml as COLLECTION_ID
3. Create Token using TokenID
If using a Clouflare worker, ensure to add
node_compat = true to your wrangler.toml to allow the window object to be available to the @0xsequence/metadata packageSequenceCollections with pnpm install @0xsequence/metadata
4. Create Asset using TokenID
In the request, set themetadadaField (assetType) to image, with the other necessary fields completed to return an asset response to be used in the next step
5. Store Image Asset
With the passed inasset.id from the previous jsonCreateAsset object
uploadAssetRes.url is the media file url living on Sequence servers
6. Update Non-private Token
Now, we make the token non-private by setting aprivate boolean to false
7. Publish Collection From A cURL Request
Finally, also as a one time request, we publish the collection based on theprojectID and collectionID by running the following command
false accessible publicly, while others remain hidden until changed
8. Render Asset from API Publicly
You can test your prior work, by calling this cURL request with the updated variables, which will download the file to your local terminal. Or, you can copy and paste into a browser and see the image Where if you used the same code, the<file_name> will be image.png
[cURL]
baseURI of an ERC721 or ERC1155 you would write to a smart contract setBaseMetadataURI the following URI
tokenID to the end
Give it a try
[cURL]
Render Asset from API Privately
If you decide to keep your assets private (in the token parameter, private: true), you can still view the token image if you provide the jwt_access_key in the header. For this guide, themetadata_field is set to image
[cURL]
Full code for this guide can be found here