Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 1 addition & 15 deletions app/routes/app.js-web-posthog-settings/route.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,20 +94,6 @@ export default function JsWebEvents() {
const jsWebPosthogSettingsInitialState = defaultJsWebPosthogSettings.map<JsWebPosthogSettingChoice>((entry) => {
return {
...entry,
...(entry.key == 'ui_host' && entry.type == SettingType.Select && {
selectOptions: entry.selectOptions.map((v) => {
const label = (() => {
if (v == 'https://eu.posthog.com') {
return 'Posthog EU'
}
return 'Posthog US'
})();
return {
label: label,
value: v,
}
})
}),
value: jsWebPosthogSettingsMetafieldValue?.[entry.key],
} as JsWebPosthogSettingChoice;

Expand Down Expand Up @@ -219,7 +205,7 @@ export default function JsWebEvents() {
};

const dirty = useMemo(() => {

const diff = detailedDiff(jsWebPosthogSettingsInitialState || {}, jsWebPosthogSettings);

if (Object.values(diff).some((changeType: object) => Object.keys(changeType).length != 0)) {
Expand Down
9 changes: 5 additions & 4 deletions common/dto/js-web-settings.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ export const JsWebPosthogConfigSchema = z.object({
/* api_host: z.string().describe('URL of your PostHog instance.').trim().url().nullish().default(''), */

ui_host: z
.enum(['https://us.posthog.com', 'https://eu.posthog.com'])
.string()
.url()
.describe(
`If using a reverse proxy for 'api_host' then this should be the actual PostHog app URL (e.g. https://us.posthog.com). This ensures that links to PostHog point to the correct host.`
`If using a reverse proxy for 'api_host' then this should be the actual PostHog app URL (e.g. https://us.posthog.com, https://eu.posthog.com). This ensures that links to PostHog point to the correct host. If using a self-hosted PostHog instance, provide your custom URL here.`
)
.nullable()
.default("https://us.posthog.com"),
Expand Down Expand Up @@ -134,14 +135,14 @@ export const JsWebPosthogConfigSchema = z.object({

// the following will not be implemented
/**
*
*
sanitize_properties: z.unknown().transform(() => null),
loaded: z.unknown().transform(() => null),
bootstrap: z.unknown().transform(() => null),
session_recording: z.unknown().transform(() => null),
xhr_headers: z.unknown().transform(() => null),
autocapture: z.unknown().transform(() => null),

'autocapture.url_allowlist': z
.array(z.string().trim())
.describe(
Expand Down