> For the complete documentation index, see [llms.txt](https://docs.squidrouter.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.squidrouter.com/old-v2-documentation-deprecated/quick-start.md). Agents can also search and read this documentation through its [MCP server](https://docs.squidrouter.com/~gitbook/mcp).

# Quick Start

The Quick Start section is intended to give you a preview of the implementations of Squid's SDK, API, and Widget.

Remember you must have an [**integrator-id**](https://squidrouter.typeform.com/partnerships) **to be able to implement one of these applications.** (Squid issues Integrator IDs on a limited basis and upon review via a partnership request.)

{% tabs %}
{% tab title="SDK" %}
Example of a cross-chain swap from Avalanche-AVAX to Polygon-MATIC.

First, install the Squid SDK and Squid types:

<pre class="language-typescript"><code class="lang-typescript"><strong>npm i @0xsquid/sdk@2.8.0-beta.0 @0xsquid/squid-types # 2.8.0-beta.0 
</strong></code></pre>

```typescript
import { Squid } from "@0xsquid/sdk"
import { ethers } from "ethers"
const userAddress = "<your address>"
const integratorId = "<your integrator id>"
const squid = new Squid({
  baseUrl: "https://v2.api.squidrouter.com",
  integratorId: integratorId
})
// initialize the Squid client
await squid.init()
const { route } = await squid.getRoute({
  fromChain: "43114", // Avalanche
  fromAmount: "10000000000000000", // 0.1 AVAX
  fromToken: "0xEEeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
  toChain: "137", // Polygon
  toToken: "0xEEeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
  fromAddress: userAddress,
  toAddress: userAddress,
})
const privateKey = "<your private key>"
const rpcUrl = "https://avalanche.drpc.org" // fromChain RPC URL
const provider = new ethers.JsonRpcProvider(rpcUrl)
const signer = new ethers.Wallet(privateKey, provider)
const result = await squid.executeRoute({
  route,
signer })
console.log(result)

```

{% endtab %}

{% tab title="API" %}
Example for getting a route from Avalanche-AVAX to Polygon-MATIC:

```typescript
const integratorId = "<your-integrator-id>"
const userAddress = "<your-address>"
const result = await fetch("https://v2.api.squidrouter.com/v2/route",
  method: "POST",
  body: JSON.stringify({
    fromChain: 43114, // Avalanche
    toChain: 137, // Polygon
    fromToken: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
    toToken: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
    fromAmount: "100000000000000000", // 0.1 AVAX
    fromAddress: userAddress,
    toAddress: userAddress,
  }),
  headers: {
    "x-integrator-id": integratorId,
    "Content-Type": "application/json"
  }
})
const route = await result.json()
console.log(route)
```

{% endtab %}

{% tab title="Widget" %}
Install the Squid Widget React component:

```
npm i @0xsquid/widget
```

And import it in your app:

```typescript
import { SquidWidget } from "@0xsquid/widget"
export default function App() {
  const config = {
    companyName: "Squid Widget",
    integratorId: "<your integrator id>",
    slippage: 1,
    instantExec: true,
    infiniteApproval: false,
    apiUrl: "https://api.squidrouter.com",
  } as AppConfig;
  return <SquidWidget config={config} />
}
```

{% endtab %}
{% endtabs %}


---

# 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.squidrouter.com/old-v2-documentation-deprecated/quick-start.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.
