v0.4.5 - Documentation Improvements
📚 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:
- Install dependencies
- Configure environment
- Create API routes
- Wrap app with LatchProvider
- Use auth in components
- 🆕 Create app-specific auth helpers (lib/auth.ts) ← NEW
- Use helpers in components
- 🆕 Use wrapper in Server Actions & API routes ← NEW
- Protect routes
- Explore examples
📖 What You Get
lib/auth.ts example with:
getCurrentUser()- Cached, with database syncrequireAuth()- 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 wrapperCreates 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
- 📦 npm: https://www.npmjs.com/package/@lance0/latch
- 📚 Documentation: https://github.com/lance0/latch
- 🐛 Issues: https://github.com/lance0/latch/issues