firecrawl 4.30.1 → 4.31.1

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.
@@ -12,7 +12,7 @@ var require_package = __commonJS({
12
12
  "package.json"(exports, module) {
13
13
  module.exports = {
14
14
  name: "@mendable/firecrawl-js",
15
- version: "4.30.1",
15
+ version: "4.31.1",
16
16
  description: "JavaScript SDK for Firecrawl API",
17
17
  main: "dist/index.js",
18
18
  types: "dist/index.d.ts",
@@ -39,7 +39,7 @@ var require_package = __commonJS({
39
39
  license: "MIT",
40
40
  dependencies: {
41
41
  axios: "1.18.0",
42
- firecrawl: "4.16.0",
42
+ firecrawl: "4.30.1",
43
43
  "typescript-event-target": "^1.1.1",
44
44
  zod: "^3.23.8",
45
45
  "zod-to-json-schema": "^3.23.0"
@@ -73,22 +73,6 @@ var require_package = __commonJS({
73
73
  ],
74
74
  engines: {
75
75
  node: ">=22.0.0"
76
- },
77
- pnpm: {
78
- overrides: {
79
- "@isaacs/brace-expansion@<=5.0.0": ">=5.0.1",
80
- "minimatch@<10.2.3": ">=10.2.3",
81
- "rollup@<4.59.0": ">=4.59.0",
82
- "picomatch@<4.0.4": ">=4.0.4",
83
- handlebars: ">=4.7.9",
84
- "brace-expansion": ">=5.0.6",
85
- "js-yaml@>=3.0.0 <3.15.0": "3.15.0",
86
- "axios@>=1.0.0 <1.16.0": "1.16.1",
87
- "follow-redirects@<1.16.0": ">=1.16.0 <2.0.0",
88
- "form-data@>=4.0.0 <4.0.6": "4.0.6",
89
- "@babel/core@>=7.0.0 <7.29.6": "7.29.7",
90
- "esbuild@>=0.17.0 <0.28.1": "0.28.1"
91
- }
92
76
  }
93
77
  };
94
78
  }
package/dist/index.cjs CHANGED
@@ -39,7 +39,7 @@ var require_package = __commonJS({
39
39
  "package.json"(exports2, module2) {
40
40
  module2.exports = {
41
41
  name: "@mendable/firecrawl-js",
42
- version: "4.30.1",
42
+ version: "4.31.1",
43
43
  description: "JavaScript SDK for Firecrawl API",
44
44
  main: "dist/index.js",
45
45
  types: "dist/index.d.ts",
@@ -66,7 +66,7 @@ var require_package = __commonJS({
66
66
  license: "MIT",
67
67
  dependencies: {
68
68
  axios: "1.18.0",
69
- firecrawl: "4.16.0",
69
+ firecrawl: "4.30.1",
70
70
  "typescript-event-target": "^1.1.1",
71
71
  zod: "^3.23.8",
72
72
  "zod-to-json-schema": "^3.23.0"
@@ -100,22 +100,6 @@ var require_package = __commonJS({
100
100
  ],
101
101
  engines: {
102
102
  node: ">=22.0.0"
103
- },
104
- pnpm: {
105
- overrides: {
106
- "@isaacs/brace-expansion@<=5.0.0": ">=5.0.1",
107
- "minimatch@<10.2.3": ">=10.2.3",
108
- "rollup@<4.59.0": ">=4.59.0",
109
- "picomatch@<4.0.4": ">=4.0.4",
110
- handlebars: ">=4.7.9",
111
- "brace-expansion": ">=5.0.6",
112
- "js-yaml@>=3.0.0 <3.15.0": "3.15.0",
113
- "axios@>=1.0.0 <1.16.0": "1.16.1",
114
- "follow-redirects@<1.16.0": ">=1.16.0 <2.0.0",
115
- "form-data@>=4.0.0 <4.0.6": "4.0.6",
116
- "@babel/core@>=7.0.0 <7.29.6": "7.29.7",
117
- "esbuild@>=0.17.0 <0.28.1": "0.28.1"
118
- }
119
103
  }
120
104
  };
121
105
  }
@@ -802,6 +786,8 @@ function prepareMapPayload(url, options) {
802
786
  if (options.location != null) payload.location = options.location;
803
787
  if (options.threatProtection != null)
804
788
  payload.threatProtection = options.threatProtection;
789
+ if (options.auditMetadata != null)
790
+ payload.auditMetadata = options.auditMetadata;
805
791
  }
806
792
  return payload;
807
793
  }
@@ -1295,6 +1281,8 @@ function prepareAgentPayload(args) {
1295
1281
  if (args.webhook != null) body.webhook = args.webhook;
1296
1282
  if (args.threatProtection != null)
1297
1283
  body.threatProtection = args.threatProtection;
1284
+ if (args.auditMetadata != null)
1285
+ body.auditMetadata = args.auditMetadata;
1298
1286
  return body;
1299
1287
  }
1300
1288
  async function startAgent(http, args) {
package/dist/index.d.cts CHANGED
@@ -114,6 +114,9 @@ interface PDFAction {
114
114
  scale?: number;
115
115
  }
116
116
  type ActionOption = WaitAction | ScreenshotAction | ClickAction | WriteAction | PressAction | ScrollAction | ScrapeAction | ExecuteJavascriptAction | PDFAction;
117
+ interface AuditMetadata$1 {
118
+ username: string;
119
+ }
117
120
  interface ScrapeOptions {
118
121
  formats?: FormatOption[];
119
122
  headers?: Record<string, string>;
@@ -142,6 +145,7 @@ interface ScrapeOptions {
142
145
  lockdown?: boolean;
143
146
  redactPII?: boolean | RedactPIIOptions;
144
147
  threatProtection?: ThreatProtectionOptions;
148
+ auditMetadata?: AuditMetadata$1;
145
149
  profile?: {
146
150
  name: string;
147
151
  saveChanges?: boolean;
@@ -635,6 +639,7 @@ interface MapOptions {
635
639
  origin?: string;
636
640
  location?: LocationConfig$1;
637
641
  threatProtection?: ThreatProtectionOptions;
642
+ auditMetadata?: AuditMetadata$1;
638
643
  }
639
644
  type FeedbackRating = "good" | "partial" | "bad";
640
645
  type EndpointFeedbackEndpoint = "search" | "scrape" | "parse" | "map";
@@ -1294,6 +1299,7 @@ declare function prepareAgentPayload(args: {
1294
1299
  model?: "spark-1-pro" | "spark-1-mini";
1295
1300
  webhook?: string | AgentWebhookConfig;
1296
1301
  threatProtection?: ThreatProtectionOptions;
1302
+ auditMetadata?: AuditMetadata$1;
1297
1303
  }): Record<string, unknown>;
1298
1304
  declare function startAgent(http: HttpClient, args: Parameters<typeof prepareAgentPayload>[0]): Promise<AgentResponse>;
1299
1305
 
@@ -1836,6 +1842,9 @@ interface LocationConfig {
1836
1842
  country?: string;
1837
1843
  languages?: string[];
1838
1844
  }
1845
+ interface AuditMetadata {
1846
+ username: string;
1847
+ }
1839
1848
  /**
1840
1849
  * Parameters for scraping operations.
1841
1850
  * Defines the options and configurations available for scraping web content.
@@ -1857,6 +1866,7 @@ interface CrawlScrapeOptions {
1857
1866
  storeInCache?: boolean;
1858
1867
  maxAge?: number;
1859
1868
  parsePDF?: boolean;
1869
+ auditMetadata?: AuditMetadata;
1860
1870
  }
1861
1871
  type Action = {
1862
1872
  type: "wait";
@@ -2022,6 +2032,7 @@ interface MapParams {
2022
2032
  timeout?: number;
2023
2033
  useIndex?: boolean;
2024
2034
  location?: LocationConfig;
2035
+ auditMetadata?: AuditMetadata;
2025
2036
  }
2026
2037
  /**
2027
2038
  * Response interface for mapping operations.
@@ -2656,4 +2667,4 @@ declare class Firecrawl extends FirecrawlClient {
2656
2667
  get v1(): FirecrawlApp;
2657
2668
  }
2658
2669
 
2659
- 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 BrowserCreateResponse, type BrowserDeleteResponse, type BrowserExecuteResponse, type BrowserListResponse, type BrowserSession, type CategoryOption, type ChangeTrackingFormat, type ClickAction, type ConcurrencyCheck, type CrawlErrorsResponse$1 as CrawlErrorsResponse, type CrawlJob, type CrawlOptions, type CrawlResponse$1 as CrawlResponse, type CreateMonitorRequest, type CreditUsage, type CreditUsageHistoricalPeriod, type CreditUsageHistoricalResponse, type Document, type DocumentMetadata, type EndpointFeedbackEndpoint, type EndpointFeedbackRequest, type ErrorDetails, type ExecuteJavascriptAction, type ExtractResponse$1 as ExtractResponse, type FeedbackMissingContent, type FeedbackRating, type FeedbackResponse, type FeedbackValuableSource, Firecrawl, FirecrawlApp as FirecrawlAppV1, FirecrawlClient, type FirecrawlClientInput, type FirecrawlClientOptions, type Format, type FormatOption, type FormatString, type GetMonitorCheckOptions, type GetPaperOptions, type GitHubScoreBreakdown, type GitHubSearchItem, type GitHubSearchResponse, type HighlightsFormat, type IdMap, JobTimeoutError, type JsonFormat, type ListMonitorChecksOptions, type ListMonitorsOptions, type LocationConfig$1 as LocationConfig, type MapData, type MapOptions, type MenuAvailability, type MenuImage, type MenuItem, type MenuItemIdentifiers, type MenuMerchant, type MenuPrice, type MenuProfile, type MenuSection, type Monitor, type MonitorCheck, type MonitorCheckDetail, type MonitorCheckPage, type MonitorCrawlTarget, type MonitorCrawlTargetResult, type MonitorEmailNotification, type MonitorEmailRecipientSubscription, type MonitorJsonFieldDiff, type MonitorNotification, type MonitorPageDiff, type MonitorPageJudgment, type MonitorPageSnapshot, type MonitorSchedule, type MonitorScrapeTarget, type MonitorScrapeTargetResult, type MonitorSearchTarget, type MonitorSearchTargetResult, type MonitorSummary, type MonitorTarget, type MonitorTargetResult, type MonitorWebhookConfig, type PDFAction, type PaginationConfig, type PaperMetadata, type PaperMetadataResponse, type PaperResult, type PaperSignals, type ParseFile, type ParseFileData, type ParseFormat, type ParseFormatOption, type ParseFormatString, type ParseOptions, type Passage, type PressAction, type ProductAvailability, type ProductImage, type ProductPrice, type ProductProfile, type ProductSale, type ProductVariant, type QueryFormat, type QuestionFormat, type QueueStatusResponse$1 as QueueStatusResponse, type ReadPaperResponse, type RedactPIIEntity, type RedactPIIOptions, ResearchClient, type ScrapeAction, type ScrapeBrowserDeleteResponse, type ScrapeExecuteRequest, type ScrapeExecuteResponse, type ScrapeOptions, type ScreenshotAction, type ScreenshotFormat, type ScrollAction, SdkError, type SearchData, type SearchFeedbackRequest, type SearchGithubOptions, type SearchPapersOptions, type SearchPapersResponse, type SearchRequest, type SearchResultImages, type SearchResultNews, type SearchResultWeb, type SimilarPapersOptions, type SimilarPapersResponse, type ThreatProtectionOptions, type TokenUsage, type TokenUsageHistoricalPeriod, type TokenUsageHistoricalResponse, type UpdateMonitorRequest, type Viewport, type WaitAction, Watcher, type WatcherOptions, type WebhookConfig, type WriteAction, Firecrawl as default };
2670
+ export { type ActionOption, type ActiveCrawl, type ActiveCrawlsResponse, type AgentOptions$1 as AgentOptions, type AgentResponse, type AgentStatusResponse, type AgentWebhookConfig, type AgentWebhookEvent, type AttributesFormat, type AuditMetadata$1 as AuditMetadata, type BatchScrapeJob, type BatchScrapeOptions, type BatchScrapeResponse$1 as BatchScrapeResponse, type BrandingProfile, type BrowserCreateResponse, type BrowserDeleteResponse, type BrowserExecuteResponse, type BrowserListResponse, type BrowserSession, type CategoryOption, type ChangeTrackingFormat, type ClickAction, type ConcurrencyCheck, type CrawlErrorsResponse$1 as CrawlErrorsResponse, type CrawlJob, type CrawlOptions, type CrawlResponse$1 as CrawlResponse, type CreateMonitorRequest, type CreditUsage, type CreditUsageHistoricalPeriod, type CreditUsageHistoricalResponse, type Document, type DocumentMetadata, type EndpointFeedbackEndpoint, type EndpointFeedbackRequest, type ErrorDetails, type ExecuteJavascriptAction, type ExtractResponse$1 as ExtractResponse, type FeedbackMissingContent, type FeedbackRating, type FeedbackResponse, type FeedbackValuableSource, Firecrawl, FirecrawlApp as FirecrawlAppV1, FirecrawlClient, type FirecrawlClientInput, type FirecrawlClientOptions, type Format, type FormatOption, type FormatString, type GetMonitorCheckOptions, type GetPaperOptions, type GitHubScoreBreakdown, type GitHubSearchItem, type GitHubSearchResponse, type HighlightsFormat, type IdMap, JobTimeoutError, type JsonFormat, type ListMonitorChecksOptions, type ListMonitorsOptions, type LocationConfig$1 as LocationConfig, type MapData, type MapOptions, type MenuAvailability, type MenuImage, type MenuItem, type MenuItemIdentifiers, type MenuMerchant, type MenuPrice, type MenuProfile, type MenuSection, type Monitor, type MonitorCheck, type MonitorCheckDetail, type MonitorCheckPage, type MonitorCrawlTarget, type MonitorCrawlTargetResult, type MonitorEmailNotification, type MonitorEmailRecipientSubscription, type MonitorJsonFieldDiff, type MonitorNotification, type MonitorPageDiff, type MonitorPageJudgment, type MonitorPageSnapshot, type MonitorSchedule, type MonitorScrapeTarget, type MonitorScrapeTargetResult, type MonitorSearchTarget, type MonitorSearchTargetResult, type MonitorSummary, type MonitorTarget, type MonitorTargetResult, type MonitorWebhookConfig, type PDFAction, type PaginationConfig, type PaperMetadata, type PaperMetadataResponse, type PaperResult, type PaperSignals, type ParseFile, type ParseFileData, type ParseFormat, type ParseFormatOption, type ParseFormatString, type ParseOptions, type Passage, type PressAction, type ProductAvailability, type ProductImage, type ProductPrice, type ProductProfile, type ProductSale, type ProductVariant, type QueryFormat, type QuestionFormat, type QueueStatusResponse$1 as QueueStatusResponse, type ReadPaperResponse, type RedactPIIEntity, type RedactPIIOptions, ResearchClient, type ScrapeAction, type ScrapeBrowserDeleteResponse, type ScrapeExecuteRequest, type ScrapeExecuteResponse, type ScrapeOptions, type ScreenshotAction, type ScreenshotFormat, type ScrollAction, SdkError, type SearchData, type SearchFeedbackRequest, type SearchGithubOptions, type SearchPapersOptions, type SearchPapersResponse, type SearchRequest, type SearchResultImages, type SearchResultNews, type SearchResultWeb, type SimilarPapersOptions, type SimilarPapersResponse, type ThreatProtectionOptions, type TokenUsage, type TokenUsageHistoricalPeriod, type TokenUsageHistoricalResponse, type UpdateMonitorRequest, type Viewport, type WaitAction, Watcher, type WatcherOptions, type WebhookConfig, type WriteAction, Firecrawl as default };
package/dist/index.d.ts CHANGED
@@ -114,6 +114,9 @@ interface PDFAction {
114
114
  scale?: number;
115
115
  }
116
116
  type ActionOption = WaitAction | ScreenshotAction | ClickAction | WriteAction | PressAction | ScrollAction | ScrapeAction | ExecuteJavascriptAction | PDFAction;
117
+ interface AuditMetadata$1 {
118
+ username: string;
119
+ }
117
120
  interface ScrapeOptions {
118
121
  formats?: FormatOption[];
119
122
  headers?: Record<string, string>;
@@ -142,6 +145,7 @@ interface ScrapeOptions {
142
145
  lockdown?: boolean;
143
146
  redactPII?: boolean | RedactPIIOptions;
144
147
  threatProtection?: ThreatProtectionOptions;
148
+ auditMetadata?: AuditMetadata$1;
145
149
  profile?: {
146
150
  name: string;
147
151
  saveChanges?: boolean;
@@ -635,6 +639,7 @@ interface MapOptions {
635
639
  origin?: string;
636
640
  location?: LocationConfig$1;
637
641
  threatProtection?: ThreatProtectionOptions;
642
+ auditMetadata?: AuditMetadata$1;
638
643
  }
639
644
  type FeedbackRating = "good" | "partial" | "bad";
640
645
  type EndpointFeedbackEndpoint = "search" | "scrape" | "parse" | "map";
@@ -1294,6 +1299,7 @@ declare function prepareAgentPayload(args: {
1294
1299
  model?: "spark-1-pro" | "spark-1-mini";
1295
1300
  webhook?: string | AgentWebhookConfig;
1296
1301
  threatProtection?: ThreatProtectionOptions;
1302
+ auditMetadata?: AuditMetadata$1;
1297
1303
  }): Record<string, unknown>;
1298
1304
  declare function startAgent(http: HttpClient, args: Parameters<typeof prepareAgentPayload>[0]): Promise<AgentResponse>;
1299
1305
 
@@ -1836,6 +1842,9 @@ interface LocationConfig {
1836
1842
  country?: string;
1837
1843
  languages?: string[];
1838
1844
  }
1845
+ interface AuditMetadata {
1846
+ username: string;
1847
+ }
1839
1848
  /**
1840
1849
  * Parameters for scraping operations.
1841
1850
  * Defines the options and configurations available for scraping web content.
@@ -1857,6 +1866,7 @@ interface CrawlScrapeOptions {
1857
1866
  storeInCache?: boolean;
1858
1867
  maxAge?: number;
1859
1868
  parsePDF?: boolean;
1869
+ auditMetadata?: AuditMetadata;
1860
1870
  }
1861
1871
  type Action = {
1862
1872
  type: "wait";
@@ -2022,6 +2032,7 @@ interface MapParams {
2022
2032
  timeout?: number;
2023
2033
  useIndex?: boolean;
2024
2034
  location?: LocationConfig;
2035
+ auditMetadata?: AuditMetadata;
2025
2036
  }
2026
2037
  /**
2027
2038
  * Response interface for mapping operations.
@@ -2656,4 +2667,4 @@ declare class Firecrawl extends FirecrawlClient {
2656
2667
  get v1(): FirecrawlApp;
2657
2668
  }
2658
2669
 
2659
- 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 BrowserCreateResponse, type BrowserDeleteResponse, type BrowserExecuteResponse, type BrowserListResponse, type BrowserSession, type CategoryOption, type ChangeTrackingFormat, type ClickAction, type ConcurrencyCheck, type CrawlErrorsResponse$1 as CrawlErrorsResponse, type CrawlJob, type CrawlOptions, type CrawlResponse$1 as CrawlResponse, type CreateMonitorRequest, type CreditUsage, type CreditUsageHistoricalPeriod, type CreditUsageHistoricalResponse, type Document, type DocumentMetadata, type EndpointFeedbackEndpoint, type EndpointFeedbackRequest, type ErrorDetails, type ExecuteJavascriptAction, type ExtractResponse$1 as ExtractResponse, type FeedbackMissingContent, type FeedbackRating, type FeedbackResponse, type FeedbackValuableSource, Firecrawl, FirecrawlApp as FirecrawlAppV1, FirecrawlClient, type FirecrawlClientInput, type FirecrawlClientOptions, type Format, type FormatOption, type FormatString, type GetMonitorCheckOptions, type GetPaperOptions, type GitHubScoreBreakdown, type GitHubSearchItem, type GitHubSearchResponse, type HighlightsFormat, type IdMap, JobTimeoutError, type JsonFormat, type ListMonitorChecksOptions, type ListMonitorsOptions, type LocationConfig$1 as LocationConfig, type MapData, type MapOptions, type MenuAvailability, type MenuImage, type MenuItem, type MenuItemIdentifiers, type MenuMerchant, type MenuPrice, type MenuProfile, type MenuSection, type Monitor, type MonitorCheck, type MonitorCheckDetail, type MonitorCheckPage, type MonitorCrawlTarget, type MonitorCrawlTargetResult, type MonitorEmailNotification, type MonitorEmailRecipientSubscription, type MonitorJsonFieldDiff, type MonitorNotification, type MonitorPageDiff, type MonitorPageJudgment, type MonitorPageSnapshot, type MonitorSchedule, type MonitorScrapeTarget, type MonitorScrapeTargetResult, type MonitorSearchTarget, type MonitorSearchTargetResult, type MonitorSummary, type MonitorTarget, type MonitorTargetResult, type MonitorWebhookConfig, type PDFAction, type PaginationConfig, type PaperMetadata, type PaperMetadataResponse, type PaperResult, type PaperSignals, type ParseFile, type ParseFileData, type ParseFormat, type ParseFormatOption, type ParseFormatString, type ParseOptions, type Passage, type PressAction, type ProductAvailability, type ProductImage, type ProductPrice, type ProductProfile, type ProductSale, type ProductVariant, type QueryFormat, type QuestionFormat, type QueueStatusResponse$1 as QueueStatusResponse, type ReadPaperResponse, type RedactPIIEntity, type RedactPIIOptions, ResearchClient, type ScrapeAction, type ScrapeBrowserDeleteResponse, type ScrapeExecuteRequest, type ScrapeExecuteResponse, type ScrapeOptions, type ScreenshotAction, type ScreenshotFormat, type ScrollAction, SdkError, type SearchData, type SearchFeedbackRequest, type SearchGithubOptions, type SearchPapersOptions, type SearchPapersResponse, type SearchRequest, type SearchResultImages, type SearchResultNews, type SearchResultWeb, type SimilarPapersOptions, type SimilarPapersResponse, type ThreatProtectionOptions, type TokenUsage, type TokenUsageHistoricalPeriod, type TokenUsageHistoricalResponse, type UpdateMonitorRequest, type Viewport, type WaitAction, Watcher, type WatcherOptions, type WebhookConfig, type WriteAction, Firecrawl as default };
2670
+ export { type ActionOption, type ActiveCrawl, type ActiveCrawlsResponse, type AgentOptions$1 as AgentOptions, type AgentResponse, type AgentStatusResponse, type AgentWebhookConfig, type AgentWebhookEvent, type AttributesFormat, type AuditMetadata$1 as AuditMetadata, type BatchScrapeJob, type BatchScrapeOptions, type BatchScrapeResponse$1 as BatchScrapeResponse, type BrandingProfile, type BrowserCreateResponse, type BrowserDeleteResponse, type BrowserExecuteResponse, type BrowserListResponse, type BrowserSession, type CategoryOption, type ChangeTrackingFormat, type ClickAction, type ConcurrencyCheck, type CrawlErrorsResponse$1 as CrawlErrorsResponse, type CrawlJob, type CrawlOptions, type CrawlResponse$1 as CrawlResponse, type CreateMonitorRequest, type CreditUsage, type CreditUsageHistoricalPeriod, type CreditUsageHistoricalResponse, type Document, type DocumentMetadata, type EndpointFeedbackEndpoint, type EndpointFeedbackRequest, type ErrorDetails, type ExecuteJavascriptAction, type ExtractResponse$1 as ExtractResponse, type FeedbackMissingContent, type FeedbackRating, type FeedbackResponse, type FeedbackValuableSource, Firecrawl, FirecrawlApp as FirecrawlAppV1, FirecrawlClient, type FirecrawlClientInput, type FirecrawlClientOptions, type Format, type FormatOption, type FormatString, type GetMonitorCheckOptions, type GetPaperOptions, type GitHubScoreBreakdown, type GitHubSearchItem, type GitHubSearchResponse, type HighlightsFormat, type IdMap, JobTimeoutError, type JsonFormat, type ListMonitorChecksOptions, type ListMonitorsOptions, type LocationConfig$1 as LocationConfig, type MapData, type MapOptions, type MenuAvailability, type MenuImage, type MenuItem, type MenuItemIdentifiers, type MenuMerchant, type MenuPrice, type MenuProfile, type MenuSection, type Monitor, type MonitorCheck, type MonitorCheckDetail, type MonitorCheckPage, type MonitorCrawlTarget, type MonitorCrawlTargetResult, type MonitorEmailNotification, type MonitorEmailRecipientSubscription, type MonitorJsonFieldDiff, type MonitorNotification, type MonitorPageDiff, type MonitorPageJudgment, type MonitorPageSnapshot, type MonitorSchedule, type MonitorScrapeTarget, type MonitorScrapeTargetResult, type MonitorSearchTarget, type MonitorSearchTargetResult, type MonitorSummary, type MonitorTarget, type MonitorTargetResult, type MonitorWebhookConfig, type PDFAction, type PaginationConfig, type PaperMetadata, type PaperMetadataResponse, type PaperResult, type PaperSignals, type ParseFile, type ParseFileData, type ParseFormat, type ParseFormatOption, type ParseFormatString, type ParseOptions, type Passage, type PressAction, type ProductAvailability, type ProductImage, type ProductPrice, type ProductProfile, type ProductSale, type ProductVariant, type QueryFormat, type QuestionFormat, type QueueStatusResponse$1 as QueueStatusResponse, type ReadPaperResponse, type RedactPIIEntity, type RedactPIIOptions, ResearchClient, type ScrapeAction, type ScrapeBrowserDeleteResponse, type ScrapeExecuteRequest, type ScrapeExecuteResponse, type ScrapeOptions, type ScreenshotAction, type ScreenshotFormat, type ScrollAction, SdkError, type SearchData, type SearchFeedbackRequest, type SearchGithubOptions, type SearchPapersOptions, type SearchPapersResponse, type SearchRequest, type SearchResultImages, type SearchResultNews, type SearchResultWeb, type SimilarPapersOptions, type SimilarPapersResponse, type ThreatProtectionOptions, type TokenUsage, type TokenUsageHistoricalPeriod, type TokenUsageHistoricalResponse, type UpdateMonitorRequest, 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-2LUWTM44.js";
3
+ } from "./chunk-BEF2NAMB.js";
4
4
 
5
5
  // src/v2/utils/httpClient.ts
6
6
  import axios from "axios";
@@ -669,6 +669,8 @@ function prepareMapPayload(url, options) {
669
669
  if (options.location != null) payload.location = options.location;
670
670
  if (options.threatProtection != null)
671
671
  payload.threatProtection = options.threatProtection;
672
+ if (options.auditMetadata != null)
673
+ payload.auditMetadata = options.auditMetadata;
672
674
  }
673
675
  return payload;
674
676
  }
@@ -1162,6 +1164,8 @@ function prepareAgentPayload(args) {
1162
1164
  if (args.webhook != null) body.webhook = args.webhook;
1163
1165
  if (args.threatProtection != null)
1164
1166
  body.threatProtection = args.threatProtection;
1167
+ if (args.auditMetadata != null)
1168
+ body.auditMetadata = args.auditMetadata;
1165
1169
  return body;
1166
1170
  }
1167
1171
  async function startAgent(http, args) {
@@ -2312,7 +2316,7 @@ var FirecrawlApp = class {
2312
2316
  if (typeof process !== "undefined" && process.env && process.env.npm_package_version) {
2313
2317
  return process.env.npm_package_version;
2314
2318
  }
2315
- const packageJson = await import("./package-2VNCXFNY.js");
2319
+ const packageJson = await import("./package-GIVYQAT4.js");
2316
2320
  return packageJson.default.version;
2317
2321
  } catch (error) {
2318
2322
  const isTest = typeof process !== "undefined" && (process.env.JEST_WORKER_ID != null || false);
@@ -1,4 +1,4 @@
1
1
  import {
2
2
  require_package
3
- } from "./chunk-2LUWTM44.js";
3
+ } from "./chunk-BEF2NAMB.js";
4
4
  export default require_package();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "firecrawl",
3
- "version": "4.30.1",
3
+ "version": "4.31.1",
4
4
  "description": "JavaScript SDK for Firecrawl API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,3 +1,16 @@
1
1
  allowBuilds:
2
2
  esbuild: true
3
3
  unrs-resolver: true
4
+ overrides:
5
+ "@isaacs/brace-expansion@<=5.0.0": ">=5.0.1"
6
+ "minimatch@<10.2.3": ">=10.2.3"
7
+ "rollup@<4.59.0": ">=4.59.0"
8
+ "picomatch@<4.0.4": ">=4.0.4"
9
+ handlebars: ">=4.7.9"
10
+ "brace-expansion@>=5.0.0 <5.0.8": "5.0.8"
11
+ "js-yaml@>=3.0.0 <3.15.0": "3.15.0"
12
+ "axios@>=1.0.0 <1.16.0": "1.16.1"
13
+ "follow-redirects@<1.16.0": ">=1.16.0 <2.0.0"
14
+ "form-data@>=4.0.0 <4.0.6": "4.0.6"
15
+ "@babel/core@>=7.0.0 <7.29.6": "7.29.7"
16
+ "esbuild@>=0.17.0 <0.28.1": "0.28.1"
@@ -0,0 +1,79 @@
1
+ import { describe, test, expect, jest } from "@jest/globals";
2
+ import { scrape } from "../../../v2/methods/scrape";
3
+ import { startBatchScrape } from "../../../v2/methods/batch";
4
+ import { startCrawl } from "../../../v2/methods/crawl";
5
+ import { search } from "../../../v2/methods/search";
6
+ import { map } from "../../../v2/methods/map";
7
+ import { startExtract } from "../../../v2/methods/extract";
8
+ import { startAgent } from "../../../v2/methods/agent";
9
+
10
+ const auditMetadata = { username: "alice@example.com" };
11
+
12
+ function makeHttp(data: Record<string, unknown>) {
13
+ const post = jest.fn(async () => ({ status: 200, data }));
14
+ return {
15
+ post,
16
+ prepareHeaders: jest.fn(() => undefined),
17
+ } as any;
18
+ }
19
+
20
+ describe("v2 auditMetadata request serialization", () => {
21
+ test("scrape and batch scrape send metadata at the top level", async () => {
22
+ const scrapeHttp = makeHttp({ success: true, data: {} });
23
+ await scrape(scrapeHttp, "https://example.com", { auditMetadata });
24
+ expect(scrapeHttp.post.mock.calls[0][1]).toEqual(
25
+ expect.objectContaining({ auditMetadata }),
26
+ );
27
+
28
+ const batchHttp = makeHttp({ success: true, id: "job", url: "u" });
29
+ await startBatchScrape(batchHttp, ["https://example.com"], {
30
+ options: { auditMetadata },
31
+ });
32
+ expect(batchHttp.post.mock.calls[0][1]).toEqual(
33
+ expect.objectContaining({ auditMetadata }),
34
+ );
35
+ });
36
+
37
+ test("crawl, search, and extract send metadata under scrapeOptions", async () => {
38
+ const crawlHttp = makeHttp({ success: true, id: "job", url: "u" });
39
+ await startCrawl(crawlHttp, {
40
+ url: "https://example.com",
41
+ scrapeOptions: { auditMetadata },
42
+ });
43
+ expect(crawlHttp.post.mock.calls[0][1]).toEqual(
44
+ expect.objectContaining({ scrapeOptions: expect.objectContaining({ auditMetadata }) }),
45
+ );
46
+
47
+ const searchHttp = makeHttp({ success: true, data: {} });
48
+ await search(searchHttp, {
49
+ query: "example",
50
+ scrapeOptions: { auditMetadata },
51
+ });
52
+ expect(searchHttp.post.mock.calls[0][1]).toEqual(
53
+ expect.objectContaining({ scrapeOptions: expect.objectContaining({ auditMetadata }) }),
54
+ );
55
+
56
+ const extractHttp = makeHttp({ success: true, id: "job" });
57
+ await startExtract(extractHttp, {
58
+ urls: ["https://example.com"],
59
+ scrapeOptions: { auditMetadata },
60
+ });
61
+ expect(extractHttp.post.mock.calls[0][1]).toEqual(
62
+ expect.objectContaining({ scrapeOptions: expect.objectContaining({ auditMetadata }) }),
63
+ );
64
+ });
65
+
66
+ test("map and agent send metadata at the top level", async () => {
67
+ const mapHttp = makeHttp({ success: true, links: [] });
68
+ await map(mapHttp, "https://example.com", { auditMetadata });
69
+ expect(mapHttp.post.mock.calls[0][1]).toEqual(
70
+ expect.objectContaining({ auditMetadata }),
71
+ );
72
+
73
+ const agentHttp = makeHttp({ success: true, id: "job" });
74
+ await startAgent(agentHttp, { prompt: "find pricing", auditMetadata });
75
+ expect(agentHttp.post.mock.calls[0][1]).toEqual(
76
+ expect.objectContaining({ auditMetadata }),
77
+ );
78
+ });
79
+ });
package/src/v1/index.ts CHANGED
@@ -114,6 +114,10 @@ export interface LocationConfig {
114
114
  languages?: string[];
115
115
  }
116
116
 
117
+ export interface AuditMetadata {
118
+ username: string;
119
+ }
120
+
117
121
  /**
118
122
  * Parameters for scraping operations.
119
123
  * Defines the options and configurations available for scraping web content.
@@ -135,6 +139,7 @@ export interface CrawlScrapeOptions {
135
139
  storeInCache?: boolean;
136
140
  maxAge?: number;
137
141
  parsePDF?: boolean;
142
+ auditMetadata?: AuditMetadata;
138
143
  }
139
144
 
140
145
  export type Action = {
@@ -310,6 +315,7 @@ export interface MapParams {
310
315
  timeout?: number;
311
316
  useIndex?: boolean;
312
317
  location?: LocationConfig;
318
+ auditMetadata?: AuditMetadata;
313
319
  }
314
320
 
315
321
  /**
@@ -1,4 +1,4 @@
1
- import { type AgentResponse, type AgentStatusResponse, type AgentWebhookConfig, type ThreatProtectionOptions } from "../types";
1
+ import { type AgentResponse, type AgentStatusResponse, type AgentWebhookConfig, type AuditMetadata, type ThreatProtectionOptions } from "../types";
2
2
  import { HttpClient } from "../utils/httpClient";
3
3
  import { normalizeAxiosError, throwForBadResponse } from "../utils/errorHandler";
4
4
  import { isZodSchema, zodSchemaToJsonSchema } from "../../utils/zodSchemaToJson";
@@ -15,6 +15,7 @@ function prepareAgentPayload(args: {
15
15
  model?: "spark-1-pro" | "spark-1-mini";
16
16
  webhook?: string | AgentWebhookConfig;
17
17
  threatProtection?: ThreatProtectionOptions;
18
+ auditMetadata?: AuditMetadata;
18
19
  }): Record<string, unknown> {
19
20
  const body: Record<string, unknown> = {};
20
21
  if (args.urls) body.urls = args.urls;
@@ -30,6 +31,8 @@ function prepareAgentPayload(args: {
30
31
  if (args.webhook != null) body.webhook = args.webhook;
31
32
  if (args.threatProtection != null)
32
33
  body.threatProtection = args.threatProtection;
34
+ if (args.auditMetadata != null)
35
+ body.auditMetadata = args.auditMetadata;
33
36
  return body;
34
37
  }
35
38
 
@@ -26,6 +26,8 @@ function prepareMapPayload(
26
26
  if (options.location != null) payload.location = options.location;
27
27
  if (options.threatProtection != null)
28
28
  payload.threatProtection = options.threatProtection;
29
+ if (options.auditMetadata != null)
30
+ payload.auditMetadata = options.auditMetadata;
29
31
  }
30
32
  return payload;
31
33
  }
package/src/v2/types.ts CHANGED
@@ -183,6 +183,10 @@ export type ActionOption =
183
183
  | ExecuteJavascriptAction
184
184
  | PDFAction;
185
185
 
186
+ export interface AuditMetadata {
187
+ username: string;
188
+ }
189
+
186
190
  export interface ScrapeOptions {
187
191
  formats?: FormatOption[];
188
192
  headers?: Record<string, string>;
@@ -209,6 +213,7 @@ export interface ScrapeOptions {
209
213
  lockdown?: boolean;
210
214
  redactPII?: boolean | RedactPIIOptions;
211
215
  threatProtection?: ThreatProtectionOptions;
216
+ auditMetadata?: AuditMetadata;
212
217
  profile?: {
213
218
  name: string;
214
219
  saveChanges?: boolean;
@@ -796,6 +801,7 @@ export interface MapOptions {
796
801
  origin?: string;
797
802
  location?: LocationConfig;
798
803
  threatProtection?: ThreatProtectionOptions;
804
+ auditMetadata?: AuditMetadata;
799
805
  }
800
806
 
801
807
  export type FeedbackRating = "good" | "partial" | "bad";