---
title: "RoutingOptions | Client js | Api client"
description: "Documentation for MapTiler Client"
---

> For AI agents: a documentation index is available at [/llms.txt](https://docs.maptiler.com/llms.txt). Markdown versions of all pages are available by appending .md to any URL.

# Interface RoutingOptions

Options applying to the routing request itself, rather than to the route.

interface RoutingOptions {  
    [adjustSearchParams](#adjustsearchparams)?: (searchParams: URLSearchParams) \=> void;  
    [apiKey](#apikey)?: string;  
    [fetchExtras](#fetchextras)?: RequestInit;  
}

-   Defined in [services/routing.ts:265](https://github.com/maptiler/maptiler-client-js/blob/840c3494cc9fa876b145ae8e89c35241f91cbc6f/src/services/routing.ts#L265)

##### Index

### Properties

[adjustSearchParams?](#adjustsearchparams) [apiKey?](#apikey) [fetchExtras?](#fetchextras)

## Properties

### `Optional`adjustSearchParams[](#adjustsearchparams)

adjustSearchParams?: (searchParams: URLSearchParams) \=> void

Callback function to adjust the target URL search params before fetching.

#### Type Declaration

-   -   (searchParams: URLSearchParams): void
    -   #### Parameters
        
        -   searchParams: URLSearchParams
            
            [URLSearchParams](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams) object that can be modified in place.
            
        
        #### Returns void
        

-   Defined in [services/routing.ts:275](https://github.com/maptiler/maptiler-client-js/blob/840c3494cc9fa876b145ae8e89c35241f91cbc6f/src/services/routing.ts#L275)

### `Optional`apiKey[](#apikey)

apiKey?: string

Custom MapTiler Cloud API key to use instead of the one in global `config`.

-   Defined in [services/routing.ts:269](https://github.com/maptiler/maptiler-client-js/blob/840c3494cc9fa876b145ae8e89c35241f91cbc6f/src/services/routing.ts#L269)

### `Optional`fetchExtras[](#fetchextras)

fetchExtras?: RequestInit

Extra options to pass to the underlying [fetch](https://developer.mozilla.org/en-US/docs/Web/API/RequestInit) call.

-   Defined in [services/routing.ts:278](https://github.com/maptiler/maptiler-client-js/blob/840c3494cc9fa876b145ae8e89c35241f91cbc6f/src/services/routing.ts#L278)
