hughescoin / cb-commerce-frames

Create a Warpcast Frame for selling items using Coinbase Commerce

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Commerce x Farcaster Frames Single-Item Guide

This guide explain how to sell a single item using via a Cast which allows your users to pay with crypto via Coinbase Commerce.

Pre-requirements

  1. Create a Coinbase Commerce account

Tip

Be sure to set your deposit address in the Coinbase Commerce merchant dashboard to avoid charge creation failures.

  1. You will need a custom domain. This guide will use a vercel account for easy deployment and testing.

Important

Warpcast requires your Frame to be a https:// URL

  1. Create a Github [account] (https://github.com/signup)
  2. An image of your item for sale (.png, .jpg) with 1200 x 630 pixel dimensions

Start here

  1. Fork this repo
  2. Connect your github account to Vercel. Reference the official Vercel guide for detailed steps
  3. Upload your Commerce API key credentials to Vercel settings page or your website hosting server. See the official Vercel guide on environment variables for detailed steps !image

Tip

For an app deployed at https://sample-frame.vercel.app/ your settings page will be located at https://vercel.com/your-projects/sample-frame/settings

  1. Open the forked repo from step 1 in a code editor like Visual Studio
  2. Using a code editor or the command line, replace the temporary image in the public/ folder with the image of your product
  3. Navigate to the utils/ folder (if using the command line run cd utils/)
  4. Replace the following variables in the utils.ts file:

Important

Ensure your NEXT_PUBLIC_URL does not have a trailing /. Extra characters in the post_url will cause the redirect to fail.

  • NEXT_PUBLIC_URL - Your website or vercel domain (ex: https://your-site.com or https://sample-frame.vercel.app/). You may find your vercel domain under your Projects page
  • ITEM_DESCRIPTION - A description of your product
  • ITEM_TITLE - Title of your product
  • IMAGE_NAME - The full name of your image including file type. (ex: onchain.png)
  • (optional) REDIRECT_URL - A URL (string) to redirect users to upon purchase completion
  • PRODUCT_PRICE_USD - The price (string) of your prouct in USD (ex: "5.99")

Commit changes

git init
git add -A
git commit -m "first frame"
git branch -M master
git remote add origin git@github.com:Your-Github-Username/Your-Forked-Repo.git
git push -u origin master

Add Cast your Frame:

  1. Log into your Warpcast
  2. Paste a link to your vercel site or custom domain remember to use https:// image
  3. Click "Cast"

Enjoy!

Additional tips

Tip

Use the Frame validator tool to view your frame and test functionality.

A redirect frame example

Built using a-frame-in-100-lines by Zizzamia and redirect-frame by Zizzamia and Sanjay

Resources

License

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

About

Create a Warpcast Frame for selling items using Coinbase Commerce

License:MIT License


Languages

Language:TypeScript 95.4%Language:JavaScript 4.6%