Spaces, members and contact forms
A space is a named place for posts, and it decides who can read it and who can write to it. You create spaces in the console (the site's Spaces card); your site's code names the one it shows, as in <PostList space="contact" />.
Who can read, who can write
| Who can read | What it means |
|---|---|
Everyone (public) | Anyone can read. Fine for server rendering, OGP and the sitemap. |
Members (members) | Only members and your admins. Everyone else gets "not found", and the space is not listed for them. |
Participants only (participants) | Only the person who started a thread and your admins (replies included). For example, a contact form. |
| Who can write posts | What it means |
|---|---|
Admins (admins) | Only the owner and editors. |
Members (members) | Members and admins. |
Any signed-in reader (signedIn) | Every signed-in reader. |
People who can't read a space can't write to it, so a members-only space can't be writable by every signed-in reader. Replies follow the same rule as the post they belong to.
Readers who are not admins can't save drafts or choose a slug, collection, tags or reply policy. The space's defaults apply. They can edit the title and body of their own post and delete it. Admins can delete any post.
The console has templates for the common cases: News / DevLog, Short posts, Guestbook, Members-only blog and Contact. They only fill in the form; after that, a space is just a space.
Post types
Each space also picks a post type for its posts, which decides their shape: the built-in fields (title, slug, excerpt, tags and attachments, each required, optional or none; posts without a slug are referenced by ID) and your own fields. New sites get two types, post (title optional, with a slug) and reply (body and attachments), and a space created without choosing uses them. Choose the type when you create or edit a space in the console; the templates bring their own type (for example News / DevLog uses a type with a required title).
GET /v1/spaces(client.listSpaces()) returns each space'srootType,replyTypesanddefaultReplyType. The default editor shows the title and slug fields only when the root type uses them.- Every post carries its
typeKey. A post keeps the type it was created with, even if the space's type changes later. - Replies stay in the thread's space, and
createPostnames it asspacefor replies too (another space is refused with400 SPACE_MISMATCH). A reply can use any reply type the space allows (typeKeyoncreatePost); without one it usesdefaultReplyType. Any other type is refused with400 POST_TYPE_NOT_ALLOWED.
Types can also carry your own fields; see Post types.
What non-members see
For a members-only space you choose what everyone else sees:
- Nothing (the default): the space isn't listed and every request gets "not found".
- Titles, excerpts and dates only: posts come back with their title, excerpt, date and the author's display name (no avatar, bio or links), an empty
bodyandlocked: true. Use it to show a teaser and invite people to join. The excerpt is whatever an admin wrote in theexcerptfield; Knit never builds one from the body. In the default editor, admins type it into the Excerpt field (excerptoncreatePost/updatePostin the API). The default post card shows a "Members only" label and the excerpt. Replies and attachments stay hidden.
generateKnitPostMetadata follows the same rule: for a locked post, or any post in a space that isn't public, it builds no title, description or image from the body and asks search engines not to index the page. Leave members and participants spaces out of your sitemap and don't render them on the server for signed-out visitors. Without a session token, the server client only ever receives what a signed-out visitor can read.
Widening who can read
Changing a space so that more people can read its existing posts (for example Participants only to Everyone, or Members to Everyone, or turning on "titles, excerpts and dates only") needs confirmation. Without it the API answers 409 SPACE_WIDEN_UNCONFIRMED and puts the number of posts and replies in details. The console and the site management panel show those counts and who will be able to see the posts, then resend the change with confirmWiden: true and confirmedFrom (the details.from and details.fromLockedMode of the 409). If someone else changed the space while the confirmation was open, the API answers 409 SPACE_SETTINGS_CHANGED instead of applying a wider change than the one that was confirmed. If you build your own management UI, do the same with client.updateSpaceSettings(key, { readableBy, confirmWiden: true, confirmedFrom: { readableBy: details.from, lockedMode: details.fromLockedMode } }). Narrowing needs no confirmation.
Admin labels
Admins can put labels on a post to keep track of it, for example open and replied on contact messages. Labels are separate from the readers' tags: only the site's admins ever receive them, so readers can't see or set them. In the post editor, admins get an Admin labels field (comma-separated, up to 10 labels of 32 characters). To list posts with a label, pass adminLabel to client.listPosts({ space, adminLabel: "open" }); the filter works for admins only. The same editor has an Excerpt field for admins (see What non-members see).
Contact forms
Replies follow each post's reply policy. If a space's reply policy is closed, readers can still send text messages to a contact space, but nobody can reply to them (existing replies stay visible and can still be reported).
Create a space from the Contact template (readable by participants, writable by any signed-in reader) and show it with PostList and PostEditor.
"use client";
import { KnitProvider } from "@knit/react";
import { PostEditor, PostList } from "@knit/react/ui";
// A space whose "who can read" is "participants": each signed-in reader sees their own
// messages and the replies to them, and your admins see everything.
export function ContactPage() {
return (
<KnitProvider
publishableKey={process.env.NEXT_PUBLIC_KNIT_PUBLISHABLE_KEY ?? ""}
apiUrl={process.env.NEXT_PUBLIC_KNIT_API_URL ?? ""}
>
<PostEditor space="contact" onSaved={() => window.location.reload()} />
<PostList space="contact" />
</KnitProvider>
);
}Readers see the messages they sent and your replies. You see every message and reply from the site itself. Nothing is returned to signed-out visitors or to other readers. Keep the space out of your sitemap and don't render it on the server for signed-out visitors.
Members
Members can read the spaces that are for members only. In the site's ⚙ menu, open the Members tab, search the readers who have signed in to your site, and add them. You can set an expiry date: once it has passed, the person is no longer a member. Removing a member doesn't delete their posts.
Members are added by hand for now. Inviting by link and members who pay you are not available yet.
Plans
Spaces that are not public (members or participants only) need a paid plan. On Free they can't be created and members can't be added. Personal and Team have no limit on how many you create.
If a site moves down to Free, its non-public spaces stay as they are (they are never made public), but new posts, replies and members are refused with PLAN_LIMIT_SPACES. Existing posts stay readable by the same people.
Attachments
Images attached to posts are served from /media/... without a sign-in. The address is a random string that can't be guessed, but anyone who has the address can open the image, even if the post is in a members-only or participants-only space. Knit does not protect attachments in those spaces. Don't ask people to attach anything that must stay private.
Reports
When a reader reports a comment, its text goes to the site's admins and to Knit's operators, who review reports across sites. Knit's operator console shows only the text of reported comments; it does not show other posts from members-only or participants-only spaces. The report dialog tells readers this before they submit.
Privacy
Posts in participants and members spaces are personal data of your readers. A few things to know:
- Posts are not deleted automatically. The owner and the author can delete a post. When a reader deletes their account, their name is anonymized and their posts stay.
- Keep
participantsandmembersspaces out of server rendering, OGP and your sitemap, and don't pass a session token to the server client for them, so their text is not left in HTML or caches. Without a session token the API returns nothing from them to the server.generateKnitPostMetadataalso builds no title, description or image from a post in a non-public space and asks search engines not to index it. - Attachments are readable by anyone who has the address (see above).
- The site export includes these spaces. Its
spaceslist marks each space that holds readers' personal data (containsPersonalData); treat those posts as personal data. - The site export is raw data: each post and reply has its
typeKeyand storedfields(a post'smarkdownWithFrontmattercarries them in its frontmatter too), including values of fields removed from the type, and built-in fields a type marksnone(such astitleandslug) are exported as stored.
Example privacy policy wording
Adapt this to your site and have it reviewed:
Messages sent through the contact form and members-only posts. When you sign in and send a message, or post in the members area, we store your name or handle, your message and the time you sent it. Only you and our staff can read a message you sent through the contact form. Members-only posts can be read by members and our staff. We use this information only to answer you and to run the site, and we keep it until you or we delete it. You can ask us to delete your messages. If you delete your account, your name is removed from the messages and the messages may remain. Images you attach are stored with our service provider and can be opened by anyone who knows their address. Comments you report are shared with our service provider, Knit, which reviews reports.