# @chayns/uac-service

> With this package Uac groups can be requested and edited. The package works in the frontend as well as in the node backend. In the background, the package uses protobuf for communication with the uac-service.

Latest version **0.0.62** (published 2025-11-14) · 0 weekly downloads

## Install

```sh
npm install @chayns/uac-service
pnpm add @chayns/uac-service
yarn add @chayns/uac-service
bun add @chayns/uac-service
```

## Health

**Score 55/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.0.62 |
| Published | 2025-11-14 |
| First published | 2023-06-21 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 4 |
| Unpacked size | 744.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | tobit.software, braun-michael, jonasgossens, leodr |
| Keywords | chayns, chayns-toolkit, react |

## Links

- npm: https://www.npmjs.com/package/@chayns/uac-service
- npm.io page: https://npm.io/package/@chayns/uac-service

## Dependencies (4)

- [long](https://npm.io/package/long.md) ^5.3.1
- [protobufjs](https://npm.io/package/protobufjs.md) ^7.4.0
- [protobufjs-cli](https://npm.io/package/protobufjs-cli.md) ^1.1.3
- [google-protobuf](https://npm.io/package/google-protobuf.md) ^3.21.4

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.0.62 (latest) — 2025-11-14
- 0.0.61 — 2025-08-06
- 0.0.60 — 2025-08-05
- 0.0.59 — 2025-08-05
- 0.0.58 — 2025-03-25
- 0.0.57 — 2025-03-25
- 0.0.56 — 2025-02-17
- 0.0.55 — 2025-02-04
- 0.0.54 — 2025-02-04
- 0.0.53 — 2025-01-13
- 0.0.52 — 2025-01-13
- 0.0.51 — 2024-12-17
- 0.0.50 — 2024-09-03
- 0.0.49 — 2024-09-02
- 0.0.48 — 2024-07-22
- … 8 more at https://npm.io/package/@chayns/uac-service/versions

## README

## @chayns/uac-service

With this package Uac groups can be requested and edited. The package works in the frontend as well as in the node backend. In the background, the package uses protobuf for communication with the uac-service.

### Installation in frontend projects

1. Install package ```npm install @chayns/uac-service```
2. Create instance of UacServiceClient (could be in separate js/ts file in your project)
```js
import { getAccessToken, getLanguage, getSite, getUser } from 'chayns-api';
export const client = new UacServiceClient({
    getToken: async () => ((await getAccessToken()).accessToken || ""),
    getDefaultSiteId: () => getSite().id,
    logger: logger, // your chayns logger instance
    getDefaultPersonId: () => getUser()?.personId || "",
    getLanguage: () => getLanguage().active
});
```

### Installation in node projects

1. Install package ```npm install @chayns/uac-service```
2. Create instance of UacServiceClient (could be in separate js/ts file in your project)
```js
export const client = new UacServiceClient({
    getApiToken: async () => accessToken,
    logger: logger, // your chayns logger instance
});
```

### Usage in front and backend projects

These are just a few examples, there are many more functions. 

#### Create UserGroup
```js
const { id } = await client.createUserGroup({ showName: 'test name', users:['GER-TDNKN'], description: 'Beschreibung'});
```

#### Get all usergroups from site
```js
const result = await client.getUserGroups({ countUsers: true });
```

#### Get all users in group 
```js
const members = await client.getGroupMembers({ groupId: 1 });
```

#### Add user to group
```js
await client.addUsersToGroup({ groupId: 1, members: [{personId: 'F69-1LT41'}] })
```

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