Skip to content

Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥

Nick: add back origin to the js sdks

Nicolas8e6631117f8c
diff --git a/apps/js-sdk/firecrawl/package.json b/apps/js-sdk/firecrawl/package.json
index 6f26a8430..67240683f 100644
--- a/apps/js-sdk/firecrawl/package.json
+++ b/apps/js-sdk/firecrawl/package.json
@@ -1,6 +1,6 @@
{
"name": "@mendable/firecrawl-js",
- "version": "4.15.1",
+ "version": "4.15.2",
"description": "JavaScript SDK for Firecrawl API",
"main": "dist/index.js",
"types": "dist/index.d.ts",
diff --git a/apps/js-sdk/firecrawl/src/v2/methods/agent.ts b/apps/js-sdk/firecrawl/src/v2/methods/agent.ts
index ad7b4c482..d789d66b3 100644
--- a/apps/js-sdk/firecrawl/src/v2/methods/agent.ts
+++ b/apps/js-sdk/firecrawl/src/v2/methods/agent.ts
@@ -9,6 +9,7 @@ function prepareAgentPayload(args: {
prompt: string;
schema?: Record<string, unknown> | ZodTypeAny;
integration?: string;
+ origin?: string;
maxCredits?: number;
strictConstrainToURLs?: boolean;
model?: "spark-1-pro" | "spark-1-mini";
@@ -21,6 +22,7 @@ function prepareAgentPayload(args: {
body.schema = isZodSchema(args.schema) ? zodSchemaToJsonSchema(args.schema) : args.schema;
}
if (args.integration && args.integration.trim()) body.integration = args.integration.trim();
+ if (args.origin) body.origin = args.origin;
if (args.maxCredits !== null && args.maxCredits !== undefined) body.maxCredits = args.maxCredits;
if (args.strictConstrainToURLs !== null && args.strictConstrainToURLs !== undefined) body.strictConstrainToURLs = args.strictConstrainToURLs;
if (args.model !== null && args.model !== undefined) body.model = args.model;
diff --git a/apps/js-sdk/firecrawl/src/v2/methods/batch.ts b/apps/js-sdk/firecrawl/src/v2/methods/batch.ts
index 58ebf6b1a..d21f23294 100644
--- a/apps/js-sdk/firecrawl/src/v2/methods/batch.ts
+++ b/apps/js-sdk/firecrawl/src/v2/methods/batch.ts
@@ -25,6 +25,7 @@ export async function startBatchScrape(
zeroDataRetention,
idempotencyKey,
integration,
+ origin,
}: BatchScrapeOptions = {}
): Promise<BatchScrapeResponse> {
if (!Array.isArray(urls) || urls.length === 0) throw new Error("URLs list cannot be empty");
@@ -39,6 +40,7 @@ export async function startBatchScrape(
if (maxConcurrency != null) payload.maxConcurrency = maxConcurrency;
if (zeroDataRetention != null) payload.zeroDataRetention = zeroDataRetention;
if (integration != null && integration.trim()) payload.integration = integration.trim();
+ if (origin) payload.origin = origin;
try {
const headers = http.prepareHeaders(idempotencyKey);
diff --git a/apps/js-sdk/firecrawl/src/v2/methods/browser.ts b/apps/js-sdk/firecrawl/src/v2/methods/browser.ts
index 23e4be006..31a39ba13 100644
--- a/apps/js-sdk/firecrawl/src/v2/methods/browser.ts
+++ b/apps/js-sdk/firecrawl/src/v2/methods/browser.ts
@@ -18,6 +18,7 @@ export async function browser(
saveChanges?: boolean;
};
integration?: string;
+ origin?: string;
} = {}
): Promise<BrowserCreateResponse> {
const body: Record<string, unknown> = {};
@@ -26,6 +27,7 @@ export async function browser(
if (args.streamWebView != null) body.streamWebView = args.streamWebView;
if (args.profile != null) body.profile = args.profile;
if (args.integration != null) body.integration = args.integration;
+ if (args.origin) body.origin = args.origin;
try {
const res = await http.post<BrowserCreateResponse>("/v2/browser", body);
diff --git a/apps/js-sdk/firecrawl/src/v2/methods/crawl.ts b/apps/js-sdk/firecrawl/src/v2/methods/crawl.ts
index ce851106a..502532dbc 100644
--- a/apps/js-sdk/firecrawl/src/v2/methods/crawl.ts
+++ b/apps/js-sdk/firecrawl/src/v2/methods/crawl.ts
@@ -38,6 +38,7 @@ function prepareCrawlPayload(request: CrawlRequest): Record<string, unknown> {
if (request.regexOnFullURL != null) data.regexOnFullURL = request.regexOnFullURL;
if (request.webhook != null) data.webhook = request.webhook;
if (request.integration != null && request.integration.trim()) data.integration = request.integration.trim();
+ if (request.origin) data.origin = request.origin;
if (request.scrapeOptions) {
ensureValidScrapeOptions(request.scrapeOptions);
data.scrapeOptions = request.scrapeOptions;
diff --git a/apps/js-sdk/firecrawl/src/v2/methods/extract.ts b/apps/js-sdk/firecrawl/src/v2/methods/extract.ts
index 58c2089c5..1b10b21b4 100644
--- a/apps/js-sdk/firecrawl/src/v2/methods/extract.ts
+++ b/apps/js-sdk/firecrawl/src/v2/methods/extract.ts
@@ -16,6 +16,7 @@ function prepareExtractPayload(args: {
scrapeOptions?: ScrapeOptions;
ignoreInvalidURLs?: boolean;
integration?: string;
+ origin?: string;
agent?: AgentOptions;
}): Record<string, unknown> {
const body: Record<string, unknown> = {};
@@ -30,6 +31,7 @@ function prepareExtractPayload(args: {
if (args.showSources != null) body.showSources = args.showSources;
if (args.ignoreInvalidURLs != null) body.ignoreInvalidURLs = args.ignoreInvalidURLs;
if (args.integration && args.integration.trim()) body.integration = args.integration.trim();
+ if (args.origin) body.origin = args.origin;
if (args.agent) body.agent = args.agent;
if (args.scrapeOptions) {
ensureValidScrapeOptions(args.scrapeOptions);
diff --git a/apps/js-sdk/firecrawl/src/v2/methods/map.ts b/apps/js-sdk/firecrawl/src/v2/methods/map.ts
index 7374c405b..18d0b8938 100644
--- a/apps/js-sdk/firecrawl/src/v2/methods/map.ts
+++ b/apps/js-sdk/firecrawl/src/v2/methods/map.ts
@@ -13,6 +13,7 @@ function prepareMapPayload(url: string, options?: MapOptions): Record<string, un
if (options.limit != null) payload.limit = options.limit;
if (options.timeout != null) payload.timeout = options.timeout;
if (options.integration != null && options.integration.trim()) payload.integration = options.integration.trim();
+ if (options.origin) payload.origin = options.origin;
if (options.location != null) payload.location = options.location;
}
return payload;
diff --git a/apps/js-sdk/firecrawl/src/v2/methods/search.ts b/apps/js-sdk/firecrawl/src/v2/methods/search.ts
index 94333577f..700594357 100644
--- a/apps/js-sdk/firecrawl/src/v2/methods/search.ts
+++ b/apps/js-sdk/firecrawl/src/v2/methods/search.ts
@@ -18,6 +18,7 @@ function prepareSearchPayload(req: SearchRequest): Record<string, unknown> {
if (req.ignoreInvalidURLs != null) payload.ignoreInvalidURLs = req.ignoreInvalidURLs;
if (req.timeout != null) payload.timeout = req.timeout;
if (req.integration && req.integration.trim()) payload.integration = req.integration.trim();
+ if (req.origin) payload.origin = req.origin;
if (req.scrapeOptions) {
ensureValidScrapeOptions(req.scrapeOptions as ScrapeOptions);
payload.scrapeOptions = req.scrapeOptions;
diff --git a/apps/js-sdk/firecrawl/src/v2/types.ts b/apps/js-sdk/firecrawl/src/v2/types.ts
index f928c4fb7..afce484df 100644
--- a/apps/js-sdk/firecrawl/src/v2/types.ts
+++ b/apps/js-sdk/firecrawl/src/v2/types.ts
@@ -158,6 +158,7 @@ export interface ScrapeOptions {
minAge?: number;
storeInCache?: boolean;
integration?: string;
+ origin?: string;
}
export interface WebhookConfig {
@@ -453,6 +454,7 @@ export interface SearchRequest {
timeout?: number; // ms
scrapeOptions?: ScrapeOptions;
integration?: string;
+ origin?: string;
}
export interface CrawlOptions {
@@ -474,6 +476,7 @@ export interface CrawlOptions {
regexOnFullURL?: boolean;
zeroDataRetention?: boolean;
integration?: string;
+ origin?: string;
}
export interface CrawlResponse {
@@ -501,6 +504,7 @@ export interface BatchScrapeOptions {
zeroDataRetention?: boolean;
idempotencyKey?: string;
integration?: string;
+ origin?: string;
}
export interface BatchScrapeResponse {
@@ -532,6 +536,7 @@ export interface MapOptions {
limit?: number;
timeout?: number;
integration?: string;
+ origin?: string;
location?: LocationConfig;
}