# Introduction (/docs/rest)



`@kysoql/rest` is Kysoql's native Salesforce transport. It uses `fetch`, so you can execute typed queries without adding JSforce to the application.

The executor handles normal Query, QueryAll, scalar counts, Salesforce pagination, selected child relationship continuations, cancellation, and renewable access tokens.

## Install [#install]

<Tabs items="[&#x22;npm&#x22;, &#x22;yarn&#x22;, &#x22;pnpm&#x22;, &#x22;bun&#x22;]" defaultIndex="2">
  <Tab value="npm">
    ```bash
    npm install @kysoql/core @kysoql/rest
    ```
  </Tab>

  <Tab value="yarn">
    ```bash
    yarn add @kysoql/core @kysoql/rest
    ```
  </Tab>

  <Tab value="pnpm">
    ```bash
    pnpm add @kysoql/core @kysoql/rest
    ```
  </Tab>

  <Tab value="bun">
    ```bash
    bun add @kysoql/core @kysoql/rest
    ```
  </Tab>
</Tabs>

## Connect it to Kysoql [#connect-it-to-kysoql]

```ts
import { Kysoql } from "@kysoql/core";
import { createRestExecutor } from "@kysoql/rest";
import type { SalesforceSchema } from "./kysoql/salesforce.generated";

export function createDatabase(instanceUrl: string, accessToken: string) {
  return new Kysoql<SalesforceSchema>({
    executor: createRestExecutor({ instanceUrl, accessToken }),
  });
}
```

That is enough for a static access token. Production applications usually pass an access-token provider so an expired Salesforce session can be renewed safely. See [authentication and token refresh](/docs/rest/authentication).

## What happens during execution? [#what-happens-during-execution]

For ordinary record queries, the executor follows Salesforce continuation links until the query is complete. Selected child subqueries are completed too, including nested child relationships, while respecting each query level's compiled `LIMIT`.

You can collect the whole result with `.execute()`, use QueryAll with `.executeAll()`, or process larger root result sets through the executor's async page and record iterators.

Start with [native REST execution](/docs/rest/execution) for the full execution model, limits, cancellation, and error handling.
