Upgrade FireCrawl document loader to the firecrawl JS SDK v4 (v2 API)#6474
Upgrade FireCrawl document loader to the firecrawl JS SDK v4 (v2 API)#6474rakshith48 wants to merge 6 commits into
Conversation
Replace the hand-rolled v1 REST client in the FireCrawl document loader
with the official @mendable/firecrawl-js v2 API (Firecrawl class) and bump
the dependency from ^1.18.2 to ^4.25.2.
- Use `new Firecrawl({ apiKey, apiUrl })` and its `.scrape` / `.crawl` /
`.search` / `.extract` methods instead of manual axios calls to /v1/*.
- Adapt to v2 response shapes: scrape/crawl return Document(s) directly
(no { success, data } envelope); crawl returns a CrawlJob with `.data`;
search returns results grouped by source (use `.web`).
- Preserve the node's inputs, modes, defaults, and Document/Text output
shape. Search `country` now maps to v2's single `location` field, since
v1's separate `lang`/`country` params were removed in v2.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…crawl-js) Both names dual-publish the identical v4 SDK; `firecrawl` is the current canonical package. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…crawl-js) Both names dual-publish the identical v4 SDK; `firecrawl` is the current canonical package. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…2 maxDiscoveryDepth Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request refactors the FireCrawl document loader to use the official firecrawl SDK instead of a custom Axios-based implementation, simplifying the codebase and updating the integration to the latest SDK version. Feedback on these changes highlights critical issues where the loader fails to check the success status of SDK operations (scrape, search, crawl, and extract), which could lead to unhandled failures or runtime type mismatches. Additionally, it is recommended to use loose equality checks (== null and != null) as a standard idiom for nullish checks in TypeScript.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
… success/status/error) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Thanks for the review! I applied one of these and respectfully declined the others — here's the reasoning: Applied — extract Declined —
So Declined — |
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Upgrades
packages/components/nodes/documentloaders/FireCrawl/FireCrawl.tsfrom the hand-rolled v1 axios calls to the officialfirecrawlJS SDK v4 (v2 API):.scrape/.crawl/.search/.extract+ typed responses. Node label/inputs/modes/output shape preserved; legacymaxDepthmapped tomaxDiscoveryDepthfor back-compat. Note: HTTP now goes through the SDK client instead ofsecureAxiosRequest— flagged for reviewer preference.Verification: static + SDK-introspection/mocked against the real v2 SDK (
firecrawl-py 4.28.2/@mendable firecrawl v4); not run against the live API. Happy to address review/CI feedback.🤖 Generated with Claude Code