<commit_before>#Getting started

## Sandbox

We have a Sandbox environment to play with!

Just use [sandbox.gonebusy.com](http://sandbox.gonebusy.com) instead of where you see beta.gonebusy.com referenced, including where to create an account to retrieve your API Key.

The Sandbox environment is completely separate from the Live site - that includes meaning your Sandbox API Key will not work in the Live environment.

## Installation

The SDK relies on [Node Package Manager](https://www.npmjs.com/) (NPM) being available to resolve dependencies.
Once published you will need copy the folder `gonebusy` in to your `node_modules` folder.

## Usage

The following shows how import and use the controller:

1. Import the module:

    ```js
    var gonebusy = require('gonebusy');
    ```

2. Configure any authentication parameters. For example:

    ```js
    var config = gonebusy.configuration;
    config.authorization = "Token <your API key>";
    ```

3. Access various controllers by:

    ```js
    var controller = gonebusy.XYZ;
    controller.getItems(id, callback);
    ```<commit_msg>Updating README for usage with Bluebird promises<commit_after>#Getting started

## Sandbox

We have a Sandbox environment to play with!

Just use [sandbox.gonebusy.com](http://sandbox.gonebusy.com) instead of where you see beta.gonebusy.com referenced, including where to create an account to retrieve your API Key.

The Sandbox environment is completely separate from the Live site - that includes meaning your Sandbox API Key will not work in the Live environment.

## Sample Client Usage

The following shows how to import the library and use it with Bluebird Promises:

1. Configure your package.json:

    ```js
    {
        "dependencies": {
            "gonebusy-nodejs-client": "^0.0.2",
            "bluebird": "^3.3.5"
        }
    }
    ```

1. ```npm install```

1. Import the module:

    ```js
    > gonebusy = require('gonebusy-nodejs-client')
    ```

1. Configure the BASEURI for Sandbox testing

    ```js
    > gonebusy.configuration.BASEURI = 'http://sandbox.gonebusy.com/api/v1'
    ```
    
1. Configure your API Key:

    ```js
    > gonebusy.configuration.authorization = 'Token <PASSWORD>' // Default Sandbox token
    ```

1. Require Bluebird:

    ```js
    > Promise = require('bluebird').Promise
    ```
    
1. Promisify all ServicesController methods:

    ```js
    > services = Promise.promisifyAll(gonebusy.ServicesController)
    ```

1. Get a list of Services for the current user:

    ```js
    > services.getServicesAsync(gonebusy.configuration).then((result)=>{console.log(result);})
    Promise {
      _bitField: 0,
      _fulfillmentHandler0: undefined,
      _rejectionHandler0: undefined,
      _promise0: undefined,
      _receiver0: undefined }
    > BaseModel {
      services: 
       [ BaseModel {
           categories: [],
           description: 'A Service for Samples',
           duration: 30,
           id: 197264885,
           isActive: true,
           name: 'Sample Service',
           ownerId: 8552697701,
           priceModelId: 2,
           resources: [Object],
           shortName: null } ] }
   ```
   
{'fraction_non_alphanumeric': 0.10094637223974763, 'fraction_numerical': 0.014195583596214511, 'mean_word_length': 2.9051724137931036, 'pattern_counts': {'":': 3, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '156700', 'n_tokens_mistral': 962, 'n_tokens_neox': 897, 'n_words': 313}