TomTom Maps for JavaScript
    Preparing search index...

    Type Alias GlobalConfig

    Global configuration for the TomTom Maps SDK.

    Contains essential parameters like API keys, language settings, and display preferences that apply across all SDK services and map functionality.

    This configuration can be set globally using TomTomConfig and will be merged with service-specific configurations, with service configs taking precedence.

    const config: GlobalConfig = {
    apiKey: 'your-api-key',
    apiVersion: 1,
    commonBaseURL: 'https://api.tomtom.com',
    language: 'en-US',
    displayUnits: {
    distance: { type: 'metric' },
    time: { hours: 'hrs', minutes: 'mins' }
    }
    };
    type GlobalConfig = {
        apiKey: string;
        apiVersion: number;
        commonBaseURL: string;
        displayUnits?: DisplayUnits;
        language?: Language;
        trackingId?: string;
    }
    Index

    Properties

    apiKey: string

    TomTom API key for authentication.

    Required for all SDK features. Obtain an API key from the TomTom Developer Portal.

    None (required)
    
    apiVersion: number

    API version number for service endpoints.

    Each service may have its own default version. Consult the specific service documentation for available versions.

    1 (but each service can override)
    
    commonBaseURL: string

    Base URL for all TomTom API services.

    Individual services can override this with their own base URLs. Typically only changed for testing or enterprise deployments.

    "https://api.tomtom.com"
    
    displayUnits?: DisplayUnits

    Custom display units for time and distance.

    Applied to formatDistance and formatDuration utilities, which are used throughout the SDK for displaying map information. If not provided, default unit labels are used.

    language?: Language

    Language code for SDK services and map content.

    Accepts IETF language codes (case-insensitive). Affects search results, routing instructions, and map labels.

    "NGT" (Neutral Ground Truth - uses local language for each location)
    
    trackingId?: string

    Request identifier for tracing and support.

    Must match the pattern: ^[a-zA-Z0-9-]{1,100}$

    Recommended format is UUID (e.g., 9ac68072-c7a4-11e8-a8d5-f2801f1b9fd1). When specified, it's included in the Tracking-ID response header. This is solely for support purposes and does not involve user tracking.