README
Flatfile.com CSV Importer Adapter
A simple adapter for elegantly importing data (CSV, XLS & more) via flatfile.com (Typescript, ES6, Browser)
Important note: While the below info is a basic way to get up and running, we recommend reading the developer docs → https://flatfile.com/developers/javascript/getting-started
Another note: If you are using Angular or React, we have specific packages for those. Check out our React package on GitHub and Angular package on GitHub.
License Key
In order to setup, you need to create or sign in to your flatfile.com account and obtain a license key.
Changelog
To view information about the latest releases and any minor/major changes, check out the changelog here.
Note: In version 2.8, previously available "deep-imports" (for Interfaces) have been moved to the root level of
@flatfile/adapter
.
Using NPM
If you don't like external dependencies, or you have a nice build system like Webpack in place. You can install and use Flatfile as an npm package.
npm i @flatfile/adapter --save
Using CDN
The latest version of the package is available via CDN so you can just drop it into your website and start using it.
https://unpkg.com/@flatfile/adapter/build/dist/index.min.js
Quickstart
Add the following code before the ending </body>
tag in your html.
<script src="https://unpkg.com/@flatfile/adapter/build/dist/index.min.js"></script>
<script>
const LICENSE_KEY = '00000000-0000-0000-0000-000000000000' // replace this with your license key
const importer = new FlatfileImporter(LICENSE_KEY, {
type: 'Robot',
fields: [
{
label: 'Name',
key: 'name',
validators: [ { validate: 'unique' } ]
},
{
label: 'Phone',
key: 'phone',
alternates: ['number', 'tel'],
validators: [
{
validate: 'regex_matches',
regex: '^\d{10}