Loading...
Loading...
Use when calling the CloudCannon API from code — constructing a client, finding a site or organisation UUID, reading or writing files on a hosted site programmatically, triggering and inspecting builds, or reaching a CloudCannon endpoint the CLI has no command for (DAMs, backups, sync history, site scans, screenshots, provider connections, copying or deleting a site).
npx skill4agent add cloudcannon/agent-skills cloudcannon-sdk@cloudcannon/sdkfetchsite.copysite.deletecloudcannon-clicloudcannon devcloudcannon-dev-servercloudcannon.config.ymlcloudcannon-configurationcloudcannon-visual-editingcloudcannon-snippetscloudcannon-clisite.delete()site.delete()site.copy()disconnectSourceProvider()disconnectOutputProvider()client.fetchPOSTengines"type": "module"import CloudCannonClient from "@cloudcannon/sdk";import CloudCannonClient from "@cloudcannon/sdk";
// The SDK reads no credentials of its own — you supply them.
const client = new CloudCannonClient({
userAccessKey: {
id: process.env.CC_ACCESS_KEY_ID,
secret: process.env.CC_ACCESS_KEY_SECRET,
},
});
const { items: orgs } = await client.orgs();
const { items: sites } = await client.org(orgs[0].uuid).sites({ filters: { search: "my-site" } });
const site = await client.site(sites[0].uuid).get();| File | Covers |
|---|---|
| SKILL.md (this file) | Routing, the write gate, requirements |
| client.md | Constructing the client, the config shape, and why it reads no credentials itself |
| resources.md | The sub-client hierarchy, UUID addressing, pagination, return types |
| api-surface.md | Reading the authoritative method list, and the raw |
| editing-sessions.md | Writing files to a hosted site through the SDK |
| troubleshooting.md | Symptom → cause → fix |
| Excuse | Reality |
|---|---|
"I'll pass the site name to | Sub-clients take a UUID only. Resolve it first — resources.md § Addressing a resource. |
" | There is no such method. Sites are listed per organisation. See resources.md. |
"The SDK will pick up my | It reads nothing from disk or the environment. That chain is a CLI feature — client.md. |
| "I'll write out the method signatures from memory." | Signatures change between releases. Read them from the installed package — api-surface.md. |
" | It gives you a |
| "The list came back, so that's all of them." | Paginated endpoints return one page. Check |
" | The gate is about the endpoint, not the wrapper. A |