Skip to content

Instantly share code, notes, and snippets.

Avatar

Shashi Kiran R shashkiranr

  • United States
View GitHub Profile
@shashkiranr
shashkiranr / db.ts
Last active Mar 9, 2020
GCP Secret Manager to get runtime environment credentials
View db.ts
import {SecretManagerServiceClient} from '@google-cloud/secret-manager';
import * as admin from 'firebase-admin';
const client = new SecretManagerServiceClient();
let credentails: admin.app.App;
export const db = async (): Promise<admin.app.App> => {
if (credentails) {
return credentails;
@shashkiranr
shashkiranr / db.ts
Created Mar 9, 2020
GCP Secret Manager to get runtime environment credentials for multiple environments
View db.ts
import {SecretManagerServiceClient} from '@google-cloud/secret-manager';
import * as admin from 'firebase-admin';
const client = new SecretManagerServiceClient();
let credentials: admin: admin.app.App;
let credentials1: admin: admin.app.App;
let credentials2: admin: admin.app.App;
export const db = async (type: string): Promise<admin: admin.app.App> => {