Copy our template environment file and fill in missing variables.
cp template.env .env
NEXT_PUBLIC_ONCHAINKIT_CDP_KEY=""
BASE_SEPOLIA_PAYMASTER_URL=""
SUBSCRIPTION_PRIVATE_KEY=""
NEXT_PUBLIC_SUBSCRIPTION_SPENDER=""
First, go to portal.cdp.coinbase.com and sign up for an account.
NEXT_PUBLIC_ONCHAINKIT_CDP_KEY
: Go to "Onchain Tools" > "OnchainKit" and copy "Client API Key"BASE_SEPOLIA_PAYMASTER_URL
: Go to "Onchain Tools" > "Paymaster" > "Configuration" and change the network dropdown on the far right to "Base Testnet (Sepolia)" and copy "Paymaster & Bundler endpoint"
Next, you need to generate a new private key. Foundry's cast wallet new
is recommended and you can install Foundry here.
SUBSCRIPTION_PRIVATE_KEY
: set the output private key fromcast wallet new
NEXT_PUBLIC_SUBSCRIPTION_SPENDER
: set the output address fromcast wallet new
(note we will actually change this later)
npm install
npm run dev