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

# Code Events

# Code Events

Code events may only be used for Web and Mobile applications. There are two ways to add events to Sprig: create the Code Event in the Sprig app, or have your developer send an event from the SDK.

## Proactive

If you use the Sprig app to create a Code event, a code snippet is generated with the matching SDK parameter that you can give to your developer to incorporate into their code.

1. In the Navigation Pane, click **Events**.
2. Click **Add Event**.
3. Click **Create Code Event**.
4. In the **Key** field, enter the Event name. The Event name must match the same SDK parameter you are using to track the event.
5. Click **Use Key as display name** to use a different string to describe the event instead of the **Key** label.
6. In the **Description** field, enter the event description.
7. Click **Add Event**. You’ll be directed to the Events page.
8. Locate and select the Event you just created.
9. Click Configure to Toggle between **JavaScript**, **iOS**, or **Android** to see the snippet that your engineers will need, depending on which study delivery platform you’re planning to use the Event on, and share that snippet with engineering. Direct them to the [Integrations](https://app.sprig.com/integrations/installation) section of the docs for more information on that specific platform, as well as how to locate the **Environment ID**.

## Reactive

1. Once your engineering team has sent a new event to Sprig, you will need to approve the request.  You should see a banner similar to the following:

<img align="center" alt="Image 1116" width="100%" src="https://mintcdn.com/sprig/8rOBJC6NeyY76ru8/images/8d08038-manage-requests.png?fit=max&auto=format&n=8rOBJC6NeyY76ru8&q=85&s=5a620eae6c9aae39ac5460d0cf57110f" title="manage-requests.png" data-path="images/8d08038-manage-requests.png" />

1. In the Navigation Pane, click **Events**.
2. Click **Manage Requests**.
3. Click the check box next to the event(s) and click **Approve**.
4. Click **X** to close the window.

<Warning>
  You must *Approve* of an Event Request before it can trigger a study.\
  If you *Deny* an Event Request, it will be removed from the Event Request list. However, if Sprig subsequently detects that same Event Request, it will re-appear in the list.

  If you do not see an Event Request for an event you expect, perform the user behavior to generate the event in your application, and then reload the **Events** page and return to **Manage Requests** to approve it.

  Legacy [Events ](https://app.sprig.com/events) do not have to be *Approved*.
</Warning>
