feat: added support for self-hosted

Co-authored-by: Siddik <bitcentsup@gmail.com>
This commit is contained in:
alexboone 2025-02-03 20:38:53 -08:00
parent 4e7f73f317
commit 0ec269d701
2 changed files with 6 additions and 6 deletions

View File

@ -90,8 +90,8 @@ npm install
```bash
FIRECRAWL_KEY="your_firecrawl_key"
# If you want to use your localhost firecrawl, add the following below:
FIRECRAWL_BASE_URL="http://localhost:3002"
# If you want to use your self-hosted Firecrawl, add the following below:
# FIRECRAWL_BASE_URL="http://localhost:3002"
OPENAI_KEY="your_openai_key"
```

View File

@ -15,11 +15,11 @@ type ResearchResult = {
// increase this if you have higher API rate limits
const ConcurrencyLimit = 2;
// Initialize Firecrawl with API key if available, otherwise use local
const isLocal = !process.env.FIRECRAWL_KEY || process.env.FIRECRAWL_KEY === "your_firecrawl_key";
// Initialize Firecrawl with optional API key and optional base url
const firecrawl = new FirecrawlApp({
apiKey: isLocal ? 'local-development-token' : process.env.FIRECRAWL_KEY!,
apiUrl: isLocal ? (process.env.FIRECRAWL_BASE_URL || 'http://localhost:3002') : undefined
apiKey: process.env.FIRECRAWL_KEY ?? "",
apiUrl: process.env.FIRECRAWL_BASE_URL
});
// Default options for API consistency