> For the complete documentation index, see [llms.txt](https://docs.metaproprotocol.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.metaproprotocol.com/wallet-connector/basic-informations/next-13-integration.md).

# Next 13 integration

You need to declare a **MetaproProvider**  which controls access and persistence to a **connector** instance, create a simple Provider component

{% hint style="info" %}
In this particular example in Next13, implement **"use client"** on top of the component.
{% endhint %}

#### 1. Create a Provider component

```typescript
"use client";

import React from "react";
import { MetaproProvider } from "@metapro/connector";

interface IProviderProps {
  children: React.ReactNode;
}

const Provider: React.FC<IProviderProps> = ({ children }) => {
  return <MetaproProvider>{children}</MetaproProvider>;
};

export default Provider;

```

#### 2. Insert provider in /app directory&#x20;

\---> layout.tsx

```typescript
import Provider from "@/components/Provider";

export default function RootLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  return (
    <html lang="en">
      <body>
        <Provider>{children}</Provider>
      </body>
    </html>
  );
}
```

### Use metapro plugin&#x20;

```typescript
"use client";

import React from "react";
import {
  MetaproConnector,
  MetaproConnectorChain,
  useMetapro,
} from "@metapro/connector";



/* Creating a new MetaproConnector object. */
const metaConfig = new MetaproConnector({
  chainId: MetaproConnectorChain.TESTNET,
});
/* you can choose which chainId metapro should connect to*/

const LoginPanel: React.FC = () => {
  const { login, logout} = useMetapro(metaConfig);
  const account = metaproHooks.useAccount();
  
  return (
    <>
      <button onClick={()=> login()}>Login</button>
      <button onClick={() => logout()}>logout</button>
    </>
  );
};

export default LoginPanel;
```

### [Click to get more information about useMetapro hook](/wallet-connector/basic-informations.md#metapro-hook-explained-usemetapro)

### After implementation you can follow [this steps](/wallet-connector/basic-informations.md#after-setup-our-plugin) to login with metapro wallet


---

# 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, and the optional `goal` query parameter:

```
GET https://docs.metaproprotocol.com/wallet-connector/basic-informations/next-13-integration.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
