2.0.1 • Published 7 years ago

s3-signatory v2.0.1

Weekly downloads
3
License
ISC
Repository
github
Last release
7 years ago

s3-signatory

It's often useful to create a file in the browser and then upload it to s3. You could upload it to your server first, but that's both slow and lame.

In order to upload a file from the browser to s3, you need a signed request url. This library is for making signed request urls.

You'll find (legit, deployable) example microservices for AWS Lambda and zeit/now in the examples directory

You'll also find a very minimal example of the browser integration in that same folder.

api

browser

getSignedRequest

{signatoryUrl: string}
=> {name: string, type: string}
=> Promise<string>

uploadSignedRequest

(signedRequest: string, {name: string, type: string})
=> Promise<{ key: string, bucket: string, signedRequest: string }>

upload, default

{name: string, type: string, signatoryUrl: string}
=> Promise<{ key: string, bucket: string, signedRequest: string }>

node

sign, default

{signatoryUrl: string}
=> ({bucket: string, name: string, type: string}, signedRequest: string)
=> Promise<{ key: string, signedRequest: string }>