How to use client secrets with the JavaScript SDK


#1

Hello all,

I’m working on a project for my company where we are creating a Particle Product using Electrons. The basis of the project is that there are pairs of Electrons that can communicate with each other which will be given to two different members within a family.

I am working on creating a web app experience using JS (and Node.JS as backend if there needs to be) that will allow these family members to create accounts using Particle and then claim the devices so that they can control functions on the Electron using the web app.

I’ve created a new Simple Authentication Client using the Particle IDE so I have the client ID and secret. I’ve also looked through the JS SDK Particle provides.

However, I can’t figure out how to add the client id/secrets to the SDK using the Particle JS SDK. There doesn’t seem to exist any documentation on how to do this. Has anyone successfully created a Web App that behaves similarly to what I’m looking for?

Any help would be very appreciated!


#2

I’ve been using Node also as a back-end. But I have had better success using the CloudAPI. So here’s my tip. If you can get a hold of the POSTMAN app do so.

The workflow that seems to work well for me is to dev the end points on the back-end (do something on my server and/or something against the Particle API). Once successful, there is a “Code” button in POSTMAN where I can select Node Native and copy/paste that into my server side code. From there I interact with an Angular front-end.

Might not be exactly the answer you’re looking for but it might be something worth trying.

Cheers,


#3

The question seems dead, but it’s still relevant to me. Any progress figuring it out?