# Stormly

[Stormly](https://www.stormly.com/) is a product analytics tool powered by AI. It gives you insights into your users' behavior and tailored tips on improving their product experience.

Find the open source transformation code for this destination in the <a href="https://github.com/rudderlabs/rudder-transformer/blob/main/src/v0/destinations/stormly/transform.js">GitHub repository</a>.

## Connection compatibility

{{< destination-config >}}

## Get started

Once you have confirmed that the platform supports sending events to Stormly, follow these steps:

1. From your [RudderStack dashboard](https://app.rudderstack.com/), add a source. Then, from the list of destinations, select **Stormly**.
2. Assign a name to the destination and click **Continue**.

## Connection settings

- **API Key**: Enter your Stormly API key. For steps on obtaining the key, see [FAQ](#faq).
- **Consent management settings**: Configure the consent management settings for the specified source by choosing the **Consent management provider** from the dropdown and entering the relevant consent category IDs. See [Consent Management in RudderStack]({{< ref "data-governance/consent-management/overview.md" >}}) for more information on this feature.

## Identify

Use the [`identify`]({{< ref "event-spec/standard-events/identify.md" >}}) call to create a user in Stormly.

A sample `identify` call sent to Stormly:

```javascript
rudderanalytics.identify("1hKOmRA4GRlm",{
        city: "New York",
        name: "Alex Keener",
        email: "alex@example.com",
        country: "US",
        trait1:123
    });
```

#### Supported mappings

The following table details the mappings between RudderStack traits and Stormly properties:

| RudderStack trait | Stormly property | Data type | 
| :-----| :--------| :-----|
| `userId` <br/> <span style="color: #4D4DFF;font-size:12px;">Required</span> | `userId` | String |
| `traits` <br /> `context.traits` | `traits` | Object |
 
## Track

You can use the [`track`]({{< ref "event-spec/standard-events/track.md" >}}) call to capture user events and add them to the Stormly database. 

The following snippet highlights a sample `track` call:

```javascript
rudderanalytics.track('Product Reviewed', {
  review_id: 'REV1344112',
  product_id: 'XUV112',
  rating: 3.0,
  review_body: 'Good product.',
  groupId: '91Yb32830',
});
```

#### Supported mappings

The following table details the mappings between RudderStack and Stormly properties:

| RudderStack property | Stormly property | Data type | 
| :-----| :--------| :-----|
| `userId` <br/> <span style="color: #4D4DFF;font-size:12px;">Required</span> | `userId` | String | 
| `event` <br/> <span style="color: #4D4DFF;font-size:12px;">Required</span> | `event` | String |
| `properties` | `properties` | Object | 

## Group

Use the [`group`]({{< ref "event-spec/standard-events/group.md" >}}) call to create a group in Stormly and add a user to it.

A sample `group` call sent to Stormly:

```javascript
rudderanalytics.group("91Yb32830", {
  name: "User Group 1",
  employees: 1000,
  industry: "Software",
});
```

#### Supported mappings

The following table details the mappings between RudderStack and Stormly properties:

| RudderStack property | Stormly property | Data type | 
| :-----| :--------| :-----|
| `userId` <br/> <span style="color: #4D4DFF;font-size:12px;">Required</span> | `userId` | String | 
| `groupId` <br/> <span style="color: #4D4DFF;font-size:12px;">Required</span> | `groupId` | String |
| `traits` | `traits` | Object | 

## FAQ

#### Where can I find the Stormly API key?

1. Log in to your [Stormly dashboard](https://www.stormly.com/login).
2. From the left sidebar, click the dropdown and select **Manage Projects**.
3. Select your project.
4. Click **Set-Up Data**.

{{< image src="images/event-stream-destinations/stormly-setup-data.webp" alt="Stormly Setup Data option" >}}

5. Copy the API key from the resulting URL.

{{< image src="images/event-stream-destinations/stormly-api-key.webp" alt="Stormly API key" >}}
