UNPKG

1.63 kBMarkdownView Raw
1# @uppy/provider-views
2
3<img src="https://uppy.io/images/logos/uppy-dog-head-arrow.svg" width="120" alt="Uppy logo: a superman puppy in a pink suit" align="right">
4
5<a href="https://www.npmjs.com/package/@uppy/provider-views"><img src="https://img.shields.io/npm/v/@uppy/provider-views.svg?style=flat-square"></a>
6<img src="https://github.com/transloadit/uppy/workflows/Tests/badge.svg" alt="CI status for Uppy tests"> <img src="https://github.com/transloadit/uppy/workflows/Companion/badge.svg" alt="CI status for Companion tests"> <img src="https://github.com/transloadit/uppy/workflows/End-to-end%20tests/badge.svg" alt="CI status for browser tests">
7
8View library for Uppy remote provider plugins.
9
10Uppy is being developed by the folks at [Transloadit](https://transloadit.com), a versatile file encoding service.
11
12## Example
13
14```js
15const Plugin = require('@uppy/core/lib/plugin')
16const { ProviderViews } = require('@uppy/provider-views')
17
18class GoogleDrive extends Plugin {
19 constructor () { /* snip */ }
20 install () {
21 this.view = new ProviderViews(this)
22 // snip
23 }
24
25 onFirstRender () {
26 return Promise.all([
27 this.provider.fetchPreAuthToken(),
28 this.view.getFolder('root', '/')
29 ])
30 }
31
32 render (state) {
33 return this.view.render(state)
34 }
35}
36```
37
38## Installation
39
40> Unless you are creating a custom provider plugin, you do not need to install this.
41
42```bash
43$ npm install @uppy/provider-views
44```
45
46<!-- Undocumented currently
47## Documentation
48
49Documentation for this plugin can be found on the [Uppy website](https://uppy.io/docs/DOC_PAGE_HERE).
50-->
51
52## License
53
54[The MIT License](./LICENSE).