Sharing Documents with Share Links

Generate unique share URLs for any document in your vault, with optional password protection, expiry dates, and per-link view limits to control exactly who can access your content and for how long.

beginner10 min read

What You'll Learn

Share links let you generate a unique URL for any document in your vault and distribute it to anyone — no Lifestream Vault account required on the recipient's end. Each link can optionally carry a password, an expiry date, and a maximum view count, giving you precise control over access.

By the end of this guide you will be able to:

  • Create view-only and edit share links for any document
  • Add password protection and expiry dates to sensitive shares
  • Understand how recipients access a shared document
  • List all active share links for a document and revoke them when no longer needed
Plan Required

Free tier supports view-only share links. Pro and Business tiers unlock edit permission, password protection, expiry dates, and per-link view limits.

Prerequisites

  • A Lifestream Vault account (any tier for basic view-only sharing)
  • Node.js 18+ if following the SDK or CLI examples

How Recipients Access a Share Link

Recipients access shared documents through the public share endpoint — no Lifestream Vault account or authentication token is required.

Endpoint: GET /api/v1/public/share/:token

  • If the link has a password, the recipient must include the X-Share-Password header with the correct value.
  • The response includes the document's content, title, frontmatter metadata, and the share link's permission level.
  • If the link has expired or reached its maxViews limit, the endpoint returns 404.
typescript
// Recipients can open the share URL directly in any browser —
// no SDK or account required.
//
// Share URL format:
//   https://vault.lifestreamdynamics.com/share/<TOKEN>
//
// The Lifestream Vault web UI handles password prompts and
// renders the document automatically.

Share links work for anyone with the URL — no Lifestream Vault account required. Recipients with "edit" permission can modify the document directly through the shared link without logging in.

List and Revoke Share Links

You can retrieve all active share links for a document at any time, and revoke any link by its ID. Listing returns each link's metadata — including hasPassword, viewCount, and expiresAt — but never re-exposes the raw token.

typescript
// List all share links for a document — returns an array of ShareLink
const shareLinks = await client.shares.list(
  'your-vault-id',
  'notes/my-doc.md',
);

for (const link of shareLinks) {
  console.log(`ID: ${link.id}  permission: ${link.permission}  views: ${link.viewCount}  hasPassword: ${link.hasPassword}`);
}

// Revoke a specific share link by ID
const shareIdToRevoke = shareLinks[0].id;
await client.shares.revoke('your-vault-id', shareIdToRevoke);
console.log('Share link revoked.');

Revoking a share link is permanent and immediate. Anyone who attempts to open the URL after revocation will receive a 404. There is no undo — if you need to re-share the document, create a new link.

Tips & Best Practices

  • Set expiry dates on sensitive documents — expired links return 404 automatically, so you do not need to remember to revoke them manually.

  • Use maxViews for one-time shares — set maxViews: 1 to create a single-use link that self-disables after its first access, ideal for sending confidential drafts.

  • Password-protect sensitive content — add a password to links containing private or confidential information. Recipients must know the password to view the document, even if they have the URL.

  • Audit share links periodically — use the list endpoint (or Vault → Document → Share Links in the UI) to review active links and revoke any that are no longer needed.

  • Edit permission allows document modification — a recipient with "edit" permission can change the document's content through the share link without an account. Grant edit permission only to trusted collaborators.

  • Share links are per-document — each link is scoped to a single document path. To share multiple documents, create individual links for each one. There is no vault-wide share link.

What's Next

  • Build a Documentation Site — publish an entire vault as a public documentation site with a custom domain, navigation, and branding
  • Collaborative Writing — invite team members to co-edit documents in real time using Yjs-powered collaborative editing
  • API Keys & Scoping — create scoped API keys for programmatic access to your vault, including fine-grained permission control and zero-downtime key rotation