# Initialize project and setup provider

## 1. Create a react / next repo and install the SDK

Install the npm package in your React or Next JS / TS project.

```
npm i @enclavemoney/enclave-wallet-sdk
```

## 2. Initialise Provider

Import the provider from the installed package. Initialize the API key obtained from the dev portal. Make sure to place the API key in your environment variables. You can select the theme of the embedded wallet based on the theme of your application.&#x20;

```tsx
"use client";

import { WalletProvider } from "@enclavemoney/enclave-wallet-sdk/dist/components/WalletProvider";
import { useTheme } from "@/app/contexts/ThemeContext";
import { NoSSR } from "@/app/components/ui/NoSSR";
import { Dashboard } from "@/app/components/Dashboard";

const sdkKey = process.env.NEXT_PUBLIC_ENCLAVE_SDK_KEY || "";

function WalletWrapper() {
  const { isDarkMode } = useTheme();

  return (
    <WalletProvider sdkKey={sdkKey} theme={isDarkMode ? "dark" : "light"}>
      <NoSSR>
        <Dashboard />
      </NoSSR>
    </WalletProvider>
  );
}

export default function Home() {
  return <WalletWrapper />;
}
```


---

# 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.enclave.money/integrate-with-enclave-money/embedded-wallet/initialize-project-and-setup-provider.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.
