@canva/n8n-nodes-canva 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +217 -0
- package/dist/credentials/CanvaOAuth2Api.credentials.d.ts +9 -0
- package/dist/credentials/CanvaOAuth2Api.credentials.js +55 -0
- package/dist/credentials/CanvaOAuth2Api.credentials.js.map +1 -0
- package/dist/nodes/Canva/Canva.node.d.ts +5 -0
- package/dist/nodes/Canva/Canva.node.js +717 -0
- package/dist/nodes/Canva/Canva.node.js.map +1 -0
- package/dist/nodes/Canva/Canva.node.json +19 -0
- package/dist/nodes/Canva/GenericFunctions.d.ts +2 -0
- package/dist/nodes/Canva/GenericFunctions.js +12 -0
- package/dist/nodes/Canva/GenericFunctions.js.map +1 -0
- package/dist/nodes/Canva/icons/canva.dark.svg +1 -0
- package/dist/nodes/Canva/icons/canva.svg +1 -0
- package/dist/nodes/Canva/resources/asset/delete.d.ts +2 -0
- package/dist/nodes/Canva/resources/asset/delete.js +16 -0
- package/dist/nodes/Canva/resources/asset/delete.js.map +1 -0
- package/dist/nodes/Canva/resources/asset/get.d.ts +2 -0
- package/dist/nodes/Canva/resources/asset/get.js +16 -0
- package/dist/nodes/Canva/resources/asset/get.js.map +1 -0
- package/dist/nodes/Canva/resources/asset/index.d.ts +3 -0
- package/dist/nodes/Canva/resources/asset/index.js +53 -0
- package/dist/nodes/Canva/resources/asset/index.js.map +1 -0
- package/dist/nodes/Canva/resources/asset/update.d.ts +2 -0
- package/dist/nodes/Canva/resources/asset/update.js +42 -0
- package/dist/nodes/Canva/resources/asset/update.js.map +1 -0
- package/dist/nodes/Canva/resources/asset/upload.d.ts +2 -0
- package/dist/nodes/Canva/resources/asset/upload.js +44 -0
- package/dist/nodes/Canva/resources/asset/upload.js.map +1 -0
- package/dist/nodes/Canva/resources/asset/uploadPreviewNotice.d.ts +2 -0
- package/dist/nodes/Canva/resources/asset/uploadPreviewNotice.js +13 -0
- package/dist/nodes/Canva/resources/asset/uploadPreviewNotice.js.map +1 -0
- package/dist/nodes/Canva/resources/autofill/create.d.ts +2 -0
- package/dist/nodes/Canva/resources/autofill/create.js +53 -0
- package/dist/nodes/Canva/resources/autofill/create.js.map +1 -0
- package/dist/nodes/Canva/resources/autofill/index.d.ts +3 -0
- package/dist/nodes/Canva/resources/autofill/index.js +29 -0
- package/dist/nodes/Canva/resources/autofill/index.js.map +1 -0
- package/dist/nodes/Canva/resources/autofill/premiumNotice.d.ts +2 -0
- package/dist/nodes/Canva/resources/autofill/premiumNotice.js +13 -0
- package/dist/nodes/Canva/resources/autofill/premiumNotice.js.map +1 -0
- package/dist/nodes/Canva/resources/brandTemplate/get.d.ts +2 -0
- package/dist/nodes/Canva/resources/brandTemplate/get.js +16 -0
- package/dist/nodes/Canva/resources/brandTemplate/get.js.map +1 -0
- package/dist/nodes/Canva/resources/brandTemplate/getAll.d.ts +2 -0
- package/dist/nodes/Canva/resources/brandTemplate/getAll.js +69 -0
- package/dist/nodes/Canva/resources/brandTemplate/getAll.js.map +1 -0
- package/dist/nodes/Canva/resources/brandTemplate/getDataset.d.ts +2 -0
- package/dist/nodes/Canva/resources/brandTemplate/getDataset.js +16 -0
- package/dist/nodes/Canva/resources/brandTemplate/getDataset.js.map +1 -0
- package/dist/nodes/Canva/resources/brandTemplate/index.d.ts +3 -0
- package/dist/nodes/Canva/resources/brandTemplate/index.js +55 -0
- package/dist/nodes/Canva/resources/brandTemplate/index.js.map +1 -0
- package/dist/nodes/Canva/resources/brandTemplate/premiumNotice.d.ts +2 -0
- package/dist/nodes/Canva/resources/brandTemplate/premiumNotice.js +13 -0
- package/dist/nodes/Canva/resources/brandTemplate/premiumNotice.js.map +1 -0
- package/dist/nodes/Canva/resources/brandTemplate/publish.d.ts +2 -0
- package/dist/nodes/Canva/resources/brandTemplate/publish.js +16 -0
- package/dist/nodes/Canva/resources/brandTemplate/publish.js.map +1 -0
- package/dist/nodes/Canva/resources/brandTemplate/publishPreviewNotice.d.ts +2 -0
- package/dist/nodes/Canva/resources/brandTemplate/publishPreviewNotice.js +13 -0
- package/dist/nodes/Canva/resources/brandTemplate/publishPreviewNotice.js.map +1 -0
- package/dist/nodes/Canva/resources/comment/createReply.d.ts +2 -0
- package/dist/nodes/Canva/resources/comment/createReply.js +37 -0
- package/dist/nodes/Canva/resources/comment/createReply.js.map +1 -0
- package/dist/nodes/Canva/resources/comment/createThread.d.ts +2 -0
- package/dist/nodes/Canva/resources/comment/createThread.js +45 -0
- package/dist/nodes/Canva/resources/comment/createThread.js.map +1 -0
- package/dist/nodes/Canva/resources/comment/getReply.d.ts +2 -0
- package/dist/nodes/Canva/resources/comment/getReply.js +36 -0
- package/dist/nodes/Canva/resources/comment/getReply.js.map +1 -0
- package/dist/nodes/Canva/resources/comment/getThread.d.ts +2 -0
- package/dist/nodes/Canva/resources/comment/getThread.js +26 -0
- package/dist/nodes/Canva/resources/comment/getThread.js.map +1 -0
- package/dist/nodes/Canva/resources/comment/index.d.ts +3 -0
- package/dist/nodes/Canva/resources/comment/index.js +61 -0
- package/dist/nodes/Canva/resources/comment/index.js.map +1 -0
- package/dist/nodes/Canva/resources/comment/listReplies.d.ts +2 -0
- package/dist/nodes/Canva/resources/comment/listReplies.js +45 -0
- package/dist/nodes/Canva/resources/comment/listReplies.js.map +1 -0
- package/dist/nodes/Canva/resources/comment/previewNotice.d.ts +2 -0
- package/dist/nodes/Canva/resources/comment/previewNotice.js +13 -0
- package/dist/nodes/Canva/resources/comment/previewNotice.js.map +1 -0
- package/dist/nodes/Canva/resources/design/create.d.ts +2 -0
- package/dist/nodes/Canva/resources/design/create.js +78 -0
- package/dist/nodes/Canva/resources/design/create.js.map +1 -0
- package/dist/nodes/Canva/resources/design/get.d.ts +2 -0
- package/dist/nodes/Canva/resources/design/get.js +16 -0
- package/dist/nodes/Canva/resources/design/get.js.map +1 -0
- package/dist/nodes/Canva/resources/design/getAll.d.ts +2 -0
- package/dist/nodes/Canva/resources/design/getAll.js +69 -0
- package/dist/nodes/Canva/resources/design/getAll.js.map +1 -0
- package/dist/nodes/Canva/resources/design/getDataset.d.ts +2 -0
- package/dist/nodes/Canva/resources/design/getDataset.js +16 -0
- package/dist/nodes/Canva/resources/design/getDataset.js.map +1 -0
- package/dist/nodes/Canva/resources/design/getDatasetPreviewNotice.d.ts +2 -0
- package/dist/nodes/Canva/resources/design/getDatasetPreviewNotice.js +13 -0
- package/dist/nodes/Canva/resources/design/getDatasetPreviewNotice.js.map +1 -0
- package/dist/nodes/Canva/resources/design/getExportFormats.d.ts +2 -0
- package/dist/nodes/Canva/resources/design/getExportFormats.js +16 -0
- package/dist/nodes/Canva/resources/design/getExportFormats.js.map +1 -0
- package/dist/nodes/Canva/resources/design/getPages.d.ts +2 -0
- package/dist/nodes/Canva/resources/design/getPages.js +34 -0
- package/dist/nodes/Canva/resources/design/getPages.js.map +1 -0
- package/dist/nodes/Canva/resources/design/getPagesPreviewNotice.d.ts +2 -0
- package/dist/nodes/Canva/resources/design/getPagesPreviewNotice.js +13 -0
- package/dist/nodes/Canva/resources/design/getPagesPreviewNotice.js.map +1 -0
- package/dist/nodes/Canva/resources/design/index.d.ts +3 -0
- package/dist/nodes/Canva/resources/design/index.js +71 -0
- package/dist/nodes/Canva/resources/design/index.js.map +1 -0
- package/dist/nodes/Canva/resources/designImport/createImport.d.ts +2 -0
- package/dist/nodes/Canva/resources/designImport/createImport.js +44 -0
- package/dist/nodes/Canva/resources/designImport/createImport.js.map +1 -0
- package/dist/nodes/Canva/resources/designImport/index.d.ts +3 -0
- package/dist/nodes/Canva/resources/designImport/index.js +27 -0
- package/dist/nodes/Canva/resources/designImport/index.js.map +1 -0
- package/dist/nodes/Canva/resources/export/export.d.ts +2 -0
- package/dist/nodes/Canva/resources/export/export.js +92 -0
- package/dist/nodes/Canva/resources/export/export.js.map +1 -0
- package/dist/nodes/Canva/resources/export/index.d.ts +3 -0
- package/dist/nodes/Canva/resources/export/index.js +27 -0
- package/dist/nodes/Canva/resources/export/index.js.map +1 -0
- package/dist/nodes/Canva/resources/folder/create.d.ts +2 -0
- package/dist/nodes/Canva/resources/folder/create.js +26 -0
- package/dist/nodes/Canva/resources/folder/create.js.map +1 -0
- package/dist/nodes/Canva/resources/folder/delete.d.ts +2 -0
- package/dist/nodes/Canva/resources/folder/delete.js +16 -0
- package/dist/nodes/Canva/resources/folder/delete.js.map +1 -0
- package/dist/nodes/Canva/resources/folder/get.d.ts +2 -0
- package/dist/nodes/Canva/resources/folder/get.js +16 -0
- package/dist/nodes/Canva/resources/folder/get.js.map +1 -0
- package/dist/nodes/Canva/resources/folder/index.d.ts +3 -0
- package/dist/nodes/Canva/resources/folder/index.js +67 -0
- package/dist/nodes/Canva/resources/folder/index.js.map +1 -0
- package/dist/nodes/Canva/resources/folder/listItems.d.ts +2 -0
- package/dist/nodes/Canva/resources/folder/listItems.js +73 -0
- package/dist/nodes/Canva/resources/folder/listItems.js.map +1 -0
- package/dist/nodes/Canva/resources/folder/moveItem.d.ts +2 -0
- package/dist/nodes/Canva/resources/folder/moveItem.js +26 -0
- package/dist/nodes/Canva/resources/folder/moveItem.js.map +1 -0
- package/dist/nodes/Canva/resources/folder/update.d.ts +2 -0
- package/dist/nodes/Canva/resources/folder/update.js +26 -0
- package/dist/nodes/Canva/resources/folder/update.js.map +1 -0
- package/dist/nodes/Canva/resources/merge/create.d.ts +2 -0
- package/dist/nodes/Canva/resources/merge/create.js +90 -0
- package/dist/nodes/Canva/resources/merge/create.js.map +1 -0
- package/dist/nodes/Canva/resources/merge/index.d.ts +3 -0
- package/dist/nodes/Canva/resources/merge/index.js +29 -0
- package/dist/nodes/Canva/resources/merge/index.js.map +1 -0
- package/dist/nodes/Canva/resources/merge/previewNotice.d.ts +2 -0
- package/dist/nodes/Canva/resources/merge/previewNotice.js +13 -0
- package/dist/nodes/Canva/resources/merge/previewNotice.js.map +1 -0
- package/dist/nodes/Canva/resources/resize/create.d.ts +2 -0
- package/dist/nodes/Canva/resources/resize/create.js +86 -0
- package/dist/nodes/Canva/resources/resize/create.js.map +1 -0
- package/dist/nodes/Canva/resources/resize/index.d.ts +3 -0
- package/dist/nodes/Canva/resources/resize/index.js +29 -0
- package/dist/nodes/Canva/resources/resize/index.js.map +1 -0
- package/dist/nodes/Canva/resources/resize/premiumNotice.d.ts +2 -0
- package/dist/nodes/Canva/resources/resize/premiumNotice.js +13 -0
- package/dist/nodes/Canva/resources/resize/premiumNotice.js.map +1 -0
- package/dist/nodes/Canva/resources/user/index.d.ts +3 -0
- package/dist/nodes/Canva/resources/user/index.js +35 -0
- package/dist/nodes/Canva/resources/user/index.js.map +1 -0
- package/dist/package.json +61 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +61 -0
package/README.md
ADDED
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
# n8n-nodes-canva
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
An n8n community node for connecting Canva to n8n using the [Canva Connect API](https://www.canva.dev/docs/connect/). Create and export designs, bulk-generate from brand templates, manage assets and folders, import external files, and connect Canva to the rest of your stack.
|
|
6
|
+
|
|
7
|
+
- [Installation](#installation)
|
|
8
|
+
- [Running n8n locally](#running-n8n-locally)
|
|
9
|
+
- [Credentials](#credentials)
|
|
10
|
+
- [Operations](#operations)
|
|
11
|
+
- [Usage notes](#usage-notes)
|
|
12
|
+
- [Resources](#resources)
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
> This section is for people who already have an n8n instance running (cloud or self-hosted). If you want to test this node on your own machine first, see [Running n8n locally](#running-n8n-locally) below.
|
|
17
|
+
|
|
18
|
+
Follow the [installation guide](https://docs.n8n.io/integrations/community-nodes/installation/) in the n8n community nodes documentation.
|
|
19
|
+
|
|
20
|
+
## Running n8n locally
|
|
21
|
+
|
|
22
|
+
> This section is for developers who want to run and test this node locally.
|
|
23
|
+
|
|
24
|
+
**Prerequisites:** Node.js 24+, npm.
|
|
25
|
+
|
|
26
|
+
1. Install dependencies and start n8n in dev mode:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npm install
|
|
30
|
+
npm run dev
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
This builds the node, links it to a local n8n instance, and starts n8n at [http://127.0.0.1:5678](http://127.0.0.1:5678) with hot reload enabled. The **Canva** node will appear in the node picker under _Community Nodes_.
|
|
34
|
+
|
|
35
|
+
2. Follow the [Credentials](#credentials) section below to connect your Canva account.
|
|
36
|
+
|
|
37
|
+
> **Note:** When running locally, use `http://127.0.0.1:5678/rest/oauth2-credential/callback` as the redirect URI in the Canva Developer Portal. Canva does not accept `localhost` — you must use the IP address.
|
|
38
|
+
|
|
39
|
+
### Troubleshooting
|
|
40
|
+
|
|
41
|
+
#### `npm run dev` fails with `EACCES: permission denied, rename ...` inside `~/.npm/_cacache`
|
|
42
|
+
|
|
43
|
+
`npm run dev` starts n8n via `npx n8n@latest`, which downloads n8n through your machine's shared npm cache (`~/.npm`). If that cache contains files owned by another user — usually root, left behind by running npm with `sudo` at some point — the download fails with `EACCES`/`EEXIST` rename errors. Reclaim ownership of the cache and retry:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
sudo chown -R $(id -u):$(id -g) ~/.npm
|
|
47
|
+
npm run dev
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Credentials
|
|
51
|
+
|
|
52
|
+
This node uses **OAuth2 with PKCE** to authenticate with Canva.
|
|
53
|
+
|
|
54
|
+
### 1. Create a Canva integration
|
|
55
|
+
|
|
56
|
+
Go to the [Canva Developer Portal](https://www.canva.com/developers/integrations/connect-api) and create a new private integration. After creation, the integration's settings page will automatically open.
|
|
57
|
+
|
|
58
|
+
- In the **Credentials** section, click on **Generate secret** to generate a new secret.
|
|
59
|
+
- Copy and paste both the **Client ID** and **Client secret** to a secure file.
|
|
60
|
+
- In the **Authentication** tab, add either of the following to the **URL 1** field of the **Authorized redirects**:
|
|
61
|
+
- **Cloud or self-hosted n8n:** `https://your-n8n-instance.com/rest/oauth2-credential/callback`
|
|
62
|
+
- **Local n8n:** `http://127.0.0.1:5678/rest/oauth2-credential/callback`
|
|
63
|
+
|
|
64
|
+
- In the **Scopes** tab, enable the following scopes:
|
|
65
|
+
|
|
66
|
+
| Scope | Used by |
|
|
67
|
+
| ---------------------------------------------------------------------------------------- | ------------------------------------------------- |
|
|
68
|
+
| `asset:read` / `asset:write` | Asset resource |
|
|
69
|
+
| `brandtemplate:content:read` / `brandtemplate:content:write` / `brandtemplate:meta:read` | Brand Template resource |
|
|
70
|
+
| `comment:read` / `comment:write` | Comment resource (Preview) |
|
|
71
|
+
| `design:content:read` / `design:content:write` / `design:meta:read` | Design, Autofill, Export, Merge, Resize resources |
|
|
72
|
+
| `folder:read` / `folder:write` | Folder resource |
|
|
73
|
+
| `profile:read` | User resource |
|
|
74
|
+
|
|
75
|
+
Your integration's **Scopes** settings should look like this:
|
|
76
|
+
|
|
77
|
+
<!-- markdownlint-disable-next-line MD033 -->
|
|
78
|
+
<img src="./.github/assets/app-scopes.png" alt="Your app's scopes" width="50%" />
|
|
79
|
+
|
|
80
|
+
### 2. Add your integration's credentials to the Canva node in n8n
|
|
81
|
+
|
|
82
|
+
1. In n8n, open **Credentials → New → Canva OAuth2 API**.
|
|
83
|
+
2. Enter the **Client ID** and **Client secret** that you saved earlier.
|
|
84
|
+
3. Click **Connect my account** and complete the OAuth flow.
|
|
85
|
+
|
|
86
|
+
## Operations
|
|
87
|
+
|
|
88
|
+
### Asset
|
|
89
|
+
|
|
90
|
+
| Operation | Description |
|
|
91
|
+
| --------------------------- | ----------------------------------------------------------------- |
|
|
92
|
+
| Delete | Delete an asset |
|
|
93
|
+
| Get | Get metadata for an asset |
|
|
94
|
+
| Update | Update an asset's name or tags |
|
|
95
|
+
| Upload From URL _(Preview)_ | Upload an asset from a public URL and wait for completion (async) |
|
|
96
|
+
|
|
97
|
+
### Autofill
|
|
98
|
+
|
|
99
|
+
> 💎 The Autofill API can only be used on behalf of users who are members of a Canva Enterprise organization.
|
|
100
|
+
|
|
101
|
+
| Operation | Description |
|
|
102
|
+
| --------- | ----------------------------------------------------------------------------- |
|
|
103
|
+
| Create | Populate a brand template with data and wait for the resulting design (async) |
|
|
104
|
+
|
|
105
|
+
### Brand Template
|
|
106
|
+
|
|
107
|
+
> 💎 The Brand Template APIs require a Canva plan with premium features (such as Canva Pro).
|
|
108
|
+
|
|
109
|
+
| Operation | Description |
|
|
110
|
+
| ------------------- | ----------------------------------------------- |
|
|
111
|
+
| Get | Get metadata for a brand template |
|
|
112
|
+
| Get Dataset | Get the autofill dataset for a brand template |
|
|
113
|
+
| Get Many | Get many brand templates accessible to the user |
|
|
114
|
+
| Publish _(Preview)_ | Publish a design as a brand template |
|
|
115
|
+
|
|
116
|
+
### Comment _(Preview API)_
|
|
117
|
+
|
|
118
|
+
> ⚠️ All Comment operations use a Preview API that may have unannounced breaking changes and cannot be used in public integrations submitted for Canva review.
|
|
119
|
+
|
|
120
|
+
| Operation | Description |
|
|
121
|
+
| ------------- | ------------------------------------------ |
|
|
122
|
+
| Create Reply | Reply to a comment thread on a design |
|
|
123
|
+
| Create Thread | Create a new comment thread on a design |
|
|
124
|
+
| Get Reply | Get a specific reply from a comment thread |
|
|
125
|
+
| Get Thread | Get metadata for a comment thread |
|
|
126
|
+
| List Replies | List all replies in a comment thread |
|
|
127
|
+
|
|
128
|
+
### Design
|
|
129
|
+
|
|
130
|
+
| Operation | Description |
|
|
131
|
+
| ----------------------- | --------------------------------------------- |
|
|
132
|
+
| Create | Create a new design |
|
|
133
|
+
| Get | Get metadata for a design |
|
|
134
|
+
| Get Dataset _(Preview)_ | Get the autofill dataset for a design |
|
|
135
|
+
| Get Export Formats | Get the available export formats for a design |
|
|
136
|
+
| Get Many | Get many designs from the user's projects |
|
|
137
|
+
| Get Pages _(Preview)_ | Get metadata for pages in a design |
|
|
138
|
+
|
|
139
|
+
### Design Import
|
|
140
|
+
|
|
141
|
+
| Operation | Description |
|
|
142
|
+
| --------------- | ---------------------------------------------------------------------------------------------- |
|
|
143
|
+
| Import From URL | Import an external file (e.g. PPTX, PDF) into Canva from a URL and wait for completion (async) |
|
|
144
|
+
|
|
145
|
+
### Export
|
|
146
|
+
|
|
147
|
+
| Operation | Description |
|
|
148
|
+
| ------------- | ---------------------------------------------------------------------- |
|
|
149
|
+
| Export Design | Export a design to a file format and wait for the download URL (async) |
|
|
150
|
+
|
|
151
|
+
### Folder
|
|
152
|
+
|
|
153
|
+
| Operation | Description |
|
|
154
|
+
| ---------- | ----------------------------------------------------- |
|
|
155
|
+
| Create | Create a new folder |
|
|
156
|
+
| Delete | Delete a folder |
|
|
157
|
+
| Get | Get metadata for a folder |
|
|
158
|
+
| List Items | List items inside a folder |
|
|
159
|
+
| Move Item | Move a design, asset, or folder to a different folder |
|
|
160
|
+
| Update | Rename a folder |
|
|
161
|
+
|
|
162
|
+
### Merge _(Preview API)_
|
|
163
|
+
|
|
164
|
+
> ⚠️ All Merge operations use a Preview API that may have unannounced breaking changes and cannot be used in public integrations submitted for Canva review.
|
|
165
|
+
|
|
166
|
+
| Operation | Description |
|
|
167
|
+
| ---------------- | ----------------------------------------------------------------------------------- |
|
|
168
|
+
| Create Merge Job | Merge design pages by applying page operations to create or modify a design (async) |
|
|
169
|
+
|
|
170
|
+
### Resize
|
|
171
|
+
|
|
172
|
+
> 💎 The Resize API requires a Canva plan with premium features (such as Canva Pro). Users on the Canva Free plan have access to a limited trial.
|
|
173
|
+
|
|
174
|
+
| Operation | Description |
|
|
175
|
+
| ----------------- | --------------------------------------------------------------------------------- |
|
|
176
|
+
| Create Resize Job | Create a resized copy of a design in new dimensions or a different format (async) |
|
|
177
|
+
|
|
178
|
+
### User
|
|
179
|
+
|
|
180
|
+
| Operation | Description |
|
|
181
|
+
| ---------------- | -------------------------------------------------------------- |
|
|
182
|
+
| Get Capabilities | Get the API capabilities available to the current user account |
|
|
183
|
+
| Get Me | Get the User ID and Team ID of the authenticated user |
|
|
184
|
+
| Get Profile | Get the display name of the authenticated user |
|
|
185
|
+
|
|
186
|
+
## Usage notes
|
|
187
|
+
|
|
188
|
+
### Async operations
|
|
189
|
+
|
|
190
|
+
Several operations — **Asset Upload From URL**, **Autofill**, **Design Import**, **Export**, **Merge**, and **Resize** — create background jobs in Canva. This node automatically polls for completion and returns the final result once the job succeeds.
|
|
191
|
+
|
|
192
|
+
You can tune polling behaviour with two optional parameters available on each async operation:
|
|
193
|
+
|
|
194
|
+
- **Poll Interval** (default 2–3 s depending on the operation) — how often to check for job completion
|
|
195
|
+
- **Max Wait** (default 60 s, or 120 s for Design Import) — maximum time to wait before throwing a timeout error
|
|
196
|
+
|
|
197
|
+
If a job fails, the node throws an error with the Canva error details.
|
|
198
|
+
|
|
199
|
+
### Preview APIs
|
|
200
|
+
|
|
201
|
+
Operations marked _(Preview)_ use endpoints that are still in preview on the Canva platform. They may change without notice and **cannot be used in integrations submitted to Canva's public integration review**. Use them only for internal or development workflows.
|
|
202
|
+
|
|
203
|
+
### Moving items
|
|
204
|
+
|
|
205
|
+
The **Folder → Move Item** operation accepts any item ID (design, asset, or folder). To move an item to the top-level Projects folder, use `root` as the **To Folder ID**.
|
|
206
|
+
|
|
207
|
+
### Autofill dataset format
|
|
208
|
+
|
|
209
|
+
The **Autofill → Create** operation requires a `data` object whose keys must match the dataset fields returned by **Brand Template → Get Dataset**. Use the Get Dataset operation first to discover the correct field names.
|
|
210
|
+
|
|
211
|
+
## Resources
|
|
212
|
+
|
|
213
|
+
- [Ready-to-import example workflows](./examples/)
|
|
214
|
+
- [n8n community nodes documentation](https://docs.n8n.io/integrations/community-nodes/)
|
|
215
|
+
- [Canva Connect API reference](https://www.canva.dev/docs/connect/api-reference/)
|
|
216
|
+
- [Canva Developer Portal](https://www.canva.com/developers)
|
|
217
|
+
- [Canva Developer Documentation](https://www.canva.dev/)
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ICredentialType, INodeProperties, Icon } from 'n8n-workflow';
|
|
2
|
+
export declare class CanvaOAuth2Api implements ICredentialType {
|
|
3
|
+
name: string;
|
|
4
|
+
extends: string[];
|
|
5
|
+
displayName: string;
|
|
6
|
+
documentationUrl: string;
|
|
7
|
+
icon: Icon;
|
|
8
|
+
properties: INodeProperties[];
|
|
9
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CanvaOAuth2Api = void 0;
|
|
4
|
+
class CanvaOAuth2Api {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = 'canvaOAuth2Api';
|
|
7
|
+
this.extends = ['oAuth2Api'];
|
|
8
|
+
this.displayName = 'Canva OAuth2 API';
|
|
9
|
+
this.documentationUrl = 'https://github.com/canva-sdks/n8n-nodes-canva/tree/main#credentials';
|
|
10
|
+
this.icon = {
|
|
11
|
+
light: 'file:../nodes/Canva/icons/canva.svg',
|
|
12
|
+
dark: 'file:../nodes/Canva/icons/canva.dark.svg',
|
|
13
|
+
};
|
|
14
|
+
this.properties = [
|
|
15
|
+
{
|
|
16
|
+
displayName: 'Grant Type',
|
|
17
|
+
name: 'grantType',
|
|
18
|
+
type: 'hidden',
|
|
19
|
+
default: 'pkce',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
displayName: 'Authorization URL',
|
|
23
|
+
name: 'authUrl',
|
|
24
|
+
type: 'hidden',
|
|
25
|
+
default: 'https://www.canva.com/api/oauth/authorize',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
displayName: 'Access Token URL',
|
|
29
|
+
name: 'accessTokenUrl',
|
|
30
|
+
type: 'hidden',
|
|
31
|
+
default: 'https://api.canva.com/rest/v1/oauth/token',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
displayName: 'Auth URI Query Parameters',
|
|
35
|
+
name: 'authQueryParameters',
|
|
36
|
+
type: 'hidden',
|
|
37
|
+
default: '',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
displayName: 'Scope',
|
|
41
|
+
name: 'scope',
|
|
42
|
+
type: 'hidden',
|
|
43
|
+
default: 'asset:read asset:write brandtemplate:content:read brandtemplate:content:write brandtemplate:meta:read comment:read comment:write design:content:read design:content:write design:meta:read folder:read folder:write profile:read',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
displayName: 'Authentication',
|
|
47
|
+
name: 'authentication',
|
|
48
|
+
type: 'hidden',
|
|
49
|
+
default: 'header',
|
|
50
|
+
},
|
|
51
|
+
];
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.CanvaOAuth2Api = CanvaOAuth2Api;
|
|
55
|
+
//# sourceMappingURL=CanvaOAuth2Api.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CanvaOAuth2Api.credentials.js","sourceRoot":"","sources":["../../credentials/CanvaOAuth2Api.credentials.ts"],"names":[],"mappings":";;;AAEA,MAAa,cAAc;IAA3B;QACC,SAAI,GAAG,gBAAgB,CAAC;QAExB,YAAO,GAAG,CAAC,WAAW,CAAC,CAAC;QAExB,gBAAW,GAAG,kBAAkB,CAAC;QAEjC,qBAAgB,GAAG,qEAAqE,CAAC;QAEzF,SAAI,GAAS;YACZ,KAAK,EAAE,qCAAqC;YAC5C,IAAI,EAAE,0CAA0C;SAChD,CAAC;QAEF,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,YAAY;gBACzB,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,MAAM;aACf;YACD;gBACC,WAAW,EAAE,mBAAmB;gBAChC,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,2CAA2C;aACpD;YACD;gBACC,WAAW,EAAE,kBAAkB;gBAC/B,IAAI,EAAE,gBAAgB;gBACtB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,2CAA2C;aACpD;YACD;gBACC,WAAW,EAAE,2BAA2B;gBACxC,IAAI,EAAE,qBAAqB;gBAC3B,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;aACX;YACD;gBACC,WAAW,EAAE,OAAO;gBACpB,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,QAAQ;gBACd,OAAO,EACN,kOAAkO;aACnO;YACD;gBACC,WAAW,EAAE,gBAAgB;gBAC7B,IAAI,EAAE,gBAAgB;gBACtB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,QAAQ;aACjB;SACD,CAAC;IACH,CAAC;CAAA;AArDD,wCAqDC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type IExecuteFunctions, type INodeExecutionData, type INodeType, type INodeTypeDescription } from 'n8n-workflow';
|
|
2
|
+
export declare class Canva implements INodeType {
|
|
3
|
+
description: INodeTypeDescription;
|
|
4
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
5
|
+
}
|