> ## Documentation Index
> Fetch the complete documentation index at: https://docs.suprsend.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Sync Events

> Methods for sending events from your react native app to the SuprSend platform to trigger workflows.

In this section, we'll cover how to send events to the Suprsend platform for both iOS and Android application

## Pre-Requisites

1. [Create User](/docs/react-native-create-user)- Mandatory to pass in event trigger

## Sending Events to SuprSend

You can setup events on user actions in your app and configure workflows on top of it that triggers when the corresponding event is passed through App. Variables added in the template or workflow should be passed as event `properties`

You can send Events from your app to SuprSend platform by using `suprsend.track()` method.

<CodeGroup>
  ```javascript javascript theme={"system"}
  suprsend.track(event_name, properties);
  suprsend.track("grocery_purchased", {"item":"olive oil","amount":"$12"});
  ```
</CodeGroup>

<Warning>
  Event Name or Property Name should not start with **`$`** or **`ss_`**. These keywords are reserved for internal events and property names.
</Warning>

### System Events tracked by SuprSend

There are some system events tracked by SuprSend SDK by default. These are some basic events, as well as events that are necessary for tracking notifications related activity (like delivered, clicked, etc). You are not required to do anything here.

| Event Name                | Description                                                                                                                                                                                                                                                                                                                                                                   |
| ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| \$app\_installed          | \$app\_installed will get tracked when user launch his app for the first time. FYI cases in which it will also get called 1. When user launches his app for first time. 2. When user uninstall the app and installs it again. 3. \[Multiple device login ]When user launch app for first time on different devices. 4. When user clears the app cache and relaunches the app. |
| \$app\_launched           | Gets tracked when user launches the app each time.                                                                                                                                                                                                                                                                                                                            |
| \$user\_login             | Gets tracked when user logs in inside the app                                                                                                                                                                                                                                                                                                                                 |
| \$user\_logout            | Gets tracked when user logs in to the app                                                                                                                                                                                                                                                                                                                                     |
| \$notification\_delivered | Will get tracked when the suprsend notification payload is received at SDK end.                                                                                                                                                                                                                                                                                               |
| \$notification\_clicked   | Will get tracked when user either clicks the notification body or any action button in the notification.                                                                                                                                                                                                                                                                      |
| \$notification\_dismissed | Will get tracked when user dismisses the notification by left swiping the notification or by clicking on "Clear All" button                                                                                                                                                                                                                                                   |

## Advanced concepts

### 1. Super Properties

Super Properties are data that are always sent with events data. These super properties will be sent in each event after calling this method. Super Properties will be stored in local storage, and will persist across invocations of app.

<AccordionGroup>
  <Accordion title="Set Super Property" defaultOpen={false}>
    There are some super properties that SuprSend SDK will send by default. Developer can set custom super properties as well with `suprsend.setSuperProperties()` method

    <CodeGroup>
      ```javascript javascript theme={"system"}
      //method
      suprsend.setSuperProperties(key, value);
      suprsend.setSuperProperties(property_obj);

      //Example
      suprsend.setSuperProperties("Location", "Banglore");
      suprsend.setSuperProperties({"Location": "Banglore","Pincode": 1234567});
      ```
    </CodeGroup>

    Default Super Properties tracked by SuprSend SDK:

    | Super Property         | Description                                  | Sample Value     |
    | ---------------------- | -------------------------------------------- | ---------------- |
    | \$app\_version\_string | Version of your app                          | 0.0.1            |
    | \$app\_build\_number   | Build number of your app                     | 2                |
    | \$os                   | Operating system of the user                 | android          |
    | \$manufacturer         | Manufacturer of the user's device            | OnePlus          |
    | \$brand                | Brand of the user's device                   | OnePlus          |
    | \$model                | Model of the user's device                   | GM1901           |
    | \$deviceId             | Device id                                    | 89eead05a0150146 |
    | \$ss\_sdk\_version     | SuprSend SDK version                         | 0.1.31           |
    | \$network              | Network on which the user is                 | wifi             |
    | \$connected            | Whether the user is connected to the network | true             |
  </Accordion>

  <Accordion title="Unset Super Property" defaultOpen={false}>
    There are unset custom super properties with `suprsend.unSetSuperProperty()` method. This method will stop calling that property with every event trigger.

    <CodeGroup>
      ```javascript javascript theme={"system"}
      suprsend.unSetSuperProperty(key);

      suprsend.unSetSuperProperty("Location");
      ```
    </CodeGroup>
  </Accordion>
</AccordionGroup>

### 2. Flush Events

SuprSend SDK automatically flushes events at an interval of 5 seconds, and on certain activities like app relaunch, etc. If you wish to flush a time sensitive event to SuprSend immediately, you can use the `suprSendApi.flush()` method.

All the system tracked events are flushed immediately

<CodeGroup>
  ```javascript javascript theme={"system"}
  suprSendApi.flush();
  ```
</CodeGroup>

***
