Add posthog api key back in (it's ok to have it exposed), and always load env.local if it exists
This commit is contained in:
parent
048287a9ff
commit
23e994e193
2 changed files with 6 additions and 7 deletions
|
|
@ -1,7 +1,5 @@
|
|||
import { PostHog } from "posthog-node" // new
|
||||
|
||||
const phProjectApiKey = process.env.POSTHOG_PROJECT_API_KEY
|
||||
if (phProjectApiKey === undefined) {
|
||||
throw new Error("POSTHOG_PROJECT_API_KEY is not defined in your environment or in .env.local")
|
||||
}
|
||||
export const posthog = new PostHog(phProjectApiKey, { host: "https://app.posthog.com" })
|
||||
export const posthog = new PostHog("phc_aUO790jHd7z1SXwsYCz8dRApxueplZlZWeDSpKc5hol", {
|
||||
host: "https://app.posthog.com",
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
import dotenv from "dotenv"
|
||||
import * as console from "console"
|
||||
import console from "console"
|
||||
import fs from "fs"
|
||||
|
||||
if (process.env.NODE_ENV !== "production") {
|
||||
if (fs.existsSync(".env.local")) {
|
||||
console.log("Using .env.local file to supply config environment variables")
|
||||
dotenv.config({ path: ".env.local" })
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue