> ## Documentation Index
> Fetch the complete documentation index at: https://s2.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Endpoint Overrides

> Configure S2 SDK endpoint overrides for custom account and basin URLs, including local s2-lite development.

By default, SDKs connect to the cloud instance at s2.dev, and only require an access token to get started, which can be generated from the [dashboard](https://s2.dev/dashboard).

SDKs can also connect to any S2-compatible endpoint, such as [s2-lite](https://github.com/s2-streamstore/s2) for local development:

<Tabs>
  <Tab title="TypeScript">
    ```typescript theme={null}
    const client = new S2({
    	accessToken: "local-token",
    	endpoints: {
    		account: "http://localhost:8080",
    		basin: "http://localhost:8080",
    	},
    });
    ```
  </Tab>

  <Tab title="Python">
    ```python theme={null}
    client = S2(
        "local-token",
        endpoints=Endpoints(
            account="http://localhost:8080",
            basin="http://localhost:8080",
        ),
    )
    ```
  </Tab>

  <Tab title="Go">
    ```go theme={null}
    client := s2.New("local-token", &s2.ClientOptions{
    	BaseURL: "http://localhost:8080",
    	MakeBasinBaseURL: func(basin string) string {
    		return "http://localhost:8080"
    	},
    })
    ```
  </Tab>

  <Tab title="Rust">
    ```rust theme={null}
    let client = S2::new(
        S2Config::new("local-token").with_endpoints(S2Endpoints::new(
            AccountEndpoint::new("http://localhost:8080")?,
            BasinEndpoint::new("http://localhost:8080")?,
        )?),
    )?;
    ```
  </Tab>
</Tabs>

## Environment Variables

SDKs can read some common configuration keys from environment variables:

| Variable              | Description                                                                        |
| --------------------- | ---------------------------------------------------------------------------------- |
| `S2_ACCOUNT_ENDPOINT` | Account-level API endpoint                                                         |
| `S2_BASIN_ENDPOINT`   | Basin-level API endpoint (may include `{basin}` placeholder for DNS-based routing) |
