gyazo-browser-upload
Lightweight in-browser library to simply upload a base64 image to gyazo.
Why?
gyazo-api allows upload to gyazo quite well but it requires authentication. This library is a in-browser library that allows to simply upload an image to your gyazo account.
Important
Right now only https://scrapbox.io
is allowed to upload to the default reqUrl
!
Supply a custom reqUrl
for your server/service.
How?
It uses the lightweight superagent package to send a POST request with the image data to the server.
Step-by-step
- Install this package:
$ npm install gyazo-browser-upload --save
- Use the packageconst upload =const redDotImage = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=='const options = clientId: 'My client'
Options
options.clientId
… Identifier to be used to show in gyazo where the request came from required!options.reqUrl
… URL to which the request should be sent (optional, default: https://upload.gyazo.com/api/upload/easy_auth)options.referer
… Browser referer to be set (optiona, default:window.location.href
)options.title
… Title that the image should get after uploading. (optional)