---
metadata:
  - name: generator
    content: Diplodoc Platform v5.50.6
alternate:
  - https://appmetrica.yandex.by/docs/en/sdk/flutter/analytics/quick-start.md
  - https://appmetrica.yandex.by/docs/ru/sdk/flutter/analytics/quick-start.md
---
> **Documentation Index:** Fetch the complete configuration index at https://appmetrica.yandex.by/docs/en/llms.txt

# Installation and initialization

To integrate AppMetrica into Flutter, use the [AppMetrica SDK for Flutter](https://pub.dev/packages/appmetrica_plugin) plugin:

## Step 1. Install the AppMetrica SDK for Flutter plugin in your project {#integration}

From the root of the project, run the command:

```bash translate=no
flutter pub add appmetrica_plugin
```

After adding the plugin, you'll see a line with the following dependency in the `pubspec.yaml` file:

```yaml translate=no
dependencies:
   appmetrica_plugin: ^4.0.0
```

## Step 2. Initialize the library {#initialization}   

1. Add `appmetrica_plugin` import:
   ```java translate=no
   import 'package:appmetrica_plugin/appmetrica_plugin.dart';
   ```

2. Initialize the AppMetrica library using `AppMetrica.activate` and your API key:

   ```bash translate=no
   AppMetrica.activate(AppMetricaConfig("insert_your_api_key_here"));
   ```

3. Send an event using `AppMetrica.reportEvent` to test the operation:

   ```bash translate=no
   AppMetrica.reportEvent('My first AppMetrica event!');
   ```


## Learn more {#learn-more}

- [Sending E-commerce events](https://appmetrica.yandex.by/docs/en/sdk/flutter/analytics/flutter-operations.md#send-ecommerce)
- [Sending Revenue data](https://appmetrica.yandex.by/docs/en/sdk/flutter/analytics/flutter-operations.md#send-revenue)
- [Sending Ad Revenue data](https://appmetrica.yandex.by/docs/en/sdk/flutter/analytics/flutter-operations.md#send-adrevenue)   

<!-- source: en/_includes/feedback-button-3.md -->
If you didn't find the answer you were looking for, you can use the feedback form to submit your question. Please describe the problem in as much detail as possible. Attach a screenshot if possible.

<a href="../../../troubleshooting/feedback-new">
  <span class="button">Contact support</span>
</a>

<a href="../../../troubleshooting/feedback-docs">
  <span class="button">Suggest an improvement for documentation</span>
</a>
<!-- endsource: en/_includes/feedback-button-3.md -->
