Hello, I have a question related to Web-Hooks in K...
# talk-kratos
g
Hello, I have a question related to Web-Hooks in Kratos. Can I pass data from the user identity to the body for an after registration hook? Something such as id or traits
s
you can find some examples here: https://www.ory.sh/docs/kratos/self-service/hooks#web-hooks that should get you started 😉
a
Just to add on to what Patrik mentioned, you will have it done in your jsonnet file. Mine goes something like this.
Copy code
function(ctx) {
    type: 'after_registration',
    user_id: ctx.identity.id,
    identity: ctx.identity,
    flow: ctx.flow,
    request: {
        url: ctx.request_url,
        method: ctx.request_method,
        headers: ctx.request_headers,
    },
}
you can freely pass the
ctx.identity
or other possible variables as well as take a much precise data from those like
ctx.identity.id
(don't mind the
request
part, I just wanted to see all the possible data that can be passed via webhooks).
🙏 1
g
thanks for the answers guys, really helpful 😄