# exchangeToken (/docs/auth/api/functions/exchangeToken)



[@kysoql/auth](/docs/auth/api) / exchangeToken

```ts
function exchangeToken(options): Promise<SalesforceOAuthSession>;
```

OAuth 2.0 token exchange using one of Salesforce's supported subject-token
types.

## Parameters [#parameters]

| Parameter | Type                                                                     |
| --------- | ------------------------------------------------------------------------ |
| `options` | [`TokenExchangeOptions`](/docs/auth/api/interfaces/TokenExchangeOptions) |

## Returns [#returns]

`Promise`\<[`SalesforceOAuthSession`](/docs/auth/api/interfaces/SalesforceOAuthSession)>
