Last updated:
0 purchases
satori
Satori Dart/Flutter Client #
Satori is a liveops server for games that powers actionable analytics, A/B testing and remote configuration. Use the Satori Dart Client to communicate with Satori from within your Dart game.
Full documentation is online - https://heroiclabs.com/docs/satori/client-libraries/dart/index.html
Getting Started #
In your dart project add the dependency in pubspec.yaml:
dependencies:
...
satori: ^1.0.0
copied to clipboard
To use Satori within your dart app you need to import the Satori package:
import 'package:satori/satori.dart';
copied to clipboard
Now to start using Satori, create a client object that accepts the API key you were given as a Satori customer.
final client = getSatoriClient(
host: '127.0.0.1',
port: 7450,
ssl: false,
apiKey: 'apikey',
);
copied to clipboard
Then authenticate with the server to obtain your session.
// Authenticate with the Satori server.
try {
final session = await _satoriClient.authenticate(id: 'your-id');
print('Authenticated successfully: $session');
} catch (error) {
print('Authentication failed $error');
}
copied to clipboard
Using the client you can get any experiments or feature flags the user belongs to.
final experiments = await _satoriClient.getExperiments(session: session, names: ['experiment1', 'Experiment2']);
final flag = await _satoriClient.getFlag(session: session, name: 'FlagName');
copied to clipboard
You can also send arbitrary events to the server:
final event = Event(
name: 'gameLaunched',
value: jsonEncode({'gameId': 'id-1234'}),
);
await _satoriClient.event(session: session, event: event);
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.