API reference
REST API reference
Generated API reference for the native Salesforce REST client, executor, pagination, OAuth compatibility, and errors in @kysoql/rest.
Functions
| Function | Description |
|---|---|
| createRestClient | Creates an authenticated Salesforce REST client with optional token refresh retry. |
| createRestExecutor | Creates a Kysoql query executor around a RestClient. |
| authenticateClientCredentials | One token exchange. Configure the OAuth application in Salesforce first. |
| refreshAccessToken | One refresh exchange. Interactive authorisation and secure token storage stay in the application. |
Classes
| Class | Description |
|---|---|
| SalesforceOAuthError | Thrown when a Salesforce OAuth token request fails. |
| SalesforceQueryLimitError | Thrown when configured pagination limits are exceeded before a query completes. |
| SalesforceResponseError | Thrown when Salesforce returns a response that cannot be validated. |
| SalesforceRestError | Structured API errors. Details may contain org data; do not log them blindly. |
Interfaces
| Interface | Description |
|---|---|
| RestClient | Minimal authenticated Salesforce REST client used by the query executor. |
| RestClientOptions | Connection, authentication, and transport options for the Salesforce REST client. |
| RestGetOptions | Options for one authenticated Salesforce REST GET request. |
| SalesforceRestErrorDetail | Structured error detail returned by Salesforce REST endpoints. |
| RestExecutor | Query executor backed by the Salesforce REST API. |
| RestPaginationOptions | Safety limits applied while following Salesforce query pagination. |
| RestQueryOptions | Execution options for a Salesforce REST query. |
| RestQueryPage | Validated page returned by a Salesforce REST query request. |
| HttpOptions | REST request options plus an injectable fetch implementation. |
| RestRequestOptions | Abort and timeout options shared by Salesforce REST operations. |
| ClientCredentialsOptions | Options for the Salesforce client-credentials grant in the REST package. |
| RefreshTokenOptions | Options for the Salesforce refresh-token grant in the REST package. |
| SalesforceOAuthSession | Access-token and instance metadata returned by the REST package OAuth helpers. |
Type Aliases
| Type Alias | Description |
|---|---|
| AccessTokenProvider | Provides a Salesforce access token and can be asked to force a refresh after 401. |
Variables
| Variable | Description |
|---|---|
| DEFAULT_API_VERSION | Deliberately pinned, not auto-upgraded when Salesforce publishes a release. |