---
schema_version: "1"
id: 0996f9406b8b05a5e0d3a8941b45d7b0ec980db51e3c86a7a56cfee80426d8b6
title: LwrRouterConfig
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/lwr-node/lwr/references/csr-reference/lwrrouterconfig.md
canonical_url: https://developer.salesforce.com/docs/platform/lwr/references/csr-reference/lwrrouterconfig.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: d270c7c44f4069b947b90278207f4f504602d1985c161ab816661644de20ecf8
products:
  - Lightning Web Runtime
---
# LwrRouterConfig

**important:** To configure a router module with the [Router Module Provider](https://developer.salesforce.com/docs/platform/lwr/guide/lwr-create-router.html#router-module-provider), you have to set up both `LwrRouterConfig` and `LwrConfigRouteDefinition`.

## Syntax

```
interface LwrRouterConfig {
    basePath?: string;
    caseSensitive?: boolean;
    routes: LwrConfigRouteDefinition[];
    i18n?: I18NRouterConfig;
}
```

## Properties

The `LwrRouterConfig` object, which is passed to the Router Module Provider, contains the same properties as [`RouterConfig`](https://developer.salesforce.com/docs/platform/lwr/references/csr-reference/routerconfig.md), which is passed to [`createRouter()`](https://developer.salesforce.com/docs/platform/lwr/references/csr-reference/createrouter.md).

| Property        | Type    | Required/Optional | Description                                                                                                                                                                                                          |
| --------------- | ------- | ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `basePath`      | String  | Optional          | A path prefix applied to all URIs for the router. If no base path is provided, the default value is empty (" ").                                                                                                     |
| `caseSensitive` | Boolean | Optional          | If `true`, URIs are processed case sensitively. The default value is `false`.                                                                                                                                        |
| `routes`        | Array   | Required          | An array of `LwrConfigRouteDefinition` objects.                                                                                                                                                                      |
| `i18n`          | Array   | Optional          | An [`i18n`](https://developer.salesforce.com/docs/platform/lwc/guide/create-i18n.html) config that may affect the path prefix applied to all URIs. The default value is `{locale: 'en-US', defaultLocale: 'en-US'}`. |

## Example

```
{
    "caseSensitive": "true";        // URIs will be processed case sensitively
    "i18n": {                       // Sets custom locale
        "locale": "es",
        "defaultLocale": "es-MX"
    };
    "routes": [                     // Defines routes for two pages: home and namedPage
        {
            "id": "home",
            "uri": "/",
            "component": "examples/home",
            "page": {
                "type": "home"
            },
            "metadata": {
                "title": "Home"
            }
        },
        {
            "id": "namedPage",
            "uri": "/:pageName",
            "handler": "examples/namedPageHandler",
            "page": {
                "type": "namedPage",
                "attributes": {
                    "pageName": ":pageName"
                }
            }
        }
    ]
}
```

**See Also**

- [Routers and Route Matching: Router Configuration](https://developer.salesforce.com/docs/platform/lwr/guides/lwr-routers-route-matching.md#router-configuration)
- [Create a Router: Configure the Router JSON](https://developer.salesforce.com/docs/platform/lwr/guides/lwr-create-router.md#4-configure-the-router-json)
