@moneydevkit/nextjs is the moneydevkit checkout SDK for App Router-based Next.js apps. It bundles the client hook, hosted checkout UI, API route handler, and config helpers required to launch Lightning-powered payments within minutes.Prerequisites
- Next.js 15+ with the App Router enabled
- Node.js 18 or higher
- Access to your project’s
.envor.env.localfiles
Install the package
Provision credentials with the CLI
Run the onboarding CLI from any project root to mint API keys, webhook secrets, and seed mnemonics. The CLI writes directly to.env.local so the checkout package can consume the values immediately.
Add credentials to your deployment environment
Bring your credentials into your environment variables wherever you’re deploying.(Optional) Configure environment variables manually
Generate credentials from your dashboard at moneydevkit.com and add them to your.env file:
@moneydevkit/create you will need to generate MDK_MNEMONIC yourself.
Your mnemonic is the key to your wallet. Do not lose it!
create-moneydevkit will automatically backup your mnemonic locally at ~/.mdk. Otherwise you will need to make sure you backup (ideally, write down) your mnemonic and keep it safe.Testing Locally
Right now,@moneydevkit/nextjs relies on webhooks to your website to receive payments, as such you will not be able to test locally unless you use something like ngrok. We will be adding an easy to use sandbox mode for testnet soon. Reach out to us on Discord if you’d like to test using mutinynet.
Implementation steps
1
Trigger a checkout from a client component
2
Render the hosted checkout page
3
Expose the unified moneydevkit endpoint
4
Enable the Next.js plugin