You can use the request_headers parameter to pass custom HTTP headers (such as Authorization Bearer tokens or API keys) with all tile requests. This is essential for accessing private tile servers, OAuth-protected services, or including custom headers for logging.
Note that headers are applied to all tile requests, including style sources, sprites, and glyphs. Changing request_headers dynamically will apply to new requests but will not re-fetch tiles that have already been loaded.
import anymap
# Create a map with authorization headers
m = anymap.Map(
center=[-74.0060, 40.7128],
zoom=12,
request_headers={"Authorization": "Bearer YOUR_TOKEN_HERE"},
)