UNPKG

@unito/integration-sdk

Version:

Integration SDK

33 lines (32 loc) 917 B
import { Request, Response, NextFunction } from 'express'; declare global { namespace Express { interface Locals { credentials: Credentials; } } } /** * The credentials object passed to every handler function. * * It contains the parsed credentials payload associated with the request through the X-Unito-Credentials header. */ export type Credentials = { /** * The access token for the provider. */ accessToken?: string; /** * The id of the unito credential record. * * This is not available on the initial call to /me before the creation of the credential. */ unitoCredentialId?: string; /** * The id of the unito user record. */ unitoUserId?: string; [keys: string]: unknown; }; declare function extractCredentials(req: Request, res: Response, next: NextFunction): void; export default extractCredentials;