Using the Package
Logos
Finmarks tracks multiple logo variants per entity. Every URL returned by the API resolves — the index only lists variants that actually exist on disk at build time, so you never need to handle a 404.
Variants
getLogoUrl
Returns the CDN URL for a single variant, or undefined if the entity is unknown or that variant has not been sourced. Defaults to 'full'.
import { getLogoUrl } from '@finmarks/finmarks';
getLogoUrl('hdfc-bank'); // full logo (default)
getLogoUrl('hdfc-bank', 'icon'); // icon only
getLogoUrl('hdfc-bank', 'mono_dark'); // monochrome for dark bg
getLogoUrl('unknown-id'); // undefinedgetLogoUrlWithFallback
Tries each variant in order and returns the first that exists. Use this when you want a specific variant but need to gracefully degrade.
import { getLogoUrlWithFallback } from '@finmarks/finmarks';
// Prefer icon, fall back to the full logo
getLogoUrlWithFallback('phonepe', ['icon', 'full']);
// Default order: ['full', 'icon']
getLogoUrlWithFallback('phonepe');getLogos
Returns an object with every available URL for an entity, keyed by variant. Returns a fresh object — mutating it does not affect the dataset.
import { getLogos } from '@finmarks/finmarks';
const logos = getLogos('icici-bank');
// { full: '...', icon: '...', mono_dark: '...' }Hotlinking without npm
Logo URLs follow a predictable pattern. You can construct them manually if you do not want to use the npm package at all:
https://cdn.jsdelivr.net/gh/Finmarks/Finmarks@main/entities/{id}/{variant}.svgFor example:
<img
src="https://cdn.jsdelivr.net/gh/Finmarks/Finmarks@main/entities/phonepe/icon.svg"
alt="PhonePe"
width="32"
height="32"
/>Tip: Use
buildLogoUrl(id, filename)to compose a URL without a dataset lookup, for cases where you already know the filename.