@sanity/routes
    Preparing search index...

    Interface ResolverOptions

    Options for createRouteResolver.

    // Minimal — auto-detect channel
    createRouteResolver(client)

    // With environment matching
    createRouteResolver(client, 'web', {
    environment: 'production',
    })

    // Development mode with console warnings
    createRouteResolver(client, 'web', {
    warn: process.env.NODE_ENV !== 'production',
    })
    interface ResolverOptions {
        baseUrl?: string;
        cacheTtl?: number;
        channel?: string;
        environment?: string;
        locale?: string;
        onResolutionError?: (error: DiagnosisResult) => void;
        warn?: boolean;
    }
    Index

    Properties

    baseUrl?: string

    Explicit base URL — highest priority, overrides all baseUrl entries in config.

    cacheTtl?: number

    Cache TTL in milliseconds (default: 30000). Controls how long the route config is cached before re-fetching.

    channel?: string

    The channel name to resolve routes for (e.g. "web"). Optional — if omitted, uses the default config.

    environment?: string

    Environment name to match against baseUrls[].name (e.g., 'production', 'staging').

    locale?: string

    Default locale for all resolutions. Can be overridden per-call via options.locale.

    onResolutionError?: (error: DiagnosisResult) => void

    Callback invoked when RouteResolver.resolveUrlById returns null. Receives a DiagnosisResult with the failure details. Use for error tracking (e.g., Sentry). Only called when resolution fails — not on successful resolution.

    warn?: boolean

    Log a diagnostic message to console when RouteResolver.resolveUrlById returns null. Set to process.env.NODE_ENV !== 'production' for development-only warnings.