Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
nuxt-http-client-hints
Advanced tools
Access and use HTTP Client Hints in your Nuxt application. Detect the client browser and the operating system on your server.
[!WARNING] The HTTP Client hints headers listed below are still in draft and only Chromium based browsers support them: Chrome, Edge, Chromium and Opera.
The module includes support for the following HTTP Client hints:
Install the module to your Nuxt application with one command:
npx nuxi module add nuxt-http-client-hints
Add your configuration to your Nuxt config file:
httpClientHints: {
// Your configuration here
}
Add your client and server plugins to your Nuxt application and register the corresponding hooks with your configuration:
// my-plugin.client.js
export default defineNuxtPlugin((nuxtApp) => {
nuxtApp.hook('http-client-hints:client-hints', (httpClientHints) => {
// Your client logic here
})
})
// my-plugin.server.js
export default defineNuxtPlugin((nuxtApp) => {
nuxtApp.hook('http-client-hints:ssr-client-hints', (httpClientHints) => {
// Your server logic here
})
})
You use the httpClientHints object in your application to access the configuration:
<!-- SomeComponent.vue -->
<template>
<pre>{{ $httpClientHints }}"</pre>
</template>
or in your modules, composables, or other plugins:
// my-module.js
const clientHints = useNuxtApp().$httpClientHints
That's it! You can now use HTTP Client Hints in your Nuxt app ✨
You can check the source code or the JSDocs for more information.
# Install dependencies
pnpm install
# Generate type stubs
pnpm dev:prepare
# Develop with the playground
pnpm dev
# Build the playground
pnpm dev:build
# Run ESLint
pnpm lint
# Run Vitest
pnpm test
pnpm test:watch
MIT License © 2024-PRESENT Joaquín Sánchez
FAQs
Nuxt HTTP Client Hints
The npm package nuxt-http-client-hints receives a total of 16 weekly downloads. As such, nuxt-http-client-hints popularity was classified as not popular.
We found that nuxt-http-client-hints demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.