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

# Use the TypeScript SDK

Install Nullark, run one complete integration, then use the API reference for exact inputs and outputs.

Want Nullark inside your TypeScript app? Start here. SDK prepares recovery data, proofs, private-balance results, and unsigned deposit and withdrawal requests. Your app supplies proving files, chain reads, recovery storage, and wallet submission.

## Install

```bash
npm pkg set overrides.underscore=1.13.8
npm install @nullark/sdk@0.2.0 snarkjs@0.7.6 viem@2.56.0
```

These exact versions match tested starter. `@nullark/sdk` uses ESM and ships TypeScript declarations.

## Tested starter

Starter follows one order:

1. Create client with checked proving files and chain adapters.
2. Create recovery key and prepare deposit.
3. Save recovery key with encrypted envelope.
4. Restore saved data before opening wallet.
5. Submit unsigned deposit request through wallet layer.
6. Read private balance after deposit appears onchain.
7. Prepare bounded withdrawal.
8. Reconcile original submission when receipt or wallet result stays uncertain.

Save-and-restore step comes before wallet submission. User leaves deposit flow with backup already tested by same client that created it.

[Build a complete SDK integration](/developers/sdk/quickstart.md) gives full path and starter code. [API reference](/developers/sdk/api.md) gives exact public methods, inputs, outputs, adapters, and setup helpers used by that path.

## Pick your next page

### [Build complete flow](/developers/sdk/quickstart.md)

Run setup, deposit, backup, restore, balance, withdrawal, and reconciliation in order.

### [Set up client](/developers/sdk/setup.md)

Check proving files and connect required chain reads.

### [Prepare deposit](/developers/sdk/deposit.md)

Create recovery data, proof, and unsigned deposit request.

### [Save and restore](/developers/sdk/recovery.md)

Test backup roundtrip and read private balance.

### [Prepare withdrawal](/developers/sdk/withdrawal.md)

Choose available note, set fee bounds, and build unsigned request.

### [Handle uncertain status](/developers/sdk/errors.md)

Check original operation before any new submission.

### [Read API reference](/developers/sdk/api.md)

Find method signatures, result fields, adapter shapes, and common stops.

## Who handles what

| SDK | Your app |
| --- | --- |
| Checks runtime passed to client | Keeps every adapter on same chain and pool |
| Builds recovery data and validates restore | Stores recovery key and envelope together |
| Calls configured local provers and checks returned proof data | Loads checked proving files and runs prover |
| Returns unsigned transaction requests | Reviews, simulates, signs, and submits requests |
| Recovers matching deposits and checks note status | Supplies deposit, membership, spent-state, and fee reads |
| Reads fee and note status again after withdrawal proof | Keeps transaction hash and reconciles final result |

Keep recovery keys, private bundles, and proof witness data inside trusted client.
