
Enable nostr protocol based comment system on your Nuxt 4 based applications.
Features
- Nostr-powered comments for Nuxt Content blog posts
- NIP-07 login prompt if user is not authenticated
- Comments are written in Markdown and rendered via @nuxt/content's ContentRendererMarkdown
- Configurable relay list and tagging strategy
Quick Setup
Install the module to your Nuxt application with one command:
npx nuxi module add @threenine/nuxstr-comments
That's it! You can now use Nuxstr Comments in your Nuxt app ✨
Usage
- Ensure @nuxt/content is enabled and your blog post pages use ContentDoc or render content files.
- Add the comments component where you want comments to appear (usually below a ContentDoc):
<template>
<div>
<ContentDoc />
<NuxstrComments />
</div>
</template>
By default, the component tags comments by the current route path (e.g., content:/blog/my-post) and fetches them from configured relays.
- Configuration (nuxt.config.ts):
export default defineNuxtConfig({
modules: [
'@nuxt/content',
'@threenine/nuxstr-comments',
],
nuxstrComments: {
relays: ['wss://relay.damus.io', 'wss://relay.nostr.band'],
tagStrategy: 'path',
tagPrefix: 'comment:',
},
})
Select your preferred relays from the list of relays and configure the tag strategy and tag prefix.
When a user attempts to post, they will be prompted to log in with their Nostr browser extension NIP-07.
Comments are published as kind: 1111 as defined in NIP-22
notes tagged with a t
tag containing the content tag (e.g., comment:/blog/my-post
).
Replys to comments are enable, and are also published as kind: 1111, as defined in NIP-22
Contribution
Local development
npm install
npm run dev:prepare
npm run dev
npm run dev:build
npm run lint
npm run test
npm run test:watch
npm run release
Support
⚡️ lightning address:
threenine@getalby.com