<@U04UQ68083H> How do I add transient trade data t...
# ory-copilot
b
@chilly-king-10285 How do I add transient trade data to the registration hook response?
b
A message from kapa.ai
To add transient data to the registration hook response in Ory, you can use the
transient_payload
field when updating a registration flow. This field allows you to pass additional data that will be available to any webhooks triggered during the registration process, without being permanently stored in Ory. The
transient_payload
field is available in various registration flow methods, including password, WebAuthn, OIDC, and others. Here's how you can use it:
Copy code
javascript const {   data: { id }, } = await frontendAPI.createNativeRegistrationFlow() await frontendAPI.updateRegistrationFlow({   flow: id,   updateRegistrationFlowBody: {     method: "password",     password: "super secure password",     traits: {       email: "<mailto:mymail@example.com|mymail@example.com>",     },     transient_payload: {       consents: [         {           id: "cookies",           given: true,           date: "2023-03-02",         },         {           id: "analytics",           given: false,           date: "2023-02-28",         },       ],       terms: {         accepted: true,         date: "2023-02-28",       }     },   }, })
The content of the
transient_payload
field must be a valid JSON object. This data will be presented to any post-registration webhook but will not be persisted by Ory. This feature is available in the SDK starting from version 1.1.18. [GitHub Issue #187](https://github.com/ory/network/issues/187) provides more context on this feature, which was specifically added to solve the problem of passing additional data along with registration.
b
@chilly-king-10285 What do I set the response body to in the webhook to include transient_payload?
b
A message from kapa.ai
Based on the knowledge sources provided, I don't see specific information about how to set the response body in a webhook to include the
transient_payload
. The documentation shows that the
transient_payload
field is included in the request body when updating various flows (registration, login, settings), but it doesn't detail how this data is handled in webhook responses. What we do know is that the
transient_payload
is: 1. An optional field you can include when updating registration, login, or settings flows 2. Described as "Transient data to pass along to any webhooks" 3. Not persisted by Ory but presented to webhooks From the GitHub issue comment: > "The content of this field must be a valid json object. It will be presented to any post registration webhook. (See [here](https://www.ory.sh/docs/guides/integrate-with-ory-cloud-through-webhooks#customizing-request-body-with-jsonnet) for the webhook body and how to customize it). The transient payload will not be persisted by Ory." However, the knowledge sources don't contain information about how to specifically include the
transient_payload
in a webhook response body. To get accurate information on this, you might want to check the webhook documentation referenced in the GitHub issue or contact Ory support for more specific guidance.