@formo/analytics 1.22.0 → 1.24.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.
@@ -94,6 +94,24 @@ export interface AutocaptureOptions {
94
94
  */
95
95
  chain?: boolean;
96
96
  }
97
+ /**
98
+ * Configuration options for referral parameter parsing
99
+ */
100
+ export interface ReferralOptions {
101
+ /**
102
+ * Custom query parameter names to check for referral codes
103
+ * @default ["ref", "referral", "refcode"]
104
+ * @example ["via", "referrer", "source"] - will check ?via=CODE, ?referrer=CODE, ?source=CODE
105
+ */
106
+ queryParams?: string[];
107
+ /**
108
+ * URL path pattern to extract referral code from
109
+ * Should be a regex string that matches the path segment containing the referral code
110
+ * The first capture group will be used as the referral code
111
+ * @example "/r/([^/]+)" - will extract "01K17FKB" from "https://glider.fi/r/01K17FKB"
112
+ */
113
+ pathPattern?: string;
114
+ }
97
115
  export interface Options {
98
116
  provider?: EIP1193Provider;
99
117
  tracking?: boolean | TrackingOptions;
@@ -105,6 +123,15 @@ export interface Options {
105
123
  * @default true
106
124
  */
107
125
  autocapture?: boolean | AutocaptureOptions;
126
+ /**
127
+ * Custom API host for sending events through your own domain to bypass ad blockers
128
+ * - If not provided, events are sent directly to events.formo.so
129
+ * - When provided, events are sent to your custom endpoint which should forward them to Formo
130
+ * - Example: 'https://your-host-url.com/ingest' or '/api/analytics'
131
+ *
132
+ * See https://docs.formo.so/sdks/web#proxy for setup instructions
133
+ */
134
+ apiHost?: string;
108
135
  flushAt?: number;
109
136
  flushInterval?: number;
110
137
  retryCount?: number;
@@ -113,6 +140,12 @@ export interface Options {
113
140
  enabled?: boolean;
114
141
  levels?: LogLevel[];
115
142
  };
143
+ /**
144
+ * Configuration for referral parameter parsing from URLs
145
+ * Allows customizing how referral codes are detected from query parameters and URL paths
146
+ * @example { queryParams: ["via"], pathPattern: "/r/([^/]+)" }
147
+ */
148
+ referral?: ReferralOptions;
116
149
  ready?: (formo: IFormoAnalytics) => void;
117
150
  }
118
151
  export interface FormoAnalyticsProviderProps {
@@ -0,0 +1,2 @@
1
+ export declare const version = "1.24.0";
2
+ //# sourceMappingURL=version.d.ts.map
@@ -0,0 +1,4 @@
1
+ // This file is auto-generated by scripts/update-version.js during npm version
2
+ // Do not edit manually - it will be overwritten
3
+ export var version = '1.24.0';
4
+ //# sourceMappingURL=version.js.map