Skip to content
This repository was archived by the owner on Oct 10, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@
{
"group": "@lit-protocol/auth@beta",
"pages": ["sdk/sdk-reference/auth/functions/createAuthManager"]
},
{
"group": "@lit-protocol/networks@beta",
"pages": [
"sdk/sdk-reference/networks/functions/withOverrides"
]
}
]
}
Expand Down
40 changes: 40 additions & 0 deletions sdk/sdk-reference/networks/functions/withOverrides.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
title: withOverrides
---

# Functions

> **withOverrides**(`overrides`)

Create a network module instance with runtime overrides (primarily for RPC URL). Use this to direct SDK operations to your own private RPC endpoint.

## Parameters

<ParamField path="param.overrides" type="{ rpcUrl?: string }" required>
Optional overrides. Provide `rpcUrl` to replace the chain RPC used by the module instance.
```ts
{ rpcUrl: "https://my-private-rpc.example.com" }
```
</ParamField>

## Returns

<ResponseField name="result" type="NagaNetworkModule">
A new module instance with overrides applied. Pass this into `createLitClient(
{network})`.
</ResponseField>

## Example

### Override RPC at runtime

```ts
import { createLitClient } from "@lit-protocol/lit-client";
import { nagaDev } from "@lit-protocol/networks";

const network = nagaDev.withOverrides({
rpcUrl: "https://my-private-rpc.example.com",
});

const litClient = await createLitClient({ network });
```