Quick start
Create an editor, get a Test key, open a session from your server and mount the editor on your page.
1. Create your editor
Sign up, add your details and name your editor. Then pick a plan: every plan starts with a 15-day free trial (Checkout asks for a card and charges nothing until it ends). Every editor has a Test and a Live environment, each with its own keys and data. Test always allows localhost, and sessions there are free.
Using an AI coding agent? Connect it to Muzekit's MCP server and ask it to set up the editor in your app: it writes steps 3 and 4 for your stack.
2. Get a Test key
Your editor comes with a Test key: open API keys in the dashboard to copy it. It starts with mk_test_. Keep it on your server: it is a secret.
3. Open a session from your server
curl https://api.muzekit.com/v1/sessions \
-H "Authorization: Bearer $MUZEKIT_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{ "user": { "id": "user_42", "name": "Ada" }, "mode": "design" }'The response carries a single-use client_secret that is valid for 10 minutes, and the editor_url:
{
"object": "session",
"id": "ses_…",
"client_secret": "ses_…_secret_…",
"editor_url": "https://editor.muzekit.com/session",
"expires_at": "2026-10-16T21:45:00.000Z",
"mode": "design",
"user": { "object": "user", "id": "usr_…", "external_id": "user_42" }
}Your user is created on the first session and updated on later ones, matched by your own user.id.
4. Mount the editor
Add the browser SDK to your page and give it a way to get a client secret from your server. The SDK loads the editor in an iframe and hands it the secret by message, to the editor's own origin only, so the secret never appears in a URL.
<div id="editor" style="height: 720px"></div>
<script src="https://muzekit.com/sdk/v1.js"></script>
<script>
const editor = Muzekit.mount("#editor", {
// Called each time the editor opens; return a fresh client secret.
fetchClientSecret: () =>
fetch("/api/muzekit-session", { method: "POST" })
.then((r) => r.json())
.then((s) => s.client_secret),
on: {
ready: () => console.log("Editor ready"),
save: (e) => console.log("Saved", e.template, e.revision),
error: (e) => console.error(e.code, e.message),
},
});
</script>Pass clientSecret instead of fetchClientSecret when you already have one; it works once, since secrets are single use.
| Event | When | Detail |
|---|---|---|
ready | The editor is open | mode, template |
save | A save finished | template (tpl_…), revision, created (true when the save made a new template) |
error | The editor could not open, or a session refresh failed | code, message |
editor.save() asks the editor to save now, and editor.destroy() removes it from the page.
With a Test key, localhost and 127.0.0.1 on any port are always allowed, and those sessions are free. To go live, make a Live key (mk_live_), add your app's domain to Live under Allowed domains (the editor opens only inside pages on those exact origins) and use Copy to Live to move your templates, look and features.
5. Read what your users make
Templates your users save belong to them and are listed with GET /v1/templates?user=usr_…. Read a template's document with Get a document.