> For the complete documentation index, see [llms.txt](https://docs.northstar.sonicsvm.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.northstar.sonicsvm.org/getting-started/install.md).

# Install the SDK

```bash
bun add @sonicsvm/northstar-sdk @solana/web3.js
# or
npm install @sonicsvm/northstar-sdk @solana/web3.js
```

The SDK is a thin TypeScript wrapper around the Portal program plus a few helpers for session lifecycle, account delegation, and ER endpoint routing. It pairs with `@solana/web3.js` for the underlying transaction primitives.

## Requirements

* **Node 20+ or Bun 1.2+** — the SDK ships ESM only.
* **A funded keypair on devnet** — sessions are anchored on L1, so the owner needs SOL for the OpenSession + Delegate transactions. Get devnet SOL via `solana airdrop` or a faucet.
* **A local checkout of `@solana/web3.js`'s peer dep** — the SDK lists it as a peer, not a direct dep, to let your project pin its own version.

## Verify the install

Quickest sanity check — open a session against devnet:

```typescript
import { NorthStarSDK } from "@sonicsvm/northstar-sdk";
import { Connection, Keypair } from "@solana/web3.js";

const sdk = new NorthStarSDK({
  portalProgramId: "74iiMCqFw1afWyp3tdh9pUqfRfCRq7gfdC2YZoNGpovt",
  customEndpoints: {
    solana: new Connection("https://api.devnet.sonic.game"),
    ephemeralRollup: new Connection("https://ephemeral.devnet.sonic.game"),
  },
});

const owner = Keypair.generate();
console.log(`Owner: ${owner.publicKey.toBase58()}`);
```

If that imports without error, you're ready for [Hello World](https://github.com/mirrorworld-universe/northstar-docs/blob/main/getting-started/hello-world/README.md).

## Next steps

* [Hello World](https://github.com/mirrorworld-universe/northstar-docs/blob/main/getting-started/hello-world/README.md) — open a session, run a transaction inside it, settle back.
* [Recipes](https://github.com/mirrorworld-universe/northstar-docs/blob/main/getting-started/recipes/README.md) — common patterns for agents, oracles, orderbooks.
* [Concepts](https://github.com/mirrorworld-universe/northstar-docs/blob/main/concepts/sessions/README.md) — what's actually happening under the hood.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.northstar.sonicsvm.org/getting-started/install.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
