Metaplex
Last updated
Last updated
This guide will walk you through creating and deploying a storefront using the Metaplex platform.
Before starting, ensure you have:
A basic understanding of React
concepts such as hooks. Refer to the React documentation .
A wallet containing tokens to perform your transactions.
Familiarity with the different packages
and their purposes (helpful but not required).
To create a store, you first need to derive the store ID using your public wallet address. The Metaplex developers have provided an environment variable for this purpose: REACT_APP_STORE_OWNER_ADDRESS_ADDRESS
.
Steps:
Create a .env
file in packages/web
.
Set REACT_APP_STORE_OWNER_ADDRESS_ADDRESS
to your wallet's public address.
Example:
After setting up your store ID, you can create your store using Metaplex's helper methods.
Steps:
Use the saveAdmin
method located at packages/web/src/actions/saveAdmin
.
You can create a script or a button in your UI to call this method.
Example:
For a button in your UI:
Note: Confirm your transactions after clicking the button. Do not navigate away from the page during this process.
After creating your store, update your store's information by editing the userNames.json
file located at packages/web/src/config/userNames.json
. Follow the format used by other objects in this file.
Once your store is set up, you can access the admin panel at YOUR_URL/#/admin
. Here, you can manage your store, add whitelisted creators, or make your store public. Ensure you save your changes after editing.
In the js/packages/web/package.json
file, update the following lines:
Replace https://github.com/metaplex-foundation/metaplex
with your repository URL, and set ASSET_PREFIX
to your repository name.
Example:
Navigate to the js/packages/web
directory and run the following command:
If using a custom domain, remove the ASSET_PREFIX
from the deploy script:
Deploy using the same commands as above.
To deploy your store to Vercel:
Create a pages/
directory under js
.
Configure the project with the following settings:
Framework: Next.js
Root directory: js
Output directory: packages/web/.next
Add REACT_APP_STORE_OWNER_ADDRESS_ADDRESS
in the Environment Variables section.
To deploy through Google Cloud Run:
In the Dockerfile
, set ENV REACT_APP_STORE_OWNER_ADDRESS_ADDRESS=""
to your wallet address.
In js/packages/web/.env.production
, set REACT_APP_STORE_OWNER_ADDRESS_ADDRESS
to your wallet address.
Build your Docker image using:
Set up your service name (e.g., my nft store
) and choose your uploaded image.
In the advanced settings, add the following environment variable:
Name: NODE_ENV
Value: production
Visit the "Manage Custom Domain" section in Cloud Run.
Set up your domain and bind it to the service.
Note: If you have 2FA enabled, you'll need to use a personal access token as your password. Follow for more details.
Visit and create a new project linked to your GitHub repo.
Upload your image using gcloud cli
. Refer to .
Visit and create a new service.