posthog-js 1.287.0 → 1.288.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/array.full.es5.js +1 -1
  2. package/dist/array.full.es5.js.map +1 -1
  3. package/dist/array.full.js +1 -1
  4. package/dist/array.full.js.map +1 -1
  5. package/dist/array.full.no-external.js +1 -1
  6. package/dist/array.full.no-external.js.map +1 -1
  7. package/dist/array.js +1 -1
  8. package/dist/array.js.map +1 -1
  9. package/dist/array.no-external.js +1 -1
  10. package/dist/array.no-external.js.map +1 -1
  11. package/dist/customizations.full.js +1 -1
  12. package/dist/lazy-recorder.js +1 -1
  13. package/dist/main.js +1 -1
  14. package/dist/main.js.map +1 -1
  15. package/dist/module.d.ts +10 -1
  16. package/dist/module.full.d.ts +10 -1
  17. package/dist/module.full.js +1 -1
  18. package/dist/module.full.js.map +1 -1
  19. package/dist/module.full.no-external.d.ts +10 -1
  20. package/dist/module.full.no-external.js +1 -1
  21. package/dist/module.full.no-external.js.map +1 -1
  22. package/dist/module.js +1 -1
  23. package/dist/module.js.map +1 -1
  24. package/dist/module.no-external.d.ts +10 -1
  25. package/dist/module.no-external.js +1 -1
  26. package/dist/module.no-external.js.map +1 -1
  27. package/dist/posthog-recorder.js +1 -1
  28. package/dist/src/types.d.ts +8 -0
  29. package/dist/src/utils/request-router.d.ts +2 -1
  30. package/dist/surveys-preview.d.ts +10 -1
  31. package/lib/package.json +1 -1
  32. package/lib/src/posthog-core.js +1 -0
  33. package/lib/src/posthog-core.js.map +1 -1
  34. package/lib/src/posthog-featureflags.js +2 -2
  35. package/lib/src/posthog-featureflags.js.map +1 -1
  36. package/lib/src/types.d.ts +8 -0
  37. package/lib/src/types.js.map +1 -1
  38. package/lib/src/utils/request-router.d.ts +2 -1
  39. package/lib/src/utils/request-router.js +15 -0
  40. package/lib/src/utils/request-router.js.map +1 -1
  41. package/package.json +1 -1
@@ -1056,6 +1056,14 @@ interface PostHogConfig {
1056
1056
  * @default 'https://us.i.posthog.com'
1057
1057
  */
1058
1058
  api_host: string;
1059
+ /**
1060
+ * URL to use for feature flag requests specifically.
1061
+ * If not set, feature flag requests will use the URL derived from `api_host`.
1062
+ * This is useful when you want to route feature flag requests to a different endpoint than other analytic APIs.
1063
+ *
1064
+ * @default null
1065
+ */
1066
+ flags_api_host?: string | null;
1059
1067
  /**
1060
1068
  * If using a reverse proxy for `api_host` then this should be the actual PostHog app URL (e.g. https://us.posthog.com).
1061
1069
  * This ensures that links to PostHog point to the correct host.
@@ -3099,12 +3107,13 @@ declare enum RequestRouterRegion {
3099
3107
  EU = "eu",
3100
3108
  CUSTOM = "custom"
3101
3109
  }
3102
- type RequestRouterTarget = 'api' | 'ui' | 'assets';
3110
+ type RequestRouterTarget = 'api' | 'ui' | 'assets' | 'flags';
3103
3111
  declare class RequestRouter {
3104
3112
  instance: PostHog;
3105
3113
  private _regionCache;
3106
3114
  constructor(instance: PostHog);
3107
3115
  get apiHost(): string;
3116
+ get flagsApiHost(): string;
3108
3117
  get uiHost(): string | undefined;
3109
3118
  get region(): RequestRouterRegion;
3110
3119
  endpointFor(target: RequestRouterTarget, path?: string): string;