Skip to content

Commit

Permalink
feat(mode): change development flag to testMode flag
Browse files Browse the repository at this point in the history
  • Loading branch information
Karthik Bhaskara authored Sep 12, 2018
1 parent f4caad3 commit 44cfcea
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const client = new smartcar.AuthClient({
clientSecret: 'SMARTCAR_CLIENT_SECRET',
redirectUri: 'YOUR_CALLBACK_URI',
scope: ['read_vehicle_info'],
development: true, // include "mock" Smartcar brand in make selector for testing
testMode: true, // launch the Smartcar auth flow in test mode
});

// Redirect to Smartcar's authentication flow
Expand Down
20 changes: 19 additions & 1 deletion doc/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ Smartcar Node SDK documentation.
<dd></dd>
</dl>

## Functions

<dl>
<dt><a href="#parseAge">parseAge(response)</a> ⇒ <code>Date</code> | <code>null</code></dt>
<dd></dd>
</dl>

## Typedefs

<dl>
Expand Down Expand Up @@ -310,7 +317,8 @@ Create a Smartcar OAuth client for your application.
| options.clientSecret | <code>String</code> | | The application's client secret. |
| options.redirectUri | <code>String</code> | | Redirect URI registered in the [application settings](https://developer.smartcar.com/apps). The given URL must exactly match one of the registered URLs. |
| [options.scope] | <code>Array.&lt;String&gt;</code> | <code>all</code> | List of permissions your application requires. This will default to requiring all scopes. The valid permission names are found in the [API Reference](https://smartcar.com/docs#get-all-vehicles). |
| [options.development] | <code>Boolean</code> | <code>false</code> | Launch Smartcar auth in development mode to enable the mock vehicle brand. |
| [options.testMode] | <code>Boolean</code> | <code>false</code> | Launch the Smartcar auth flow in test mode. [API Reference](https://smartcar.com/docs#request-authorization). |
| [options.development] | <code>Boolean</code> | <code>false</code> | DEPRECATED: Launch Smartcar auth in development mode to enable mock vehicle brands. |

<a name="AuthClient+getAuthUrl"></a>

Expand Down Expand Up @@ -469,6 +477,16 @@ POST Vehicle.unlock

**Kind**: instance method of [<code>Vehicle</code>](#Vehicle)
**Returns**: [<code>Promise</code>](#Promise) - A success or failure response.
<a name="parseAge"></a>

## parseAge(response) ⇒ <code>Date</code> \| <code>null</code>
**Kind**: global function
**Returns**: <code>Date</code> \| <code>null</code> - A parsed age or null if no age exists

| Param | Type |
| --- | --- |
| response | <code>Object</code> |

<a name="Access"></a>

## Access : <code>Object</code>
Expand Down
4 changes: 2 additions & 2 deletions lib/auth-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ const config = require('./config');
* requires. This will default to requiring all scopes. The valid permission
* names are found in the
* [API Reference](https://smartcar.com/docs#get-all-vehicles).
* @param {Boolean} [options.testMode=false] - Launch Smartcar auth flow in
* @param {Boolean} [options.testMode=false] - Launch the Smartcar auth flow in
* test mode.
* [API Reference](https://smartcar.com/docs#request-authorization).
* @param {Boolean} [options.development=false] - DEPRECATED: Launch Smartcar auth in
* development mode to enable the mock vehicle brand.
* development mode to enable mock vehicle brands.
*/
function AuthClient(options) {

Expand Down

0 comments on commit 44cfcea

Please sign in to comment.