# Session Recording Control

## Overview

The session control functions allow you to manage when data is collected by the SDK. Whether you need to temporarily halt data capture or end a session entirely, the following functions provide the necessary control:

* **Pause:** Temporarily stop capturing events while keeping the session active.
* **Resume:** Continue event recording after a pause.
* **Stop:** End the current session and stop all event recording.
* **Start/Init:** Start a new session after stopping.

## Pause Recording

Use this function when you need to momentarily stop data capture without ending the session.

```swift
// Pause recording (e.g., before handling sensitive information)
Zipy.pause()

// Your sensitive code here
handleSensitiveData()

// Resume recording
Zipy.resume()
```

## Resume Recording

Use this function to continue capturing events after a pause.&#x20;

> **Note:**  It will start a new session if the current one has already timed out ( i.e. paused for 30mins or whatever is configured).

```swift
Zipy.resume()
```

## Stop Recording

When this function is called, the session ends and no further events are captured. To capture events again, you must initialise a new session.

```swift
Zipy.stop()
```

## Start/Init Again

Use this function with your API key to either start a new session.

```swift
Zipy.init("YOUR_API_KEY")
```
