diff --git a/README.md b/README.md index 9a499d7..ec602db 100644 --- a/README.md +++ b/README.md @@ -54,10 +54,15 @@ To re-create an access token instance and make requests on behalf on the user, y // Can also just pass the raw `data` object in place of an argument. var token = githubAuth.createToken('access token', 'optional refresh token', 'optional token type', { data: 'raw user data' }) -// Refresh the users credentials and save the updated access token. +// Set the token TTL. +token.expiresIn(1234) // Seconds. +token.expiresIn(new Date('2016-11-08')) // Date. + +// Refresh the users credentials and save the new access token and info. token.refresh().then(storeNewToken) -// Sign a standard HTTP request object, updating URL with token or authorization headers. +// Sign a standard HTTP request object, updating the URL with the access token +// or adding authorization headers, depending on token type. token.sign({ method: 'get', url: 'https://api.github.com/users'