The new TemplatedMetadataUpdater allows to deploy this solution without touching a single line of code in most of the cases (even when shuffling the tokens).
Usage
The new METADATA_TEMPLATE env variable can be set to null (metadata is kept as is) or a JSON object that is used in order to update the metadata for each token.
Some placeholder keys are also provided for dynamic replacement:
{TOKEN_ID}
{INT_TOKEN_ID}: a value matching this string exactly will be replaced with the token ID as an integer value
{ASSET_URI}: please remember that the "image" key is already replaced by default!
TemplatedMetadataUpdater
Example:
In a collection where tokens have been shuffled (e.g. token number 1234 becomes 5678), you may have the need to update that ID in some properties such as name.
The new
TemplatedMetadataUpdater
allows to deploy this solution without touching a single line of code in most of the cases (even when shuffling the tokens).Usage
The new
METADATA_TEMPLATE
env variable can be set tonull
(metadata is kept as is) or a JSON object that is used in order to update the metadata for each token.Some placeholder keys are also provided for dynamic replacement:
{TOKEN_ID}
{INT_TOKEN_ID}
: a value matching this string exactly will be replaced with the token ID as an integer value{ASSET_URI}
: please remember that the "image" key is already replaced by default! TemplatedMetadataUpdaterExample:
In a collection where tokens have been shuffled (e.g. token number
1234
becomes5678
), you may have the need to update that ID in some properties such asname
.Original metadata:
Metadata template:
App output: