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

Commit

Permalink
Merge pull request #585 from stormpath/documentation/twitter-directory
Browse files Browse the repository at this point in the history
Document creating social directory
  • Loading branch information
robertjd authored Feb 4, 2017
2 parents b9bbfc3 + 4ac007a commit a8a7eb6
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions lib/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,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 @@ -700,13 +705,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

0 comments on commit a8a7eb6

Please sign in to comment.