0.1.2 • Published 3 years ago

cloud-capture-components v0.1.2

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

Cloud Capture Components

A set of react components to easily manage images with the cloud capture API. Check out some live examples here

Installation

Install with npm or yarn

NPM

npm i cloud-capture-components

Yarn

yarn add cloud-capture-components

Signing uploads

Uploads are made directly from the browser to your configured source. To obtain a signed payload for upload you need to call https://api.cloudcapture.io/{source_name}/upload/sign?apiKey=1234 securely from your own server.

Upload Form

Use the upload form to easily upload one or many images to your configured source.

Component

<UploadForm
  onRequestUpload={() => {
    // Within your own server call https://api.cloudcapture.io/{source_name}/upload/sign?apiKey=1234
    return fetch('http://localhost:3000/get-signed-payload')
      .then(res => res.json())
      .then(res => res);
  }}
/>

Props

PropTypeDescription
dropTextstringText to display in dropzone
onRequestUpload *() => PromiseRequest for a signed payload
onUploadStart() => voidCalled when upload begins
onUploadEnd() => EntriesCalled when upload ends