Constructor
new ClientsManager(options)
- Source:
Parameters:
Name | Type | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object
|
The client options.
|
Members
(inner) auth0RestClient :external:RestClient
Provides an abstraction layer for consuming the Auth0 Clients endpoint.
- Source:
Type:
(inner) clientOptions :Object
Options object for the Rest Client instance.
- Source:
Type:
-
Object
Methods
create(data, cbopt) → {Promise|undefined}
Create an Auth0 client.
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
data |
Object
|
The client data object. |
|
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
management.clients.create(data, function (err) {
if (err) {
// Handle error.
}
// Client created.
});
delete(params, cbopt) → {Promise|undefined}
Delete an Auth0 client.
- Source:
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
params |
Object
|
Client parameters.
|
|||||||
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
management.clients.delete({ client_id: CLIENT_ID }, function (err) {
if (err) {
// Handle error.
}
// Client deleted.
});
get(params, cbopt) → {Promise|undefined}
Get an Auth0 client.
- Source:
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
params |
Object
|
Client parameters.
|
|||||||
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
management.clients.get({ client_id: CLIENT_ID }, function (err, client) {
if (err) {
// Handle error.
}
console.log(client);
});
getAll(cbopt) → {Promise|undefined}
Get all Auth0 clients.
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
management.clients.getAll(function (err, clients) {
console.log(clients.length);
});
update(params, data, cbopt) → {Promise|undefined}
Update an Auth0 client.
- Source:
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
params |
Object
|
Client parameters.
|
|||||||
data |
Object
|
Updated client data. |
|||||||
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
var data = { name: 'newClientName' };
var params = { client_id: CLIENT_ID };
management.clients.update(params, data, function (err, client) {
if (err) {
// Handle error.
}
console.log(client.name); // 'newClientName'
});