Crypto Middleware
    Preparing search index...

    Variable cryptoPluginConst

    cryptoPlugin: (
        fastify: FastifyInstance,
        opts: MiddlewareConfig,
    ) => Promise<void> = ...

    Fastify plugin wrapping cryptoPluginImpl via fastify-plugin.

    Type Declaration

      • (fastify: FastifyInstance, opts: MiddlewareConfig): Promise<void>
      • Fastify plugin that performs cryptographic operations on requests and responses.

        Parameters

        Returns Promise<void>

        import Fastify from "fastify";
        import { cryptoPlugin } from "@sebastienrousseau/crypto-middleware";

        const app = Fastify();
        app.register(cryptoPlugin, {
        key: process.env.CRYPTO_KEY,
        operations: ["decrypt-request", "encrypt-response"],
        });