usapan
v0.2.0
Published
A no-frills comments widget powered by Firebase
Downloads
2
Readme
Usapan
A no-frills comments widget powered by Firebase
Usapan is the Filipino word for discussion
Features
- Unstyled
- Serverless
- Nested comments
- Abuse protection through App Check
Usage
Set up a Firebase project.
Enable the Google sign-in provider.
Set up Firestore security rules. Check out
firestore.rules.example
in the repository.Add a web app to the project and note its config.
(Optional) Set up App Check from the Firebase console. You don't need to do step 3. The widget initializes App Check if you supply the reCAPTCHA site key.
Add the following code in your page:
<script type="module"> import usapan from 'https://unpkg.com/[email protected]/dist/usapan.es.js' usapan({ el: document.querySelector('#comments'), // Element to render comments firebaseConfig: { ... }, // Your Firebase config firestoreCollection: 'usapan', // Root Firestore collection pageId: 'my-page', // Unique page identifier recaptchaSiteKey: '...', // reCAPTCHA v3 site key for App Check }) </script>
(Optional) Load the default stylesheet:
<link href="https://unpkg.com/[email protected]/dist/style.css" rel="stylesheet" />
Todo
- [ ] Permalinks
- [ ] Reactions
- [ ] Anonymous mode
- [ ] Reduce bundle size
- [ ] Moderation
Demo
Development
npm i
npm run dev
Release
npm version <major|minor|patch>
npm publish
Example page is automatically deployed on merge to main.