Upgrade to the latest SDK
Do you have an existing Portal 2 integration? Upgrade to the latest version for a number of benefits highlighted below.
How to upgrade
Latest Portal installs Client SDK from @flatfile/sdk
.
Legacy Portal 2 installed Client SDK from @flatfile/adapter
.
Using npm:
npm install @flatfile/sdk
Using unpkg:
<script src="https://unpkg.com/@flatfile/sdk/dist/index.js"></script>
Change highlights
Configure in code
The recommended path of maintaining data schema and validation functions (Templates, Data Hooks®) is through code.
Browse CLI Quickstart and Workbooks guides to learn more.
Import and initialization
flatfileImporter()
function is no longer used to initialize a Flatfile Import.
A Flatfile
class allows you to create an instance with all available configurations.
See embed Portal guide.
Production mode must be authenticated
A signed JWT token must be used to securely pass in a user session in production mode as: token
Developer mode can continue to pass in an unsecured user info as: embedId
, user
, org
See embed Portal guide on securing your import.
Data Hooks® at field, record and batch levels
The recommended ways to implement Data Hooks from legacy versions has improved.
Data Hooks are easier to maintain and test within your Platform SDK workbook.
Read more about it in Workbooks and Data Hooks guides
Think of Data Hooks on three levels:
- Run a function on just a field with a Field Hook function.
- Run a function on all fields in a single record (row of data) with a Record Hook
- Run a function or make an external API call on all imported data with a Batch Hook