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.
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:
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.