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:
- The user clicks "Connect Canva" in Marketing HQ's Design Studio.
- The frontend generates a PKCE code verifier and challenge, then redirects the user to Canva's authorization page.
- The PKCE session (code verifier) is temporarily stored in the database with a 10-minute expiry.
- The user authorizes NearSync in the Canva consent screen.
- Canva redirects back to the NearSync callback URL (handled by a dedicated edge function).
- The edge function exchanges the authorization code and PKCE verifier for access and refresh tokens.
- Tokens are stored securely in the database, associated with the user's marketing channel connection.
- 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:
| Capability | API | Purpose |
|---|---|---|
| User info | Users API | Verify the connected account identity |
| Design listing | Designs API | Retrieve the user's designs with thumbnails and metadata |
| Design export | Exports API | Request an export job for a design in a specified format (PNG, PDF) |
| Export polling | Exports API | Poll 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:
- Create a Canva app in the Canva Developer Portal
- Set the Redirect URL to your NearSync deployment's Canva OAuth callback endpoint
- Note the Client ID and Client Secret for configuration
- 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.
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