assignContent
constassignContent: (config?) =>Policy
Defined in: src/policies/transform/assign-content.ts:76
Assign content policy.
Injects or overrides fields in JSON request and/or response bodies. Useful for injecting tenant IDs, timestamps, metadata, or other fields that should be transparently added by the gateway.
Parameters
Section titled “Parameters”config?
Section titled “config?”Returns
Section titled “Returns”Example
Section titled “Example”import { assignContent } from "@homegrower-club/stoma";
assignContent({ request: { tenantId: "acme", timestamp: (c) => new Date().toISOString(), }, response: { gateway: "stoma", },});