@@ -165,18 +165,19 @@ import { fromIni } from "@aws-sdk/credential-provider-ini";
165165
166166// Create client with credentials that will reload from file
167167const client = new S3Client ({
168- credentials: fromIni ({ ignoreCache: true })
169- });
170- ```
168+ credentials: fromIni ({ ignoreCache: true }),
169+ });
170+ ```
171171
172172Refreshing credentials for an existing client:
173+
173174``` typescript
174175import { S3Client } from " @aws-sdk/client-s3" ;
175176import { fromIni } from " @aws-sdk/credential-provider-ini" ;
176177
177178// Initial client setup
178179const client = new S3Client ({
179- credentials: fromIni ({ ignoreCache: true })
180+ credentials: fromIni ({ ignoreCache: true }),
180181});
181182
182183// To refresh credentials later:
@@ -189,22 +190,22 @@ async function refreshClientCredentials() {
189190```
190191
191192For temporary credentials:
193+
192194``` typescript
193- import { fromTemporaryCredentials } from " @aws-sdk/credential-provider " ;
195+ import { fromTemporaryCredentials } from " @aws-sdk/credential-providers " ;
194196
195197// Better approach for temporary credentials that need regular refreshing
196198const client = new S3Client ({
197199 credentials: fromTemporaryCredentials ({
198- // your temporary credentials config
199- })
200- });
200+ // your temporary credentials config
201+ }),
202+ });
201203```
202204
203205- When using with AWS clients, the credential provider function is handled automatically.
204206- For temporary credentials that need regular refreshing, ` fromTemporaryCredentials ` is recommended over manual refresh with ` ignoreCache ` .
205207- Creating a new client instance ensures fresh credentials.
206208
207-
208209### AWS Profile ` profile `
209210
210211Available since [ v3.714.0] ( https://github.com/aws/aws-sdk-js-v3/releases/tag/v3.714.0 ) .
0 commit comments