# React integration

At the root of your application, you need to declare a **MetaproProvider**  which controls access and persistence to a **connector** instance:&#x20;

```typescript
import { MetaproProvider } from "@metapro/connector";

const App = () => {
  return (
    <MetaproProvider>
{/* App code goes here. */}
    </MetaproProvider>
  );
};

export default App;

```

### Basic implementation of our plugin

```typescript
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 Page: React.FC = () => {
  const { login, logout} = useMetapro(metaConfig);
  const account = metaproHooks.useAccount();
  
  return (
    <>
      <button onClick={()=> login()}>Login</button>
      <button onClick={() => logout()}>logout</button>
    </>
  );
};

export default Page;
```

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

### 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/react-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.
