Skip to content

Load environment variables (.env) from a private GitHub repository. This CLI tool bootstraps your application by securely authenticating with GitHub and fetching the .env file before startup. Ideal for PaaS, CI/CD pipelines, or local development with centralized configuration management.

License

Notifications You must be signed in to change notification settings

setbytes/env-auth

Repository files navigation

How to use

npm install env-auth
bun install env-auth

Example

import fs from "fs";
import dotenv from "dotenv";
import { EnvAuth } from "env-auth";
import crypto from "crypto";

const env = dotenv.parse(fs.readFileSync(".env"));

await EnvAuth.builder()
  .clientId(env.GITHUB_CLIENT_ID)
  .clientSecret(env.GITHUB_CLIENT_SECRET)
  .uniqueToken(crypto.randomUUID())
  .url(env.GITHUB_ENV_REPOSITORY)
  .loader();

// load from github to your environment
console.log(process.env.STRIPE_CLIENT_ID);
console.log(process.env.STRIPE_CLIENT_SECRET);

About

Load environment variables (.env) from a private GitHub repository. This CLI tool bootstraps your application by securely authenticating with GitHub and fetching the .env file before startup. Ideal for PaaS, CI/CD pipelines, or local development with centralized configuration management.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published