docs ✍️
This commit is contained in:
14
README.md
14
README.md
@@ -44,6 +44,7 @@ The `Auth` component provides methods for authentication:
|
||||
|
||||
#### Universal Auth
|
||||
|
||||
#### Authenticating
|
||||
```typescript
|
||||
await client.auth().universalAuth.login({
|
||||
clientId: "<machine-identity-client-id>",
|
||||
@@ -56,6 +57,11 @@ await client.auth().universalAuth.login({
|
||||
- `clientId` (string): The client ID of your Machine Identity.
|
||||
- `clientSecret` (string): The client secret of your Machine Identity.
|
||||
|
||||
#### Renewing
|
||||
You can renew the authentication token that is currently set by using the `renew()` method.
|
||||
```typescript
|
||||
await client.auth().universalAuth.renew();
|
||||
|
||||
|
||||
#### Manually set access token
|
||||
By default, when you run a successful `.login()` method call, the access token returned will be auto set for the client instance. However, if you wish to set the access token manually, you may use this method.
|
||||
@@ -73,6 +79,7 @@ client.auth().accessToken("<your-access-token>")
|
||||
> [!NOTE]
|
||||
> AWS IAM auth only works when the SDK is being used from within an AWS service, such as Lambda, EC2, etc.
|
||||
|
||||
#### Authenticating
|
||||
```typescript
|
||||
await client.auth().awsIamAuth.login({
|
||||
identityId: "<your-identity-id>"
|
||||
@@ -83,6 +90,13 @@ await client.auth().awsIamAuth.login({
|
||||
- `options` (object):
|
||||
- `identityId` (string): The ID of your identity
|
||||
|
||||
#### Renewing
|
||||
You can renew the authentication token that is currently set by using the `renew()` method.
|
||||
```typescript
|
||||
await client.auth().awsIamAuth.renew();
|
||||
```
|
||||
|
||||
|
||||
|
||||
### `secrets`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user