This project demonstrates how to use the Canva Apps SDK and REST API to create a design via an API request. The backend is built using Node.js and Express.
- Creates a Canva design via API
- Adds a text element (fixed font, size, and color)
- Inserts an image via
asset_id - Returns the design URL
- Canva Developer Account: Register at Canva Developers.
- Canva API Access Token: Obtain from your Canva app settings.
- Node.js & npm: Install from Node.js official website.
git clone https://github.com/yourusername/canva-api-poc.git
cd canva-api-pocnpm installCreate a .env file in the project root and add the following:
CANVA_ACCESS_TOKEN=your_canva_access_token
PORT=3000node server.jsPOST /create-design
{
"text": "Hello Canva!",
"assetId": "your_asset_id"
}{
"success": true,
"designId": "123456789",
"designUrl": "https://api.canva.com/v1/designs/123456789"
}You can deploy this project on platforms like Vercel, Heroku, or AWS.
Example for Heroku:
git init
git add .
git commit -m "Initial commit"
heroku create
heroku config:set CANVA_ACCESS_TOKEN=your_canva_access_token
heroku push heroku mainThis project is licensed under the MIT License.
For contributions or issues, feel free to open a pull request or issue on GitHub!