Giter Club home page Giter Club logo

cb-commerce-frames's Introduction

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 [email protected]: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

cb-commerce-frames's People

Contributors

hughescoin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.