Skip to content

Latest commit

 

History

History
30 lines (24 loc) · 1.35 KB

FETCHING.md

File metadata and controls

30 lines (24 loc) · 1.35 KB

Fetching data

Exponea SDK allows you to fetch data from Exponea backend, namely Customer consents and Customer recommendations.

Customer consents

With customer consents you can define categories and base your application features/tracking based on customer's membership in those categories. More information can be found in Exponea GDPR documentation.

To fetch consents for the current customer, you can use fetchConsents() function:

import 'package:exponea/exponea.dart';

final _plugin = ExponeaPlugin();
_plugin.fetchConsents()
  .then((list) => list.forEach((consent) => print(consent)))
  .catchError((error) => print('Error: $error'));

Customer recommendations

Exponea offers a machine learning engine providing product recommendations for for customers based on your data. You can read more about customer recommendations and how to setup your model in Exponea Recommendations manual.

To fetch recommendations for the current customer, use fetchRecommendations() function:

final options = RecommendationOptions(
  id: 'recommendation_id',
  fillWithRandom: true,
);
_plugin.fetchRecommendations(options)
  .then((list) => list.forEach((recommendation) => print(recommendation.itemId)))
  .catchError((error) => print('Error: $error'));