I can't find a way to put the "enrich

I can't find a way to put the "enriched" payload object into a different variable so that I can nest that into my POST data in the way that my API requires. Feature request, or anyone know a trick?
2 Replies
Mackenly
Mackenly9mo ago
Can you expand on what you mean? Re Combining Objects: This seems like a good use case for the spread syntax. Ex:
const var1 = { a: 1, b: 2 };
const var2 = { ...var1, comment: "Extra data" }
console.log(var2);
const var1 = { a: 1, b: 2 };
const var2 = { ...var1, comment: "Extra data" }
console.log(var2);
Logs out: {"a": 1, "b": 2, "comment": "Extra data" } Docs: https://developers.cloudflare.com/zaraz/advanced/context-enricher/
Cloudflare Docs
Context Enricher · Cloudflare Zaraz docs
The Zaraz Context Enricher is a tool to modify or enrich the context that is being used across Zaraz using a Cloudflare Worker. The Context Enricher …
g000m
g000mOP9mo ago
Using POST, the payload object is enriched with all of the properties that show up. But I need to nest that object within another property so that the receiving end will read it. { "body": zaraz_payload } Hoping to do this without a worker If I could just assign a copy of the payload after it's been enriched to a new variable, then the problem would be solved
Want results from more Discord servers?
Add your server