Template-Craft

💻 Developer Guide

Integrate Template-Craft with Canva Connect API

⚠️ Important: GitHub Pages Limitation

GitHub Pages is a static hosting service and cannot execute Node.js scripts. The Canva integration script (canvaIntegration.js) must be run locally on your machine or deployed to a backend server that supports Node.js. It will not work directly on GitHub Pages.

🚀 Getting Started

Follow these steps to set up Canva API integration:

  • Create a Canva Developer Account

    Visit Canva Developers Portal and create a developer account.

  • Register Your Application

    Create a new app in the Canva Developer Console and obtain your API credentials.

  • Set Required API Scopes

    Ensure your app has the design:content:write scope enabled.

  • Get Your API Token

    Generate an API token from your app's settings page.

📦 Installation

Install the required dependencies for the Node.js integration script:

# Install node-fetch for HTTP requests (Node.js < 18) npm install node-fetch # Note: Node.js 18+ has built-in fetch, so this is optional

🔧 Configuration

Set your Canva API token as an environment variable:

# Set your Canva API token export CANVA_API_TOKEN="your_api_token_here" # Or set it inline when running the script: CANVA_API_TOKEN=your_token node canvaIntegration.js

▶️ Running the Script

Execute the Canva integration script from your terminal:

# Run with environment variable CANVA_API_TOKEN=your_token node canvaIntegration.js # The script will: # 1. Connect to Canva API # 2. Create a new design with specified parameters # 3. Return the design ID and edit URL
✨ What the Script Does

The canvaIntegration.js script creates a new design in your Canva account using the API. It sends a POST request with design specifications (type, title, etc.) and returns a URL where you can edit the created design in Canva's editor.

✨ Features & Capabilities

🎨
Design Creation
Programmatically create new Canva designs with custom templates
🔄
API Integration
Direct integration with Canva's REST API for automation
Batch Processing
Create multiple designs efficiently with scripted workflows
🔗
Edit Links
Get direct URLs to edit created designs in Canva

📚 Documentation

For detailed setup instructions and API documentation, see:

🎯 Use Cases

The Canva integration enables several powerful use cases:

  • Automated Design Generation: Create designs programmatically based on data or user input
  • Batch Template Creation: Generate multiple variations of templates efficiently
  • Workflow Integration: Connect Template-Craft with your existing design workflows
  • Custom Tooling: Build custom tools on top of Canva's design capabilities