api client context in frontend app
Hi guys,
I'm trying to build new integration using new Sdk Integration Boilerplate and I got stuck on how to get api-client context on frontend nuxt app. What I want to do is, to add token that i get from api-client/middleware response, after I get it on frontend app I want to save the token in app context so that api-client can take it and adds that Bearer token to header on every call. I have tried to add new fields to: packages/api-client/src/types/context/index.ts and read them here: playground/app/pages/methods/exampleMethod.vue but with no success. Maybe Its wrong idea to handle authentication token on frontend app, and it should only be handled on api-client?
I'm trying to build new integration using new Sdk Integration Boilerplate and I got stuck on how to get api-client context on frontend nuxt app. What I want to do is, to add token that i get from api-client/middleware response, after I get it on frontend app I want to save the token in app context so that api-client can take it and adds that Bearer token to header on every call. I have tried to add new fields to: packages/api-client/src/types/context/index.ts and read them here: playground/app/pages/methods/exampleMethod.vue but with no success. Maybe Its wrong idea to handle authentication token on frontend app, and it should only be handled on api-client?