@mendable/firecrawl 4.11.4 → 4.12.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.
@@ -8,7 +8,7 @@ var require_package = __commonJS({
8
8
  "package.json"(exports, module) {
9
9
  module.exports = {
10
10
  name: "@mendable/firecrawl-js",
11
- version: "4.11.4",
11
+ version: "4.12.0",
12
12
  description: "JavaScript SDK for Firecrawl API",
13
13
  main: "dist/index.js",
14
14
  types: "dist/index.d.ts",
package/dist/index.cjs CHANGED
@@ -35,7 +35,7 @@ var require_package = __commonJS({
35
35
  "package.json"(exports2, module2) {
36
36
  module2.exports = {
37
37
  name: "@mendable/firecrawl-js",
38
- version: "4.11.4",
38
+ version: "4.12.0",
39
39
  description: "JavaScript SDK for Firecrawl API",
40
40
  main: "dist/index.js",
41
41
  types: "dist/index.d.ts",
@@ -117,6 +117,7 @@ __export(index_exports, {
117
117
  FirecrawlClient: () => FirecrawlClient,
118
118
  JobTimeoutError: () => JobTimeoutError,
119
119
  SdkError: () => SdkError,
120
+ Watcher: () => Watcher,
120
121
  default: () => index_default
121
122
  });
122
123
  module.exports = __toCommonJS(index_exports);
@@ -2871,5 +2872,6 @@ var index_default = Firecrawl;
2871
2872
  FirecrawlAppV1,
2872
2873
  FirecrawlClient,
2873
2874
  JobTimeoutError,
2874
- SdkError
2875
+ SdkError,
2876
+ Watcher
2875
2877
  });
package/dist/index.d.cts CHANGED
@@ -110,7 +110,7 @@ interface ScrapeOptions {
110
110
  fastMode?: boolean;
111
111
  useMock?: string;
112
112
  blockAds?: boolean;
113
- proxy?: 'basic' | 'stealth' | 'auto' | string;
113
+ proxy?: 'basic' | 'stealth' | 'enhanced' | 'auto' | string;
114
114
  maxAge?: number;
115
115
  minAge?: number;
116
116
  storeInCache?: boolean;
@@ -954,7 +954,7 @@ interface CrawlScrapeOptions {
954
954
  skipTlsVerification?: boolean;
955
955
  removeBase64Images?: boolean;
956
956
  blockAds?: boolean;
957
- proxy?: "basic" | "stealth" | "auto";
957
+ proxy?: "basic" | "stealth" | "enhanced" | "auto";
958
958
  storeInCache?: boolean;
959
959
  maxAge?: number;
960
960
  parsePDF?: boolean;
@@ -1736,4 +1736,4 @@ declare class Firecrawl extends FirecrawlClient {
1736
1736
  get v1(): FirecrawlApp;
1737
1737
  }
1738
1738
 
1739
- export { type ActionOption, type ActiveCrawl, type ActiveCrawlsResponse, type AgentOptions$1 as AgentOptions, type AgentResponse, type AgentStatusResponse, type AgentWebhookConfig, type AgentWebhookEvent, type AttributesFormat, type BatchScrapeJob, type BatchScrapeOptions, type BatchScrapeResponse$1 as BatchScrapeResponse, type BrandingProfile, type CategoryOption, type ChangeTrackingFormat, type ClickAction, type ConcurrencyCheck, type CrawlErrorsResponse$1 as CrawlErrorsResponse, type CrawlJob, type CrawlOptions, type CrawlResponse$1 as CrawlResponse, type CreditUsage, type CreditUsageHistoricalPeriod, type CreditUsageHistoricalResponse, type Document, type DocumentMetadata, type ErrorDetails, type ExecuteJavascriptAction, type ExtractResponse$1 as ExtractResponse, Firecrawl, FirecrawlApp as FirecrawlAppV1, FirecrawlClient, type FirecrawlClientOptions, type Format, type FormatOption, type FormatString, JobTimeoutError, type JsonFormat, type LocationConfig$1 as LocationConfig, type MapData, type MapOptions, type PDFAction, type PaginationConfig, type PressAction, type QueueStatusResponse$1 as QueueStatusResponse, type ScrapeAction, type ScrapeOptions, type ScreenshotAction, type ScreenshotFormat, type ScrollAction, SdkError, type SearchData, type SearchRequest, type SearchResultImages, type SearchResultNews, type SearchResultWeb, type TokenUsage, type TokenUsageHistoricalPeriod, type TokenUsageHistoricalResponse, type Viewport, type WaitAction, type WebhookConfig, type WriteAction, Firecrawl as default };
1739
+ export { type ActionOption, type ActiveCrawl, type ActiveCrawlsResponse, type AgentOptions$1 as AgentOptions, type AgentResponse, type AgentStatusResponse, type AgentWebhookConfig, type AgentWebhookEvent, type AttributesFormat, type BatchScrapeJob, type BatchScrapeOptions, type BatchScrapeResponse$1 as BatchScrapeResponse, type BrandingProfile, type CategoryOption, type ChangeTrackingFormat, type ClickAction, type ConcurrencyCheck, type CrawlErrorsResponse$1 as CrawlErrorsResponse, type CrawlJob, type CrawlOptions, type CrawlResponse$1 as CrawlResponse, type CreditUsage, type CreditUsageHistoricalPeriod, type CreditUsageHistoricalResponse, type Document, type DocumentMetadata, type ErrorDetails, type ExecuteJavascriptAction, type ExtractResponse$1 as ExtractResponse, Firecrawl, FirecrawlApp as FirecrawlAppV1, FirecrawlClient, type FirecrawlClientOptions, type Format, type FormatOption, type FormatString, JobTimeoutError, type JsonFormat, type LocationConfig$1 as LocationConfig, type MapData, type MapOptions, type PDFAction, type PaginationConfig, type PressAction, type QueueStatusResponse$1 as QueueStatusResponse, type ScrapeAction, type ScrapeOptions, type ScreenshotAction, type ScreenshotFormat, type ScrollAction, SdkError, type SearchData, type SearchRequest, type SearchResultImages, type SearchResultNews, type SearchResultWeb, type TokenUsage, type TokenUsageHistoricalPeriod, type TokenUsageHistoricalResponse, type Viewport, type WaitAction, Watcher, type WatcherOptions, type WebhookConfig, type WriteAction, Firecrawl as default };
package/dist/index.d.ts CHANGED
@@ -110,7 +110,7 @@ interface ScrapeOptions {
110
110
  fastMode?: boolean;
111
111
  useMock?: string;
112
112
  blockAds?: boolean;
113
- proxy?: 'basic' | 'stealth' | 'auto' | string;
113
+ proxy?: 'basic' | 'stealth' | 'enhanced' | 'auto' | string;
114
114
  maxAge?: number;
115
115
  minAge?: number;
116
116
  storeInCache?: boolean;
@@ -954,7 +954,7 @@ interface CrawlScrapeOptions {
954
954
  skipTlsVerification?: boolean;
955
955
  removeBase64Images?: boolean;
956
956
  blockAds?: boolean;
957
- proxy?: "basic" | "stealth" | "auto";
957
+ proxy?: "basic" | "stealth" | "enhanced" | "auto";
958
958
  storeInCache?: boolean;
959
959
  maxAge?: number;
960
960
  parsePDF?: boolean;
@@ -1736,4 +1736,4 @@ declare class Firecrawl extends FirecrawlClient {
1736
1736
  get v1(): FirecrawlApp;
1737
1737
  }
1738
1738
 
1739
- export { type ActionOption, type ActiveCrawl, type ActiveCrawlsResponse, type AgentOptions$1 as AgentOptions, type AgentResponse, type AgentStatusResponse, type AgentWebhookConfig, type AgentWebhookEvent, type AttributesFormat, type BatchScrapeJob, type BatchScrapeOptions, type BatchScrapeResponse$1 as BatchScrapeResponse, type BrandingProfile, type CategoryOption, type ChangeTrackingFormat, type ClickAction, type ConcurrencyCheck, type CrawlErrorsResponse$1 as CrawlErrorsResponse, type CrawlJob, type CrawlOptions, type CrawlResponse$1 as CrawlResponse, type CreditUsage, type CreditUsageHistoricalPeriod, type CreditUsageHistoricalResponse, type Document, type DocumentMetadata, type ErrorDetails, type ExecuteJavascriptAction, type ExtractResponse$1 as ExtractResponse, Firecrawl, FirecrawlApp as FirecrawlAppV1, FirecrawlClient, type FirecrawlClientOptions, type Format, type FormatOption, type FormatString, JobTimeoutError, type JsonFormat, type LocationConfig$1 as LocationConfig, type MapData, type MapOptions, type PDFAction, type PaginationConfig, type PressAction, type QueueStatusResponse$1 as QueueStatusResponse, type ScrapeAction, type ScrapeOptions, type ScreenshotAction, type ScreenshotFormat, type ScrollAction, SdkError, type SearchData, type SearchRequest, type SearchResultImages, type SearchResultNews, type SearchResultWeb, type TokenUsage, type TokenUsageHistoricalPeriod, type TokenUsageHistoricalResponse, type Viewport, type WaitAction, type WebhookConfig, type WriteAction, Firecrawl as default };
1739
+ export { type ActionOption, type ActiveCrawl, type ActiveCrawlsResponse, type AgentOptions$1 as AgentOptions, type AgentResponse, type AgentStatusResponse, type AgentWebhookConfig, type AgentWebhookEvent, type AttributesFormat, type BatchScrapeJob, type BatchScrapeOptions, type BatchScrapeResponse$1 as BatchScrapeResponse, type BrandingProfile, type CategoryOption, type ChangeTrackingFormat, type ClickAction, type ConcurrencyCheck, type CrawlErrorsResponse$1 as CrawlErrorsResponse, type CrawlJob, type CrawlOptions, type CrawlResponse$1 as CrawlResponse, type CreditUsage, type CreditUsageHistoricalPeriod, type CreditUsageHistoricalResponse, type Document, type DocumentMetadata, type ErrorDetails, type ExecuteJavascriptAction, type ExtractResponse$1 as ExtractResponse, Firecrawl, FirecrawlApp as FirecrawlAppV1, FirecrawlClient, type FirecrawlClientOptions, type Format, type FormatOption, type FormatString, JobTimeoutError, type JsonFormat, type LocationConfig$1 as LocationConfig, type MapData, type MapOptions, type PDFAction, type PaginationConfig, type PressAction, type QueueStatusResponse$1 as QueueStatusResponse, type ScrapeAction, type ScrapeOptions, type ScreenshotAction, type ScreenshotFormat, type ScrollAction, SdkError, type SearchData, type SearchRequest, type SearchResultImages, type SearchResultNews, type SearchResultWeb, type TokenUsage, type TokenUsageHistoricalPeriod, type TokenUsageHistoricalResponse, type Viewport, type WaitAction, Watcher, type WatcherOptions, type WebhookConfig, type WriteAction, Firecrawl as default };
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  require_package
3
- } from "./chunk-UMVTH3OK.js";
3
+ } from "./chunk-G5AJUV7O.js";
4
4
 
5
5
  // src/v2/utils/httpClient.ts
6
6
  import axios from "axios";
@@ -1374,7 +1374,7 @@ var FirecrawlApp = class {
1374
1374
  if (typeof process !== "undefined" && process.env && process.env.npm_package_version) {
1375
1375
  return process.env.npm_package_version;
1376
1376
  }
1377
- const packageJson = await import("./package-4JFABD5Y.js");
1377
+ const packageJson = await import("./package-T35BK7SG.js");
1378
1378
  return packageJson.default.version;
1379
1379
  } catch (error) {
1380
1380
  const isTest = typeof process !== "undefined" && (process.env.JEST_WORKER_ID != null || false);
@@ -2752,5 +2752,6 @@ export {
2752
2752
  FirecrawlClient,
2753
2753
  JobTimeoutError,
2754
2754
  SdkError,
2755
+ Watcher,
2755
2756
  index_default as default
2756
2757
  };
@@ -1,4 +1,4 @@
1
1
  import {
2
2
  require_package
3
- } from "./chunk-UMVTH3OK.js";
3
+ } from "./chunk-G5AJUV7O.js";
4
4
  export default require_package();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mendable/firecrawl",
3
- "version": "4.11.4",
3
+ "version": "4.12.0",
4
4
  "description": "JavaScript SDK for Firecrawl API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -128,9 +128,9 @@ describe("v2.scrape e2e", () => {
128
128
  });
129
129
  expect(doc.images).toBeTruthy();
130
130
  expect(Array.isArray(doc.images)).toBe(true);
131
- expect(doc.images.length).toBeGreaterThan(0);
131
+ expect(doc.images?.length).toBeGreaterThan(0);
132
132
  // Should find firecrawl logo/branding images
133
- expect(doc.images.some(img => img.includes("firecrawl") || img.includes("logo"))).toBe(true);
133
+ expect(doc.images?.some(img => img.includes("firecrawl") || img.includes("logo"))).toBe(true);
134
134
  }, 60_000);
135
135
 
136
136
  test("images format: works with multiple formats", async () => {
@@ -142,7 +142,7 @@ describe("v2.scrape e2e", () => {
142
142
  expect(doc.links).toBeTruthy();
143
143
  expect(doc.images).toBeTruthy();
144
144
  expect(Array.isArray(doc.images)).toBe(true);
145
- expect(doc.images.length).toBeGreaterThan(0);
145
+ expect(doc.images?.length).toBeGreaterThan(0);
146
146
 
147
147
  // Images should find things not available in links format
148
148
  const imageExtensions = ['.jpg', '.jpeg', '.png', '.gif', '.webp', '.svg', '.ico'];
@@ -151,7 +151,7 @@ describe("v2.scrape e2e", () => {
151
151
  ) || [];
152
152
 
153
153
  // Should discover additional images beyond those with obvious extensions
154
- expect(doc.images.length).toBeGreaterThanOrEqual(linkImages.length);
154
+ expect(doc.images?.length).toBeGreaterThanOrEqual(linkImages.length);
155
155
  }, 60_000);
156
156
 
157
157
  test("invalid url should throw", async () => {
@@ -2,7 +2,7 @@
2
2
  * E2E tests for v2 search (translated from Python tests)
3
3
  */
4
4
  import Firecrawl from "../../../index";
5
- import type { Document, SearchResult } from "../../../index";
5
+ import type { Document, SearchResultWeb, SearchResultNews, SearchResultImages } from "../../../index";
6
6
  import { config } from "dotenv";
7
7
  import { getIdentity, getApiUrl } from "./utils/idmux";
8
8
  import { describe, test, expect, beforeAll } from "@jest/globals";
@@ -28,7 +28,7 @@ function collectTexts(entries: any[] | undefined): string[] {
28
28
  return texts;
29
29
  }
30
30
 
31
- function isDocument(entry: Document | SearchResult | undefined | null): entry is Document {
31
+ function isDocument(entry: Document | SearchResultWeb | SearchResultNews | SearchResultImages | undefined | null): entry is Document {
32
32
  if (!entry) return false;
33
33
  const d = entry as Document;
34
34
  return (
@@ -86,10 +86,10 @@ describe("v2.search e2e", () => {
86
86
  expect(results.images == null).toBe(true);
87
87
 
88
88
  const webTitles = (results.web || [])
89
- .filter((r): r is SearchResult => !isDocument(r))
89
+ .filter((r): r is SearchResultWeb => !isDocument(r))
90
90
  .map(r => (r.title || "").toString().toLowerCase());
91
91
  const webDescriptions = (results.web || [])
92
- .filter((r): r is SearchResult => !isDocument(r))
92
+ .filter((r): r is SearchResultWeb => !isDocument(r))
93
93
  .map(r => (r.description || "").toString().toLowerCase());
94
94
  const allWebText = (webTitles.concat(webDescriptions)).join(" ");
95
95
  expect(allWebText.includes("firecrawl")).toBe(true);
@@ -183,7 +183,7 @@ describe("v2.search e2e", () => {
183
183
  expect(Boolean(result.markdown) || Boolean(result.html)).toBe(true);
184
184
  } else {
185
185
  expect(typeof result.url).toBe("string");
186
- expect(result.url.startsWith("http")).toBe(true);
186
+ expect(result.url?.startsWith("http")).toBe(true);
187
187
  }
188
188
  }
189
189
  }
@@ -193,7 +193,7 @@ describe("v2.search e2e", () => {
193
193
  for (const result of results.images || []) {
194
194
  if (!isDocument(result)) {
195
195
  expect(typeof result.url).toBe("string");
196
- expect(result.url.startsWith("http")).toBe(true);
196
+ expect(result.url?.startsWith("http")).toBe(true);
197
197
  }
198
198
  }
199
199
  }, 120_000);
@@ -23,16 +23,15 @@ describe("v2.usage e2e", () => {
23
23
  expect(typeof resp.maxConcurrency).toBe("number");
24
24
  }, 60_000);
25
25
 
26
- // NOTE: Disabled, broken on central team due to overflow
27
- // test("get_credit_usage", async () => {
28
- // const resp = await client.getCreditUsage();
29
- // expect(typeof resp.remainingCredits).toBe("number");
30
- // }, 60_000);
31
-
32
- // test("get_token_usage", async () => {
33
- // const resp = await client.getTokenUsage();
34
- // expect(typeof resp.remainingTokens).toBe("number");
35
- // }, 60_000);
26
+ test("get_credit_usage", async () => {
27
+ const resp = await client.getCreditUsage();
28
+ expect(typeof resp.remainingCredits).toBe("number");
29
+ }, 60_000);
30
+
31
+ test("get_token_usage", async () => {
32
+ const resp = await client.getTokenUsage();
33
+ expect(typeof resp.remainingTokens).toBe("number");
34
+ }, 60_000);
36
35
 
37
36
  test("get_queue_status", async () => {
38
37
  const resp = await client.getQueueStatus();
package/src/index.ts CHANGED
@@ -9,6 +9,8 @@
9
9
  export { FirecrawlClient } from "./v2/client";
10
10
  /** Public v2 request/response types. */
11
11
  export * from "./v2/types";
12
+ /** Watcher class and options for crawl/batch job monitoring. */
13
+ export { Watcher, type WatcherOptions } from "./v2/watcher";
12
14
  /** Legacy v1 client (feature‑frozen). */
13
15
  export { default as FirecrawlAppV1 } from "./v1";
14
16
 
package/src/v1/index.ts CHANGED
@@ -131,7 +131,7 @@ export interface CrawlScrapeOptions {
131
131
  skipTlsVerification?: boolean;
132
132
  removeBase64Images?: boolean;
133
133
  blockAds?: boolean;
134
- proxy?: "basic" | "stealth" | "auto";
134
+ proxy?: "basic" | "stealth" | "enhanced" | "auto";
135
135
  storeInCache?: boolean;
136
136
  maxAge?: number;
137
137
  parsePDF?: boolean;
package/src/v2/types.ts CHANGED
@@ -153,7 +153,7 @@ export interface ScrapeOptions {
153
153
  fastMode?: boolean;
154
154
  useMock?: string;
155
155
  blockAds?: boolean;
156
- proxy?: 'basic' | 'stealth' | 'auto' | string;
156
+ proxy?: 'basic' | 'stealth' | 'enhanced' | 'auto' | string;
157
157
  maxAge?: number;
158
158
  minAge?: number;
159
159
  storeInCache?: boolean;