bugfix on idempotency key check

This commit is contained in:
rafaelsideguide
2024-05-23 11:47:04 -03:00
parent 3f460af6c5
commit 184e4678f1
8 changed files with 45 additions and 20 deletions
+3 -1
View File
@@ -1,8 +1,10 @@
import { v4 as uuidv4 } from 'uuid';
import FirecrawlApp from '@mendable/firecrawl-js';
const app = new FirecrawlApp({apiKey: "YOUR_API_KEY"});
const crawlResult = await app.crawlUrl('mendable.ai', {crawlerOptions: {excludes: ['blog/*'], limit: 5}}, false);
const idempotencyKey = uuidv4(); // optional
const crawlResult = await app.crawlUrl('mendable.ai', {crawlerOptions: {excludes: ['blog/*'], limit: 5}}, false, 2, idempotencyKey);
console.log(crawlResult)
const jobId = await crawlResult['jobId'];