Managed secret providers
PostHog
Connect PostHog to Alter Vault for secure API access
Overview
Section titled “Overview”Use PostHog credentials to make authenticated API calls through Alter Vault without exposing API keys in code.
| Property | Value |
|---|---|
| Provider ID | posthog |
| Category | Developer Tools |
| Credential Type | Bearer Token |
Step 1: Get Credentials
Section titled “Step 1: Get Credentials”Log in to PostHog
Log in to PostHog at us.posthog.com.
Go to Settings → User → Personal API Keys
Go to Settings → User → Personal API Keys at us.posthog.com/settings/user-api-keys.
Create a personal API key
Click ‘Create personal API key’, set a label and permissions.
Copy your API key
Copy the generated Personal API Key (starts with phx_).
Enter host if needed
If using EU cloud or self-hosted, enter the host in the PostHog Host field.
Step 2: Add to Alter Vault
Section titled “Step 2: Add to Alter Vault”Open the Developer Portal
Go to portal.alterauth.com and navigate to the application.
Add PostHog
Go to Managed Secrets > Add Provider > PostHog.
Enter credentials
Paste your Personal API Key into the credential field. If using EU Cloud or a self-hosted instance, also enter your PostHog host (e.g. eu.i.posthog.com) in the PostHog Host field.
Save
Click Save. You’ll receive a grant_id to use with the SDK.
Using in Code
Section titled “Using in Code”response = await alter_app.request( HttpMethod.GET, "https://us.i.posthog.com/api/projects/YOUR_PROJECT_ID/events", grant_id="YOUR_GRANT_ID", # Use eu.i.posthog.com for EU cloud or your own host for self-hosted)