{"id":48187955,"url":"https://github.com/widgrensit/asobi-dart","last_synced_at":"2026-05-01T19:00:39.108Z","repository":{"id":348053879,"uuid":"1195225346","full_name":"widgrensit/asobi-dart","owner":"widgrensit","description":"Dart/Flutter client SDK for Asobi game backend","archived":false,"fork":false,"pushed_at":"2026-05-01T15:09:30.000Z","size":63,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-01T16:27:34.903Z","etag":null,"topics":["asobi","client-sdk","dart","flutter","game-backend","gamedev","multiplayer","sdk"],"latest_commit_sha":null,"homepage":null,"language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/widgrensit.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-29T11:58:54.000Z","updated_at":"2026-05-01T15:09:18.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/widgrensit/asobi-dart","commit_stats":null,"previous_names":["widgrensit/asobi-dart"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/widgrensit/asobi-dart","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/widgrensit%2Fasobi-dart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/widgrensit%2Fasobi-dart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/widgrensit%2Fasobi-dart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/widgrensit%2Fasobi-dart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/widgrensit","download_url":"https://codeload.github.com/widgrensit/asobi-dart/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/widgrensit%2Fasobi-dart/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32508912,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asobi","client-sdk","dart","flutter","game-backend","gamedev","multiplayer","sdk"],"created_at":"2026-04-04T17:52:02.610Z","updated_at":"2026-05-01T19:00:39.090Z","avatar_url":"https://github.com/widgrensit.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# asobi\n\nDart client SDK for the [Asobi](https://github.com/widgrensit/asobi) game backend. Works with Flutter, Flame, and standalone Dart applications.\n\nPure Dart — no Flutter dependency. Minimal footprint (only `http` + `web_socket_channel`).\n\n## Installation\n\n```bash\ndart pub add asobi\n```\n\n## Run a backend first\n\nThe SDK talks to an Asobi server. The fastest way to get one is the canonical SDK demo backend:\n\n```bash\ngit clone https://github.com/widgrensit/sdk_demo_backend\ncd sdk_demo_backend \u0026\u0026 docker compose up -d\n```\n\nThat serves at `http://localhost:8084` (HTTP + WebSocket on `/ws`) with a 2-player `demo` mode. For the full reference game (arena shooter, boons, modifiers, bots) see [`asobi_arena_lua`](https://github.com/widgrensit/asobi_arena_lua).\n\n## Quick Start\n\n```dart\nimport 'dart:async';\n\nimport 'package:asobi/asobi.dart';\n\nFuture\u003cvoid\u003e main() async {\n  final client = AsobiClient('localhost', port: 8084);\n\n  // Register, falling back to login if the user already exists.\n  try {\n    await client.auth.register('player1', 'secret123', displayName: 'Player One');\n  } on AsobiException catch (e) {\n    if (e.statusCode == 409) {\n      await client.auth.login('player1', 'secret123');\n    } else {\n      rethrow;\n    }\n  }\n\n  // Wait for the WS handshake before queuing.\n  final connected = Completer\u003cvoid\u003e();\n  client.realtime.onConnected.stream.listen((_) {\n    if (!connected.isCompleted) connected.complete();\n  });\n\n  // Server pushes match.matched (matchmaker push) or match.joined (reply to a\n  // client-initiated match.join). Subscribe to both for the matchmade flow.\n  client.realtime.onMatchmakerMatched.stream.listen((m) async {\n    print('Matched into ${m.matchId} — joining…');\n    await client.realtime.joinMatch(m.matchId);\n  });\n\n  client.realtime.onMatchState.stream.listen((state) {\n    print('Tick — ${state.players.length} players');\n  });\n\n  await client.realtime.connect();\n  await connected.future.timeout(const Duration(seconds: 5));\n  await client.realtime.addToMatchmaker(mode: 'demo');\n}\n```\n\nA complete runnable example is at [`example/example.dart`](example/example.dart). For an end-to-end console demo (register → matchmake → state → finish) see [`example/dart_console_demo.dart`](example/dart_console_demo.dart).\n\n## Features\n\n| Feature | REST | WebSocket |\n|---------|------|-----------|\n| Auth | Register, login, token refresh | - |\n| Players | Profiles, updates | - |\n| Matchmaker | Queue, status, cancel | Real-time match found |\n| Matches | List, details | State sync, input, events |\n| Leaderboards | Top scores, around player, submit | - |\n| Economy | Wallets, store, purchases | - |\n| Inventory | Items, consume | - |\n| Social | Friends, groups, chat history | Chat messages, presence |\n| Tournaments | List, join | - |\n| Notifications | List, read, delete | Real-time push |\n| Storage | Cloud saves, key-value | - |\n\n## Flutter\n\nThe SDK is pure Dart but works fine inside Flutter apps. Hold the `AsobiClient` in whatever DI container you use (Riverpod, GetIt, an `InheritedWidget`) and dispose it when the app exits.\n\n```dart\nclass _MyAppState extends State\u003cMyApp\u003e {\n  late final AsobiClient _client = AsobiClient('localhost', port: 8084);\n\n  @override\n  void dispose() {\n    _client.dispose();\n    super.dispose();\n  }\n\n  @override\n  Widget build(BuildContext context) =\u003e\n      StreamBuilder\u003cMatchState\u003e(\n        stream: _client.realtime.onMatchState.stream,\n        builder: (_, snap) =\u003e Text('Players: ${snap.data?.players.length ?? 0}'),\n      );\n}\n```\n\n## Flame Integration\n\nFor Flame games, use [flame_asobi](https://github.com/widgrensit/flame_asobi) which provides Flame-native components and mixins on top of this SDK.\n\n## Wire protocol\n\nSee the [WebSocket protocol guide](https://github.com/widgrensit/asobi/blob/main/guides/websocket-protocol.md).\n\n## License\n\nApache-2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwidgrensit%2Fasobi-dart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwidgrensit%2Fasobi-dart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwidgrensit%2Fasobi-dart/lists"}