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

# Install the SDK

> Add @gol/sdk to a TypeScript project, choose an entry point, and pin a version.

`@gol/sdk` is GOL's published TypeScript integration surface. It wraps the public API with typed clients and gives you the exact owner, agent, and EIP-7702 setup signing payloads and account operations each supported account checks. It is the same package the GOL console uses, and it depends only on the public API and contract interfaces.

Two entry points keep secrets off the client. Import the one that matches where your code runs.

| Entry point | Import from       | Use it in                         | Contains                                                                                                                         |
| ----------- | ----------------- | --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| Root        | `@gol/sdk`        | Browser, mobile bundle, or server | Policy encoding, owner and agent wallet payloads, EIP-7702 setup, child mandates, owner account operations, verification helpers |
| Server      | `@gol/sdk/server` | Your server only                  | API clients that send your API key or developer session token, polling helpers, webhook verification                             |

The root entry point has no Node.js imports and no credentials, so it is safe in a web page. The server entry point holds your API key, so importing it into browser code would ship the key to every visitor.

## Add the package

Use Node.js 22 or later. `viem` is the SDK's only runtime dependency, and the versions below are pinned for the reason in the next section.

```sh theme={null}
pnpm add @gol/sdk@0.5.0 viem@2.37.13
```

```sh theme={null}
npm install @gol/sdk@0.5.0 viem@2.37.13
```

```sh theme={null}
yarn add @gol/sdk@0.5.0 viem@2.37.13
```

Pin `@gol/sdk` exactly. The package publishes under both the `latest` and `next` tags, and today both resolve to `0.5.0`, so an unpinned range is not a reproducible build.

### Match the pinned viem

`@gol/sdk@0.5.0` declares `viem` as `2.37.13` exactly, not a range. Install that version so your project and the SDK share a single copy.

```sh theme={null}
pnpm add @gol/sdk@0.5.0 viem@2.37.13
```

This matters for types, not for the bytes on the wire. If your project resolves a different viem, the package manager installs a second nested copy. Both copies declare the same chain client types in separate modules, and TypeScript will not treat them as interchangeable, so a call such as `assertAccountImplementation(publicClient, ...)` fails to compile even though both objects look identical. Pinning, or adding a resolution rule that forces one version, resolves it.

## Which version to read

|                         | Value                                                              | What it covers                                                                                                                                                                                                    |
| ----------------------- | ------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Published package       | [`@gol/sdk@0.5.0`](https://www.npmjs.com/package/@gol/sdk/v/0.5.0) | Everything on this tab                                                                                                                                                                                            |
| Hosted Base Sepolia use | `@gol/sdk@0.5.0`                                                   | Verified with the version 3 core for bounded USDC transfers from Safe 1.4.1, Biconomy Nexus 1.0.0, ZeroDev Kernel v0.3.1, Alchemy Modular Account v2, and an EOA delegated to Biconomy Nexus 1.3.3 under EIP-7702 |

`0.5.0` implements hosted gas public API revision 2.0 for the version 3 core. It is a breaking release for owner signing: payloads use the version 3 core domain, the gas policy names the approved submitter, and `buildWalletSigningPayload` takes the GOL payload instead of a struct hash. It adds the `nexus7702` family and EIP-7702 setup helpers, the agent's gas action signing with a charge ceiling, child mandates, developer relayer transactions, and their server routes. Approvals made with `0.4.0` or earlier bind the version 2 core and are not valid with the current version 3 setup. See [current availability](/availability) for the supported network, addresses, and limits.

## Where to go next

<CardGroup cols={2}>
  <Card title="Browser entry point" icon="window-maximize" href="/sdk/browser">
    What `@gol/sdk` exports and how to wire an owner wallet to it.
  </Card>

  <Card title="Server entry point" icon="server" href="/sdk/server">
    Typed clients, base URL rules, and how to keep credentials server-side.
  </Card>

  <Card title="Owner signing" icon="signature" href="/sdk/owner-signing">
    The two owner paths, the five account dialects, and verifying before signing.
  </Card>

  <Card title="SDK reference" icon="list" href="/sdk/reference">
    Every exported symbol, generated from the package's own type declarations.
  </Card>
</CardGroup>

This section explains the SDK. [Integrate hosted gas](/guides/hosted-gas) remains the single end-to-end walkthrough: one owner account from installation to revocation, with every step in order.
