---
title: Javascript
slug: wip/cFTJ-javascript
createdAt: 2023-07-26T11:03:12.835Z
---

# JavaScript

## The Config object

Cosmos Web exposes a configuration object with a set of properties, that enables customization of some aspects of the Cosmos Web library.

## Properties

| **Property**        | **Type**         | **Default&#x20;** | **Description**                                                  |
| ------------------- | ---------------- | ----------------- | ---------------------------------------------------------------- |
| `disableWarnings`   | *boolean &#x20;* | false             | Disable console warnings from Cosmos, like deprecation warnings. |



## How to use

### In a bundle

If you use a bundler, like webpack and rollup, you can directly import the config module, and set the desired value:

:::CodeblockTabs
index.js

```typescript
import { config as cosmosConfig } from '@cosmos/web';

cosmosConfig.disableWarnings = true;
```
:::

### In the global window

The cosmos config is also available from the global window object, under `cosmosConfig`. Because it is not possible to determine if the config has already been instantiated, you need to test for it first and assign an empty object to it if it is not the case:

:::CodeblockTabs
index.js

```typescript
window.cosmosConfig = window.cosmosConfig || {};

window.cosmosConfig.disableWarnings = true;
```
:::

