# Resources schema

The schema that defines the resources that your app needs. Most of the time these things include dynamic values that
your app needs which will be provided by some external api. Resources can be Dynamic or hard coded. In the example
below, we are taking group and channel by calling some api. These values will be stored and accessed
from `resources.group` and `resources.channel`.

```typescript
interface ResourceTypes {
    [key: string]: ResourceTypeSchema
}
```

## Properties ResourceTypeSchema

| Property | Description | Value Type |
|  --- | --- | --- |
| id | Identifier of the resource | [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) |
| perform | The perform function that returns the value of resource in array | [array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) |


## Example

```javascript
module.exports = {
    group: {
        id: "group",
        perform: async (sdk, bundle) => {
            const response = await sdk.request({
                method: "GET",
                url: `https://${bundle.authData.host}/v2/groups`,
            });
            return response.data.groups;
        },
    },
    channel: {
        id: "channel",
        perform: async (sdk, bundle) => {
            const response = await sdk.request({
                method: "GET",
                url: `https://${bundle.authData.host}/v2/channels`,
            });
            return response.data.channels;
        },
    },
    userType: {
        id: 'userType',
        perform: (sdk, bundle) => {
            return [
                'User',
                'Bot'
            ]
        }
    }
};
```

```javascript
const resources = require("./src/resources");

module.exports = {
    ...,
    resources: resources,
};
```