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 tocreateDefaultClient.
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.Action Hooks
Create, update, preview, and test hooks return action state plus a named function for the operation.execute, which returns { ok, data, error } instead of throwing.
Source Forms
UseuseSourceForm 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 asSourceOptions, 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.