Skip to content

Managed secret providers

PostHog

Connect PostHog to Alter Vault for secure API access

Use PostHog credentials to make authenticated API calls through Alter Vault without exposing API keys in code.

PropertyValue
Provider IDposthog
CategoryDeveloper Tools
Credential TypeBearer Token

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.

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.

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
)