Skip to main content

React SDK

Use @prequel/import-react to build custom Import experiences in a React application. The SDK provides a provider, a default authenticated client, and hooks for sources, datasets, streams, extracts, loads, and destinations.

Install

Authentication

Do not expose your Prequel API key to browser code. Instead, create a backend endpoint that exchanges your server-side credentials for a short-lived scoped Import API token, then pass that token fetcher to createDefaultClient.
createDefaultClient caches the token and retries once with a fresh token after a 401 response.

Query Hooks

List hooks return pagination helpers in addition to the current page of items.
Use single-resource hooks when you already have an ID:

Action Hooks

Create, update, preview, and test hooks return action state plus a named function for the operation.
Each action hook also exposes execute, which returns { ok, data, error } instead of throwing.

Source Forms

Use useSourceForm to build a vendor-specific source connection form from Prequel metadata. It returns the fields to render, a draft source object, a setter, and getSource() for producing a typed create/update payload.

Hooks

Types

The SDK exports TypeScript types for request payloads and response resources, such as SourceOptions, DatasetResource, and StreamResource. Use these from your editor while building forms and handling responses. For signatures and return shapes, see the React SDK Reference and React SDK Common Types. For the API model shapes used by the hooks, see React SDK API Models. For endpoint-level schemas, see the Import API reference.