{"record":{"id":"8e3b9494b424ec75","repo":"FlowiseAI/Flowise","slug":"firecrawl-api-key-not-set-you-can-set-it-as-firec","errorCode":null,"errorMessage":"Firecrawl API key not set. You can set it as FIRECRAWL_API_KEY in your .env file, or pass it to Firecrawl.","messagePattern":"Firecrawl API key not set\\. You can set it as FIRECRAWL_API_KEY in your \\.env file, or pass it to Firecrawl\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"packages/components/nodes/documentloaders/FireCrawl/FireCrawl.ts","lineNumber":564,"sourceCode":"    apiKey?: string\n    apiUrl?: string\n    mode?: 'crawl' | 'scrape' | 'extract' | 'search'\n    params?: Record<string, unknown>\n}\n\nexport class FireCrawlLoader extends BaseDocumentLoader {\n    private apiKey: string\n    private apiUrl: string\n    private url?: string\n    private query?: string\n    private mode: 'crawl' | 'scrape' | 'extract' | 'search'\n    private params?: Record<string, unknown>\n\n    constructor(loaderParams: FirecrawlLoaderParameters) {\n        super()\n        const { apiKey, apiUrl, url, query, mode = 'crawl', params } = loaderParams\n        if (!apiKey) {\n            throw new Error('Firecrawl API key not set. You can set it as FIRECRAWL_API_KEY in your .env file, or pass it to Firecrawl.')\n        }\n\n        this.apiKey = apiKey\n        this.url = url\n        this.query = query\n        this.mode = mode\n        this.params = params\n        this.apiUrl = apiUrl || 'https://api.firecrawl.dev'\n    }\n\n    public async load(): Promise<DocumentInterface[]> {\n        const app = new FirecrawlApp({ apiKey: this.apiKey, apiUrl: this.apiUrl })\n        let firecrawlDocs: FirecrawlDocument[]\n\n        if (this.mode === 'search') {\n            if (!this.query) {\n                throw new Error('Firecrawl: Query is required for search mode')\n            }","sourceCodeStart":546,"sourceCodeEnd":582,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/documentloaders/FireCrawl/FireCrawl.ts#L546-L582","documentation":"Thrown by the FireCrawlLoader constructor when `apiKey` is falsy. The loader refuses to instantiate without credentials because every FireCrawl API call requires a Bearer token. The message directs users to FIRECRAWL_API_KEY or the constructor param.","triggerScenarios":"new FireCrawlLoader({ apiKey: undefined | null | '' }) — typically because getCredentialParam returned empty (credential not attached in Flowise) or FIRECRAWL_API_KEY is unset in .env.","commonSituations":"Flowise node deployed without the FireCrawl credential attached; .env missing FIRECRAWL_API_KEY; credential name typo (must be 'fireCrawlApi'); migrating from env var to credential store and forgetting to populate it.","solutions":["In Flowise, attach the 'FireCrawl API' credential to the node and store the key.","Or set FIRECRAWL_API_KEY=<key> in the server .env and restart.","Verify getCredentialParam('credential', options, additionalConfig) returns a value before constructing the loader.","Generate a new key at firecrawl.dev if the old one is lost."],"exampleFix":"// before\nconst loader = new FireCrawlLoader({ apiKey: process.env.FIRECRAWL_API_KEY, url, mode: 'crawl' })\n\n// after\nconst apiKey = getCredentialParam('fireCrawlApi', credentials, additionalConfig) ?? process.env.FIRECRAWL_API_KEY\nif (!apiKey) throw new Error('Attach a FireCrawl credential or set FIRECRAWL_API_KEY before running this node')\nconst loader = new FireCrawlLoader({ apiKey, url, mode: 'crawl' })","handlingStrategy":"validation","validationCode":"const apiKey = (loaderParams.apiKey ?? getCredentialParam('fireCrawlApi', creds, cfg) ?? process.env.FIRECRAWL_API_KEY || '').trim()\nif (!apiKey) throw new Error('FireCrawl API key missing')\nconst loader = new FireCrawlLoader({ ...loaderParams, apiKey })","typeGuard":"function hasApiKey(p: FirecrawlLoaderParameters): p is FirecrawlLoaderParameters & { apiKey: string } {\n  return typeof p.apiKey === 'string' && p.apiKey.trim().length > 0\n}","tryCatchPattern":"try { return new FireCrawlLoader(params) }\ncatch (e) {\n  if (/API key not set/.test((e as Error).message)) throw new Error('Attach a FireCrawl credential in Flowise')\n  throw e\n}","preventionTips":["Store the key in the Flowise credential named 'fireCrawlApi', not in code.","Health-check the key on deploy with a trivial scrape call.","Keep FIRECRAWL_API_KEY in .env as a fallback."],"tags":["firecrawl","config","credentials","auth","loader"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}