Backend for Frontend

Recipes

Patterns and gotchas from building connectors against real commerce backends. Each recipe captures one problem we hit and the approach that worked.

The reference pages in this section tell you what each Orchestr primitive does. The recipes here are about how we use those primitives in real connectors: the patterns that earned their keep and the dead ends we steered around. They assume you know the basics of query handlers, action handlers, middleware, and caching; if not, start with the linked reference pages first.

Translating vendor errors

Map raw backend errors (Shopify userErrors, Shopware error payloads) into canonical Laioutr errors so the storefront UI can render them with no connector-specific code.

System bootstrap in extendRequest

When your backend needs internal IDs for currency, locale, or sales channel that aren't part of clientEnv, fetch and cache the metadata once, then resolve it on each request.

Identity cookies (cart and visitor IDs)

Read-or-create-and-set patterns for cart, session, and visitor IDs. Where to put the bootstrap depends on when you actually need the ID.

Userland cache patterns

Pre-warm caches without blocking responses (event.waitUntil), and isolate cache entries across tenants and locales by composing prefixes and keys. Two patterns that show up in every connector.

Analytics components from query handlers

When per-result context exists only in the originating query response (attribution tokens, relevance scores), provide an entity component inline from the query handler and skip writing a resolver for it.
Copyright © 2026 Laioutr GmbH