A lightweight JavaScript library for collecting and submitting user feedback from various applications to different destinations like Slack and Google Forms. This library provides a consistent interface for sending bug reports, feature requests, and security issues across mobile, desktop, and browser extension applications.
- Send feedback directly to Slack channels
- Submit feedback to Google Forms
- Customizable fields and formatting
- Support for different application types (Mobile, Desktop, Browser Extension)
- Support for different feedback types (Bug Reports, Feature Requests, Security Issues)
- Highly configurable for different use cases
- No external dependencies
Install the package via npm:
npm install pear-apps-lib-feedbackimport { sendSlackFeedback } from 'pear-apps-lib-feedback';
// Send a bug report to Slack
sendSlackFeedback({
webhookUrPath: '/T00000000/B00000000/xxxxxxxxxxxxxxxxxxxxxxxx',
topic: 'BUG_REPORT',
app: 'MOBILE',
operatingSystem: 'iOS 15.4',
deviceModel: 'iPhone 13',
message: 'The app crashes when I tap on the settings button',
appVersion: '1.2.3'
});import { sendGoogleFormFeedback } from 'pear-apps-lib-feedback';
// Send a feature request to Google Forms
sendGoogleFormFeedback({
formKey: '1FAIpQLSd8X-xxxxxxxxxxxxxxxxxxxxxxxxxxx',
mapping: {
timestamp: 'entry.1111111111',
topic: 'entry.2222222222',
app: 'entry.3333333333',
operatingSystem: 'entry.4444444444',
deviceModel: 'entry.5555555555',
message: 'entry.6666666666',
appVersion: 'entry.7777777777'
},
topic: 'FEATURE_REQUEST',
app: 'DESKTOP',
operatingSystem: 'Windows 11',
deviceModel: 'HP Pavilion',
message: 'I would love to have dark mode in the next update',
appVersion: '2.1.0',
additionalFields: [
{ key: 'entry.8888888888', value: 'Additional info' }
]
});Sends feedback to a Slack channel using a webhook.
Parameters:
config(Object):webhookUrPath(string): The path part of the Slack webhook URLtopic(string, optional): Type of feedback ('BUG_REPORT', 'FEATURE_REQUEST', 'SECURITY_ISSUE')app(string, optional): Type of app ('MOBILE', 'DESKTOP', 'BROWSER_EXTENSION')operatingSystem(string, optional): OS informationdeviceModel(string, optional): Device model informationmessage(string): The feedback message contentappVersion(string, optional): Version of the appcustomFields(Array, optional): Additional fields to include in the messageadditionalAttachment(Object, optional): Additional attachment properties
Sends feedback to a Google Form.
Parameters:
config(Object):formKey(string): The key of the Google Formmapping(Object, optional): Maps feedback fields to Google Form entry IDstopic(string, optional): Type of feedback ('BUG_REPORT', 'FEATURE_REQUEST', 'SECURITY_ISSUE')app(string, optional): Type of app ('MOBILE', 'DESKTOP', 'BROWSER_EXTENSION')operatingSystem(string, optional): OS informationdeviceModel(string, optional): Device model informationmessage(string): The feedback message contentappVersion(string, optional): Version of the appadditionalFields(Array, optional): Additional fields to include in the form submission
This library has no external runtime dependencies.
The library includes unit tests for all functionality. To run the tests:
npm test- pearpass-app-desktop - A desktop app for PearPass, a password manager
- pearpass-app-mobile - A mobile app for PearPass, a password manager
- pearpass-app-browser-extension - A nrowser extension app for PearPass, a password manager
- tether-dev-docs - Documentations and guides for developers
This project is licensed under the Apache License, Version 2.0. See the LICENSE file for details.