Skip to content

c.var.client has syntaxCallback bug in Hono routes #645

Description

@mrkmadsn

When` using c.var.client in custom Hono routes (router.ts), it throws:

TypeError: endOptions.syntaxCallback is not a function
Use Case: Webhooks need to update Blade Account data from external services (e.g., Stripe subscription status). According to the docs, c.var.client should work for this.

Code Example:

 // router.ts
app.post('/webhook', async (c) => {
  // @ts-expect-error - Blade provides client via c.var but types aren't exported
  const bladeClient = c.var.client;
  if (bladeClient?.set) {
    await bladeClient.set.account({
      with: { id: accountId },
      to: { subscriptionStatus: 'active' },
    });
  }
});

Expected: Should update Blade Account records Actual: Throws syntaxCallback error

This prevents using Blade as the source of truth for external webhook data, requiring client-side fetching instead of instant server-side data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions