@evo/concierge-koa
v0.0.16
Published
Koa-based JS client library for Concierge service
Downloads
73
Maintainers
Keywords
Readme
Concierge-koa
Koa-based JS client library for Concierge service
installation
npm install --save @evo/concierge-koa
usage
import { conciergeAuthMiddleware } from "concierge-koa";
const app: Koa = new Koa();
app.use(conciergeAuthMiddleware);
Now you can access it in a Koa context
app.use(async (ctx: Koa.BaseContext, next: any) => {
console.log(ctx.conciergeUser);
/**
* prints ->
* ConciergeUserInfo {
userId: 'user_id_1',
profile: Map { 'email' => '[email protected]' },
accessToken: 'user_1',
meta: { services_meta: { project: 'uaprom' } }
}
*/
await next();
})