Add PostHog source UI with region select

Show a US/EU region dropdown for the PostHog Cloud API-key form and
an instance-URL field for Self-Hosted, map both to the connector inputs,
and register the PostHog logo for the self-hosted provider.

Signed-off-by: Aurélien Sibiril <81782+aureliensibiril@users.noreply.github.com>
This commit is contained in:
Aurélien Sibiril
2026-05-29 12:24:21 +02:00
parent da2276516b
commit 836fbfbe26
2 changed files with 40 additions and 13 deletions

View File

@@ -122,6 +122,12 @@ function mapAPIKeyExtraSettingToField(
case "METABASE":
if (settingKey === "instanceUrl") return "metabaseInstanceUrl";
break;
case "POSTHOG":
if (settingKey === "region") return "posthogRegion";
break;
case "POSTHOG_SELF_HOSTED":
if (settingKey === "instanceUrl") return "posthogInstanceUrl";
break;
}
return null;
}
@@ -580,19 +586,39 @@ export function AddAccessSourceDialog({
required
autoFocus
/>
{activeProvider?.extraSettings.map(setting => (
<Field
key={setting.key}
label={__(setting.label)}
value={extraSettingValues[setting.key] ?? ""}
onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
setExtraSettingValues(prev => ({
...prev,
[setting.key]: e.target.value,
}))}
required={setting.required}
/>
))}
{activeProvider?.extraSettings.map(setting =>
setting.key === "region"
? (
<div key={setting.key} className="space-y-1.5">
<label className="text-sm font-medium">{__(setting.label)}</label>
<Select
value={extraSettingValues[setting.key] ?? ""}
onValueChange={(val: string) =>
setExtraSettingValues(prev => ({
...prev,
[setting.key]: val,
}))}
placeholder={__("Select a region")}
>
<Option value="US">{__("United States (US)")}</Option>
<Option value="EU">{__("Europe (EU)")}</Option>
</Select>
</div>
)
: (
<Field
key={setting.key}
label={__(setting.label)}
value={extraSettingValues[setting.key] ?? ""}
onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
setExtraSettingValues(prev => ({
...prev,
[setting.key]: e.target.value,
}))}
required={setting.required}
/>
),
)}
</DialogContent>
<DialogFooter>
<Button

View File

@@ -78,6 +78,7 @@ const thirdParties: Record<string, FC<ComponentProps<"svg">>> = {
OPENAI: OpenAI,
PAGERDUTY: PagerDuty,
POSTHOG: PostHog,
POSTHOG_SELF_HOSTED: PostHog,
RESEND: Resend,
SENTRY: Sentry,
SLACK: Slack,