
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
nuxt-webhook-validators
Advanced tools
A simple nuxt module that works on the edge to easily validate incoming webhooks from different services.
A simple nuxt module that works on the edge to easily validate incoming webhooks from different services.
This module only works with a Nuxt server running as it uses server API routes (nuxt build
).
This means that you cannot use this module with nuxt generate
.
npx nuxi@latest module add webhook-validators
nuxt.config.ts
export default defineNuxtConfig({
modules: [
'nuxt-webhook-validators'
],
})
The validator helpers are auto-imported in your server/
directory.
All validator helpers are exposed globally and can be used in your server API routes.
The helpers return a boolean value indicating if the webhook request is valid or not.
The config can be defined directly from the runtimeConfig
in your nuxt.config.ts
:
export default defineNuxtConfig({
runtimeConfig: {
webhook: {
<provider>: {
<requiredProps>: '',
}
}
}
})
It can also be set using environment variables:
NUXT_WEBHOOK_<PROVIDER>_<REQUIRED_PROPERTY> = ""
Go to playground/.env.example or playground/nuxt.config.ts to see a list of all the available properties needed for each provider.
You can add your favorite webhook validator by creating a new file in src/runtime/server/lib/validators/
Validate a GitHub webhook in a server API route.
~/server/api/webhooks/github.post.ts
export default defineEventHandler(async (event) => {
const isValidWebhook = await isValidGitHubWebhook(event)
if (!isValidWebhook) {
throw createError({ statusCode: 401, message: 'Unauthorized: webhook is not valid' })
}
// Some logic...
return { isValidWebhook }
})
# Install dependencies
npm install
# Generate type stubs
npm run dev:prepare
# Develop with the playground
npm run dev
# Build the playground
npm run dev:build
# Run ESLint
npm run lint
# Run Vitest
npm run test
npm run test:watch
# Run typecheck
npm run test:types
# Release new version
npm run release
FAQs
A simple nuxt module that works on the edge to easily validate incoming webhooks from different services.
The npm package nuxt-webhook-validators receives a total of 225 weekly downloads. As such, nuxt-webhook-validators popularity was classified as not popular.
We found that nuxt-webhook-validators demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.