
Our Blog
Explore our blog posts on web design, development, and digital marketing to stay up-to-date with the latest trends and strategies.
Found 83 blog posts
Getting Typed JSON Out of LLMs: How We Use generateObject and the AI SDK
Language models return strings, not types. These are the Vercel AI SDK patterns our team uses to get schema-validated JSON out of a model every time: generateObject for extraction, streamObject for progressive UI, the four output modes, and NoObjectGeneratedError as a real code path.
Running TypeScript Natively in Node.js: How We Dropped the Build Step for Scripts
Node.js now executes TypeScript files directly through type stripping. Here is how our team moved scripts, configs, and cron jobs to native execution, how we keep code erasable with TypeScript 5.8's erasableSyntaxOnly flag, and why our NestJS services kept their build.
AbortController Beyond fetch: Cancellation Patterns We Use in Every React App
Uncancelled fetches do not fail loudly — they resolve late and overwrite fresh state. The AbortController patterns we use in every React app we ship: useEffect cleanup, AbortSignal.timeout(), AbortSignal.any(), and one-signal listener cleanup.
One API Key for Every Model: How We Use the Vercel AI Gateway
We removed three provider SDKs and three API keys after routing our AI SDK calls through the Vercel AI Gateway. Here is how string-based model routing works, when fallbacks earn their keep, and what the gateway actually replaces.
WebSockets on Vercel Functions: Real-Time Without a Separate Server
We stopped running a separate WebSocket server for realtime features once Vercel Functions started supporting them natively on Fluid Compute. Here's how the upgrade works, when it beats SSE, and what reconnection logic you still own yourself.
Next.js Middleware in 2026: Auth Guards, A/B Tests, and What Belongs at the Edge
We have debugged the same mistake across multiple projects: database calls in middleware.ts that make every matched request pay a round-trip cost before the route runs. Field notes on the patterns that belong at the edge — auth guards, A/B cookie bucketing, locale rewrites — and what does not.
Shipping Bilingual Next.js Apps in English and Arabic: Routing, RTL, and What Crawlers Actually See
We build almost every product in English and Arabic. Field notes from our team: why cookie-based language switching hides half your site from crawlers, URL-per-locale routing in the App Router, RTL layouts with CSS logical properties, and hreflang done right.
Streaming AI Responses in Next.js: What Actually Breaks in Production
Every AI feature we ship at Devya streams its output, and the streaming code is the easy part. Our field notes on SSE over fetch in the Next.js App Router: the proxy buffering that freezes streams in production, the abort wiring that stops wasted token spend, and what a refresh really does to an in-flight generation.
What Changed in Zod 4, and How We Migrated Production Schemas
Zod 4 is a rewrite of the TypeScript-first schema library: top-level string formats such as z.email(), one unified error option, new error-reading helpers, and a tree-shakeable zod/mini build. We break down what changed and how our team migrated production schemas.
Route Handlers vs Server Actions in Next.js: When Our Team Reaches for Each
Server Actions and Route Handlers both run server code in the Next.js App Router, but they solve different problems. At Devya we use Server Actions for mutations from our own UI and Route Handlers for public APIs, webhooks, and streaming — and we treat both as public endpoints.
URL State in the Next.js App Router: Type-Safe Search Params That Survive a Refresh
We move filters, tabs, and pagination out of useState and into the URL query string, so a refresh or a shared link restores the exact view. Here is how our team reads and writes search params in the Next.js App Router, and when nuqs earns its place.
Error Handling in the Next.js App Router: What Each Error File Actually Catches
In the Next.js App Router, error.tsx defines an error boundary that catches render errors in a route segment and its children — but not its own layout, and not event-handler errors. Our engineering notes on error.tsx, global-error.tsx, not-found.tsx, the production digest, and the reset function.
Stay Updated
Subscribe to our newsletter for the latest insights on web design, development, and digital marketing.