Installation
Basic Implementation
1. Wrap Your App
Wrap your application with theFlatfileProvider:
2. Add Import Trigger
Use theuseFlatfile hook to open Flatfile:
3. Get Your Credentials
publishableKey: Get from Platform Dashboard → Developer Settings For authentication guidance including JWT tokens and user management, see Advanced Configuration.Complete Example
The example below will open an empty space. To create the sheet your users
should land on, you’ll want to create a workbook as shown further down this
page.
Making API Requests
The
publishableKey is designed exclusively for initializing FlatfileProvider. To make API requests, use the accessToken from the useFlatfileInternal hook.useFlatfileInternal to access the accessToken for making authenticated API calls:
Configuration Options
For all configuration options including authentication, theming, and advanced settings, see Advanced Configuration.Using Space Component
For more control, you can use theSpace component directly:
Creating New Spaces
To create a new Space each time:- Add a
workbookconfiguration object. Read more about workbooks here. - Optionally deploy a
listenerfor custom data processing. Your listener will contain your validations and transformations
Reusing Existing Spaces
For production applications, you should create Spaces on your server and pass the Space ID to your React application:Server-side (Node.js/Express)
Client-side (React)
- Create Spaces with server-side authentication
- Add custom event listeners and data processing
- Control Space lifecycle and cleanup
TypeScript Support
The React SDK includes full TypeScript support:Next Steps
- React Authentication: Complete guide to using accessToken for API requests
- Advanced Configuration: Authentication, theming, and advanced options
- Server Setup: Backend integration and event handling
- API Integration: Use Flatfile API to retrieve processed data
- Package Documentation: See @flatfile/react documentation
Quick Links
React Authentication
Using accessToken for secure API requests
Advanced Configuration
Authentication, theming, and advanced options
Server Setup
Backend integration and event handling
Example Projects
React Example
Complete React application with Flatfile embedding

