filestack-js
Official JavaScript library for Filestack
Last updated 7 years ago by filestack-dev .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ npm install filestack-js 
SYNC missed versions from official npm registry.

Javascript SDK for the Filestack API and content management system.



Important: This is the readme for 1.0.0-rc1. If you need previous versions please switch to the appropriate git tag.

What's in the box?

  • A multi-part uploader powered on the backend by the Filestack CIN.
  • An interface to the Filestack Processing Engine for transforming assets via URLs.
  • The Filestack Picker - an upload widget for the web that integrates over a dozen cloud providers and provides pre-upload image editing.

Installation

npm install filestack-js@next

Usage

Browsers

ES module:

import * as filestack from 'filestack-js';
const client = filestack.init('apikey');

UMD module:

<script src="//static.filestackapi.com/filestack-js/1.x.x/filestack.min.js"></script>
<script>
  const client = filestack.init('apikey');
</script>

Node

CommonJS module:

const client = require('filestack-js').init('apikey');

Module Overview

The package.json specifies two separate modules:

  • main for the CommonJS module (intended for Node runtimes)
  • browser for the pre-bundled ES module (intended for browser runtimes)

Node projects which depend on filestack-js will follow the main field in package.json. When building for the browser, newer tools (like Webpack, Rollup, and Parcel) follow the browser field, which will resolve to the pre-bundled ES module. Both modules follow the same API, but some methods behave differently based on their runtime. For example, client.upload treats the file argument as a file path in Node but in browsers it assumes a Blob object.

The pre-bundled browser module is also available in UMD format. This is useful if you are using script tags on a web page instead of bundling your application. It can be retrieved from both the Filestack CDN and the unpkg CDN:

Live examples (JSFiddle)

Upload image
Open picker
Open picker in inline mode
Crop images
Multiple drop panes
Preview
Import using RequireJS
Retrieve image data
Transform image
Custom Picker CSS
Assign file to user

Examples can be run locally with:

npm run examples

Picker Quick Start

If you are here to use the picker widget, it can be initialized from the Filestack client by calling client.picker(options). Options for the picker are documented here.

The picker instance returned from client.picker can be controlled with a few methods:

  • open - Create the application and mount it into the DOM based on the displayMode.
  • close - Close the application and remove its resources from the DOM.
  • crop(files) - Create the application, mount it, and pre-select the passed files for cropping.
  • cancel - Cancel all uploads controlled by this instance.

Please see our examples above to learn more about customizing the picker for your use case.

API Documentation

https://filestack.github.io/filestack-js/

Promises

This library requires an environment that implements the Promise object spec. If you target IE11 or iOS before 8.0 you will need to add a Promise polyfill to your page or application.

Polyfills we recommend:

Module (for bundling):

Script (for script tag):

Development

Most tests in this library are expected to interface with actual backend services. Because we like to run tests during development, these services are mocked during unit testing.

All tests are using Mocha. Browser tests are run with Karma.

To run units:

npm test

To run integration tests:

npm run test:integration

Integration tests require a .env file in the root of your project with the following fields:

BROWSERSTACK_USERNAME=
BROWSERSTACK_ACCESS_KEY=
TEST_APIKEY=
TEST_CLOUD_APIKEY=
TEST_INTELLIGENT_APIKEY=
TEST_SECURE_APIKEY=
TEST_SIGNATURE=
TEST_POLICY=
TEST_FILELINK=
TEST_SECURE_FILELINK=

You will need to acquire this data from a Filestack developer if you plan on running the integration suite.

Contributing

We follow the conventional commits specification to ensure consistent commit messages and changelog formatting.

Current Tags

  • 0.10.0-rc1                                ...           beta (7 years ago)
  • 3.32.3                                ...           latest (6 months ago)
  • 1.0.0-rc2                                ...           next (7 years ago)

168 Versions

  • 3.32.3                                ...           6 months ago
  • 3.32.2                                ...           6 months ago
  • 3.32.1                                ...           7 months ago
  • 3.32.0                                ...           9 months ago
  • 3.31.0                                ...           9 months ago
  • 3.30.2                                ...           10 months ago
  • 3.30.1                                ...           a year ago
  • 3.30.0                                ...           a year ago
  • 3.29.0                                ...           a year ago
  • 3.28.0                                ...           a year ago
  • 3.27.0                                ...           a year ago
  • 3.26.1                                ...           2 years ago
  • 3.26.0                                ...           2 years ago
  • 3.25.0                                ...           3 years ago
  • 3.24.1                                ...           3 years ago
  • 3.24.0                                ...           3 years ago
  • 3.23.2                                ...           4 years ago
  • 3.23.1                                ...           4 years ago
  • 3.22.1                                ...           4 years ago
  • 3.22.0                                ...           4 years ago
  • 3.21.1                                ...           4 years ago
  • 3.21.0                                ...           4 years ago
  • 3.20.0                                ...           4 years ago
  • 3.19.0                                ...           4 years ago
  • 3.18.0                                ...           4 years ago
  • 3.17.0                                ...           4 years ago
  • 3.16.0                                ...           4 years ago
  • 3.15.0                                ...           5 years ago
  • 3.14.0                                ...           5 years ago
  • 3.13.2                                ...           5 years ago
  • 3.13.1                                ...           5 years ago
  • 3.13.0                                ...           5 years ago
  • 3.12.4                                ...           5 years ago
  • 3.12.3                                ...           5 years ago
  • 3.12.2                                ...           5 years ago
  • 3.12.1                                ...           5 years ago
  • 3.12.0                                ...           5 years ago
  • 3.11.2                                ...           5 years ago
  • 3.11.1                                ...           5 years ago
  • 3.11.0                                ...           5 years ago
  • 3.10.1                                ...           5 years ago
  • 3.10.0                                ...           5 years ago
  • 3.9.0                                ...           5 years ago
  • 3.8.0                                ...           5 years ago
  • 3.7.0                                ...           5 years ago
  • 3.6.0                                ...           5 years ago
  • 3.5.0                                ...           5 years ago
  • 3.4.2                                ...           5 years ago
  • 3.4.1                                ...           5 years ago
  • 3.4.0                                ...           5 years ago
  • 3.3.5                                ...           5 years ago
  • 3.3.4                                ...           5 years ago
  • 3.3.3                                ...           6 years ago
  • 3.3.2                                ...           6 years ago
  • 3.3.1                                ...           6 years ago
  • 3.3.0                                ...           6 years ago
  • 3.2.0                                ...           6 years ago
  • 3.1.1                                ...           6 years ago
  • 3.1.0                                ...           6 years ago
  • 3.0.0                                ...           6 years ago
  • 2.1.0                                ...           6 years ago
  • 2.0.7                                ...           6 years ago
  • 2.0.6                                ...           6 years ago
  • 2.0.5                                ...           6 years ago
  • 2.0.4                                ...           6 years ago
  • 2.0.3                                ...           6 years ago
  • 2.0.2                                ...           6 years ago
  • 2.0.1                                ...           6 years ago
  • 2.0.0                                ...           6 years ago
  • 1.14.6                                ...           6 years ago
  • 1.14.5                                ...           6 years ago
  • 1.14.4                                ...           6 years ago
  • 1.14.3                                ...           6 years ago
  • 1.14.2                                ...           6 years ago
  • 1.14.1                                ...           6 years ago
  • 1.14.0                                ...           6 years ago
  • 1.13.4                                ...           6 years ago
  • 1.13.3                                ...           6 years ago
  • 1.13.2                                ...           6 years ago
  • 1.13.1                                ...           6 years ago
  • 1.13.0                                ...           6 years ago
  • 1.12.1                                ...           6 years ago
  • 1.12.0                                ...           6 years ago
  • 1.11.0                                ...           6 years ago
  • 1.10.0                                ...           6 years ago
  • 1.9.0                                ...           6 years ago
  • 1.8.3                                ...           6 years ago
  • 1.8.2                                ...           6 years ago
  • 1.8.1                                ...           6 years ago
  • 1.8.0                                ...           6 years ago
  • 1.7.7                                ...           6 years ago
  • 1.7.6                                ...           6 years ago
  • 1.7.5                                ...           6 years ago
  • 1.7.4                                ...           6 years ago
  • 1.7.3                                ...           6 years ago
  • 1.7.2                                ...           6 years ago
  • 1.7.1                                ...           6 years ago
  • 1.7.0                                ...           6 years ago
  • 1.6.1                                ...           6 years ago
  • 1.6.0                                ...           6 years ago
  • 1.5.1                                ...           6 years ago
  • 1.5.0                                ...           6 years ago
  • 1.4.1                                ...           6 years ago
  • 1.4.0                                ...           6 years ago
  • 1.3.2                                ...           6 years ago
  • 1.3.1                                ...           6 years ago
  • 1.3.0                                ...           6 years ago
  • 1.2.1                                ...           6 years ago
  • 1.2.0                                ...           6 years ago
  • 1.0.2                                ...           7 years ago
  • 1.0.1                                ...           7 years ago
  • 1.0.0                                ...           7 years ago
  • 0.11.5                                ...           7 years ago
  • 1.0.0-rc2                                ...           7 years ago
  • 0.11.4                                ...           7 years ago
  • 1.0.0-rc1                                ...           7 years ago
  • 0.11.2                                ...           7 years ago
  • 0.11.1                                ...           7 years ago
  • 0.10.1                                ...           7 years ago
  • 0.10.0                                ...           7 years ago
  • 0.10.0-rc1                                ...           7 years ago
  • 0.9.12                                ...           7 years ago
  • 0.9.11                                ...           7 years ago
  • 0.9.10                                ...           7 years ago
  • 0.9.9                                ...           7 years ago
  • 0.9.8                                ...           7 years ago
  • 0.9.8-rc2                                ...           7 years ago
  • 0.9.8-rc1                                ...           7 years ago
  • 0.9.7                                ...           7 years ago
  • 0.9.6                                ...           7 years ago
  • 0.9.5                                ...           7 years ago
  • 0.9.5-rc1                                ...           7 years ago
  • 0.9.4                                ...           7 years ago
  • 0.9.4-rc1                                ...           7 years ago
  • 0.9.3                                ...           7 years ago
  • 0.9.2                                ...           7 years ago
  • 0.9.1                                ...           7 years ago
  • 0.9.0                                ...           7 years ago
  • 0.8.5                                ...           7 years ago
  • 0.8.4                                ...           7 years ago
  • 0.8.3                                ...           7 years ago
  • 0.8.2                                ...           7 years ago
  • 0.8.1                                ...           7 years ago
  • 0.8.1-rc                                ...           7 years ago
  • 0.8.0                                ...           7 years ago
  • 0.7.1                                ...           7 years ago
  • 0.7.0                                ...           7 years ago
  • 0.7.0-rc                                ...           8 years ago
  • 0.6.3                                ...           8 years ago
  • 0.6.2                                ...           8 years ago
  • 0.6.1                                ...           8 years ago
  • 0.6.0                                ...           8 years ago
  • 0.5.2                                ...           8 years ago
  • 0.5.1                                ...           8 years ago
  • 0.5.0                                ...           8 years ago
  • 0.4.2                                ...           8 years ago
  • 0.4.1                                ...           8 years ago
  • 0.3.2                                ...           8 years ago
  • 0.3.1                                ...           8 years ago
  • 0.3.0                                ...           8 years ago
  • 0.2.1                                ...           8 years ago
  • 0.2.0                                ...           8 years ago
  • 0.1.12                                ...           8 years ago
  • 0.1.11                                ...           8 years ago
  • 0.1.10                                ...           8 years ago
  • 0.1.9                                ...           8 years ago
  • 0.1.8                                ...           8 years ago
  • 0.1.7                                ...           8 years ago
Maintainers (1)
Downloads
Total 0
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (8)
Dev Dependencies (59)

© 2010 - cnpmjs.org x YWFE | Home | YWFE