Getting Started
Get your first asset live in under five minutes.
Create a project
From the Projects page, click New Project and give it a name. Each project has its own isolated set of assets and API keys.
Grab your API key
Open your project's Settings page and generate your API keys. Create a Secret key for server-side access including writes and draft content, and a Client key for read-only access to published content.
| Type | Returns drafts? | Use in |
|---|---|---|
| Secret | Yes | Trusted server-side environment. Allows writes and returns drafts, so keep secure |
| Client | No. Published only | Read-only, published content only. Built to ship in client-side code — see the note below for what that does and does not mean. |
No staging environment? A preview token passed alongside your Client key temporarily unlocks draft content for that session — so you can proof changes on your live site without a separate staging setup. See Live Preview for details.
Create your first asset
Go to Assets and click New Asset. Choose a type (Text, JSON, Image, HTML), enter a unique tag — this is the key you'll use in API calls — and save.
Fetch your assets
Make a single GET request to retrieve all published assets for your project. Pass your API key in the x-api-key header.
const res = await fetch('https://api.duggiecms.com/v1/content', {
headers: { 'x-api-key': 'YOUR_API_KEY' }
});
const { assets } = await res.json();
console.log(assets['hero-heading']); // 'Welcome to our site'What you get back
- Text and HTML — a plain string, ready to use.
- JSON — also a string. Parse it yourself with
JSON.parse(); it is not decoded for you. - Images — an object of URLs keyed
original,large,medium,thumb. See Limits for sizes and when a variant is absent.
Secret keys are server-only — Client keys are safer to expose
Secret keys must never leave your server — they allow writes and return draft content.
Client keys are read-only and return only published content — they are safe to include in client-side code and public repositories. The worst outcome of an exposed Client key is that someone reads your published content, which is already public by design. That said, store it in an environment variable rather than hardcoding it so you can rotate without a code change.
Next steps
- Explore the full endpoint options in API Reference
- Learn about asset types and statuses in Assets
- Set up real-time content preview in Live Preview