
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeYou're correct that documents with a dot (.) in their ID become private in Sanity! This is an important architectural feature that's well-documented.
How the dot-prefix privacy works:
Any document ID containing a . (dot) is considered private and has restricted accessibility. According to the IDs and Paths documentation, these documents can only be accessed when:
read permission is provided for client/HTTP API callsThe root path (IDs without dots, like myDocument) is publicly accessible, while all subpaths (IDs with dots, like secret.myDocument or drafts.myDocument) are private.
Your secret. singleton pattern:
This is actually a clever use of Sanity's ID system! By using a prefix like secret.mySettings, you're creating a document that:
drafts. and versions. prefixesImportant considerations:
Avoid drafts. and versions. prefixes - The documentation specifically advises against creating custom documents with these prefixes as they're used internally by Sanity and may interact with platform functionality in unexpected ways.
Your custom prefix is fine - Using secret. or any other custom prefix (like config., private., etc.) is a valid approach for private documents.
Token requirements - If you ever need to access these documents from client-side code or external APIs, you'll need to provide an authenticated token with appropriate read permissions.
Alternative approaches - For more granular control, consider using Sanity's custom access control rules, which give you fine-grained permission control without relying solely on the dot-prefix convention.
Dataset considerations - Remember that this privacy mechanism works with Sanity's default access control rules. If you have a completely private dataset, all documents are already protected regardless of their IDs.
This is a practical pattern for singleton configuration documents, settings, or secrets that should only be accessible to authenticated Studio users!
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.
Content operations
Content backend


The only platform powering content operations
By Industry


Tecovas strengthens their customer connections
Build and Share

Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag store