# @carto/ps-services

> CARTO's Professional Service Services library

Latest version **3.0.0** (published 2026-09-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install @carto/ps-services
pnpm add @carto/ps-services
yarn add @carto/ps-services
bun add @carto/ps-services
```

## Health

**Score 60/100 (C)** — status: active.

Positive: esm support; no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2026-09-22 |
| First published | 2022-03-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Dependencies | 1 |
| Unpacked size | 470.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | jmtorrescartodb, juanra-carto, cartodb, shylpx, jaragon, aaranadev, zbigg, josmorsot, vmilan, felixpalmer, moicalcob, aalmonacid, jmgaya, menusal |
| Keywords | carto, ps, apis |

## Links

- npm: https://www.npmjs.com/package/@carto/ps-services
- npm.io page: https://npm.io/package/@carto/ps-services

## Dependencies (1)

- [type-fest](https://npm.io/package/type-fest.md) 5.8.0

## Recent versions

- 3.0.0 (latest) — 2026-09-22
- 2.9.3 — 2026-09-17
- 2.9.1 — 2026-08-31
- 2.9.0 — 2026-08-04
- 2.8.1 — 2026-08-04
- 2.8.0 — 2026-07-15
- 2.7.5 — 2026-02-20
- 2.7.4 — 2026-02-16
- 2.7.3 — 2025-12-12
- 2.7.2 — 2025-12-12
- 2.7.0 — 2025-12-01
- 2.6.2 — 2025-10-27
- 2.6.1 — 2025-07-17
- 2.6.0 — 2025-07-16
- 2.5.3 — 2025-07-09
- … 69 more at https://npm.io/package/@carto/ps-services/versions

## README

# The CARTO PS Services Library

<a aria-label="NPM version" href="https://www.npmjs.com/package/@carto/ps-services">
  <img alt="" src="https://img.shields.io/npm/v/@carto/ps-services.svg?style=flat-square&labelColor=000000">
</a>
<a aria-label="License" href="https://github.com/CartoDB/carto-ps-lib/blob/canary/LICENSE.md">
  <img alt="" src="https://img.shields.io/npm/l/@carto/ps-services.svg?style=flat-square&labelColor=000000">
</a>
<a aria-label="CI status" href="https://github.com/carto/ps-apis/actions/workflows/pull-request.yml?query=event%3Apush+branch%3Amain">
  <img alt="" src="https://img.shields.io/github/actions/workflow/status/carto/ps-apis/pull-request.yml?event=push&branch=main&style=flat-square&labelColor=000000">
</a>

## Introduction

This package includes api functions for JavaScript and TypeScript.

The following APIs are available:

_To_develop_

## Consumption tracking — the `client` label

Every CARTO-calling runner requires a `client` built with `resolveTrackingClient({ project, env, status?, event? })`. The label is a positional `_`-delimited string, and its segments follow a fixed parsing contract:

```text
<project>_<env>_<test|live>_<event>
```

- `project` and `env` are sanitized to canonical **kebab-case** slugs (`[a-z0-9-]`).
- `status` is the literal `test` or `live`.
- `event` is sanitized to `[a-zA-Z0-9-]` **preserving letter case** (since 2.9.0): consumers may structure it as dash-separated sub-fields, encoding word boundaries inside each field with case (e.g. PascalCase: `MyOrg-Main-AssetsPerformance`) — and parse it back by splitting on `-`. The casing convention is the consuming project's to define; the library only guarantees case survives.
- `_` never survives inside a segment (it collapses to `-`), so `client.split('_')` always yields exactly the 4 fields above.
- CARTO enforces charset `[a-zA-Z0-9_-]` and max 100 chars (labels outside that are coerced to `other`); `resolveTrackingClient` warns — but does not truncate — so consumers trimming the event to fit should treat its last sub-field as best-effort when parsing.

See the [tracking docs](https://carto-ps-lib-docs.web.app/services/tracking/) for the full model and examples.

## Contributing

Please read our [contributing](https://github.com/carto/carto-ps-lib/blob/main/CONTRIBUTING.md)
guide before creating a pull request.

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