firecrawl 4.25.4 → 4.25.5
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.
- package/dist/{chunk-BVQPX6RA.js → chunk-L4JQOWAZ.js} +1 -1
- package/dist/index.cjs +5 -5
- package/dist/index.js +6 -6
- package/dist/{package-4T5PXLTT.js → package-FPTJWPF7.js} +1 -1
- package/package.json +1 -1
- package/src/__tests__/unit/v2/clientOptions.test.ts +5 -6
- package/src/v2/client.ts +3 -3
- package/src/v2/utils/httpClient.ts +4 -1
|
@@ -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.25.
|
|
15
|
+
version: "4.25.5",
|
|
16
16
|
description: "JavaScript SDK for Firecrawl API",
|
|
17
17
|
main: "dist/index.js",
|
|
18
18
|
types: "dist/index.d.ts",
|
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.25.
|
|
42
|
+
version: "4.25.5",
|
|
43
43
|
description: "JavaScript SDK for Firecrawl API",
|
|
44
44
|
main: "dist/index.js",
|
|
45
45
|
types: "dist/index.d.ts",
|
|
@@ -164,7 +164,10 @@ var HttpClient = class {
|
|
|
164
164
|
baseURL: this.apiUrl,
|
|
165
165
|
timeout: options.timeoutMs ?? 3e5,
|
|
166
166
|
headers: {
|
|
167
|
-
Authorization
|
|
167
|
+
// Omit the Authorization header entirely when no API key is set so that
|
|
168
|
+
// scrape/search/interact can use the keyless free tier (the cloud only
|
|
169
|
+
// grants it when no Authorization header is present).
|
|
170
|
+
...this.apiKey ? { Authorization: `Bearer ${this.apiKey}` } : {}
|
|
168
171
|
},
|
|
169
172
|
transitional: { clarifyTimeoutError: true }
|
|
170
173
|
});
|
|
@@ -1945,9 +1948,6 @@ var FirecrawlClient = class {
|
|
|
1945
1948
|
const opts = typeof options === "string" ? { apiKey: options } : options;
|
|
1946
1949
|
const apiKey = (opts.apiKey ?? process.env.FIRECRAWL_API_KEY ?? "").trim();
|
|
1947
1950
|
const apiUrl = (opts.apiUrl ?? process.env.FIRECRAWL_API_URL ?? "https://api.firecrawl.dev").replace(/\/$/, "");
|
|
1948
|
-
if (this.isCloudService(apiUrl) && !apiKey) {
|
|
1949
|
-
throw new Error("API key is required for the cloud API. Set FIRECRAWL_API_KEY env or pass apiKey.");
|
|
1950
|
-
}
|
|
1951
1951
|
this.http = new HttpClient({
|
|
1952
1952
|
apiKey,
|
|
1953
1953
|
apiUrl,
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
require_package
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-L4JQOWAZ.js";
|
|
4
4
|
|
|
5
5
|
// src/v2/utils/httpClient.ts
|
|
6
6
|
import axios from "axios";
|
|
@@ -34,7 +34,10 @@ var HttpClient = class {
|
|
|
34
34
|
baseURL: this.apiUrl,
|
|
35
35
|
timeout: options.timeoutMs ?? 3e5,
|
|
36
36
|
headers: {
|
|
37
|
-
Authorization
|
|
37
|
+
// Omit the Authorization header entirely when no API key is set so that
|
|
38
|
+
// scrape/search/interact can use the keyless free tier (the cloud only
|
|
39
|
+
// grants it when no Authorization header is present).
|
|
40
|
+
...this.apiKey ? { Authorization: `Bearer ${this.apiKey}` } : {}
|
|
38
41
|
},
|
|
39
42
|
transitional: { clarifyTimeoutError: true }
|
|
40
43
|
});
|
|
@@ -1815,9 +1818,6 @@ var FirecrawlClient = class {
|
|
|
1815
1818
|
const opts = typeof options === "string" ? { apiKey: options } : options;
|
|
1816
1819
|
const apiKey = (opts.apiKey ?? process.env.FIRECRAWL_API_KEY ?? "").trim();
|
|
1817
1820
|
const apiUrl = (opts.apiUrl ?? process.env.FIRECRAWL_API_URL ?? "https://api.firecrawl.dev").replace(/\/$/, "");
|
|
1818
|
-
if (this.isCloudService(apiUrl) && !apiKey) {
|
|
1819
|
-
throw new Error("API key is required for the cloud API. Set FIRECRAWL_API_KEY env or pass apiKey.");
|
|
1820
|
-
}
|
|
1821
1821
|
this.http = new HttpClient({
|
|
1822
1822
|
apiKey,
|
|
1823
1823
|
apiUrl,
|
|
@@ -2244,7 +2244,7 @@ var FirecrawlApp = class {
|
|
|
2244
2244
|
if (typeof process !== "undefined" && process.env && process.env.npm_package_version) {
|
|
2245
2245
|
return process.env.npm_package_version;
|
|
2246
2246
|
}
|
|
2247
|
-
const packageJson = await import("./package-
|
|
2247
|
+
const packageJson = await import("./package-FPTJWPF7.js");
|
|
2248
2248
|
return packageJson.default.version;
|
|
2249
2249
|
} catch (error) {
|
|
2250
2250
|
const isTest = typeof process !== "undefined" && (process.env.JEST_WORKER_ID != null || false);
|
package/package.json
CHANGED
|
@@ -67,12 +67,11 @@ describe('Firecrawl v2 Client Options', () => {
|
|
|
67
67
|
expect(client).toBeInstanceOf(FirecrawlClient);
|
|
68
68
|
});
|
|
69
69
|
|
|
70
|
-
it('should
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
expect(() => new Firecrawl(' ')).toThrow('API key is required');
|
|
70
|
+
it('should construct without an API key for the keyless free tier', () => {
|
|
71
|
+
// No key: scrape/search/interact use the keyless free tier; the SDK no
|
|
72
|
+
// longer throws at construction.
|
|
73
|
+
expect(() => new Firecrawl('')).not.toThrow();
|
|
74
|
+
expect(() => new Firecrawl(' ')).not.toThrow();
|
|
76
75
|
});
|
|
77
76
|
|
|
78
77
|
it('should provide v1 accessor when constructed with string', () => {
|
package/src/v2/client.ts
CHANGED
|
@@ -137,9 +137,9 @@ export class FirecrawlClient {
|
|
|
137
137
|
const apiKey = (opts.apiKey ?? process.env.FIRECRAWL_API_KEY ?? "").trim();
|
|
138
138
|
const apiUrl = (opts.apiUrl ?? process.env.FIRECRAWL_API_URL ?? "https://api.firecrawl.dev").replace(/\/$/, "");
|
|
139
139
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
140
|
+
// No API key is allowed: scrape, search, and interact fall back to the
|
|
141
|
+
// keyless free tier (rate-limited per IP). Other methods will return 401
|
|
142
|
+
// from the API until a key is provided.
|
|
143
143
|
|
|
144
144
|
this.http = new HttpClient({
|
|
145
145
|
apiKey,
|
|
@@ -34,7 +34,10 @@ export class HttpClient {
|
|
|
34
34
|
baseURL: this.apiUrl,
|
|
35
35
|
timeout: options.timeoutMs ?? 300000,
|
|
36
36
|
headers: {
|
|
37
|
-
Authorization
|
|
37
|
+
// Omit the Authorization header entirely when no API key is set so that
|
|
38
|
+
// scrape/search/interact can use the keyless free tier (the cloud only
|
|
39
|
+
// grants it when no Authorization header is present).
|
|
40
|
+
...(this.apiKey ? { Authorization: `Bearer ${this.apiKey}` } : {}),
|
|
38
41
|
},
|
|
39
42
|
transitional: { clarifyTimeoutError: true },
|
|
40
43
|
});
|