# 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: 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.metaproprotocol.com/wallet-connector/basic-informations/next-13-integration.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.
