FlowiseAI/Flowise · error · Error

No API key provided

Error message

No API key provided

What it means

SpiderApp constructor guard. With no apiKey (null/undefined/empty) the client cannot authenticate, so it refuses to construct. SpiderLoader passes its apiKey here; this is the lower-level counterpart of error 183.

Source

Thrown at packages/components/nodes/documentloaders/Spider/SpiderApp.ts:52

interface CrawlResponse {
    success: boolean
    data?: SpiderDocument[]
    error?: string
}

interface Params {
    [key: string]: any
}

class SpiderApp {
    private apiKey: string
    private apiUrl: string

    constructor({ apiKey = null, apiUrl = null }: SpiderAppConfig) {
        this.apiKey = apiKey || ''
        this.apiUrl = apiUrl || 'https://api.spider.cloud/v1'
        if (!this.apiKey) {
            throw new Error('No API key provided')
        }
    }

    async scrapeUrl(url: string, params: Params | null = null): Promise<ScrapeResponse> {
        const headers = this.prepareHeaders()
        const jsonData: Params = { url, limit: 1, ...params }

        try {
            const response: AxiosResponse = await this.postRequest('crawl', jsonData, headers)
            if (response.status === 200) {
                const responseData = response.data
                if (responseData[0].status) {
                    return { success: true, data: responseData[0] }
                } else {
                    throw new Error(`Failed to scrape URL. Error: ${responseData.error}`)
                }
            } else {
                this.handleError(response, 'scrape URL')

View on GitHub (pinned to abe4a8601a)

Solutions

  1. Always pass apiKey: `Bearer ${process.env.SPIDER_API_KEY}` sourced from env.
  2. Validate the env var at app startup and fail fast with a clear message.
  3. In tests, inject a dummy key or mock SpiderApp entirely.

Example fix

// before
const app = new SpiderApp({})

// after
const apiKey = process.env.SPIDER_API_KEY
if (!apiKey) throw new Error('SPIDER_API_KEY env var is required')
const app = new SpiderApp({ apiKey })
Defensive patterns

Strategy: validation

Validate before calling

const apiKey = process.env.SPIDER_API_KEY
if (!apiKey) throw new Error('SPIDER_API_KEY env var is required')
const app = new SpiderApp({ apiKey })

Type guard

function isSpiderAppConfig(v: unknown): v is { apiKey: string } {
    return typeof (v as any)?.apiKey === 'string' && (v as any).apiKey.length > 0
}

Try / catch

try {
    new SpiderApp({ apiKey })
} catch (e: any) {
    if (/No API key provided/.test(e.message)) {
        // redirect to credential setup
    }
    throw e
}

Prevention

When it happens

Trigger: Constructing `new SpiderApp({})` or `new SpiderApp({ apiKey: null })` directly, or via SpiderLoader when the key resolves to empty. apiUrl defaults to https://api.spider.cloud/v1 so only the key matters.

Common situations: Direct SDK use without reading SPIDER_API_KEY, a credential loader that returns undefined, or tests that instantiate SpiderApp without mocking the key.

Related errors


AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12). Data as JSON: /api/errors/bb2c2c1562d2523d. Report an issue: GitHub.