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

# createWithSigner

> Create an authenticated wallet viewer with a custom SparkSigner.

Creates a `SparkReadonlyClient` authenticated with a custom `SparkSigner`. Designed for partners (e.g., Privy) who provide their own signer implementation without exposing a mnemonic.

## Method Signature

```typescript theme={null}
static createWithSigner(
  config: ConfigOptions | undefined,
  signer: SparkSigner,
): SparkReadonlyClient
```

## Parameters

<ResponseField name="config" type="ConfigOptions | undefined" required>
  Configuration options including network selection. Pass `undefined` for defaults.
</ResponseField>

<ResponseField name="signer" type="SparkSigner" required>
  A pre-initialized `SparkSigner` implementation. The signer's identity key is used for authentication.
</ResponseField>

## Returns

<ResponseField name="client" type="SparkReadonlyClient" required>
  An authenticated wallet viewer using the provided signer for identity verification.
</ResponseField>

## Example

```typescript theme={null}
import { SparkReadonlyClient } from "@buildonspark/spark-sdk";

const client = SparkReadonlyClient.createWithSigner(
  { network: "MAINNET" },
  myCustomSigner,
);

const balance = await client.getAvailableBalance("sp1...");
```

<Info>
  See the [Spark Signer Interface](/wallets/spark-signer) docs for implementing a custom `SparkSigner`.
</Info>
