fix(js-sdk): add webhook option to startExtract and extract methods#3318
Open
jaydeep-pipaliya wants to merge 1 commit intofirecrawl:mainfrom
Open
fix(js-sdk): add webhook option to startExtract and extract methods#3318jaydeep-pipaliya wants to merge 1 commit intofirecrawl:mainfrom
jaydeep-pipaliya wants to merge 1 commit intofirecrawl:mainfrom
Conversation
The startExtract and extract methods in the v2 JS SDK did not accept webhook configuration, despite the API supporting it and other async methods (crawl, batchScrape) already including it. Add webhook?: string | WebhookConfig | null to prepareExtractPayload and forward it to the request body, matching the pattern used in crawl and batchScrape. Fixes firecrawl#2582
a80af56 to
a49b967
Compare
Author
|
Gentle ping — this adds |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #2582.
The
startExtractandextractmethods in the v2 JS SDK did not acceptwebhookconfiguration in their TypeScript type definitions, even though the Firecrawl API supports webhooks for extract jobs and other async methods (crawl,batchScrape) already include it.webhook?: string | WebhookConfig | nulltoprepareExtractPayload()parameter typewebhookto the request body, matching the pattern used incrawl.ts(line 39) andbatch.ts(line 37)startExtract()andextract()viaParameters<typeof prepareExtractPayload>[0]Usage after fix:
Test plan
CrawlOptions.webhookandBatchScrapeOptions.webhookpatternswebhookis forwarded to request body using the sameif (args.webhook != null)guard ascrawl.tsandbatch.tsSummary by cubic
Adds webhook support to
startExtractandextractin the v2firecrawlJS SDK so extract jobs can send callbacks. Aligns extract withcrawlandbatchScrape.webhook?: string | WebhookConfig | nullinprepareExtractPayload, flowing tostartExtract/extract.webhookto the request body when provided.Written for commit a49b967. Summary will update on new commits.