The Prequel React SDK provides a comprehensive set of React Hooks to help you embed the functionality of Prequel into your React app.

Available Hooks

HookShapeUsage
useDestinationuseDestination(): [Destination, SetDestinationFunction]Initialize a Destination object and a setDestination function to pass to useDestinationForm and collect data from your user.
useDestinationFormuseDestinationForm(destination, orgIdInPrequel): FormGet a form object that you can render to collect connection information. The form changes based on fields set on the destination.
useModelsuseModels(fetchToken, origin): ModelConfig[]Get all Prequel models.
useCreateDestinationuseCreateDestination(fetchToken, origin): CreateDestinationFunctionGenerate a function you can use to submit a completed destination form and create the connection and begin syncing data.
useTestConnectionuseTestConnection(fetchToken, origin): TestConnectionFunctionGenerate a function you can use to embed a connection test (e.g., to test the destination setup before submitting the destination).
useUpdateDestinationuseUpdateDestination(fetchToken, origin): UpdateDestinationFunctionGenerate a function you can use to submit changes to an existing destination.
useDeleteDestinationuseDeleteDestination(fetchToken, origin)Generate a function you can use to delete existing destinations.
useGetTransfersuseProducts(fetchToken, origin)Generate a function you can use to get transfers for an existing destination
useGetDestinationsForRecipientuseGetDestinationsForRecipient(fetchToken, origin)Generate a function you can use to get destinations for the specified recipient.

Hooks vs. Components

Prequel provides a comprehensive set of React Hooks to help you embed Prequel's functionality into your app, though there are no pre-built React Components at this time. We hope the provided Hooks can help you build your own React Components into your app that adhere perfectly to your branding and design guides.