
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
@nhsuk/user-feedback-form
Advanced tools
A javascript plugin to add a user feedback form to your website.
You will also need a backend data store. See user-feedback-store.
Install from npm
npm install @nhsuk/user-feedback-form
Use script in your javascript build
import userFeedbackForm from '@nhsuk/user-feedback-form';
userFeedbackForm({
cssSelector: "#my-div-id",
formEndpoint: "https://example.com/my-api-endpoint/",
enableTextResponse: false,
});
If you do not have a node-based javascript frontend build, you can use the minified javascript distribution.
The latest javascript file can be found in github releases https://github.com/nhsuk/user-feedback-form/releases
<!-- in the html <head> -->
<script src="./user-feedback-form.min.js" defer></script>
...
<!-- where you want the form to appear -->
<div id="nhsuk-user-feedback-form" data-form-endpoint="https://example.com/endpoint/"></div>
data-form-endpoint
- (required) An HTTP data store endpoint to POST data to. Include the trailing slash
data-enable-text-response
- (optional) Include to enable text responses on the feedback form.
userFeedbackForm(settings)
Adds the user feedback form inside a <div>
element. settings.cssSelector
will be used to select the div from the DOM.
settings
should be an object containing:
formEndpoint
- (required) An HTTP data store endpoint to POST data to.cssSelector
- (optional) HTML selector insert the form into. '#nhsuk-user-feedback-form'
by default.An onFeedback
event is emitted when the user gives satisfied or unsatisfied feedback by clicking on the yes or no buttons.
You can listen to this event to trigger custom javascript code.
// Listen to the event on the container div
document.querySelector("#nhsuk-user-feedback-form").addEventListener('onFeedback', (event) => {
// custom code using the boolean `isSatisfied` value.
console.log(event.detail.isSatisfied)
});
Run npm install
followed by npm start
to start a development server. A test site will be available at http://localhost:8080/tests/example/
For now, this app is very simple, so we don't use any libraries like Vue or React.
The App
class in src/index.js
represents the app as a whole.
Each screen has it's own class which can be instantiated and rendered with the render
method when the screen should be displayed.
The screen classes are responsible for screen-level interactions such as rendering, attaching event listeners and input validation.
Run npm run lint
to run eslint code linting.
Run npm test
to run all tests.
FAQs
A form for collecting user feedback
The npm package @nhsuk/user-feedback-form receives a total of 119 weekly downloads. As such, @nhsuk/user-feedback-form popularity was classified as not popular.
We found that @nhsuk/user-feedback-form demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.