From c0cf066e3ae9abcd61f7ced02d1fca49dc5a4ad0 Mon Sep 17 00:00:00 2001 From: siddsriv Date: Thu, 30 Jan 2025 18:36:16 +0000 Subject: [PATCH] docs(supplemental-docs): typo fix --- supplemental-docs/CLIENTS.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/supplemental-docs/CLIENTS.md b/supplemental-docs/CLIENTS.md index 46125d39267b..25c2f02bd5e1 100644 --- a/supplemental-docs/CLIENTS.md +++ b/supplemental-docs/CLIENTS.md @@ -165,18 +165,19 @@ import { fromIni } from "@aws-sdk/credential-provider-ini"; // Create client with credentials that will reload from file const client = new S3Client({ - credentials: fromIni({ ignoreCache: true }) - }); - ``` + credentials: fromIni({ ignoreCache: true }), +}); +``` Refreshing credentials for an existing client: + ```typescript import { S3Client } from "@aws-sdk/client-s3"; import { fromIni } from "@aws-sdk/credential-provider-ini"; // Initial client setup const client = new S3Client({ - credentials: fromIni({ ignoreCache: true }) + credentials: fromIni({ ignoreCache: true }), }); // To refresh credentials later: @@ -189,22 +190,22 @@ async function refreshClientCredentials() { ``` For temporary credentials: + ```typescript -import { fromTemporaryCredentials } from "@aws-sdk/credential-provider"; +import { fromTemporaryCredentials } from "@aws-sdk/credential-providers"; // Better approach for temporary credentials that need regular refreshing const client = new S3Client({ credentials: fromTemporaryCredentials({ - // your temporary credentials config - }) - }); + // your temporary credentials config + }), +}); ``` - When using with AWS clients, the credential provider function is handled automatically. - For temporary credentials that need regular refreshing, `fromTemporaryCredentials` is recommended over manual refresh with `ignoreCache`. - Creating a new client instance ensures fresh credentials. - ### AWS Profile `profile` Available since [v3.714.0](https://github.com/aws/aws-sdk-js-v3/releases/tag/v3.714.0).