Context how it work?
export type AuthUser = {
id?: number
name?: string;
email?: string;
};
i want have c.get('user'); and c.set('user', authUser);
but i recive Argument type "user" is not assignable to parameter type keyof E["Variables"] and Argument type "user" is not assignable to parameter type keyof E["Variables"]
#context
1 Reply
Basically Hono is typesafe, so if you are planning to add some variables in the context you will need to add them to the Hono Variables, which is beneficial as you will get intelli sense and all the typings. Here is how you can do it