# @moonup/moon-rainbowkit

## @moonup/moon-rainbowkit Package Documentatio&#x6E;**:**

The `@moonup/moon-rainbowkit` package is a React component that provides authentication functionality using the Moon SDK and RainbowKit. This package allows users to sign in with Ethereum to the app using SIWE (Sign-In with Ethereum) and manages the authentication state.

<br>

## **Installing Moon Rainbowkit:**

To utilize the Moon rainbowkit package, first install it to the desired directory of the project:

#### To install Moon rainbowkit

{% tabs %}
{% tab title="npm" %}

```bash
npm install @moonup/moon-rainbowkit
```

{% endtab %}

{% tab title="yarn" %}

```bash
yarn add @moonup/moon-rainbowkit
```

{% endtab %}

{% tab title="pnpm" %}

```bash
pnpm add @moonup/moon-rainbowkit
```

{% endtab %}
{% endtabs %}

### Usage

Import the `RainbowMoonProvider` component from the package and wrap your application with it.

```tsx
import {RainbowKitUseMoonProvider} from '@moonup/moon-rainbowkit';
import {
  RainbowKitProvider,
} from '@rainbow-me/rainbowkit';
import { AppProps } from 'next/app';
import { WagmiConfig } from 'wagmi';

export default function App({ Component, pageProps }: AppProps) {
  // You'll need to resolve AUTHENTICATION_STATUS here
  // using your application's authentication system.
  // It needs to be either 'loading' (during initial load),
  // 'unauthenticated' or 'authenticated'.

  return (
    <WagmiConfig {...etc}>
      <RainbowKitUseMoonProvider
       onSignIn={onSignIn} onSignOut={onSignOut}
      >
        <RainbowKitProvider {...etc}>
          <Component {...pageProps} />
        </RainbowKitProvider>
      </RainbowKitAuthenticationProvider>
    </WagmiConfig>
  );
}
```

## Example Project

<https://github.com/moon-up/moon-sdk/tree/main/examples/moon-sdk-rainbowkit-next-example>


---

# 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.usemoon.ai/additional-moon-packages-7ca327c0bb2846d88b8ba5bc6caeaead/moon-rainbowkit.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.
