Camlin Server
AvailableCamlin Server tools are live in Create chat for signed-in makers: list your Server apps by name, create one, define a collection, read and write documents, key-value entries, counters and the inbox, send a saved notify, read usage. Every write waits on a confirm bar. Nothing publishes by itself.
A plugin is a specialist Create can call. Camlin Server is the one for shared data on a creation: your Server apps, a collection such as a leaderboard, who may read and write it, the documents in it, key-value entries, counters, the inbox, a saved notify, a secret, an allowed host, a schedule, an inbound endpoint, functions, and a usage reading. These are tools Create calls for you in the chat, as you — they act only on Server apps you own or have been given. Asking alone does not publish anything.
What it is
- Createcamlin.server on the page · the chat plugin
- Camlin ArchitectServer nodes on interactions and apiFlows
- Operate · Admin Consoleproject view, usage, moderation
- One Camlin Server projectprod and preview environments
- Collections · key-value · counterssecrets · allow-hosts · schedules · endpoints · functions · assets
Camlin Server is shared storage and a function runner for a creation, separate from pieces that stay only in your browser. A Server app (a project) holds collections — named lists of records such as scores, bookings, a guestbook — with rules for who can read and who can write, plus key-value entries, counters, an inbox, secrets, allowed hosts, schedules, endpoints and functions.
Create offers Server when you ask for that kind of data — a leaderboard, “my server app”, cloud saves, saving or loading data, a collection, high scores, progress that syncs across devices, a shared counter, the inbox. You do not pick it from a menu. Once a creation has used Server it keeps the tools for the rest of that session, and a creation with a Server app keeps them on every turn — so pressing Confirm on a bar is always acted on. Create never invents an app id: it lists your apps first, and if you have none it says so and offers to make one.
What you can ask
You stay in the same chat. Reads happen as part of the conversation; every write shows a confirm bar first.
- “Which Camlin Server apps do I have?” Create lists them by name. With none, it says so and offers to make one for this creation.
- “Make a Server app for this game.” Creates an app owned by you and tells you its name.
- “What collections are on it?” Lists the collection names.
- “Make a shared leaderboard for this game.” Defines the collection and its rules — confirm bar first.
- “Show me the top scores.” Queries the collection, optionally where a field equals a value, up to a limit. “Show me the record for Sam.” Reads one document.
- “Add this score: Sam, 120.” Writes a document — confirm bar first.
- “What is the game set to?” / “Set the game to hard mode.” Reads or writes a key-value entry — the write waits on the bar.
- “Bump the play counter.” Adds one to a named counter and tells you the new number — confirm bar first.
- “Leave a note in the inbox.” Writes a message into the app’s inbox, the same inbox a Camlin Connect assistant writes to — confirm bar first.
- “Send my order notify.” Sends a notify template you already saved on the app, to the address it was saved with — confirm bar first. If the app has no email sender or no such template, Create says so.
- “Keep a secret for this app.” The value is stored; it is not shown back in the chat. “Allow this site as a host the creation can call.” “Check usage for this app.” That read does not change anything.
What Create needs for each ask
Every ask names the app (Create finds it by name, or makes one) and, for anything but prod, the environment — prod or preview. The rest is what the confirm bar will show you before it acts.
- A new app — a name. Nothing else; the app is owned by you.
- A collection, or a change to its rules — the collection name, who may read (public, owner or token), who may write (owner, token, moderated or public), and up to two fields to index for queries. A public write also needs a rate (at least a second between writes), a daily cap and a field schema — Create asks for the three together, or refuses.
- A document — the collection name and the JSON body; an id if you want to replace one record. A query — the collection name, an optional where (fields equal to a string, a number or true/false) and a limit from 1 to 100 (20 if you say nothing). One record — the collection name and its id.
- A key-value entry — the key and, to set it, the JSON value. A counter — its name. The inbox — the message body (the collection is inbox unless you name another).
- A notify — the name of a template already saved on the app. It goes to the address the template was saved with, never to one typed in the chat.
- A secret — a name and the value. An allowed host — an alias and one https origin. A schedule — every how many seconds (60 or more) and a tick or a notify template. An inbound endpoint — hmac or an API key, and whether it records the body, sends a notify or starts an existing flow. Functions — a name and the files (up to 200). Usage — just the app.
Confirm before it lasts
Listing your apps, creating one, listing collections, reading a document, a query, a key-value read and a usage reading happen as part of the conversation. Writing a document, a key-value entry, a counter, the inbox, a notify, a collection, a rule, a secret, a host, a schedule, an endpoint, or deploying a function waits on a confirm bar first. Confirm saves that change. Cancel leaves things as they were. Nothing publishes by itself.
Public writes
- Visitor writesput({ body })
- Rate10 seconds between writes
- Schemaevery field checked
- Daily cap1000 a day by default
- Stored live
- Heldon a moderated collection
- Refusedthe call rejects with the reason
A collection can allow public writes — a visitor adding a score or a guestbook line — only with three limits together: a rate limit, a schema that checks each field, and a daily cap on how many writes the app accepts. Stricter checks, including your own functions, are not part of this. Create will not write user code for you.
- Rate — 10 seconds between writes for one visitor, and for one connection, unless you set another (at least a second).
- Schema — every field named, a maximum length for a string or a maximum for a number; a write with an unexpected or missing field is refused.
- Daily cap — 1000 writes a day unless you set another. A moderated collection holds each visitor write until you set it live; the Admin Console lists the queue.
From a creation page
- Your pagecamlin.server.collection(…).put(…)
- Create pageattaches the visitor token
- Camlin Serverchecks the collection rules
- Collectiondocument stored or returned
A creation page already has camlin.server on window — no import. Every call takes the projectId of an existing Camlin Server app and an optional env of prod (the default) or preview, and returns a Promise. Ask the maker for the shared thing and it writes these calls with a projectId it was given — never one it invented.
Reads, writes, counters and fetch run as a visitor. After the page loads, the Create page mints a visitor token for that project and attaches it to those calls — the visitor token is never in the shared page’s HTML, and the creation frame never holds a token of any kind. The collection’s own rules still decide: a public write needs the rate limit, field schema and daily cap set on the collection, and a collection that is not public refuses a visitor. A refused call rejects its Promise with the server’s reason and nothing is written.
- camlin.server.collection(name).get({ projectId, docId }) reads one document. .list({ projectId, where, limit }) queries with a where object on indexed fields; limit defaults to 20 and takes up to 100; the reply is { docs }. .put({ projectId, id, body }) writes a document (id is optional) and returns it with its status.
- camlin.server.kv.get, kv.set and kv.list read and write key-value entries by key — from a page, each visitor has their own.
- camlin.server.counter.inc({ projectId, name }) adds one and returns the new number — once per visitor per counter.
- camlin.server.fetch({ projectId, alias, path, headers }) calls an allowed host through the server’s proxy.
- camlin.server.collection(name).delete({ projectId, docId }) and camlin.server.notify({ projectId, name }) run as the signed-in maker, so they work while the maker is signed in to Create and are refused on a share page. notify sends the named template to the maker’s own verified email only.
- Stage 2 functions are the same: store a version with camlin.server.deploy({ projectId, name, files }), then run it with camlin.server.invoke({ projectId, name, event }) — { result }, or { jobId } with async: true. The warm pool is shared. Paid Create tiers and per-app runners are not open.
Example
“Add a leaderboard other people can write to.”
const board = camlin.server.collection('leaderboard');
await board.put({ projectId, body: { name, score } });
const { docs } = await board.list({
projectId, where: { level: 3 }, limit: 10,
});The collection must already be defined on the app with a public or moderated write rule; the Create page attaches the visitor token. The full set of examples — save a record, query, key-value and counters, inbox and notify, uploads, functions — is on Help & features under Camlin Server.
With a Camlin Connect assistant
When a Camlin Connect assistant you made in Create is approved for publishing, the Server apps that assistant used from this chat are shared with your home team in Camlin Architect, so its flows and the Operate page can read the same data. You keep ownership; the creation page keeps working.
What stays in the browser
Pieces that only need to remember something on this device keep using browser-local storage. Browser storage stays in the browser. Camlin Server does not replace that.
If something fails
- Not signed in — the Server tools are for signed-in makers, and a page’s delete, notify, deploy and invoke answer “Sign in before calling Camlin Server.” Sign in and ask again.
- No app yet — Create says so and offers to make one. It never invents an app id.
- “Collection not found” — define it first (“make a collection called bookings…”), or check the name with “what collections are on it?”.
- “This collection is owner-write” or “Visitors cannot …” — the page is running as a visitor and the rule does not allow that. Change the write rule to public (with its three limits) or moderated, or do that write from the chat as yourself.
- “Filter … is not an indexed field” — a query can only filter on the collection’s indexed fields (up to two). Add the field to the indexes or filter on the page.
- A public write is refused as too soon, too many, or with a field problem — the collection’s rate, daily cap or schema said no. The rejection names which.
- A notify did not send — the template must exist on the app and the app must have an email sender; Create says which is missing and does not retry.
- You press Cancel on the confirm bar — nothing is written. The app, its collections and its data stay as they were.