docs icon indicating copy to clipboard operation
docs copied to clipboard

Support environment variables or secrets for PostHog integration API key

Open tamerc opened this issue 8 months ago • 1 comments

Hi Mintlify team 👋

I’m adding a PostHog integration and following the documentation provided. The current setup requires including the apiKey directly in the config:

"integrations": {
  "posthog": {
    "apiKey": "YOUR_POSTHOG_PROJECT_API_KEY",
    "apiHost": "optional"
  }
}

I’d like to avoid committing the API key to source control for security reasons. Is there a way to use environment variables or a secrets manager to reference the key instead of hardcoding it?

If this isn’t currently supported, I’d love to request this as a feature — it would be really helpful for teams trying to keep secrets out of versioned configs.

Thanks for the great tool!

tamerc avatar Apr 04 '25 15:04 tamerc

As far as I understand it, there's no security issue with exposing your Posthog API key to the client since the client already needs your API key so that they can make POST requests to Posthog.

This would be different if the post requests were being made to some other endpoint and being forwarded to Posthog, in which case only the server would need the API key.

TheAmanM avatar Aug 16 '25 20:08 TheAmanM