From 7d6bb6fe692b6ee2da10f7ab96daa541ba5c2405 Mon Sep 17 00:00:00 2001 From: Wyatt Smith Date: Sun, 15 Sep 2024 18:02:38 -0400 Subject: [PATCH] use env vars --- .gitignore | 1 + docusaurus.config.ts | 3 ++- package-lock.json | 14 ++++++++++++++ package.json | 1 + 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index b2d6de3..174da2d 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,4 @@ npm-debug.log* yarn-debug.log* yarn-error.log* +.env diff --git a/docusaurus.config.ts b/docusaurus.config.ts index 1d1b8bd..20638a0 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -1,6 +1,7 @@ import { themes as prismThemes } from 'prism-react-renderer' import type { Config } from '@docusaurus/types' import type * as Preset from '@docusaurus/preset-classic' +import 'dotenv/config' const config: Config = { title: 'Wyatt Smith', @@ -53,7 +54,7 @@ const config: Config = { [ 'posthog-docusaurus', { - apiKey: 'phc_tPQY6FDHGBosrMDvQUCL4Yzm25pKGJbNflCKNVtFmcO', + apiKey: process.env.POSTHOG_API_KEY, enableInDevelopment: true, // optional }, ], diff --git a/package-lock.json b/package-lock.json index 2ff441e..901d8be 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,6 +22,7 @@ "@docusaurus/module-type-aliases": "3.5.2", "@docusaurus/tsconfig": "3.5.2", "@docusaurus/types": "3.5.2", + "dotenv": "^16.4.5", "typescript": "~5.5.2" }, "engines": { @@ -6558,6 +6559,19 @@ "node": ">=8" } }, + "node_modules/dotenv": { + "version": "16.4.5", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz", + "integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, "node_modules/duplexer": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz", diff --git a/package.json b/package.json index 8128e10..42606db 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ "@docusaurus/module-type-aliases": "3.5.2", "@docusaurus/tsconfig": "3.5.2", "@docusaurus/types": "3.5.2", + "dotenv": "^16.4.5", "typescript": "~5.5.2" }, "browserslist": {