Coinbase Commerce

R
Renaudil y a 2 jours
0

Description

Embed USDC payment and commerce capabilities in a few lines of code, powered by Coinbase Smart Wallet and Coinbase Commerce.

npx boilerapp coinbase-commerce

文档

Onchain Commerce Template

<img width="1200" alt="Thumbnail (1)" src="https://github.com/user-attachments/assets/e1f513ea-d1ac-4baf-908e-35b0456d5565">

An Onchain Commerce Template built with OnchainKit, and ready to be deployed to Vercel.

Play with it live on https://onchain-commerce-template.vercel.app/

Have fun! ⛵️

<br />

Setup

To ensure all components work seamlessly, set the following environment variables in your .env file using .local.env.example as a reference.

You can find the API key on the Coinbase Developer Portal's OnchainKit page. If you don't have an account, you will need to create one.

You can find your Coinbase Commerce API key on Coinbase Commerce. If you don't have an account, you will need to create one.

# See https://portal.cdp.coinbase.com/products/onchainkit
NEXT_PUBLIC_ONCHAINKIT_API_KEY="GET_FROM_COINBASE_DEVELOPER_PLATFORM"

# See https://beta.commerce.coinbase.com/
COINBASE_COMMERCE_API_KEY="GET_FROM_COINBASE_COMMERCE"
<br />

Enabling checkout

By default, the checkout functionality is disabled to prevent transactions in non-production environments. To enable the checkout flow for local development, you need to uncomment the code found in the OnchainStoreCart.tsx component, along with the imports at the top of the file.

You can also remove the OnchainStoreModal component and logic as well as the MockCheckoutButton as these were created for demo purposes only.

Next, you'll want to replace products in the OnchainStoreProvider with your own product items.

This template showcases a multi-product checkout implementation of our Checkout component using the chargeHandler approach. You can read more about this implementation in the Advanced Usage section of our Checkout component docs here: https://onchainkit.xyz/checkout/checkout

<br />

Running locally

# Install bun in case you don't have it
bun curl -fsSL <https://bun.sh/install> | bash

# Install packages
bun i

# Run Next app
bun run dev
<br />

Resources

<br />

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Prix

Gratuit

FREE

评论 (0)

常见问题

常见问题解答 (FAQ)

有问题?我们有答案。如果您找不到想要的答案,请随时联系我们。

Boilerapp 是一个专门用于分享 Boilerplates、入门套件(Starter Kits)和项目模版的开发者社区平台。我们的目标很简单:为您节省初始配置(Setup)的时间,让您可以专注于真正重要的代码。无论您是在寻找简单的代码库还是完整的 SaaS 项目,都能在这里找到。

还有其他问题?

我们的团队随时为您提供帮助。联系我们,我们将尽快回复。