Can't create Braintree client token with customer ID
Copied directly from Braintree's tutorial, you can create a client token with a customer ID like this: gateway.clientToken.generate({ customerId: aCustomerId }, function (err, response) { clientToken = response.clientToken }); I declare var aCustomerId = "customer" but node.js closes with the error new TypeError('first argument must be a string or Buffer') When I try to generate a token without the customerId, everything works fine (though I never get a new client token but that's another question). EDIT: Here is the complete test code as requested: var http = require('http'), url=require('url