Skip to content

Commit

Permalink
allow manually setting an access token
Browse files Browse the repository at this point in the history
  • Loading branch information
Crecket committed Feb 21, 2017
1 parent 916fd6e commit 7933726
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions lib/imgur.js
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,25 @@ imgur.getAPIUrl = function() {
return IMGUR_API_URL;
}


/**
* Set Imgur Access Token
* @param {string} URL - URL to make the API calls to imgur
*/
imgur.setAccessToken = function(ACCESS_TOKEN) {
if(ACCESS_TOKEN && typeof ACCESS_TOKEN === 'string') {
IMGUR_ACCESS_TOKEN = ACCESS_TOKEN;
}
}

/**
* Get Imgur API Url
* @returns {string} API Url
*/
imgur.getAccessToken = function() {
return IMGUR_ACCESS_TOKEN;
}

/**
* Set Mashape Key
* @link https://market.mashape.com/imgur/imgur-9
Expand Down

0 comments on commit 7933726

Please sign in to comment.