@findlane/browser 0.9.0 → 0.10.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.
package/dist/index.d.ts CHANGED
@@ -177,6 +177,10 @@ export type BrowserClientOptions = {
177
177
  /** Whether `events` sends anything: true (the default), false, or "afterConsent" to hold events until
178
178
  * `events.consent(true)`. */
179
179
  events?: boolean | "afterConsent";
180
+ /** Where events go: the API, unless you relay them from a route on your own domain (the server SDK's
181
+ * `events.proxy`), such as "/findlane/events". Ad blockers block beacons to other sites, not to the
182
+ * page's own. */
183
+ eventsUrl?: string;
180
184
  };
181
185
  export declare class SearchBrowserClient {
182
186
  private readonly url;
package/dist/index.js CHANGED
@@ -61,7 +61,7 @@ export class SearchBrowserClient {
61
61
  throw new Error("A valid public index ID (pub_…) is required");
62
62
  this.url = `${(options.baseUrl ?? defaultBaseUrl).replace(/\/$/, "")}/api/public/indexes/${options.publicId}`;
63
63
  this.fetcher = options.fetch ?? ((input, init) => globalThis.fetch(input, init));
64
- this.events = eventSender(`${this.url}/events`, options.fetch, options.events ?? true);
64
+ this.events = eventSender(options.eventsUrl ?? `${this.url}/events`, options.fetch, options.events ?? true);
65
65
  }
66
66
  async post(operation, request, signal) {
67
67
  const response = await this.fetcher(`${this.url}/${operation}`, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@findlane/browser",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "description": "Findlane browser SDK: fast, typo-tolerant public search from the browser with an index's public ID, plus React hooks and components.",
5
5
  "keywords": ["findlane", "search", "full-text search", "typo tolerance", "instant search", "ecommerce search", "browser", "react", "autocomplete"],
6
6
  "license": "MIT",