@scoir/filestack
v3.0.1
Published
This utility helps with integration with Google Analytics in a React context.
Downloads
661
Maintainers
Keywords
Readme
filestack
This utility helps with integration with Google Analytics in a React context.
Usage
Factory
Factory for wrapping filestack in promise aware methods. The first argument is the CLIENT_KEY. The second argument is the filestack instance provided by importing:
<script type="text/javascript" src="https://api.filestackapi.com/filestack.js"></script>
import filestackFactory, { fileExtensions } from '@scoir/filestack';
filestackFactory(YOUR_KEY, filestackInstance);
Instance
The factory creates an object that provides filestack with some methods that have been "promisified". "Promisified" methods as follows:
- upload (file, storeOptions)
- file -- raw data, a Blob, or a DOM File Object
- storeOptions -- configuration on storing the data
- export (handle)
- handle -- Blob or URL
- use upload to generate a Blob first if using raw data or a DOM File Object
- pickAndStore (pickerOptions, storeOptions)
- pickerOptions -- configuration on picker modal behavior
- storeOptions -- configuration on storing the data