MoonPay Wallets SDK Step-by-Step Guide
git clone https://github.com/moonpay/login-sdk-demo.git
cd login-sdk-demo
npm install
Next you need to import the SDK in your project. Add the following line to your code, and replace them with the API_KEY we provided.
const sdk = new MoonpayWalletSDK({
loginDomain: "https://buy-sandbox.moonpay.com",
secureWalletDomain: "https://web3.moonpay.com",
apiKey: "pk_test_123",
});
Now all you need to do is init()
the SDK and you're ready to go!
// In this example we use React hooks
// so we can use the provider in our app
// when the component is mounted
useEffect(() => {
sdk.init().then(() => {
setProvider(sdk.provider!);
});
}, []);
Run the following command to start the demo:
npm start