Methods

auth

(source code)
auth(credentialOptions)
Permits to use credentials when doing requests (for Node module only)

Parameters:

Object
credentialOptions

Returns:

Object
the current SharepointPlus object

Example:

var user1 = {username:'aymeric', password:'sharepointplus', domain:'kodono'};
    $SP().auth(user1)
         .list("My List","http://my.sharpoi.nt/other.directory/")
        .get({...});
    // or :
    var sp = $SP().auth(user1);
    sp.list("My List", "https://web.si.te").get({...});
    sp.list("Other List"; "http://my.sharpoi.nt/other.directory/").update(...);

    // if you use the AddIn method, it may not work – in that case, you'll need to use the FedAuth method as described there: https://github.com/Aymkdn/SharepointPlus/wiki/Using-the-FedAuth-Cookie#javascript-code
    // let's say we want to use our own function to set the FedAuth cookie
    var sp = $SP().auth({method:'cookie', function() {
      // we need to return the content of our cookie
      // e.g. if it's a FedAuth we'll return 'FedAuth=YAHeZNEZdfnZEfzfzeKnfze…';
      return myFunctionToGetFedAuth();
    });

proxy

(source code)
proxy(proxyURL)
Permits to define a proxy server (for Node module only)

Parameters:

Returns:

Object
the current SharepointPlus object

Example:

var user1 = {username:'aymeric', password:'sharepointplus', domain:'kodono'};
    var proxy = "http://" + user1.domain + "%5C" + user1.username + ":" + user1.password + "@proxy:80";
    $SP().proxy(proxy).auth(user1)
         .list("My List","http://my.sharpoi.nt/other.directory/")
        .get({...});
    // or :
    var sp = $SP().proxy(proxy).auth(user1);
    sp.list("My List", "https://web.si.te").get({...});
    sp.list("Other List"; "http://my.sharpoi.nt/other.directory/").update(...);