# @product-live/api-sdk

> SDK for Product-Live public API

Latest version **3.1.7** (published 2026-09-04) · ISC license · 0 weekly downloads

## Install

```sh
npm install @product-live/api-sdk
pnpm add @product-live/api-sdk
yarn add @product-live/api-sdk
bun add @product-live/api-sdk
```

## Health

**Score 65/100 (B)** — status: active.

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

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 3.1.7 |
| Published | 2026-09-04 |
| First published | 2023-02-06 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=20 |
| Dependencies | 6 |
| Unpacked size | 5.2 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Product-Live |
| Maintainers | clementaubert, loic.cadenat, vclerc |

## Links

- npm: https://www.npmjs.com/package/@product-live/api-sdk
- npm.io page: https://npm.io/package/@product-live/api-sdk

## Dependencies (6)

- [@microsoft/kiota-abstractions](https://npm.io/package/@microsoft/kiota-abstractions.md) 1.0.0-preview.91
- [@microsoft/kiota-http-fetchlibrary](https://npm.io/package/@microsoft/kiota-http-fetchlibrary.md) 1.0.0-preview.91
- [@microsoft/kiota-serialization-form](https://npm.io/package/@microsoft/kiota-serialization-form.md) 1.0.0-preview.91
- [@microsoft/kiota-serialization-json](https://npm.io/package/@microsoft/kiota-serialization-json.md) 1.0.0-preview.91
- [@microsoft/kiota-serialization-text](https://npm.io/package/@microsoft/kiota-serialization-text.md) 1.0.0-preview.91
- [@microsoft/kiota-serialization-multipart](https://npm.io/package/@microsoft/kiota-serialization-multipart.md) 1.0.0-preview.91

## Recent versions

- 3.1.7 (latest) — 2026-09-04
- 3.1.6 — 2026-05-18
- 3.1.5 — 2026-04-10
- 3.1.4 — 2026-01-14
- 3.1.3 — 2025-10-30
- 3.1.2 — 2025-09-11
- 3.1.1 — 2025-08-19
- 3.1.0 — 2025-06-23
- 3.0.0 — 2025-05-21
- 3.0.0-preview.0 — 2025-03-28
- 2.38.0 — 2024-07-17
- 2.26.0 — 2024-02-13
- 2.23.0 — 2024-01-12
- 2.22.0 — 2023-12-04
- 2.20.0 — 2023-11-15
- … 21 more at https://npm.io/package/@product-live/api-sdk/versions

## README

# Product-live sdk

This sdk aims at simplifying access to the Product-Live public API.

## Generation

The following section describe the necessary steps to generate and publish a new version of the sdk. All action are performed through the github web interface.

### Generation

A new version of the sdk can be generated through the github action [Generate sdk](https://github.com/Product-Live/sdk-typescript/actions/workflows/generate-sdk.yaml). This action will generate the necessary code on a new branch and open a PR for verification. A dry publication is performed to ensure basic npm compliance.

![Generate sdk](./docs/assets/sdk-generate.png "Generate sdk")

**Note that running the same action multiple times will result in as many branches and PR being opened, that should be closed manually.**

**OPTIONS:**
- "OpenApi specification location": url for the targeted API. The default value is the production API and should be used in most cases.
- "Should perform a dry run": if checked, the changes will not be committed. This option may be used to test generation beforehand.

### PR validation

The pull request opened should be reviewed, and merged once validated.

### Release creation

The preparation of a new release is handled automatically by release-please. A PR is created and maintained whenever the main branch is updated.\
Once ready to publish the new version, said PR should be merged. All necessary actions are then handled automatically.

### Publication

Once a new release is created, it should then be published through the [Publish sdk](https://github.com/Product-Live/sdk-typescript/actions/workflows/publish.yaml) github action. Except in some edge cases, it should be executed on the 'main' branch.\
This action will build and publish the sdk to npm repository.

![Publish sdk](./docs/assets/sdk-publish.png "Publish sdk")

**OPTIONS:**
- "dry run": if checked, performs a test publication without the actual upload. This may be used to test publication


## Installing

Install the library with the following command:
`npm i @product-live/sdk`

## Usage

### Instantiation

For its creation, the apiClient must be provided with an AuthenticationProvider and a RequestAdapter

```typescript
import {ApiKeyAuthenticationProvider, ApiKeyLocation} from '@microsoft/kiota-abstractions';
import {FetchRequestAdapter} from '@microsoft/kiota-http-fetchlibrary';
import {createApiClient} from './index';

const authenticationProvider = new ApiKeyAuthenticationProvider(
    key,
    'X-Api-Key',
    ApiKeyLocation.Header
);
const requestAdapter = new FetchRequestAdapter(authenticationProvider);
requestAdapter.baseUrl = url;
const apiClient = createApiClient(requestAdapter);
```

The library provides a simplified entry point for the most usual case

```typescript
import {setup} from './index';

const apiClient = setup(key, url);
```

It is currently recommended to use the latter method when the project is of `"type": "module"`

### Call

Once instantiated, the client may be called on any API available. The methods use will always reflect the targeted url and the http verb.
For instance, to obtain a list of audit logs, we need a GET request on url `/v1/audit_logs`. The corresponding call will be:
```typescript
const auditLogsList = await apiClient.v1.audit_logs.get();
```

#### Additional parameters

Additional parameters may be provided depending on the targeted API

- url parameters: a method byId(id: string) will be available in the functions chain
````typescript
const item = await apiClient.v1.items.byId(itemId).get();
````

- body: for API calls requiring it, a body will be expected as the call function first argument
````typescript
const newVariable = await apiClient.v1.data_factory.variables.post({
    key: 'some-key',
    name: 'explicit-name',
    value: 'value'
});
````

- headers and query parameters: all calling methods accept a RequestConfiguration as a last argument. This object is a json containing a headers and/or queryParameters object, with the necessary values inside. Note that the autocomplete is not available for the content of `headers`
````typescript
const patitionsList = await apiClient.v1.partitions.get({
    queryParameters: { tableId: tableId },
    headers: { 'X-Context': contextAccountId }
});
````

## Compatibility

The library provides both cjs and esm version.

---
_Source: https://npm.io/package/@product-live/api-sdk · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
