> For the complete documentation index, see [llms.txt](https://docs.squidrouter.exchange/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.squidrouter.exchange/widget-integration/add-a-widget/deposit-widget/nextjs-installation.md).

# Next.js Installation

This guide will help you integrate the Squid Deposit Widget into your Next.js application.

### Prerequisites

Ensure you have completed the steps in the [Installing the Widget](/widget-integration/add-a-widget/deposit-widget/installing-the-widget.md) guide before proceeding.

### Installation Steps

#### Step 1: Install the package

```bash
yarn add @0xsquid/deposit-widget
```

#### Step 2: Render the widget

The widget uses browser-only APIs (wallets, `window`), so it must render on the client. The simplest way is to mark the page or component as a Client Component:

```tsx
"use client";

import { DepositWidget, type DepositConfig } from "@0xsquid/deposit-widget";

const config: DepositConfig = {
  mode: "deposit",
  destinationAddress: "0xYourReceivingAddress",
  destinationToken: {
    address: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", // USDC on Arbitrum
    chainId: "42161",
  },
  integrator: {
    id: "<your-integrator-id>",
    name: "Your App",
    logoUrl: "https://your.app/logo.png",
  },
};

export default function Page() {
  return <DepositWidget config={config} />;
}
```

If you need to keep the parent as a Server Component, wrap the widget in a client-only child or load it dynamically with `next/dynamic` and `ssr: false`.

Replace `<your-integrator-id>` with the Integrator ID you received from Squid.

### Customization

Pass `theme` and `themeType` to brand the widget — see the [Configuration](/widget-integration/add-a-widget/deposit-widget/configuration.md) page for all available options.

### Running Your Next.js App

```bash
yarn dev
```


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.squidrouter.exchange/widget-integration/add-a-widget/deposit-widget/nextjs-installation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
