Packages
@loop-engine/registry-client
Terminology: In product docs we call this the loop catalog (versioned loop definitions for Loop Engine). The npm package remains @loop-engine/registry-client and TypeScript types still use the name LoopRegistry. That is not the Commerce Gateway Registry (gateway discovery and verification).
@loop-engine/registry-client provides local-first loop definition lookup with optional network adapters.
Install
1npm install @loop-engine/registry-clientLocal catalog
1import { localRegistry } from "@loop-engine/registry-client"2 3const registry = localRegistry({4 definitions: [customLoop],5 loopsDir: "./loops",6 watch: true7})definitionsworks in browser and Node.loopsDirloads.yaml,.yml, and.jsondefinitions in Node.- Browser usage with
loopsDirlogs a warning and ignores filesystem mode.
HTTP catalog
1import { httpRegistry } from "@loop-engine/registry-client"2 3const registry = httpRegistry({4 baseUrl: "https:">//registry.example.com",5 headers: { Authorization: `Bearer ${token}` },6 timeoutMs: 10_000,7 retries: 28})Expected server contract:
GET /loopsGET /loops?domain={domain}GET /loops/{loopId}GET /loops/{loopId}/{version}POST /loopsDELETE /loops/{loopId}
Better Data adapter
1import { betterDataRegistry } from "@loop-engine/registry-client/betterdata"2 3const registry = betterDataRegistry({4 apiKey: process.env.BD_API_KEY!,5 orgId: "your-org-id",6 env: "production"7})LoopRegistry interface
The runtime type is still named LoopRegistry:
1interface LoopRegistry {2 get(id: LoopId): Promise<LoopDefinition | null>3 getVersion(id: LoopId, version: string): Promise<LoopDefinition | null>4 list(options?: { domain?: string }): Promise<LoopDefinition[]>5 has(id: LoopId): Promise<boolean>6 register(definition: LoopDefinition, options?: { force?: boolean }): Promise<void>7 remove(id: LoopId): Promise<boolean>8}