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

# TypeScript SDK

> @anafi-cc/sdk — the client for browsers and Node. It builds every transaction that the owner signs.

`@anafi-cc/sdk` is the TypeScript client of Anafi. It is open source under the MIT licence, and it runs in the browser and in Node.

```sh theme={null}
npm install @anafi-cc/sdk
```

The SDK builds every transaction and every message that the owner signs, and it checks every answer that comes back. Your app never sends a raw transaction that the SDK did not build.

## The client

`createAnafiClient(config)` returns a client for one network.

| Method | Wallet prompts | Does |
| - | - | - |
| `predictSafe(owner)` | 0 | The address of the owner's 1-of-1 Safe |
| `readAccountAdapter(account)` | 0 | Which kind of account this is, or `null` |
| `stageDsl(…)` | 0 | Checks a rule for a Safe and returns its warnings |
| `commitStagedDsl(…)` | 1 | Commits a staged rule from the Safe |
| `stageErc20AllowDsl(…)` | 0 | Checks a rule for an ERC-20 account |
| `commitStagedErc20AllowDsl(…)` | 1 per token + 1 | Approves the tokens and commits |
| `disableSafeModule(…)` | 1 | Revokes a Safe's permission |
| `revokeErc20Allowances(…)` | 1 per token | Revokes an ERC-20 account's permission |
| `recover(…)` | 1 sign-in | Reads the active rule back, decrypted |
| `getActivity(account)` | 0 | The payments that the account's rules made |
| `fetchFeeTerms()` | 0 | The live fee terms of the network |

## Rule builders

| Builder | Rule |
| - | - |
| `buildRoutingDsl` | Forward incoming funds to one or more places |
| `buildStandingOrderDsl` | A fixed payment on a schedule |
| `buildReimburseDsl` | Pay back a share of each outgoing payment |
| `buildBuilderDsl` | Any one trigger with any actions |

## Errors

Every failed HTTP call throws `BackendRequestError` with the route, the status and the body. A refused rule throws `DslStageRefusedError` with the reason.

## Versioning

The API is `0.x`. A minor release can change it. See the changelog on GitHub.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.