> For the complete documentation index, see [llms.txt](https://skyslit.gitbook.io/magicjs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://skyslit.gitbook.io/magicjs/api-references/frontend/loadconfig.md).

# loadConfig()&#x20;

> Example:

```typescript
import { createBackendFunction, data, loadConfig } from "@magicjs.dev/backend";
import configJson from './config.json';

const config = loadConfig(configJson);

export default createBackendFunction(async function (keyword) {
  try {
    const itemCollection = data(config.getValue('mongoDbCollectionName'));
    const items = await itemCollection.find({}).toArray();
    return items;
  } catch (error) {}
})
```

And the `config.json` file:

```typescript
{
  "properties": [
    {
      "name": "mongoDbCollectionName",
      "value": "items"
    },
    {
      "name": "label",
      "value": "All Products"
    }
  ],
  "label": "Item",
  "aliases": []
}
```

[Click here to refer GitHub.](https://github.com/skyslit/magicjs.dev/blob/main/packages/frontend/src/index.tsx#L630)
