Skip to content

[Question] How to globally add context (e.g., user locale) to all requests? #19

@aleksolutions

Description

@aleksolutions

Hi team,

First off, thanks for the great work on forge-trpc - it's significantly improved our development experience!

I have a question regarding requests: Is there a recommended way to automatically include additional context, specifically the user's locale, with every request? The goal is to access this locale within the server-side context/handler for each mutation.

Currently, I'm passing the locale manually with each call. I'm wondering if there's a cleaner, global approach, perhaps by extending a shared context or using some form of middleware provided by the adapter.

Thanks for any guidance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions