Skip to content
This repository has been archived by the owner on Dec 12, 2018. It is now read-only.

Document creating social directory #585

Merged
merged 2 commits into from
Feb 4, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions lib/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,11 @@ Client.prototype.getDirectories = function() {
* creating a directory, you will likely want to map it to an {@link Application} using
* {@link Application#createAccountStoreMapping Application.createAccountStoreMapping()}.
*
* Directories can be linked to social providers - such as Facebook, Google, Twitter, or
* even any other generic OAuth 2.0 provider - by specifing a valid provider containing
* the valid `providerId` and client credentials when creating or modifying the directory.
* See {@link Provider}.
*
* @param {Object} directory
* The {@link Directory} resource to create.
*
Expand All @@ -692,13 +697,28 @@ Client.prototype.getDirectories = function() {
* Callback function, will be called with (err, {@link Directory}).
*
* @example
* // Creating a simple directory
* var newDirectory = {
* name: 'Customers'
* }
*
* client.createDirectory(newDirectory, function (err, directory) {
* console.log(directory);
* });
*
* // Creating a social provider directory (e.g. Twitter)
* var twitterDirectory = {
* name: 'Twitter Users',
* provider: {
* providerId: 'twitter',
* clientId: 'my-twitter-client-id',
* clientSecret: 'my-twitter-client-secret'
* }
* };
*
* client.createDirectory(twitterDirectory, function (err, directory) {
* console.log(directory);
* });
*/
Client.prototype.createDirectory = function() {
var args = utils.resolveArgs(arguments, ['dir', 'options', 'callback']);
Expand Down