Skip to content

Commit

Permalink
Updated USER_GUIDE.md to include needsRefresh (#880)
Browse files Browse the repository at this point in the history
Signed-off-by: Theo Truong <theotr@amazon.com>
  • Loading branch information
nhtruong authored Sep 27, 2024
1 parent f4f7758 commit 036af63
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions USER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ const client = new Client({
if (err) {
reject(err);
} else {
credentials.needsRefresh = () => { // Optionally, include the needsRefresh function for short lived credentials
// Refresh the credentials if they are within 5 minutes of expiration.
return credentials.expireTime - Date.now() < 300000;
};
resolve(credentials);
}
});
Expand Down

0 comments on commit 036af63

Please sign in to comment.