nc-event

Render Nostr events with automatic media detection

npm version Zero dependencies Bundle size Tests
GitHub npm

Playground

Paste a URL or try an example to see media detection in action

Try these examples:
🔍
Enter a URL above or click an example

Why nc-event?

Zero Dependencies

Uses bundled Preact (~3KB). Nothing to install, no node_modules bloat.

Smart Detection

Recognizes 30+ file formats plus YouTube, Spotify, Vimeo, and more.

No Build Step

Pure ES modules. Works directly in browsers, CDN-ready.

Fully Tested

88 unit tests covering edge cases, based on NIP-XX guidelines.

Quick Start

import { html, render } from 'https://unpkg.com/nc-event/js/standalone.module.js' import Event from 'https://unpkg.com/nc-event/lib/index.js' const event = { pubkey: "npub1...", content: "Check this out! https://example.com/photo.png", kind: 1 } render(html`<${Event} event=${event} />`, document.body)

More Examples

📷
Single Image
🌄
Image Gallery
🎥
Video
▶️
YouTube
🎵
Playlist