Hono DynamoDB Middleware - v1.1.1
    Preparing search index...

    Function secretsManagerMiddleware

    • Secrets Manager middleware for Hono

      Creates AWS SDK v3 SecretsManager and SecretsManagerClient instances and sets them in the Hono context to generate middleware.

      Type Parameters

      • E extends Env

        Hono environment type that extends Env

      Parameters

      • config: SecretsManagerClientConfig = {}

        Configuration options for Secrets Manager client

      Returns MiddlewareHandler<E>

      Hono middleware that sets Secrets Manager instances

      import { Hono } from 'hono';
      import { secretsManagerMiddleware, Env } from '@squilla/hono-aws-middlewares';

      const app = new Hono<Env>();

      // Set up middleware
      app.use('*', secretsManagerMiddleware({
      region: 'ap-northeast-1'
      }));

      // Use Secrets Manager
      app.get('/config', async (c) => {
      const secretsManager = c.get('SecretsManager');
      const result = await secretsManager.getSecretValue({
      SecretId: 'prod/myapp/config'
      });
      return c.json({ config: result.SecretString });
      });

      1.0.0