chatboxai/chatbox · error · VibedropEmailRequiredError

email required

Error message

email required

What it means

Thrown as VibedropEmailRequiredError when the vibedrop key-issuance endpoint returns an error whose parsed body has error.code === 'email_required'. It signals that the account must have a verified email before a vd_key can be issued. The rethrow unwraps the deterministic 400 into a typed, user-actionable error.

Source

Thrown at src/renderer/packages/remote.ts:1025

      {
        method: 'POST',
        headers: {
          'Content-Type': 'application/json',
          ...(await getChatboxHeaders()),
        },
      },
      // No retry: issue-key is a fast upsert; email_required is a deterministic
      // 400 and retrying it just wastes a round-trip (afetch retries all non-2xx).
      { retry: 0 }
    )
    const json: { vd_key: string; tier: string } = await res.json()
    return { vdKey: json.vd_key, tier: json.tier }
  } catch (e) {
    if (e instanceof ApiError && e.responseBody) {
      try {
        const parsed = JSON.parse(e.responseBody)
        if (parsed?.error?.code === 'email_required') {
          throw new VibedropEmailRequiredError('email required')
        }
      } catch (parseErr) {
        if (parseErr instanceof VibedropEmailRequiredError) throw parseErr
      }
    }
    throw e
  }
}

export interface UserLicense {
  id: number
  key: string
  status: string
  platform: string
  product_name: string
  plan?: ChatboxAIPlanType
  payment_type: string
  image_usage: number

View on GitHub (pinned to 81571269ad)

Solutions

  1. Collect and verify the user's email on the account, then retry the vibedrop flow.
  2. If using OAuth login, ensure the email scope is granted so the provider returns an email.
  3. Handle VibedropEmailRequiredError in the UI to prompt for email instead of showing a generic failure.
Defensive patterns

Strategy: try-catch

Validate before calling

function accountHasEmail(): boolean {
  return !!authInfoStore.getState().email
}
if (!accountHasEmail()) {
  // prompt for email before requesting a vd_key
}

Type guard

function isVibedropEmailRequiredError(e: unknown): e is VibedropEmailRequiredError {
  return e instanceof VibedropEmailRequiredError
}

Try / catch

try {
  await requestVdKey()
} catch (e) {
  if (e instanceof VibedropEmailRequiredError) {
    // open email-collection flow, then retry
  }
}

Prevention

When it happens

Trigger: Calling the vibedrop issue-key flow for an account that has no email on record; the server responds 400 with {error:{code:'email_required'}}. The catch inspects e.responseBody, parses JSON, and rethrows VibedropEmailRequiredError('email required').

Common situations: New account created via an OAuth provider that did not share an email; account email was removed/never verified; the issue-key endpoint tightened its email requirement in a backend release.

Related errors


AI-assisted analysis of chatboxai/chatbox@81571269ad (2026-08-12). Data as JSON: /api/errors/f8ba0419005b6159. Report an issue: GitHub.