Skip to content

Commit 40f09b9

Browse files
authored
Merge pull request #48 from filestack/update-dependencies
Update for filestack-js 1.0 and React 16
2 parents 34cb701 + 1190074 commit 40f09b9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+31917
-16925
lines changed

.eslintrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
}
1313
},
1414
"rules": {
15+
"import/no-extraneous-dependencies": 0,
1516
"import/no-unresolved": 0,
1617
"global-require": 0,
1718
"no-console": 0,
@@ -27,6 +28,8 @@
2728
],
2829
"env": {
2930
"browser": true,
31+
"jest": true,
32+
"jasmine": true,
3033
"node": true
3134
}
3235
}

README.md

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,15 @@
1515

1616
## Installing
1717

18-
Install ``filestack-react`` and ``filestack-js`` through npm
18+
Install ``filestack-react`` and ``filestack-js`` through npm.
1919

2020
```shell
2121
npm install filestack-react filestack-js
2222
```
23-
or
24-
```shell
25-
yarn add filestack-react filestack-js
26-
```
23+
2724
## Import
2825
```javascript
29-
var ReactFilestack = require('filestack-react');
26+
const ReactFilestack = require('filestack-react');
3027
```
3128
In ES2015
3229
```javascript
@@ -40,7 +37,7 @@ import ReactFilestack, { client } from 'filestack-react';
4037
*client is available from version 1.3.4*
4138

4239
## Usage
43-
You should register [Filestack](https://www.filestack.com) website and get an **API key** first!
40+
You should register on the [Filestack](https://www.filestack.com) website and get an **API key** first!
4441

4542
**1. Custom Designed button**
4643
```jsx
@@ -80,12 +77,12 @@ You should register [Filestack](https://www.filestack.com) website and get an **
8077
```
8178

8279
Available modes:
83-
* [upload](https://www.filestack.com/docs/javascript-api/upload-v3)
84-
* [transform](https://www.filestack.com/docs/javascript-api/transform-v3)
85-
* [retrieve](https://www.filestack.com/docs/javascript-api/retrieve-v3)
86-
* [storeUrl](https://www.filestack.com/docs/javascript-api/store-url-v3)
87-
* [metadata](https://www.filestack.com/docs/javascript-api/metadata-v3)
88-
* [remove](https://www.filestack.com/docs/javascript-api/remove-v3)
80+
* [upload](https://filestack.github.io/filestack-js/classes/client.html#upload)
81+
* [transform](https://filestack.github.io/filestack-js/classes/client.html#transform)
82+
* [retrieve](https://filestack.github.io/filestack-js/classes/client.html#retrieve)
83+
* [storeUrl](https://filestack.github.io/filestack-js/classes/client.html#storeurl)
84+
* [metadata](https://filestack.github.io/filestack-js/classes/client.html#metadata)
85+
* [remove](https://filestack.github.io/filestack-js/classes/client.html#remove)
8986

9087
Define your own options object and callback function, connect them to the component and get the result from Filestack:
9188

@@ -116,14 +113,14 @@ You can pass a custom prop **link**.
116113
/>
117114
```
118115

119-
**Filestack-js client**
116+
**filestack-js client**
120117

121118
You can also import the official client and decouple its React component ReactFilestack.
122-
However, you will need to initialize it with the API key and optional security options.
119+
However, you will need to initialize it with the API key and any [client options](https://filestack.github.io/filestack-js/interfaces/clientoptions.html) you need such as security, cname, and sessionCache.
123120

124121
```javascript
125122
import { client } from 'filestack-react';
126-
const filestack = client.init('YOUR_API_KEY', security);
123+
const filestack = client.init('YOUR_API_KEY', options);
127124
```
128125

129126
## Examples
@@ -133,7 +130,7 @@ You can find the examples of using Pick in ``/examples/demo``.
133130
Run
134131

135132
```javascript
136-
yarn start
133+
npm start
137134
```
138135

139136
and connect to localhost:8080.
@@ -144,7 +141,7 @@ To try different functions go to ``/examples/demo2`` and follow the same steps t
144141

145142

146143
## Available Props
147-
[Official Filestack Documentation](https://filestack.com/docs)
144+
Please also see the [Official JavaScript API reference](https://filestack.github.io/filestack-js)
148145

149146
> ### apikey
150147
> **required**, string. An API key for Filestack.
@@ -162,9 +159,7 @@ To try different functions go to ``/examples/demo2`` and follow the same steps t
162159
> **optional** function. Handle errors.
163160
164161
> ### options
165-
> **optional** object. Detailed options to customize the mode behavior.
166-
>
167-
> See Javascript API from the[official documentation](https://filestack.com/docs).
162+
> **optional** object. Detailed options to customize the specific mode behavior. For example, for `pick` mode the [following options](https://filestack.github.io/filestack-js/interfaces/pickeroptions.html) are supported.
168163
169164
> ### security
170165
> **optional** object. If you have security enabled, you will need to initialize
@@ -179,6 +174,9 @@ the client with a valid Filestack policy and signature in order to perform the r
179174
> ### cname
180175
> **optional** Custom domain to use for all URLs. This requires the custom CNAME feature on your Filestack app.
181176
177+
> ### sessionCache
178+
> **optional** If true then remember users (up to session expiry) when using the Filestack Cloud API. By default users need to authenticate on every pick.
179+
182180
## Versioning
183181
Filestack React follows the [Semantic Versioning](http://semver.org/).
184182

dist/filestack-react.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/filestack-react.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/demo/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import React from 'react';
22
import { render } from 'react-dom';
33
import { client } from '../../src';
4-
import Container from './components/Container';
4+
import Container from './src/Container';
55

66
const apikey = 'Acu94EFL1STGYvkM6a8usz';
77

8-
render (
8+
render(
99
<Container apikey={apikey} />,
1010
document.getElementById('app'),
1111
);

0 commit comments

Comments
 (0)