Initialize project and setup provider
Let's start by installing the SDK package and initializing the provider.
1. Create a react / next repo and install the SDK
npm i @enclavemoney/enclave-wallet-sdk2. Initialise Provider
"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 />;
}Last updated