    import PVBidContext from 'pvbid-sdk/src/PVBidContext.js'

public class | source

# PVBidContext

## Constructor Summary

Public Constructor
public | constructor(config: object) Creates an instance of PVBidContext. |

## Member Summary

Public Members
public | repositories(projects: ProjectRepository, bids: BidRepository, projectStatuses: ProjectStatusRepository, snapshots: SnapshotRepository, assemblies: AssemblyRepository, tags: TagRepository, users: UserRepository, lineItems: LineItemRepository, metrics: MetricRepository, fields: FieldRepository): object A property that provides quick access to initialized repositories. |
public | user: User The current authorized user. |

## Method Summary

Public Methods
public | async getProject(projectId: number, forceReload: boolean): Promise<Project> Gets an initiated Project instance witn included bids. |
public | async loadAuthorizedUser(): Promise<User> Loads the authorized user for this context. |

## Public Constructors

### public constructor(config: object) source

Creates an instance of PVBidContext.

#### 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

## Public Members

### public repositories(projects: ProjectRepository, bids: BidRepository, projectStatuses: ProjectStatusRepository, snapshots: SnapshotRepository, assemblies: AssemblyRepository, tags: TagRepository, users: UserRepository, lineItems: LineItemRepository, metrics: MetricRepository, fields: FieldRepository): object source

A property that provides quick access to initialized repositories.

### public user: User source

The current authorized user.
PVBidContext.loadAuthorizedUser must get called first.

## Public Methods

### public async getProject(projectId: number, forceReload: boolean): Promise<Project> source

Gets an initiated Project instance witn included bids.

#### Params:

Name | Type | Attribute | Description
projectId | number |  | The project id in which to retrieve.
forceReload | boolean |  | Flags system to skip cache.

#### Return:

Promise<Project>

### public async loadAuthorizedUser(): Promise<User> source

Loads the authorized user for this context. Calling PVBidContext.getProject auto loads the authorized user.

#### Return:

Promise<User>