# App

Defines an App on Bkper.

Apps can be installed on Books by users.

## Extends

- `Resource`\<`bkper.App`\>

### Constructor

```ts
new App(payload?, config?): App;
```

#### Parameters

| Parameter | Type |
| :------ | :------ |
| `payload?` | `App` |
| `config?` | [`Config`](https://bkper.com/docs/api/bkper-js/interfaces/config.md) |

#### Returns

`App`

#### Overrides

```ts
Resource<bkper.App>.constructor
```

### payload

```ts
payload: App;
```

The underlying payload data for this resource

#### Inherited from

```ts
Resource.payload
```

### create()

```ts
create(): Promise;
```

Performs the app creation, applying pending changes.

The App id MUST be unique. If another app is already existing, an error will be thrown.

#### Returns

`Promise`\<`App`\>

This App after creation

***

### getDescription()

```ts
getDescription(): string | undefined;
```

Gets the description of this App.

#### Returns

`string` \| `undefined`

The description of this App

***

### getDevelopers()

```ts
getDevelopers(): string | undefined;
```

Gets the developers (usernames and domain patterns).

#### Returns

`string` \| `undefined`

The developers string

***

### getEvents()

```ts
getEvents(): EventType[] | undefined;
```

Gets the events bound to this App.

#### Returns

[`EventType`](https://bkper.com/docs/api/bkper-js/enumerations/eventtype.md)[] \| `undefined`

The events bound to this App

***

### getFilePatterns()

```ts
getFilePatterns(): string[] | undefined;
```

Gets the file patterns the App handles.

#### Returns

`string`[] \| `undefined`

The file patterns the App handles - E.g *.pdf *.csv

***

### getId()

```ts
getId(): string | undefined;
```

Gets the App universal identifier.

#### Returns

`string` \| `undefined`

The App universal identifier

***

### getLogoUrl()

```ts
getLogoUrl(): string | undefined;
```

Gets the logo url of this App.

#### Returns

`string` \| `undefined`

The logo url of this App

***

### getLogoUrlDark()

```ts
getLogoUrlDark(): string | undefined;
```

Gets the logo url of this App in dark mode.

#### Returns

`string` \| `undefined`

The logo url of this App in dark mode

***

### getMenuOpenMode()

```ts
getMenuOpenMode(): MenuOpenMode;
```

Gets how the app menu opens.

#### Returns

[`MenuOpenMode`](https://bkper.com/docs/api/bkper-js/enumerations/menuopenmode.md)

The configured app menu open mode, defaults to SIDEBAR

***

### ~~getMenuPopupHeight()~~

```ts
getMenuPopupHeight(): string | undefined;
```

Gets the menu popup height of this App.

> **Caution: Deprecated**
> Use getMenuOpenMode() to decide how the app should open.
#### Returns

`string` \| `undefined`

The menu popup height of this App

***

### ~~getMenuPopupWidth()~~

```ts
getMenuPopupWidth(): string | undefined;
```

Gets the menu popup width of this App.

> **Caution: Deprecated**
> Use getMenuOpenMode() to decide how the app should open.
#### Returns

`string` \| `undefined`

The menu popup width of this App

***

### getMenuText()

```ts
getMenuText(): string | undefined;
```

Gets the menu text of this App.

#### Returns

`string` \| `undefined`

The menu text of this App

***

### getMenuUrl()

```ts
getMenuUrl(): string | undefined;
```

Gets the menu url of this App.

#### Returns

`string` \| `undefined`

The menu url of this App

***

### getMenuUrlDev()

```ts
getMenuUrlDev(): string | undefined;
```

Gets the menu development url of this App.

#### Returns

`string` \| `undefined`

The menu development url of this App

***

### getName()

```ts
getName(): string | undefined;
```

Gets the name of this App.

#### Returns

`string` \| `undefined`

The name of this App

***

### getOwnerLogoUrl()

```ts
getOwnerLogoUrl(): string | undefined;
```

Gets the logo url of the owner of this App.

#### Returns

`string` \| `undefined`

The logo url of the owner of this App

***

### getOwnerName()

```ts
getOwnerName(): string | undefined;
```

Gets the name of the owner of this App.

#### Returns

`string` \| `undefined`

The name of the owner of this App

***

### getOwnerWebsiteUrl()

```ts
getOwnerWebsiteUrl(): string | undefined;
```

Gets the website url of the owner of this App.

#### Returns

`string` \| `undefined`

The website url of the owner of this App

***

### getReadme()

```ts
getReadme(): string | undefined;
```

Gets the readme.md file as text.

#### Returns

`string` \| `undefined`

The readme text

***

### getRepositoryUrl()

```ts
getRepositoryUrl(): string | undefined;
```

Gets the repository url of this App.

#### Returns

`string` \| `undefined`

The repository url of this App

***

### getUsers()

```ts
getUsers(): string | undefined;
```

Gets the whitelisted users (usernames and domain patterns).

#### Returns

`string` \| `undefined`

The users string

***

### getWebsiteUrl()

```ts
getWebsiteUrl(): string | undefined;
```

Gets the website url of this App.

#### Returns

`string` \| `undefined`

The website url of this App

***

### hasEvents()

```ts
hasEvents(): boolean;
```

Checks if this App has events bound to it.

#### Returns

`boolean`

True if this App has events bound to it

***

### isInstallable()

```ts
isInstallable(): boolean;
```

Tells if this App is installable.

#### Returns

`boolean`

True if this App is installable

***

### isPublished()

```ts
isPublished(): boolean;
```

Checks if this App is published.

#### Returns

`boolean`

True if this App is published

***

### isRepositoryPrivate()

```ts
isRepositoryPrivate(): boolean | undefined;
```

Tells if the repository is private.

#### Returns

`boolean` \| `undefined`

True if the repository is private

***

### json()

```ts
json(): App;
```

Gets an immutable copy of the JSON payload for this resource.

#### Returns

`App`

An immutable copy of the json payload

#### Inherited from

```ts
Resource.json
```

***

### setClientSecret()

```ts
setClientSecret(clientSecret?): App;
```

Sets the client secret.

#### Parameters

| Parameter | Type | Description |
| :------ | :------ | :------ |
| `clientSecret?` | `string` | The client secret to set |

#### Returns

`App`

This App for chaining

***

### setDevelopers()

```ts
setDevelopers(developers?): App;
```

Sets the developers (usernames and domain patterns).

#### Parameters

| Parameter | Type | Description |
| :------ | :------ | :------ |
| `developers?` | `string` | The developers (comma or space separated usernames and domain patterns like *@domain.com) |

#### Returns

`App`

This App for chaining

***

### setMenuOpenMode()

```ts
setMenuOpenMode(menuOpenMode?): App;
```

Sets how the app menu opens.

#### Parameters

| Parameter | Type | Description |
| :------ | :------ | :------ |
| `menuOpenMode?` | [`MenuOpenMode`](https://bkper.com/docs/api/bkper-js/enumerations/menuopenmode.md) | The app menu open mode to set |

#### Returns

`App`

This App, for chaining

***

### setReadme()

```ts
setReadme(readme?): App;
```

Sets the readme.md file as text.

#### Parameters

| Parameter | Type | Description |
| :------ | :------ | :------ |
| `readme?` | `string` | The readme text to set |

#### Returns

`App`

This App, for chaining

***

### setUsers()

```ts
setUsers(users?): App;
```

Sets the whitelisted users (usernames and domain patterns).

#### Parameters

| Parameter | Type | Description |
| :------ | :------ | :------ |
| `users?` | `string` | The users to whitelist (comma or space separated usernames and domain patterns like *@domain.com) |

#### Returns

`App`

This App for chaining

***

### setWebhookUrlDev()

```ts
setWebhookUrlDev(webhookUrlDev): App;
```

Sets the webhook url for development.

#### Parameters

| Parameter | Type | Description |
| :------ | :------ | :------ |
| `webhookUrlDev` | `string` | The webhook URL for development |

#### Returns

`App`

This App, for chaining

***

### update()

```ts
update(): Promise;
```

Performs a full update of the App, applying pending changes.

#### Returns

`Promise`\<`App`\>

This App after the update
