Comments (4)
I think your best bet is to look at the cloud API documentation https://docs.particle.io/reference/api/ and write code to access those HTTP endpoints through your proxy. It sounds like wrapping the particle-api-js module in a proxy module would be harder than wiring a couple HTTP calls from scratch.
from particle-api-js.
Basically I have stopped using this library and am doing the HTTP calls myself. That being said, this library provides a nice DSL, and some good practices around error handling and handling streams, which I would have to re-implement, and which I would love to avoid. Also, I imagine this library will continue to evolve as the api evolves, and so having the ability to just update this and be compatible with latest api would be great.
If there's interest, I can try and work on a pull-request.
from particle-api-js.
Sure, if you'd like to investigate how to support proxies, go ahead. I'd love to see a pull request that adds the ability to inject additional superagent plugins, and puts information in the readme on how to add a proxy plugin.
from particle-api-js.
I would recommend avoiding request
. We specifically switched away from it because it is too heavy for a library that needs to run in the browser.
from particle-api-js.
Related Issues (20)
- Uncaught Error: only one instance of babel-polyfill is allowed HOT 1
- Create Typescript compatible version of API HOT 1
- downloadFirmwareBinary and downloadProductFirmware don't check this.prefix HOT 1
- downloadFirmwareBinary and downloadProductFirmware need tests
- listProductFirmware returns "response" instead of parsed response HOT 1
- uploadProductFirmware only tests with Buffer, and doesn't test with filename HOT 1
- Particle.CallFunction Not Working HOT 3
- loginAsClientOwner only uses default token duration
- particle-api-js ^9.1.0 not working with Svelte ^3.37.0
- 429 error is not properly converted to an object
- Unsupported engine warning, even when node + npm versions meet requirement HOT 1
- EBADENGINE Error because of wrong Version of rpm?
- addDeviceToProduct doesn't appear to reject on error? HOT 1
- Possible issue with activateSIM with products
- Version 7.1.0 not published to npm HOT 2
- How to detect by code the moment of WIFi deconnection?
- Update coveralls when new version is released
- Add tests for EventStream
- Drop Support for Node v4 HOT 1
- `EventStream` doesn't handle dropped connections HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from particle-api-js.