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

# Browser & raw JavaScript

> Use the core SDK with an injected wallet or a caller-owned wallet client.

## Create a wallet-backed client

Call this from a connect action using your injected EIP-1193 provider:

```ts theme={null}
import { createPublicClient, createWalletClient, custom, http } from "viem";
import { baseSepolia } from "viem/chains";
import { CTokenClient } from "@inco/ctoken";

// readRpcUrl is your application's configured read endpoint (or HTTP proxy).
const publicClient = createPublicClient({
  chain: baseSepolia,
  transport: http(readRpcUrl),
});
// ethereum is your injected EIP-1193 provider.
const connection = createWalletClient({
  chain: baseSepolia,
  transport: custom(ethereum),
});
const [account] = await connection.requestAddresses();
if (!account) throw new Error("Connect a wallet first.");

const walletClient = createWalletClient({
  account,
  chain: baseSepolia,
  transport: custom(ethereum),
});
const ctoken = new CTokenClient({
  network: "baseSepolia",
  publicClient,
  walletClient,
});
```

Switch the wallet to the required chain before writing. Recreate the client on account/network changes; React handles this automatically.

## Read without a wallet

```ts theme={null}
const ctoken = new CTokenClient({ network: "baseSepolia", publicClient, indexer: true });
const token = "0x036CbD53842c5426634e7929541eC2318f3dCF7e";
const owner = "0x0000000000000000000000000000000000000001";

const wrapper = await ctoken.wrapperOf({ token });
const prices = await ctoken.prices([token]);
const assets = await ctoken.assets({ address: owner });
const history = await ctoken.history({ address: owner, page: 1, limit: 10 });
```

Indexer reads accept an explicit address. Balance methods use the connected owner; use viem `balanceOf(owner)` for another public address.
