Click the button below to install moneydevkit directly in Replit Agent:Replit Agent will:
Create an account for you
Implement moneydevkit for you
Already have a moneydevkit account? Use this button instead:Treat the rest of the docs as reference. If you’re having trouble, tell the agent to follow the docs at https://docs.moneydevkit.com/replit exactly.
Both environment variables are required—MDK_ACCESS_TOKEN authorizes API calls and MDK_MNEMONIC is your wallet seed. If either is missing, checkout creation will fail.
Allowlist moneydevkit packages in script/build.ts so Replit’s bundler can import them:
Trigger a checkout from your client code (the checkout component pulls in its own CSS; import @moneydevkit/replit/mdk-styles.css once globally only if you want to preload it):
// src/App.tsximport { useCheckout } from '@moneydevkit/replit'import { useState } from 'react'export default function App() { const { createCheckout, isLoading } = useCheckout() const [error, setError] = useState<string | null>(null) const handlePurchase = async () => { setError(null) const result = await createCheckout({ type: 'AMOUNT', // or 'PRODUCTS' for product-based checkouts title: 'Purchase title for the buyer', description: 'Description of the purchase', amount: 500, currency: 'USD', successUrl: '/checkout/success', metadata: { name: 'John Doe' }, }) if (result.error) { setError(result.error.message) return } window.location.href = result.data.checkoutUrl } return ( <div> {error && <p style={{ color: 'red' }}>{error}</p>} <button onClick={handlePurchase} disabled={isLoading}> {isLoading ? 'Creating checkout…' : 'Buy Now'} </button> </div> )}