@canva/user auth.initOauth() as the client. Canva’s Developer Portal supplies the client ID and secret you copy into hyperlocalise-web env vars.
Implementation lives in apps/hyperlocalise-web (/api/oauth/canva/*) and the Canva UI in apps/canva-app. End-user workflow is in Localize Canva.
Flow
- Designer chooses Connect Hyperlocalise in the Canva app.
- Canva opens
{ORIGIN}/api/oauth/canva/authorize(PKCE, scopecanva). - Hyperlocalise signs the user in with WorkOS if needed, then shows consent at
/en/connect/canva/oauthto pick a workspace Canva connection. - Canva exchanges the authorization code at
{ORIGIN}/api/oauth/canva/tokenand storeshl_canva_at_*tokens. - The app calls
/api/integrations/canva/*with headerX-Hyperlocalise-Access-Token.
Canva Developer Portal URLs
Replace{ORIGIN} with the public Hyperlocalise web origin (same as HYPERLOCALISE_PUBLIC_APP_URL, no trailing slash).
Production example (adjust host to your deployment):
https://www.hyperlocalise.com/api/oauth/canva/authorizehttps://www.hyperlocalise.com/api/oauth/canva/token
- Discovery:
{ORIGIN}/api/oauth/canva/.well-known/oauth-authorization-server - Revocation:
{ORIGIN}/api/oauth/canva/revoke
authorization_endpoint and token_endpoint must match the two portal fields.
Also in the portal:
- Set Development URL to
http://localhost:8080when runningapps/canva-app. - Allow redirect URI
https://www.canva.com/apps/oauth/authorized(Hyperlocalise default allowlist whenCANVA_OAUTH_REDIRECT_URIis unset). - Copy App ID →
CANVA_APP_IDon web and Canva app env. - Copy Client ID and Client secret from Canva into
CANVA_OAUTH_CLIENT_IDandCANVA_OAUTH_CLIENT_SECRETon the web app.
Environment variables
apps/hyperlocalise-web
If
CANVA_OAUTH_CLIENT_ID or CANVA_OAUTH_CLIENT_SECRET is missing, OAuth routes return canva_oauth_unconfigured (503).
apps/canva-app
Local development
Canva’s servers POST to/api/oauth/canva/token. They cannot reach http://localhost:3000 unless the web app is on a public HTTPS tunnel and {ORIGIN} in the portal matches that URL.
Alternatives:
- Test OAuth against staging or production Hyperlocalise with portal URLs pointed at that deployment.
- Use a connection token from a locally running Integrations page. The token paste control appears only in the local Canva app, not in the published app.
vp run db:migrate).
Verification
- Metadata curl returns issuer and endpoints.
- Connect from Canva preview reaches consent, not
canva_oauth_unconfigured. - After connect, the app shows workspace, project, and locale rows.
- Automated tests:
apps/hyperlocalise-web/src/api/routes/canva-oauth/canva-oauth.route.test.ts.
Troubleshooting
Consent requires an enabled Canva connection and org role capability
provider_credentials:write.
