Accessing client IP address in a query/mutation
Good day. Any help would be appreciated, as I am fairly new to Convex.
Is there a way to expose HTTP headers, such as for obtaining the IP address in the example below? Or is an
httpAction
required for this use case?
6 Replies
Thanks for posting in <#1088161997662724167>.
Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets.
- Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.)
- Use search.convex.dev to search Docs, Stack, and Discord all at once.
- Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI.
- Avoid tagging staff unless specifically instructed.
Thank you!
#ask-ai referred me to this post https://discord.com/channels/1019350475847499849/1281699105101451284 which answered my question.
What's your goal with this? Currently the incoming IP address is not exposed even in an httpAction.
It's for simple analytics of users' geographical distribution.
If Convex were to expose as an extra header or ctx.meta.geo property would you want the geographical location directly, or still the IP address?
For my use case,
ctx.meta.geo
would be great.