Constructor
new ConnectionsManager(options)
Parameters:
Name |
Type |
Description |
options |
Object
|
The client options.
Properties
Name |
Type |
Attributes |
Description |
baseUrl |
String
|
|
The URL of the API. |
headers |
Object
|
<optional>
|
Headers to be included in all requests. |
|
- Source:
Members
Type:
- Source:
(inner) apiOptions :Object
Options object for the Rest Client instance.
Type:
- Source:
Methods
create(data, cbopt) → {Promise|undefined}
Create a new connection.
Parameters:
Name |
Type |
Attributes |
Description |
data |
Object
|
|
Connection data object. |
cb |
function
|
<optional>
|
Callback function. |
- Source:
Returns:
-
Type
-
Promise
|
undefined
Example
management.connections.create(data, function (err) {
if (err) {
// Handle error.
}
// Conection created.
});
delete(params, cbopt) → {Promise|undefined}
Delete an existing connection.
Parameters:
Name |
Type |
Attributes |
Description |
params |
Object
|
|
Connection parameters.
Properties
Name |
Type |
Description |
id |
String
|
Connection ID. |
|
cb |
function
|
<optional>
|
Callback function. |
- Source:
Returns:
-
Type
-
Promise
|
undefined
Example
management.connections.delete({ id: CONNECTION_ID }, function (err) {
if (err) {
// Handle error.
}
// Conection deleted.
});
get(params, cbopt) → {Promise|undefined}
Get an Auth0 connection.
Parameters:
Name |
Type |
Attributes |
Description |
params |
Object
|
|
Connection parameters.
Properties
Name |
Type |
Description |
id |
String
|
Connection ID. |
|
cb |
function
|
<optional>
|
Callback function. |
- Source:
Returns:
-
Type
-
Promise
|
undefined
Example
management.connections.get({ id: CONNECTION_ID }, function (err, connection) {
if (err) {
// Handle error.
}
console.log(connection);
});
getAll(cbopt) → {Promise|undefined}
Get all connections.
Parameters:
Name |
Type |
Attributes |
Description |
cb |
function
|
<optional>
|
Callback function. |
- Source:
Returns:
-
Type
-
Promise
|
undefined
Example
management.connections.getAll(function (err, connections) {
console.log(connections.length);
});
update(params, data, cbopt) → {Promise|undefined}
Update an existing connection.
Parameters:
Name |
Type |
Attributes |
Description |
params |
Object
|
|
Conneciton parameters.
Properties
Name |
Type |
Description |
id |
String
|
Connection ID. |
|
data |
Object
|
|
Updated connection data. |
cb |
function
|
<optional>
|
Callback function. |
- Source:
Returns:
-
Type
-
Promise
|
undefined
Example
var data = { name: 'newConnectionName' };
var params = { id: CONNECTION_ID };
management.connections.update(params, data, function (err, connection) {
if (err) {
// Handle error.
}
console.log(connection.name); // 'newConnectionName'
});