# Lemnisk Cloud Mode Integration

RudderStack lets you send your event data to Lemnisk via [cloud mode]({{< ref "destinations/rudderstack-connection-modes.md#cloud-mode" >}}). 

Find the open source transformer code for this destination in the [GitHub repository](https://github.com/rudderlabs/rudder-transformer/tree/main/src/v0/destinations/lemnisk).

RudderStack supports sending data to the following Lemnisk platforms:
- [DIAPI](#diapi)
- [Pixel Listener](#pixel-listener)

## DIAPI

When you choose to send events to Lemnisk via the server-side cloud mode, RudderStack uses Lemnisk's [HTTP API](https://lemnisk.gitbook.io/lemnisk-platform-documentation/sources/http-api) to send your website or app data.

### Track

The [`track`]({{< ref "event-spec/standard-events/track.md" >}}) call lets you record the user actions along with any properties associated with them.

A sample `track` call is shown below:

```javascript
rudderanalytics.track("Product Reviewed", {
  review_id: "12345",
  product_id: "123",
  rating: 3.0,
  review_body: "Average product, expected much more."
})
```

#### Property mappings

The following table lists the mappings between the RudderStack and Lemnisk properties:

| RudderStack property   | Lemnisk property  | Data type |
| :-------------| :-----------------| :-----------------| 
|  `userId` <br/> `anonymousId` <br/> <span style="color: #4D4DFF;font-size:12px;">Required</span> | `userId` | String |
| `properties` | `properties` | Object |
| `event`  | `eventname` | String |
| `config.srcid` | `srcId` | String |
| `config.diapiWriteKey`  | `writekey` | String |

## Pixel Listener

When you choose to send events to Lemnisk via the web cloud mode, RudderStack uses Lemnisk's [JavaScript SDK](https://lemnisk.gitbook.io/lemnisk-platform-documentation/sources/javascript-sdk) to send data from your website.

### Identify

You can use the [`identify`]({{< ref "event-spec/standard-events/identify.md" >}}) call to identify a user and associate them to their actions. It also lets you record any traits about them like their name, email, etc.

A sample `identify` call is shown below:

```javascript
rudderanalytics.identify("hashed_user_id", {
  name: "Alex Keener",
  email: "alex@example.com",
})
```

#### Property mappings

The following table lists the mappings between the RudderStack and Lemnisk properties:

| RudderStack property   | Lemnisk property  |  Data type |
| :-------------| :-----------------| :-----------------| 
|  `userId` <br/> `anonymousId` <br/> <span style="color: #4D4DFF;font-size:12px;">Required</span> | `userId` <br/> `id` | String |
| `context` <br/> <span style="color: #4D4DFF;font-size:12px;">Required</span> | `context` | Object |
| `traits` <br/> <span style="color: #4D4DFF;font-size:12px;">Required</span>| `customerProperties` | Object |
| `messageId` <br/> <span style="color: #4D4DFF;font-size:12px;">Required</span>| `messageId` | String |

### Track

The [`track`]({{< ref "event-spec/standard-events/track.md" >}}) call lets you record the user actions along with any properties associated with them. 

A sample `track` call is shown below:

```javascript
rudderanalytics.track("Product Reviewed", {
  review_id: "12345",
  product_id: "123",
  rating: 3.0,
  review_body: "Average product, expected much more."
})
```

#### Property mappings

The following table lists the mappings between the RudderStack and Lemnisk properties:

| RudderStack property   | Lemnisk property  |  Data type |
| :-------------| :-----------------| :-----------------| 
|  `userId` <br/> `anonymousId` <br/> <span style="color: #4D4DFF;font-size:12px;">Required</span> | `userId` <br/> `id` | String |
| `event` <br/> <span style="color: #4D4DFF;font-size:12px;">Required</span> | `event` | String |
| `properties`   | `properties` | Object |
| `timestamp` <br/> <span style="color: #4D4DFF;font-size:12px;">Required</span>| `originalTimestamp` | String |
| `messageId` <br/> <span style="color: #4D4DFF;font-size:12px;">Required</span>| `messageId` | String |
| `context` <br/> <span style="color: #4D4DFF;font-size:12px;">Required</span> | `context` | Object |
| `properties`   | `properties` | Object |

### Page

The [`page`]({{< ref "event-spec/standard-events/page.md" >}}) call lets you record when a user views a page of your website, along with any optional properties about the page.

A sample `page` call is shown below:

```javascript
rudderanalytics.page("Home")
```

#### Property mappings

The following table lists the mappings between the RudderStack and Lemnisk properties:

| RudderStack property   | Lemnisk property  | Data type |
| :-------------| :-----------------| :-----------------| 
|  `userId` <br/> `anonymousId` <br/> <span style="color: #4D4DFF;font-size:12px;">Required</span> | `userId` <br/> `id` | String |
| `name` <br/> <span style="color: #4D4DFF;font-size:12px;">Required</span> | `name` | String |
| `timestamp` <br/> <span style="color: #4D4DFF;font-size:12px;">Required</span>| `originalTimestamp` | String |
| `messageId` <br/> <span style="color: #4D4DFF;font-size:12px;">Required</span>| `messageId` | String |
| `context` <br/> <span style="color: #4D4DFF;font-size:12px;">Required</span> | `context` | Object |
| `properties`   | `properties` | Object |

