WooNFT API is a custom backend service designed to integrate NFT minting capabilities into WooCommerce stores. It leverages the Mintbase API for NFT minting on the NEAR protocol and provides additional functionalities such as image resizing and license verification for domain-based access control.
- AI image generation: Create a unique AI art based on the actual product.
- NFT Minting: Allows WooCommerce store owners to mint NFTs corresponding to physical products.
- Image Resizing: Dynamically resizes product images before minting them as NFTs to meet platform requirements.
- License Verification: Ensures that only authorized domains can mint NFTs, enhancing security and control.
- Environment Support: Configurable for both testnet and mainnet, facilitating development, testing, and production deployments.
To set up the WooNFT API in your environment, follow these steps:
- Clone the Repository
git clone https://github.com/ivanciric/woo-api.git
cd woo-api
- Install dependencies
npm install
To deploy the WooNFT API with Vercel, you need to install the Vercel CLI globally on your machine. Run the following command:
npm install -g vercel
- Configure environment variables
Duplicate `.env.example` to `.env` and update it with your Mintbase, NEAR, and Firebase credentials.
- Start the development server
vercel dev
Your API is now running and ready to connect your WooCommerce store to the blockchain!
To interact with the API, here are some example usages:
Get image via POST request to /api/get-image
with the image description.
curl -X POST 'https://<vercel-deployment-url>/api/get-image' \
-H 'Content-Type: application/json' \
-H 'x-license-key: your-license-key' \
-d '{
"description": "A detailed description of the NFT image you want to generate."
}'
Send a POST request to /api/mint
with product details to mint NFTs.
curl -X POST 'https://<vercel-deployment-url>/api/mint' \
-H 'Content-Type: application/json' \
-H 'x-license-key: your-license-key' \
-d '{
"imageUrl": "URL_TO_PRODUCT_IMAGE",
"name": "PRODUCT_NAME",
"description": "PRODUCT_DESCRIPTION",
"redirectUrl": "REDIRECT_URL_AFTER_MINTING"
}'
Verify a license by sending a POST request to /api/verify-license
with your license key and domain.
curl -X POST 'https://<vercel-deployment-url>/api/verify-license' \
-H 'Content-Type: application/json' \
-d '{
"licenseKey": "YOUR_LICENSE_KEY",
"domain": "YOUR_DOMAIN"
}'
Contributions to WooNFT API are welcome! Feel free to fork the repository, make changes, and submit pull requests. If you encounter issues or have suggestions, please open an issue in the GitHub repository.
WooNFT API is open-source software licensed under the MIT License. See the LICENSE file for more details.