Share by public link
One toggle gives you a read-only URL anyone can open without a sweetdocs account. Optional expiry date. No password support in v1.
The fastest way to share a doc with anyone — no sweetdocs account required — is the public link. One toggle, one URL, read-only view.
Turning it on
- Open the document
- Click Share in the doc toolbar
- Switch to the Link tab (it’s beside the People tab)
- Check Anyone with the link can view (read-only)
A URL appears in the format:
https://my.sweetdocs.app/share/{token}
The token is 24 random bytes, URL-safe base64-encoded. It’s a one-way identifier — there’s no way to derive the document ID from it, no enumeration, no incremental guessing.
Click Copy to copy the URL to your clipboard.
What viewers see
When someone opens the URL in their browser:
- A read-only render of the document, using the same Markdown pipeline as your Preview mode (
marked+ DOMPurify + color swatches) - The sweetdocs viewer chrome on the page (title, doc body, footer)
- No editing surface, no comments panel, no history, no AI button
- No sign-in prompt — they don’t need an account
If the link is invalid, revoked, or expired, the viewer shows:
Link unavailable This share link is invalid, has been revoked, or has expired.
Setting an expiry
Below the URL field is an Expires date picker. Pick any date. The link stops working at the end of that day (23:59:59 in the user’s timezone).
The expiry is enforced both at the database layer (RLS policy) and the viewer layer (a defensive recheck after the row is fetched). The link is dead the moment it expires — no grace period.
Click clear next to the date picker to remove the expiry (link will live until you explicitly turn it off).
Turning it off
Uncheck the Anyone with the link can view box. The dialog confirms:
Turning this off permanently disables the current link.
The token is invalidated. Anyone who tries to use that URL gets the “Link unavailable” page. Re-enabling later creates a fresh token — the old URL never works again, even after re-enabling, so you can’t accidentally undo a revocation.
Sharing folders
Public links are document-only — folders can be shared with specific people or groups via the People tab, but they don’t have a public link. If you want public access to a collection of docs, share each one’s link individually.
Permissions
Toggling the public link requires the Manage access level on the document (see Permissions). Owners always have Manage; collaborators with read or write access can’t change the public link state. The dialog shows:
You need Manage access to change the public link.
…in that case.
Realtime updates
The share dialog subscribes to changes on the document row. If another tab or device toggles the public link, the dialog updates instantly — no refresh needed.
What’s not in v1
| Missing | Notes |
|---|---|
| Password protection | The link itself is the credential; protect it with care |
| View counts / analytics | Not surfaced in the dialog (the audit log records view events; see Audit log) |
| Custom branded landing page | The viewer uses the sweetdocs theme + footer |
| Allow-listing specific domains or IPs | Not configurable |
| Allow comments / suggestions from public viewers | Read-only only |
| Permanent / never-expires opt-in confirmation | Default is no expiry — explicit opt-out, not opt-in |