Skip to main content

index/functions/getTokenThumbnailUrl.md

getTokenThumbnailUrl(tokenName, baseUrl, extension?): string

Get redirect URL for a token thumbnail

Smaller version of the token image optimized for list views and thumbnails. Typically a smaller file size than the full image.

Backend: Redirects to S3 if available, otherwise returns placeholder.

Parameters​

ParameterTypeDescription
tokenNamestringToken name (lowercase)
baseUrlstringAPI base URL
extension?stringFile extension (optional, default: 'jpg')

Returns​

string

Full redirect URL to token thumbnail

Throws​

Error if token name is invalid or extension format is incorrect

Example​

const thumbUrl = getTokenThumbnailUrl('anime', 'https://api.example.com', 'png');
// → "https://api.example.com/v1/tokens/anime/assets/thumbnail.png"

Since​

7.3.0