🔐 Nostr Authentication Examples

Explore different approaches to Nostr authentication and relay integration

📚 Resources:

📖 NIP-42 Authentication Specification 🔗 GitHub Repository 📋 README Documentation
📋 NIP-42 AUTH Demo

Raw HTML - NIP-42 AUTH with NIP-07 Extension

Raw HTML page with vanilla JavaScript that connects to ws://localhost:3334 using a NIP-07 browser extension (like Alby or nos2x), performs NIP-42 authentication, and publishes a kind 30078 event. Copy file and save as .html file to run it in browser.

🔌 NIP-07 Example

Astro - Basic Vanilla js Integration

Demonstrates direct NIP-07 browser extension integration for Nostr authentication. Shows how to connect with extensions like Alby, nos2x, or other Nostr signers without additional abstractions.

⚡ Advanced Auth Example

Astro - TypeScript - Full-Featured Authentication

Complete authentication system with advanced features like relay management, event publishing, subscription handling, and comprehensive error handling. Best for production use.

🚀 Simple Auth Example

Astro - Minimal Authentication

Streamlined example using the reusable NostrAuth composable. Perfect for getting started quickly with basic authentication and publishing functionality.