# jovo-db-cosmosdb

> > To view this page on the Jovo website, visit https://v3.jovo.tech/marketplace/jovo-db-cosmosdb

Latest version **3.6.2** (published 2022-07-28) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install jovo-db-cosmosdb
pnpm add jovo-db-cosmosdb
yarn add jovo-db-cosmosdb
bun add jovo-db-cosmosdb
```

## Health

**Score 25/100 (F)** — status: abandoned.

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

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.6.2 |
| Published | 2022-07-28 |
| First published | 2019-01-10 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 16.9 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | jovotech |
| Maintainers | jovotech |

## Links

- npm: https://www.npmjs.com/package/jovo-db-cosmosdb
- npm.io page: https://npm.io/package/jovo-db-cosmosdb

## Dependencies (4)

- [jovo-core](https://npm.io/package/jovo-core.md) ^3.6.1
- [lodash.get](https://npm.io/package/lodash.get.md) ^4.4.2
- [lodash.set](https://npm.io/package/lodash.set.md) ^4.3.2
- [jovo-db-mongodb](https://npm.io/package/jovo-db-mongodb.md) ^3.6.2

## Recent versions

- 3.6.2 (latest) — 2022-07-28
- 3.6.1 — 2022-02-17
- 3.6.0 — 2021-11-18
- 3.5.1 — 2021-03-26
- 3.5.0 — 2021-02-22
- 3.4.1 — 2021-02-09
- 3.4.0 — 2021-02-04
- 3.3.1 — 2021-01-27
- 3.3.0 — 2020-12-03
- 3.2.2 — 2020-11-20
- 3.2.1 — 2020-11-10
- 3.2.0 — 2020-10-29
- 3.1.5 — 2020-10-23
- 3.1.4 — 2020-10-16
- 3.1.3 — 2020-10-08
- … 61 more at https://npm.io/package/jovo-db-cosmosdb/versions

## README

# Azure CosmosDB Database Integration

> To view this page on the Jovo website, visit https://v3.jovo.tech/marketplace/jovo-db-cosmosdb

Learn how to store user specific data of your Alexa Skills and Google Actions to Cosmos DB.

* [Introduction](#introduction)
* [Configuration](#configuration)

> Tutorial: [Deploy to Azure](https://v3.jovo.tech/tutorials/deploy-to-azure)

## Introduction

The Cosmos DB integration allows you to store user session data in the NoSQL service running on Azure using their MongoDB API. This integration is especially convenient if you're running your voice app on Azure Functions. You can find the official documentation about Cosmos DB here: [docs.microsoft.com/cosmos-db](https://docs.microsoft.com/en-us/azure/cosmos-db/).

> [Learn more about hosting your application on Azure Functions](https://v3.jovo.tech/docs/hosting/azure-functions).

## Configuration

Download the package like this:

```sh
$ npm install --save jovo-db-cosmosdb
```

Cosmos DB can be enabled in the `src/app.js` file like this:

```javascript
// @language=javascript

// src/app.js

const { CosmosDb } = require('jovo-db-cosmosdb');

// Enable DB after app initialization
app.use(new CosmosDb());

// @language=typescript

// src/app.ts

import { CosmosDb } from 'jovo-db-cosmosdb';

// Enable DB after app initialization
app.use(new CosmosDb());
```

Inside your `config.js` file you have to set your `primary connection string` and your database name. You can also optionally set the collection name (default is `UserData`):

```javascript
// @language=javascript

// src/config.js

module.exports = {
    
    db: {
        CosmosDb: {
            uri: '<primary_connection_string>',
            databaseName: '<database_name>',
            collectionName: '<collection_name>'
        }
    }

    // ...

};

// @language=typescript

// src/config.ts

const config = {
    
    db: {
        CosmosDb: {
            uri: '<primary_connection_string>',
            databaseName: '<database_name>',
            collectionName: '<collection_name>'
        }
    }

    // ...

};
```

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