Closed TBBle closed 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.
That is correct. You should not expose your API key and this module is designed for server-side applications.
Based on the Paperspace API docs
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:
fs.existsSync
which doesn't appear to be available.readlineSync
only whenglobal.paperspace_cli
is set, but always imports it.archiver
which eventually hitsfs.ReadStream
being missing.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?