### Add the API plugin

Although DataStore presents a distinct API, its cloud synchronization functionality relies on the underlying [API category](/lib/graphqlapi/getting-started). Therefore, you will still be required to incorporate the API plugin when working with DataStore.

Make sure you have the following plugin dependency in your `pubspec.yaml`.

```yaml
amplify_api: ^0.6.0
```

Locate your Amplify initialization code, and add an `AmplifyAPI()` plugin. Your initialization code should already include an `AmplifyDataStore()` plugin from previous steps. Note the new `import` statement for API towards the top of the file.

Be sure to import your API library first:

```dart
import 'package:amplify_flutter/amplify_flutter.dart';
import 'package:amplify_datastore/amplify_datastore.dart';
import 'package:amplify_datastore_plugin_interface/amplify_datastore_plugin_interface.dart';
// Add the following line
import 'package:amplify_api/amplify_api.dart';

import 'amplifyconfiguration.dart';
import 'models/ModelProvider.dart';
```

Then update your configuration function, in this example it is `_configureAmplify` function, by adding `AmplifyAPI` like mentioned:

```dart
void _configureAmplify() async {
  final datastorePlugin = AmplifyDataStore(
    modelProvider: ModelProvider.instance,
  );
  // Add the following line and update your function call with `addPlugins`
  final api = AmplifyAPI();
  await Amplify.addPlugins([datastorePlugin, api]);
  try {
    await Amplify.configure(amplifyconfig);
  } on AmplifyAlreadyConfiguredException {
    print('Tried to reconfigure Amplify; this can occur when your app restarts on Android.');
  }
}
```
