> ## Documentation Index
> Fetch the complete documentation index at: https://docs.configu.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Integrations Library

> Configu SDK for Node.js published to [npm](https://www.npmjs.com/package/@configu/node).

## Install

```bash theme={null}
npm install @configu/node
yarn add @configu/node
pnpm add @configu/node
```

## Usage

**With import / require:**

```js theme={null}
import { JsonFileConfigStore, ConfigSet, ConfigSchema, UpsertCommand, EvalCommand, ExportCommand } from '@configu/node';
import schemaContents from './start.cfgu.json';

(async () => {
  try {
    const store = new JsonFileConfigStore({ path: 'config-db.json' });
    const set = new ConfigSet('test');
    const schema = new ConfigSchema('start', schemaContents);

    await new UpsertCommand({
      store,
      set,
      schema,
      configs: {
        GREETING: 'hey',
        SUBJECT: 'configu node.js sdk',
      },
    }).run();

    const data = await new EvalCommand({
      store,
      set,
      schema,
    }).run();

    const configurationData = await new ExportCommand({
      pipe: data,
    }).run();
  } catch (error) {
    console.error(error);
  }
})();
```

**With fs & path**:

```js theme={null}
import path from 'path';
import fs from 'fs/promises';
import {
  JsonFileConfigStore,
  ConfigSet,
  ConfigSchema,
  UpsertCommand,
  EvalCommand,
  ExportCommand,
} from '@configu/node';

(async () => {
  try {
    const store = new JsonFileConfigStore({ path: 'config-db.json' });
    const set = new ConfigSet('test');

    const schemaContentsString = await fs.readFile(path.join(__dirname, 'start.cfgu.json'));
    const schemaContents = JSON.parse(schemaContentsString);
    const schema = new ConfigSchema('start', schemaContents);

    ...
  } catch (error) {
    console.error(error);
  }
})();
```

## Reference

See [interfaces/sdk/node/globals](/interfaces/sdk/node/globals).

## Contributing

### Requirements

Follow the [Development](https://github.com/configu/configu/blob/main/CONTRIBUTING.md#development) section from the `CONTRIBUTING.md`.

### Setup

Run these commands in order:

```bash theme={null}
pnpm install
```

### Contribute

Follow the [Sending a Pull Request](https://github.com/configu/configu/blob/main/CONTRIBUTING.md#sending-a-pull-request) section from the `CONTRIBUTING.md`.
