react-nocomment
v0.3.0
Published
This is an embeddable Nostr comments widget that just works
Downloads
16
Readme
nocomment
A Nostr-powered embeddable website comments widget that just works.
Usage as an embeddable script
Anywhere in your website you want to see the comment box, include
<script src="https://nocomment.netlify.app/embed.js" id="nocomment"></script>
You can pass special attributes to that <script>
tag, such as
data-relays='["wss://my.custom.relay", "..."]'
, a JSON list of relay URLs to use instead of the default ones.data-custom-base="reference"
, an event id in hex,note1
ornevent1
format, or anaddr
reference to a nip33 entity. This will prevent the creation of generic base events.data-skip="/"
, a path of your website to skip rendering the widgets in. The default is"/"
.data-owner="77778888cb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d"
, a string with the post owner's public key in hex format.
Custom CSS variables for styling:
--nc-background: #003049;
--nc-text-background: #dddddd;
--nc-text-color: #eae2b7;
--nc-text-color-dark: #fcbf49;
--nc-primary-color: #fcbf49;
--nc-primary-contrast: #003049;
Usage as a React component
yarn add react-nocomment
- Don't create an account anywhere.
- Don't configure a database.
- It just works. The URL is the identifier.
import { NoComment } from 'nocomment'
function App() {
return (
...
<NoComment relays={[
'wss://nostr.drss.io',
'wss://nostr-relay.freeberty.net',
'wss://nostr.unknown.place',
'wss://nostr-relay.untethr.me',
'wss://relay.damus.io'
]} />
...
);
}
License
Public domain.