Paperspace / paperspace-node

Paperspace API for node.js
https://www.paperspace.com/core
ISC License
75 stars 15 forks source link

Is paperspace-node supposed to work in-browser? #15

Closed TBBle closed 5 years ago

TBBle commented 6 years ago

Based on the Paperspace API docs

JavaScript API client (for Node.js and web browsers)

I expected that using the paperspace-node module (via ps_promise in my case) would work in a create-react-app-bootstrapped application.

However, I've hit a few problem, and they look suspiciously like assumptions of running on a node.js stack:

https://github.com/isaacs/node-graceful-fs/issues/121#issuecomment-361884236 suggests that last one might be a bug in graceful-fs, but perhaps it's a problem somewhere else.

Before I sink much more time into trying to fix these things properly, is this even a valid-use case? Is the 'web browsers' mention on the page an oversight, or is there something I need to fix about my environment to make this work?

yulianovdey commented 5 years ago

Just in case anyone stumbles upon this, it's very unlikely that this package was actually meant to be used in the browser in its current form. Your Paperspace API key should be kept secret, so be careful not to expose it in a client-side application.

dte commented 5 years ago

That is correct. You should not expose your API key and this module is designed for server-side applications.