hubkit
Advanced tools
Comparing version 2.0.4 to 2.1.0
@@ -552,9 +552,8 @@ if (typeof require !== 'undefined') { | ||
} else if (options.username && options.password) { | ||
throw new Error('Username / password authentication is no longer supported'); | ||
} else if (options.clientId && options.clientSecret) { | ||
config.auth = { | ||
username: options.username, | ||
password: options.password | ||
username: options.clientId, | ||
password: options.clientSecret | ||
}; | ||
} else if (options.clientId && options.clientSecret) { | ||
config.params['client_id'] = options.clientId; | ||
config.params['client_secret'] = options.clientSecret; | ||
} | ||
@@ -561,0 +560,0 @@ if (options.userAgent) config.headers['User-Agent'] = options.userAgent; |
{ | ||
"name": "hubkit", | ||
"version": "2.0.4", | ||
"version": "2.1.0", | ||
"description": "GitHub API library for JavaScript, promise-based, for both NodeJS and the browser", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -65,4 +65,4 @@ hubkit | ||
There are two ways to authenticate: either pass a `token` to the options, or both a `username` and | ||
`password`. Unauthenticated requests are fine too, of course. | ||
There are two ways to authenticate: either pass a `token` to the options, or both a `clientId` and | ||
`clientSecret`. Unauthenticated requests are fine too, of course. | ||
@@ -96,3 +96,2 @@ Every call returns a `Promise`, which you might need to polyfill if your target environment doesn't | ||
* `token`: String token to use for authentication; takes precedence over other auth methods. | ||
* `username` and `password`: For basic authentication; takes precedence over app-based authentication. | ||
* `clientId` and `clientSecret`: For app-based anonymous authentication (increased API quotas without impersonating a user). | ||
@@ -99,0 +98,0 @@ * `userAgent`: The user-agent to present in requests. Uses the browser's user agent, or `Hubkit` |
42023
743
135