# BkperApp

## Extends

- `BkperApp`

### AccountType

```ts
AccountType: typeof AccountType;
```

#### Inherited from

```ts
Bkper.BkperApp.AccountType
```

***

### BalanceType

```ts
BalanceType: typeof BalanceType;
```

#### Inherited from

```ts
Bkper.BkperApp.BalanceType
```

***

### BotResponseType

```ts
BotResponseType: typeof BotResponseType;
```

#### Inherited from

```ts
Bkper.BkperApp.BotResponseType
```

***

### DecimalSeparator

```ts
DecimalSeparator: typeof DecimalSeparator;
```

#### Inherited from

```ts
Bkper.BkperApp.DecimalSeparator
```

***

### Month

```ts
Month: typeof Month;
```

#### Inherited from

```ts
Bkper.BkperApp.Month
```

***

### Periodicity

```ts
Periodicity: typeof Periodicity;
```

#### Inherited from

```ts
Bkper.BkperApp.Periodicity
```

***

### Permission

```ts
Permission: typeof Permission;
```

#### Inherited from

```ts
Bkper.BkperApp.Permission
```

***

### TransactionStatus

```ts
TransactionStatus: typeof TransactionStatus;
```

#### Inherited from

```ts
Bkper.BkperApp.TransactionStatus
```

### getBook()

```ts
getBook(id): Book;
```

Gets the [[Book]] with the specified bookId from url param.

This is the main Entry Point to start interacting with the [bkper-gs](https://github.com/bkper/bkper-gs) library.

Example:

```js
var book = BkperApp.getBook("agtzfmJrcGVyLWhyZHITCxIGTGVkZ2VyGICAgIDggqALDA");
book.record("#fuel for my Land Rover 126.50 28/01/2013");
```

#### Parameters

| Parameter | Type |
| :------ | :------ |
| `id` | `string` |

#### Returns

`Book`

#### Inherited from

```ts
Bkper.BkperApp.getBook
```

***

### getBooks()

```ts
getBooks(): Book[];
```

Gets all [[Books]] the user has access.

#### Returns

`Book`[]

#### Inherited from

```ts
Bkper.BkperApp.getBooks
```

***

### newAmount()

```ts
newAmount(n): Amount;
```

Create a new [[Amount]] wrapping a given number, or arbitrary-precision math calculations.

#### Parameters

| Parameter | Type |
| :------ | :------ |
| `n` | `string` \| `number` \| `Amount` |

#### Returns

`Amount`

#### Inherited from

```ts
Bkper.BkperApp.newAmount
```

***

### normalizeName()

```ts
normalizeName(name): string;
```

Normalize a name

#### Parameters

| Parameter | Type |
| :------ | :------ |
| `name` | `string` |

#### Returns

`string`

#### Inherited from

```ts
Bkper.BkperApp.normalizeName
```

***

### setAgentId()

```ts
setAgentId(agentId): void;
```

Sets the agent ID to identify the calling agent for attribution purposes.

This ID is sent via the `bkper-agent-id` header with each API request,
allowing the server to attribute actions to the correct agent.

#### Parameters

| Parameter | Type |
| :------ | :------ |
| `agentId` | `string` \| `null` |

#### Returns

`void`

#### Inherited from

```ts
Bkper.BkperApp.setAgentId
```

***

### setApiKey()

```ts
setApiKey(key): void;
```

Sets the API key for dedicated quota limits.

API keys are optional - if not set, the Bkper API proxy provides a managed key with shared quota.
Use your own API key for dedicated quota limits and project-level usage tracking.

API keys are for project identification only, not for authentication or agent attribution.
Agent attribution is handled separately via `setAgentId()`.

#### Parameters

| Parameter | Type |
| :------ | :------ |
| `key` | `string` \| `null` |

#### Returns

`void`

#### Inherited from

```ts
Bkper.BkperApp.setApiKey
```

***

### setOAuthTokenProvider()

```ts
setOAuthTokenProvider(tokenProvider): void;
```

Sets the [[OAuthTokenProvider]].

If none set, the default built-in [ScriptApp](https://developers.google.com/apps-script/reference/script/script-app#getoauthtoken) will be used.

#### Parameters

| Parameter | Type |
| :------ | :------ |
| `tokenProvider` | `OAuthTokenProvider` |

#### Returns

`void`

#### Inherited from

```ts
Bkper.BkperApp.setOAuthTokenProvider
```
