Skip to main content

Canva

NearSync integrates with Canva to bring design asset management into Marketing HQ. Users can connect their Canva account, browse their designs, and export assets directly into the NearSync platform without switching between tools.

What It Does

The Canva integration in Marketing HQ's Design Studio allows users to:

  • Connect their Canva account via a secure OAuth flow
  • Browse designs -- View a list of all designs from the connected Canva account
  • Export designs -- Export Canva designs to PNG or PDF format and store them in NearSync's file storage
  • Use exported assets -- Exported designs are available for use in marketing campaigns, brand collateral, and other platform features

OAuth Flow

The Canva integration uses OAuth 2.0 with PKCE (Proof Key for Code Exchange) for secure authorization:

  1. The user clicks "Connect Canva" in Marketing HQ's Design Studio.
  2. The frontend generates a PKCE code verifier and challenge, then redirects the user to Canva's authorization page.
  3. The PKCE session (code verifier) is temporarily stored in the database with a 10-minute expiry.
  4. The user authorizes NearSync in the Canva consent screen.
  5. Canva redirects back to the NearSync callback URL (handled by a dedicated edge function).
  6. The edge function exchanges the authorization code and PKCE verifier for access and refresh tokens.
  7. Tokens are stored securely in the database, associated with the user's marketing channel connection.
  8. The PKCE session is cleaned up automatically.

Token refresh is handled automatically when the access token nears expiry, so users do not need to re-authorize unless they explicitly disconnect.

Canva APIs Used

The integration uses the following Canva REST API endpoints:

CapabilityAPIPurpose
User infoUsers APIVerify the connected account identity
Design listingDesigns APIRetrieve the user's designs with thumbnails and metadata
Design exportExports APIRequest an export job for a design in a specified format (PNG, PDF)
Export pollingExports APIPoll the export job status until the file is ready for download

The export process is asynchronous: NearSync creates an export request, then polls the job status until Canva reports the export is complete and provides a download URL.

Configuration

Credentials Required

  • Canva Client ID -- The OAuth client ID from your Canva developer app (needed both server-side for token exchange and client-side for initiating the OAuth flow)
  • Canva Client Secret -- The OAuth client secret from your Canva developer app (server-side only, used for token exchange)

Canva Developer Setup

To configure the Canva integration:

  1. Create a Canva app in the Canva Developer Portal
  2. Set the Redirect URL to your NearSync deployment's Canva OAuth callback endpoint
  3. Note the Client ID and Client Secret for configuration
  4. Ensure the app has the required scopes for reading designs and creating exports

For Managed deployments, NearSync configures the Canva app credentials. For BYOK deployments, you create your own Canva developer app and provide the credentials during setup.

Production Callback URL

The OAuth redirect URL must point to your production domain, not localhost. If the callback URL is misconfigured, the OAuth flow will fail after the user authorizes in Canva. Verify this setting in the Canva Developer Portal before going live.

If Canva Is Unavailable

  • The Design Studio's Canva features become unavailable
  • Design listing and export operations will fail with an error message
  • No other modules or features are affected
  • Previously exported and stored design assets remain accessible in NearSync's file storage
  • The rest of Marketing HQ (channels, analytics, content management) continues to work normally