🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

nestjs-gcloud-secret-manager

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nestjs-gcloud-secret-manager

Google Cloud Secret Manager module for Nest.js

0.4.0
latest
npm
Version published
Weekly downloads
2
100%
Maintainers
1
Weekly downloads
 
Created
Source

Summary

Google Cloud Secret Manager module for Nest.js

Installation

$ yarn add nestjs-gcloud-secret-manager

Examples

Setup

import { Module } from '@nestjs/common';
import { SecretManagerModule } from 'nestjs-gcloud-secret-manager';

@Module({
  imports: [
    /**
     * secrets are loaded to `SecretManagerService` when SecretManagerModule bootstrapped
     */
    SecretManagerModule.forRoot({
      projectId,
      credentials
    })
  ],
})
export class AppModule {}

using secret manager service

import { Injectable } from '@nestjs/common';
import { SecretManagerService } from 'nestjs-gcloud-secret-manager';

@Injectable()
export class AppService {
    constructor(private readonly secretManagerService: SecretManagerService) {}
    async getSecret() {
        this.secretManagerService.get(SECRET_NAME);
    }
}

using secret manager client

Functions such as creation have not yet been implemented. If you want to extend the functionality, use client as it is.

import { Inject } from '@nestjs/common';
import { CLIENT_INSTANCE, SecretManagerClient } from 'nestjs-gcloud-secret-manager';

export class AppService {
  constructor(@Inject(CLIENT_INSTANCE) private readonly client: SecretManagerClient) {}
}

FAQs

Package last updated on 07 May 2023

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