Skip to content

v0.4.5 - Documentation Improvements

Choose a tag to compare

@lance0lance0 released this 17 Nov 17:42
· 6 commits to master since this release

📚 Better Developer Onboarding

This release improves documentation to make production best practices more discoverable.

✨ What Changed

Wrapping Pattern in Quick Start:

The recommended production pattern is now prominently featured in the Quick Start guide (step 6), not hidden in advanced sections.

New Quick Start Flow:

  1. Install dependencies
  2. Configure environment
  3. Create API routes
  4. Wrap app with LatchProvider
  5. Use auth in components
  6. 🆕 Create app-specific auth helpers (lib/auth.ts) ← NEW
  7. Use helpers in components
  8. 🆕 Use wrapper in Server Actions & API routes ← NEW
  9. Protect routes
  10. Explore examples

📖 What You Get

lib/auth.ts example with:

  • getCurrentUser() - Cached, with database sync
  • requireAuth() - Authentication guard
  • JIT user provisioning pattern
  • Request-level caching with React cache()

Why this matters:

  • ✅ Prevents common mistakes (using Latch helpers everywhere)
  • ✅ Shows how to centralize auth logic
  • ✅ Demonstrates database integration
  • ✅ Makes testing easier

🚀 Generate with CLI

npx @lance0/latch-cli scaffold --type wrapper

Creates lib/auth.ts with recommended pattern ready to customize.

📦 Notes

  • No code changes - documentation-only release
  • Version bump to align with recent releases (v0.4.3 → v0.4.5)
  • v0.4.4 was CLI improvements

📖 Links