Guides

React

importOK is a reusable custom web component that embeds an import wizard into your app. You can follow this installation guide to use it as a React component.

Installation

The tester version of the importOK JavaScript and React components are available on NPM, while the full (paid) versions are hosted in a private repository. Both versions are fully compatible and no code changes are required when upgrading to the full (paid) versions.

1npm install @importok/javascript
2npm install @importok/react

Usage

To embed the importOK wizard in your React project, simply add the following snippet to your component or page. This will render the interactive import wizard, allowing users to import data seamlessly. For a complete list of configuration options, including available props and event handlers, refer to the Props & Events section of the documentation.

To help you get started, we’ve also prepared a live StackBlitz example you can use as a reference for setting up your configuration.

1import ImportokWizard from '@importok/react';
2 
3function App() {
4 /**
5 * Import fields to be mapped
6 * Check https://importok.io/docs/fields for more details
7 */
8 const fields = {};
9 
10 /**
11 * Custom transformers
12 * Check https://importok.io/docs/transformers for more details
13 */
14 const transformers = {};
15 
16 /**
17 * Custom validators
18 * Check https://importok.io/docs/validators for more details
19 */
20 const validators = {};
21 
22 /**
23 * Custom providers
24 * Check https://importok.io/docs/data-providers for more details
25 */
26 const providers = {};
27 
28 /**
29 * Push the provided record to the API
30 * Check https://importok.io/docs/webhooks for more details
31 */
32 const saveRecord = async function (record, meta) {};
33 
34 return (
35 <div className="App">
36 <ImportokWizard
37 fields={fields}
38 transformers={transformers}
39 validators={validators}
40 providers={providers}
41 onRecordReady={saveRecord}
42 />
43 </div>
44 );
45}

Note: There is a limit of 20 records for each import with the trial version. Additionally, access to custom validators, transformers, and data providers is restricted. Once you upgrade to a paid plan, you’ll gain access to the private packages and unlock full functionality with no limitations.