Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@relab/fastify-correlation-id

Package Overview
Dependencies
Maintainers
0
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@relab/fastify-correlation-id

Fastify plugin to store and retrieve correlation IDs.

  • 1.0.11
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

@relab/fastify-correlation-id

Fastify plugin to store and retrieve correlation IDs.

The plugin retrieves the X-Correlation-ID header (or any other desired header) from the request and makes it accessible throughout the application code. It also propagates the header to the response.

Requirements

  • Node 18+
  • Fastify 4+

Installation

NPM

npm install --save @relab/fastify-correlation-id

PNPM

pnpm add @relab/fastify-correlation-id

Usage

import Fastify from 'fastify'
import { CorrelationId } from '@relab/fastify-correlation-id'

const fastify = Fastify()
    .register(CorrelationId, {
        header: 'X-Correlation-ID', // optional
        skipResponseHeader: true, // optional
    })

Configuration

There are some environment variables used to configure logger.

OptionDescriptionDefault
headerHeader name for correlation ID.X-Correlation-ID
skipResponseHeaderIf set to true, it will not propagate correlation ID to response header.false

License

Released under MIT by Sergey Zwezdin.

Keywords

FAQs

Package last updated on 22 Jun 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc