---
title: Node.js
slug: v4-8/install-guides/nodejs
icon: {"faIcon":"fa-brands fa-node"}
docTags: 
createdAt: 2023-08-01T15:45:13.024Z
---

To get started right away without having to build an app from scratch, explore with the Ditto ready-to-use demo task app.

# Prerequisites

Before you can install Ditto, you must have the following:&#x20;

- Ditto access credentials
- [Node.js](https://nodejs.org/en/) active long-term support (LTS) version 18.x or 20.x
- Linux, macOS version 11 (or later), or Windows version 10 (or later)
- [Git](https://git-scm.com/downloads)
- Integrated developer environment (IDE)

:::hint{type="info"}
* To get your access credentials, see [Getting Playground Token Credentials](docId\:U214QhYYMCxbV9jnamRFH).
* You can use any IDE you prefer; however, for optimal compatibility with the platform, Ditto recommends using [Visual Studio Code](https://code.visualstudio.com/download).
:::

# Installing the Demo Task App

To install Ditto in your environment, install and set up Ditto, and authenticate your client identity with the Big Peer:

:::::WorkflowBlock
::::WorkflowBlockItem
Clone the [getditto > template-app-nodejs-todo](https://github.com/getditto/template-app-nodejs-todo/) repository from GitHub:

:::CodeblockTabs
Bash

```none
git clone https://github.com/getditto/template-app-nodejs-todo/
```
:::
::::

::::WorkflowBlockItem
Install the required dependencies:

:::CodeblockTabs
Bash

```none
npm install
```
:::
::::

::::WorkflowBlockItem
Open the project in your IDE, and then open the `index.ts` file. For example, if using Visual Studio Code:&#x20;

:::CodeblockTabs
Bash

```none
code .
```
:::
::::

:::WorkflowBlockItem
In line 14 of the `index.ts` file, replace `'YOUR_APP_ID'` and `'YOUR_TOKEN'` with your app ID and playground token. (See [Getting Playground Token Credentials](docId\:U214QhYYMCxbV9jnamRFH))

```typescript
// replace YOUR_APP_ID and YOUR_TOKEN with p
ditto = new Ditto({ type: 'onlinePlayground', appID: 'YOUR_APP_ID', token: 'YOUR_TOKEN' })
```
:::

::::WorkflowBlockItem
Build the demo task app:

:::CodeblockTabs
Bash

```none
npm run build
```
:::
::::

::::WorkflowBlockItem
Interact with the demo task app and simulate real-time peer-to-peer replication by running the demo task app in two or more separate terminals (one for each virtual peer):

:::CodeblockTabs
Bash

```none
node index.js
```
:::
::::

:::WorkflowBlockItem
Using the commands that automatically appear in each of your terminals, add, remove, and modify documents as desired.
:::

:::WorkflowBlockItem
If you want to observe your changes sync with the cloud-optional deployment, the [Big Peer](docId\:Owk-BYJCe9FC9i8pMv_Sl), open the data browser in the [Ditto portal](https://portal.ditto.live/).
:::
:::::

