Particle JS Node Module Questions


#1

I am trying to use the particle node module (https://docs.particle.io/reference/SDKs/javascript/#node-js) and when I try to create a customer for a product with something like this:

var Particle = require('particle-api-js');
var particleClient = new Particle({
    clientSecret: 'MY SECRET',
    clientId: 'MY CLIENT ID'
});

particleClient.createCustomer({ email: SOMEEMAIL, password: SOMEPASSWORD, product: PRODUCT SLUG})

When I go with that approach I never see the Customer in my customers tab of my Particle Console but I do get an access token back from the call. Also, I am trying to do two-legged auth which means I need to create shadow customers using the noPassword option and not pass a password but the module does not support this at all.

Am I missing something glaring? I’m a bit lost with this as I can’t create a simple customer for my Product. I have already created a two legged Oauth client in the Auth tab of my Product and am initializing the particle client above using that client id and secret.


#2

Looks like the npm module is very lean and doesn’t do much stuff. Also found out customers only show in the product when they have a device as well.


#3

Customers don’t show up until you claim a device with that customer. They’re in a state of limbo where you can’t create that customer ID again, but you can’t see it either.