bluesky 0.4.5 bluesky: ^0.4.5 copied to clipboard
The easiest and powerful Dart/Flutter library for Bluesky Social.
// Copyright 2023 Shinya Kato. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided the conditions.
import 'package:atproto/atproto.dart';
import 'package:bluesky/bluesky.dart' as bsky;
Future<void> main() async {
final bluesky = bsky.Bluesky.fromSession(
await _session,
retryConfig: RetryConfig(
maxAttempts: 5,
jitter: Jitter(maxInSeconds: 5),
),
);
final subscription = await bluesky.sync.subscribeRepoUpdates();
subscription.data.stream.listen((event) {
print(event);
});
}
Future<bsky.Session> get _session async {
final session = await bsky.createSession(
identifier: 'shinyakato.dev',
password: 'pierrot19930924ks',
);
return session.data;
}