So I'm migrating my project to the new AWS-SDK V3 because of it's modularity. However, I can't seem to figure out what to use instead of CognitoIdentityCredentials
with the new API. This is what code looked like for V2:
const credentials = new CognitoIdentityCredentials(
{
IdentityPoolId: config.get("IdentityPoolId"),
Storage: config,
Logins: {
[...]: idToken,
},
},
{
region: config.get("awsregion"),
},
);
if (credentials.needsRefresh()) {
...
}
Tried looking for CognitoIdentityCredentials
in the V3's github repo, but the only thing I found was the fromCognitoIdentity
function which does not seem to have similar parameters. Documentation for V3 is confusing and contains errors and didn't help at all. Can you provide me a workflow that would achieve the same thing as the V2 version did but with the new API?