4th Street Bar Hive-Bar

Hive-Bar Powered by Hive beta-fdb5b5b

Community post

PixelHosting NPM Integration

NPM Package Release



Free Image Hosting for Steem Projects


Hello Steem,

to make it easier for developers to integrate PixelHosting into their projects we provide a npm package called pixelhosting.

You can find it at:

https://www.npmjs.com/package/pixelhosting

Install the packe by running npm install pixelhosting --save

Then you can use the libary like this:

let pixel = require('./lib');

let data = ""data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAU4AAAEG.....";

pixel.init({
    api_key: "YOUR_API_KEY",
    api_key_id: "YOUR_API_KEY_ID"
});

pixel.upload(data).then((result) => {
    console.log(result);
});

The result will be an json object like this one:

{
  "secure_url": "https://cdn.pixelhosting.co/wvyez8xyd4/a31ea848d49f5a0a083f5799842b6b09bf196ff2125fd0649b22a783965dc7ff.jpeg",
  "thumbnail_url": "https://cdn.pixelhosting.co/wvyez8xyd4/thumb/a31ea848d49f5a0a083f5799842b6b09bf196ff2125fd0649b22a783965dc7ff.jpeg"
}
![](https://cdn.pixelhosting.co/wvyez8xyd4/a31ea848d49f5a0a083f5799842b6b09bf196ff2125fd0649b22a783965dc7ff.jpeg)![](https://cdn.pixelhosting.co/wvyez8xyd4/thumb/a31ea848d49f5a0a083f5799842b6b09bf196ff2125fd0649b22a783965dc7ff.jpeg)
10 upvotes $0.09

Replies (0)

Conversation

No replies yet

Replies will appear here as people join the conversation.

Review before signing

Posting as . Signing with . Keychain permission: Posting. Hive Keychain will ask you to approve this action next.


  
Technical details

Operation fingerprint: