# emporix-js

> SDK package for Emporix api service ## Features

Latest version **2.0.3** (published 2025-09-18) · 0 weekly downloads

## Install

```sh
npm install emporix-js
pnpm add emporix-js
yarn add emporix-js
bun add emporix-js
```

## Health

**Score 40/100 (D)** — status: maintenance-mode.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.3 |
| Published | 2025-09-18 |
| First published | 2022-06-27 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 263.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | m.buj |

## Links

- npm: https://www.npmjs.com/package/emporix-js
- Repository: https://github.com/emporix/emporix-js
- Homepage: https://github.com/emporix/emporix-js#readme
- Issues: https://github.com/emporix/emporix-js/issues
- npm.io page: https://npm.io/package/emporix-js

## Dependencies (2)

- [axios](https://npm.io/package/axios.md) ^1.12.2
- [jwt-decode](https://npm.io/package/jwt-decode.md) ^3.1.2

## Recent versions

- 2.0.3 (latest) — 2025-09-18
- 2.0.2 — 2022-07-29
- 2.0.1 — 2022-07-28
- 2.0.0 — 2022-07-28
- 1.0.0 — 2022-06-27
- 0.0.1 — 2022-06-27

## README

# Emporix-js

SDK package for Emporix api service
## Features

- methods for authenticating user
- methods for using Emporix services

## Usage

Create `Config` instance:

```
import { IClientConfig } from 'emporix-js'

const config: IClientConfig = {
  env: 'stage',
  token: <JWTToken>,
}
```


In web brawser in most cases `LocalStorageStore` is the best option
```
import { LocalStorageStore } from 'emporix-js'

const storage = LocalStorageStore()
```

You can also create a custom `Store` instance:

```

const store: = {
    saveConfig: (c: IClientConfig) => {
      // save config
    },
    getConfig: () => {
      // get config
    },
  }
```

Init `EmporixClient`:

```
import { EmporixClient } from 'emporix-js'

const emporixClient = EmporixClient(config, store)

```

Example usage:

```
await emporixClient.categoryService
    .fetchCategory(categoryId)
```

## Building and publishing

Build:
```
yarn build
```

Publish new version in npm (update version in package.js first)

```
npm publish
```

## Running examples

### Running example static stite

Open `example.js`
Add an example token to `TOKEN`
```
const TOKEN = '<yourJWTtoken>'
```

In root folder
```
yarn link
cd example
yarn link example-js
python3 -m http.server
```
### Running example node app

Open `index.ts`
Add an example token to `TOKEN`
```
const TOKEN = '<yourJWTtoken>'
```

Because the `emporix-js` uses Axsios under the hood it (which uses XHRequest) you might need to add XHRequest support

```
yarn add xhr2
global.XMLHttpRequest = require('xhr2')

```

In root folder
```
yarn link
cd example-node
yarn link example-js
yarn
yarn dev
```

---
_Source: https://npm.io/package/emporix-js · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
