diff --git a/lib/imgur.js b/lib/imgur.js index 1d6423bb..1672422c 100644 --- a/lib/imgur.js +++ b/lib/imgur.js @@ -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