# Function

Static Public Summary
public | createContext(config: object): PVBidContext Creates a authorized context instance. |
public | getAuthToken(username: string, password: string, config: object): Promise<object> Obtains a user access token and refresh_token. |

## Static Public

### public createContext(config: object): PVBidContext source

    import {createContext} from 'pvbid-sdk/src/pvbid.js'

Creates a authorized context instance.

#### Params:

Name | Type | Attribute | Description
config | object |  |
config.token | string |  | The auth token to access account data..

config.base_uri

string

- optional
- default: https://api.pvbid.com/v2

#### Return:

PVBidContext

### public getAuthToken(username: string, password: string, config: object): Promise<object> source

    import {getAuthToken} from 'pvbid-sdk/src/pvbid.js'

Obtains a user access token and refresh_token.

#### Params:

Name | Type | Attribute | Description
username | string |  | The user's email address is used
password | string |  |
config | object |  |

config.base_uri

string

- optional
- default: https://api.pvbid.com/v2

#### Return:

Promise<object>

#### Return Properties:

Name | Type | Attribute | Description
token_type | string |  |
expires_in | number |  | Unix timestamp
access_token | string |  |
refresh_token | string |  |