Skip to content

Commit

Permalink
Add documentation on passing custom params to token request
Browse files Browse the repository at this point in the history
  • Loading branch information
kaviththiranga committed Jul 29, 2024
1 parent 9f8cea6 commit c57c84b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ auth.getAuthorizationURL(config).then((url)=>{
### requestAccessToken

```TypeScript
requestAccessToken(authorizationCode: string, sessionState: string, state: string, userID?: string): Promise<TokenResponse>
requestAccessToken(authorizationCode: string, sessionState: string, state: string, userID?: string, tokenRequestConfig: { params: Record<string, unknown> }): Promise<TokenResponse>
```

#### Arguments
Expand All @@ -435,6 +435,15 @@ requestAccessToken(authorizationCode: string, sessionState: string, state: strin

If you want to use the SDK to manage multiple user sessions, you can pass a unique ID here to request an access token specific to that user. This can be useful when this SDK is used in backend applications.

5. tokenRequestConfig: `object` (optional)

An optional object that can contain additional parameters to be sent in the token request payload. The object should have a `params` property, which is a record of key-value pairs where the key is a string and the value can be of any type.

```typescript
tokenRequestConfig: {
params: Record<string, unknown>
}
```
#### Returns

A Promise that resolves with the [`TokenResponse`](#TokenResponse) object.
Expand Down

0 comments on commit c57c84b

Please sign in to comment.