conduit
conduit copied to clipboard
Question: How to write into metadata field?
Hi, this might be a noobish question, but I could not figure out how to write into events.metadata. As I see it, maybe correct me if I am wrong, this would be the right place to save for example (phoenix) connection information like user IP etc.
Thanks fro advance.
You can include any metadata during command dispatch. It will be copied onto any events created by the command.
ExampleRouter.dispatch(command,
metadata: %{"issuer_id" => issuer_id, "user_id" => "[email protected]"}
)
Metadata is a useful place to record detais about the originating request (IP address, authenticated user id, etc.).
thank you very much for helping out