# @adobe/aio-lib-core-tvm

> A JS client to access the Adobe I/O token vending machine

Latest version **4.0.3** (published 2025-02-25) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @adobe/aio-lib-core-tvm
pnpm add @adobe/aio-lib-core-tvm
yarn add @adobe/aio-lib-core-tvm
bun add @adobe/aio-lib-core-tvm
```

## Health

**Score 35/100 (D)** — status: stable.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 4.0.3 |
| Published | 2025-02-25 |
| First published | 2019-09-19 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=18 |
| Dependencies | 8 |
| Unpacked size | 33.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Adobe Inc. |
| Maintainers | marbec, tripod, garthdb, lazd, adobe-admin, patrickfulton, trieloff, shazron, krisnye, dcpfsdk, natebaldwin, devongovett, aspro83, symanovi, dpfister, stefan-guggisberg, korra, rofe, kptdobe, adobehalls, fullcolorcoder, djaeggi, dylandepass, mhaack, amol-anand, stopp-adobe, doten, duh_schmidt, asthabh23 |
| Keywords | core-sdk, nodejs, adobeio, cloud-native, client |

## Links

- npm: https://www.npmjs.com/package/@adobe/aio-lib-core-tvm
- Repository: https://github.com/adobe/aio-lib-core-tvm
- Homepage: https://github.com/adobe/aio-lib-core-tvm#readme
- Issues: https://github.com/adobe/aio-lib-core-tvm/issues
- npm.io page: https://npm.io/package/@adobe/aio-lib-core-tvm

## Dependencies (8)

- [joi](https://npm.io/package/joi.md) ^17.4.2
- [upath](https://npm.io/package/upath.md) ^2.0.1
- [fs-extra](https://npm.io/package/fs-extra.md) ^11.1.1
- [lodash.clonedeep](https://npm.io/package/lodash.clonedeep.md) ^4.5.0
- [@adobe/aio-lib-env](https://npm.io/package/@adobe/aio-lib-env.md) ^3
- [@adobe/aio-lib-core-errors](https://npm.io/package/@adobe/aio-lib-core-errors.md) ^4
- [@adobe/aio-lib-core-logging](https://npm.io/package/@adobe/aio-lib-core-logging.md) ^3
- [@adobe/aio-lib-core-networking](https://npm.io/package/@adobe/aio-lib-core-networking.md) ^5

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 4.0.3 (latest) — 2025-02-25
- 3.0.1-pre.2024-01-08.5746e97f (next) — 2024-01-08
- 4.0.2 — 2024-02-12
- 4.0.1 — 2024-01-24
- 4.0.0 — 2024-01-10
- 3.0.1 — 2023-02-22
- 3.0.0 — 2022-08-19
- 2.2.2-pre.2022-06-27.647fd2aa — 2022-06-27
- 2.2.2-pre.2022-06-06.08725b20 — 2022-06-06
- 2.2.2 — 2021-10-14
- 2.3.0 — 2021-10-14
- 2.2.1 — 2021-04-16
- 2.1.0 — 2020-11-10
- 2.0.0 — 2020-10-13
- 1.3.2 — 2020-10-06
- … 12 more at https://npm.io/package/@adobe/aio-lib-core-tvm/versions

## README

[![Version](https://img.shields.io/npm/v/@adobe/aio-lib-core-tvm.svg)](https://npmjs.org/package/@adobe/aio-lib-core-tvm)
[![Downloads/week](https://img.shields.io/npm/dw/@adobe/aio-lib-core-tvm.svg)](https://npmjs.org/package/@adobe/aio-lib-core-tvm)
[![Node.js CI](https://github.com/adobe/aio-lib-core-tvm/actions/workflows/node.js.yml/badge.svg)](https://github.com/adobe/aio-lib-core-tvm/actions/workflows/node.js.yml)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) 
[![Codecov
Coverage](https://img.shields.io/codecov/c/github/adobe/aio-lib-core-tvm/master.svg?style=flat-square)](https://codecov.io/gh/adobe/aio-lib-core-tvm/)

# Adobe I/O Lib Core Token Vending Machine

A JS client to access the token vending machine.

For more details on the server side, `goto` [adobe/aio-tvm](https://github.com/adobe/aio-tvm)

## Install

`npm install @adobe/aio-lib-core-tvm`

## Use

```javascript
const TvmClient = require('@adobe/aio-lib-core-tvm')
// init
const tvm = await TvmClient.init({ ow: { auth: '<myauth>', namespace: '<mynamespace>' } })
// init with retryOptions
const tvm = await TvmClient.init({ ow: { auth: '<myauth>', namespace: '<mynamespace>' }, retryOptions: { maxRetries: 5, initialDelayInMillis: 100} })

// aws s3
const awsS3Credentials = await tvm.getAwsS3Credentials()
const aws = require('aws-sdk')
const s3 = new aws.S3(awsS3Credentials)
// ...operations on s3 object

// azure blob
const azureBlobCredentials = await tvm.getAzureBlobCredentials()
const azure = require('@azure/storage-blob')
const azureCreds = new azure.AnonymousCredential()
const pipeline = azure.newPipeline(azureCreds)
const containerClientPrivate = new azure.ContainerClient(azureBlobCredentials.sasURLPrivate, pipeline)
const containerClientPublic = new azure.ContainerClient(azureBlobCredentials.sasURLPublic, pipeline)
// ...operations on containerClientPrivate and containerClientPublic

// azure cosmos
const azureCosmosCredentials = await tvm.getAzureCosmosCredentials()
const cosmos = require('@azure/cosmos')
const container = new cosmos.CosmosClient({ endpoint: azureCosmosCredentials.endpoint, tokenProvider: async () => azureCosmosCredentials.resourceToken })
                            .database(azureCosmosCredentials.databaseId)
                            .container(azureCosmosCredentials.containerId)
const data = await container.item('<itemKey>', azureCosmosCredentials.partitionKey).read()
// ...operations on items within azureCosmosCredentials.partitionKey
```

## Explore

`goto` [API](doc/api.md)

## Debug

set `DEBUG=@adobe/aio-lib-core-tvm*` to see debug logs.

## Contributing

Contributions are welcomed! Read the [Contributing Guide](./.github/CONTRIBUTING.md) for more information.

## Licensing

This project is licensed under the Apache V2 License. See [LICENSE](LICENSE) for more information.

---
_Source: https://npm.io/package/@adobe/aio-lib-core-tvm · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
