When I start a new project with the Stitch JavaScript SDK, while also using TypeScript, I get this error:
Property 'activeUserAuthInfo' does not exist on type 'StitchAuth'.ts
Code:
// Get the logged in user's access token from the StitchAuth interface
export async function getAccessToken(credential: StitchCredential) {
await app.auth.loginWithCredential(credential);
const { accessToken } = app.auth.activeUserAuthInfo;
return accessToken;
}
Problem
When I start a new project with the Stitch JavaScript SDK, while also using TypeScript, I get this error:
Code:
I am following this guide: https://docs.mongodb.com/stitch/graphql/connect-from-a-client-application/#create-a-graphql-client