A node module to manage Facebook Test Users of an application.
$ npm install fbapp-test-users
var FbTestUsers = require('fbapp-test-users');
var FbTestUsers = require('fbapp-test-users');
FbTestUsers.setAppId('XXXX');
FbTestUsers.setAppSecret('YYYY');
Retrieve the list of test users. By default, if no limit is given, the function gets all the test users.
FbTestUsers.getList(50)
.then(function(list) {
// Example:
/*
[
{
id: '123456789',
loginUrl: 'https://developers.facebook.com/checkpoint/test-user-login/123456789/',
accessToken: 'XXXXXXXXXX',
name: 'Open Graph Test User',
link: 'http://www.facebook.com/123456789'
}
]
*/
});
Create a test user.
See the fields in the official documentation.
FbTestUsers.createUser({
installed: false,
name: 'Batman'
})
.then(function(createdUser) {
// Example:
/*
{
id: '123456789',
email: 'xxx',
login_url: 'https://developers.facebook.com/checkpoint/test-user-login/123456789/',
password: '1876562816'
}
*/
});
Update a test user.
name
and password
can be null if you don't want to update the name or password.
FbTestUsers.updateUser(user.id, 'New name', 'New password')
.then(function success(res) {
// This function returns the result of the operation [true|false]
// Example:
/*
{
success: true
}
*/
});
Delete a test user.
FbTestUsers.deleteUser(user.id)
.then(function success(res) {
// This function returns the result of the operation [true|false]
// Example:
/*
{
success: true
}
*/
});
MIT, see LICENSE.md for details.