Run your storefront
First, choose your login and wallets. Already have Base wallets? Keep them. Have login but no wallets? Add your own wallet provider. Starting fresh? This guide uses a Privy app you own for both login and wallets.
These options are self service. You only need DYLI activation if you ask us to manage the provider.
The storefront template includes packs, a customer vault, sell-backs, shipping, secondary marketplace and P2P trading. This guide sets it up with your own Privy login and card and Base USDC pack checkout. Marketplace and trade cash settle from the customer's Base USDC wallet. Custom pack checkouts can accept other crypto too.
Still building? Your own UI can use mock data without a key, or the Read API with a free Read key. This template's live catalog uses Commerce endpoints, so it needs a Commerce key even in demo mode. Read keys cannot call Commerce.
1. Register your app
Open Create an API key with your DYLI Pro account and choose:
- Commerce API and a website/storefront.
- Use your own Privy app for a new storefront.
- DYLI-hosted checkout and balance for payments.
Enter your company, use case and HTTPS storefront domain. A temporary Vercel URL you control is fine; the site needn't be finished. Update your domains in Commerce setup before launch. Save the Commerce key; it identifies the app automatically.
Create a dedicated Privy app for your storefront and register its allowed domains. Keep its server secret private. You do not need DYLI's Privy app or your own Stripe account.
Already have login? Choose the existing-login option and connect the client/server adapters. Keep your Base wallets, or add a wallet provider you own. If you want DYLI to manage the provider, request activation.
2. Set up the repo
Use Node 24 or newer:
git clone https://github.com/doyoulikeit/dyli-commerce-example.git
cd dyli-commerce-example
npm ci
cp .env.example .env.local
If you already have .env.local, edit it instead of overwriting it. Add your Commerce key and Privy settings:
DYLI_API_KEY=YOUR_COMMERCE_API_KEY
NEXT_PUBLIC_PRIVY_APP_ID=YOUR_PRIVY_APP_ID
PRIVY_SECRET_KEY=YOUR_PRIVY_SERVER_SECRET
STOREFRONT_ORIGIN=https://your-storefront.example
NEXT_PUBLIC_DEMO_MODE=false
Replace the placeholders. Use the HTTPS origin registered with DYLI and Privy, with no path or trailing slash. Keep the env file out of Git.
No API URLs or slug setting are needed. Commerce calls default to https://www.dyli.io/api/commerce/v1; catalog enrichment uses https://www.dyli.io/api/public/v1. Both use the server-side key.
With NEXT_PUBLIC_DEMO_MODE=false, purchases use real money and inventory, including on localhost. Set it to true to try the interface without making payments; demo mode doesn't use Privy.
Your own wallets need Base ETH for gas or your own sponsorship. Card checkout does not fund gas. Gas and managed sponsorship.
3. Check and run
npm run doctor
npm run dev
Open localhost:3000. The doctor command checks your connection and settings without making purchases. Fix any reported issues before trying checkout.
Allow localhost in Privy to test locally. Card checkout returns to the page you started from, including localhost or 127.0.0.1. Remote return domains must be registered with DYLI. Localhost still uses real production payments and inventory by default.
4. Choose your packs and fees
Customize packs and fees
Add these optional settings to .env.local or your hosting provider:
INCLUDED_IDS=12997,12998
FLAT_FEE=2
# OR: PERCENT_FEE=5
INCLUDED_IDS: show only these packs. Omit for all packs permitted by your app.FLAT_FEE=2: add $2 per pack. Two $35 packs: Items $70, Your fee $2 × 2 = $4, total $74 before card processing.PERCENT_FEE=5: alternatively, add 5% of subtotal. Choose one fee setting. Use0for no added fee; omit both to inherit saved app fees (zero by default).
Restart locally or redeploy after changing these settings. Keep them server-side. DYLI includes your fee in the card or balance checkout total, so you don't need to collect it separately.
Commerce earnings
The key owner, not the customer, earns 10% of settled profit: base pack sales minus cash buybacks and the cost of items kept, with losses offsetting gains. A bought-back item is not also charged as an item cost. Your fee is separate. Test and unfinished purchases earn nothing.
Your app also earns 10% of DYLI's collected fee on completed secondary sales and cash trades by default. It comes from DYLI's fee, not an extra customer charge. Revenue share examples and custom rates.
Creating a Commerce key adds Profile → Storefront → Commerce with orders, quantities, buybacks and earnings. Withdraw available funds through the normal Claim tab. Key rotation preserves history. Accounting and app-wide config →
New Commerce apps use secured pack openings by default: items reach the customer before rewards appear. Keeping every item needs no extra transaction. Selling requires the returned sale transaction and any item approval; wait for verified completion before crediting USDC.
5. Try the full experience
For marketplace and trading, choose whether to include DYLI listings and collectors. The example has a configuration command, so you don't need extra credentials or a custom admin screen.
Sign in, open a pack, then vault an item or accept a buyback. From the vault, select an eligible item to ship, confirm the address and choose a delivery rate.
Use the launch checklist to test payments, recovery and shipping before inviting customers. The doctor command checks the connection; it doesn't complete those flows for you.