# @neolution-ch/next-with-google-secrets

> overrides mapped config-keys with the value from gcp secrets

Latest version **0.6.1** (published 2026-05-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install @neolution-ch/next-with-google-secrets
pnpm add @neolution-ch/next-with-google-secrets
yarn add @neolution-ch/next-with-google-secrets
bun add @neolution-ch/next-with-google-secrets
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; high maintenance score; high quality score.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.6.1 |
| Published | 2026-05-18 |
| First published | 2023-08-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=18 |
| Dependencies | 1 |
| Unpacked size | 51.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Neolution |
| Maintainers | neotrow, drebrez |

## Links

- npm: https://www.npmjs.com/package/@neolution-ch/next-with-google-secrets
- Repository: https://github.com/neolution-ch/next-with-google-secrets
- Homepage: https://neolution-ch.github.io/next-with-google-secrets
- Issues: https://github.com/neolution-ch/next-with-google-secrets/issues
- npm.io page: https://npm.io/package/@neolution-ch/next-with-google-secrets

## Dependencies (1)

- [@google-cloud/secret-manager](https://npm.io/package/@google-cloud/secret-manager.md) ^6.0.0

## Recent versions

- 0.6.1 (latest) — 2026-05-18
- 0.6.0 — 2026-04-27
- 0.5.0 — 2025-04-09
- 0.4.0 — 2024-09-25
- 0.3.0 — 2024-09-23
- 0.2.1 — 2024-04-23
- 0.2.0 — 2023-10-16
- 0.1.0 — 2023-09-14
- 0.0.1 — 2023-08-03

## README

# Configure your Node.js Applications with Google Secrets

## Introduction

`@neolution-ch/next-with-google-secrets` starts your next application with predefined mapped google secrets in the config.

## Options

| Name        | Required           | Description                                                                                                                                                                                                                                                   | Default                  |
| ----------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------ |
| projectName | :heavy_check_mark: | Specifies which project the secrets are read from.                                                                                                                                                                                                            | `null`                   |
| mapping     | :heavy_check_mark: | Records<string, string> to map the secrets to configuration keys                                                                                                                                                                                              | `null`                   |
| filter      | ❌                 | A server side filter forwarded to the google api according to <https://cloud.google.com/secret-manager/docs/filtering>                                                                                                                                        | `null`                   |
| filterFn    | ❌                 | A filter function that will be run after the secrets are read from google (client side filtering). Supplies the `Google.Cloud.SecretManager.V1.Secret` as parameter and the name. If returned true the secret will be processed otherwise it will be ignored. | `{secret, name} => true` |
| versions    | ❌                 | By default the latest version of each secret is taken. But you can specify a specific version in the form of a records. Key is the secret id and value is the version to take. For example: `{MySecretId: "2"}`                                               | `null`                   |

## Quick Start

```shell
npm install @neolution-ch/next-with-google-secrets
```

or

```shell
yarn add @neolution-ch/next-with-google-secrets
```

then use the available function in your `next.config.js` like this:

```typescript
...
const { withGoogleSecrets } = require("@neolution-ch/next-with-google-secrets");
...
module.export = () =>
    withGoogleSecrets({
        projectName: "projects/your-gcp-project-name",
        mapping: { YourSecretName: "serverRuntimeConfig__yourConfigKeyYouWantToOverwrite", }
        nextConfig: YourCurrentNextConfiguration....
    });
```

now if you configured everything correctly, you will see this output log in your console:

```shell
WithGoogleSecrets - overritten config with gcp secret: serverRuntimeConfig__yourConfigKeyYouWantToOverwrite
```

---
_Source: https://npm.io/package/@neolution-ch/next-with-google-secrets · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
