Skip to content

assignContent

const assignContent: (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.

AssignContentConfig

Policy

import { assignContent } from "@homegrower-club/stoma";
assignContent({
request: {
tenantId: "acme",
timestamp: (c) => new Date().toISOString(),
},
response: {
gateway: "stoma",
},
});