Skip to content

Commit

Permalink
docs(supplemental-docs): typo fix
Browse files Browse the repository at this point in the history
  • Loading branch information
siddsriv committed Jan 30, 2025
1 parent a3da633 commit c0cf066
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions supplemental-docs/CLIENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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).
Expand Down

0 comments on commit c0cf066

Please sign in to comment.