> For the complete documentation index, see [llms.txt](https://bharath-ramachandran.gitbook.io/br-writing-samples/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bharath-ramachandran.gitbook.io/br-writing-samples/technical-api-documentation-samples/ecotrack-sdk-documentation.md).

# EcoTrack SDK Documentation

Welcome to the EcoTrack SDK documentation. This guide will help you integrate EcoTrack into your application to monitor and manage environmental data efficiently.

## Introduction

EcoTrack SDK provides tools and APIs to integrate environmental data tracking into your applications. With EcoTrack, you can monitor carbon emissions, track renewable energy usage, and generate sustainability reports.

## Installation

### Prerequisites

* Unity 2019.4 or later
* .NET Standard 2.0 or later

### Download

Download the latest version of the EcoTrack SDK from the [official website](https://www.ecotrack.com/download).

### Importing the SDK

1. Open your Unity project.
2. Go to `Assets > Import Package > Custom Package`.
3. Select the downloaded EcoTrack SDK package.
4. Click `Import` to add the SDK to your project.

## Getting Started

### Initializing the SDK

To start using the EcoTrack SDK, you need to initialize it in your project. Add the following code to your main script:

```csharp
using EcoTrack;

public class EcoTrackInitializer : MonoBehaviour
{
    void Start()
    {
        EcoTrackManager.Initialize("YOUR_API_KEY");
    }
}
```

### Configuration

Configure the SDK according to your needs. You can set various parameters like data update intervals, tracking preferences, and more.

```csharp
EcoTrackManager.SetUpdateInterval(60); // Update every 60 seconds
EcoTrackManager.EnableCarbonTracking(true);
EcoTrackManager.EnableEnergyTracking(true);
```

## Features

### Carbon Emission Tracking

Track carbon emissions generated by different activities in your application. Use the following API to log emissions:

```csharp
EcoTrackManager.LogCarbonEmission(activity: "transport", amount: 50.5);
```

### Renewable Energy Tracking

Monitor the usage of renewable energy sources in your application. Log energy usage with the following code:

```csharp
EcoTrackManager.LogEnergyUsage(source: "solar", amount: 120.0);
```

### Sustainability Reports

Generate sustainability reports based on the tracked data. You can customize the report parameters as needed:

```csharp
SustainabilityReport report = EcoTrackManager.GenerateReport(startDate, endDate);
report.SaveAsPDF("sustainability_report.pdf");
```

## API Reference

### EcoTrackManager

#### Initialize

```csharp
public static void Initialize(string apiKey)
```

Initializes the EcoTrack SDK with your API key.

#### SetUpdateInterval

```csharp
public static void SetUpdateInterval(int seconds)
```

Sets the interval for data updates.

#### EnableCarbonTracking

```csharp
public static void EnableCarbonTracking(bool enable)
```

Enables or disables carbon tracking.

#### LogCarbonEmission

```csharp
public static void LogCarbonEmission(string activity, double amount)
```

Logs the amount of carbon emissions for a specific activity.

#### EnableEnergyTracking

```csharp
public static void EnableEnergyTracking(bool enable)
```

Enables or disables renewable energy tracking.

#### LogEnergyUsage

```csharp
public static void LogEnergyUsage(string source, double amount)
```

Logs the amount of energy used from a specific source.

#### GenerateReport

```csharp
public static SustainabilityReport GenerateReport(DateTime startDate, DateTime endDate)
```

Generates a sustainability report for the specified date range.

## Support

For any issues or questions, please visit our [support page](https://www.ecotrack.com/support) or contact us at <support@ecotrack.com>.
