{"id":15069206,"url":"https://github.com/uakihir0/kbsky","last_synced_at":"2025-08-31T15:19:31.014Z","repository":{"id":214073879,"uuid":"735265237","full_name":"uakihir0/kbsky","owner":"uakihir0","description":"Kotlin multiplatform Bluesky/ATProtocol library.","archived":false,"fork":false,"pushed_at":"2025-07-21T08:38:49.000Z","size":5680,"stargazers_count":54,"open_issues_count":10,"forks_count":7,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-21T10:14:01.999Z","etag":null,"topics":["ios","js","jvm","kotlin","kotlin-library","kotlin-multiplatform","macos"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/uakihir0.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2023-12-24T09:23:14.000Z","updated_at":"2025-07-21T08:10:20.000Z","dependencies_parsed_at":"2024-01-02T05:22:48.427Z","dependency_job_id":"73e7eab0-e92a-401c-9958-19d3a4edc6c5","html_url":"https://github.com/uakihir0/kbsky","commit_stats":{"total_commits":147,"total_committers":3,"mean_commits":49.0,"dds":0.4217687074829932,"last_synced_commit":"ebfb8089ec3ee4e6c5046a671fab3b67a47ee861"},"previous_names":["uakihir0/kbsky"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/uakihir0/kbsky","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uakihir0%2Fkbsky","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uakihir0%2Fkbsky/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uakihir0%2Fkbsky/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uakihir0%2Fkbsky/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uakihir0","download_url":"https://codeload.github.com/uakihir0/kbsky/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uakihir0%2Fkbsky/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272996389,"owners_count":25028120,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-31T02:00:09.071Z","response_time":79,"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":["ios","js","jvm","kotlin","kotlin-library","kotlin-multiplatform","macos"],"created_at":"2024-09-25T01:41:02.153Z","updated_at":"2025-08-31T15:19:31.008Z","avatar_url":"https://github.com/uakihir0.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e [日本語](./docs/README_ja.md)\n\n# kbsky\n\n\u003c!-- ![Maven metadata URL](https://img.shields.io/maven-metadata/v?metadataUrl=https%3A%2F%2Frepo.repsy.io%2Fmvn%2Fuakihir0%2Fpublic%2Fwork%2Fsocialhub%2Fkbsky%2Fcore%2Fmaven-metadata.xml) --\u003e\n![Maven Central Version](https://img.shields.io/maven-central/v/work.socialhub.kbsky/all)\n\n![badge][badge-jvm]\n![badge][badge-ios]\n![badge][badge-mac]\n![badge][badge-windows]\n![badge][badge-linux]\n\n**This library is a Bluesky/ATProtocol client library compatible\nwith [Kotlin Multiplatform](https://kotlinlang.org/docs/multiplatform.html).**\nIt depends on [khttpclient] and uses Ktor Client internally. Therefore, this library can be used on any platform\nsupported by Kotlin Multiplatform and Ktor Client. The behavior on each platform depends on [khttpclient].\nAlso, due to limitations of KtorClient, on which [khttpclient] depends, the\nstream package is not available on Linux platforms.\n\n## Usage\n\nBelow is how to use it with Kotlin on the supported platforms using Gradle.  \n**If you are using it on an Apple platform, please refer\nto [kbsky-cocoapods](https://github.com/uakihir0/kbsky-cocoapods).**  \nAdditionally, please check the test code as well.\n\n### Stable (Maven Central)\n\n```kotlin:build.gradle.kts\nrepositories {\n    mavenCentral()\n}\n\ndependencies {\n+   implementation(\"work.socialhub.kbsky:core:0.3.0\")\n+   implementation(\"work.socialhub.kbsky:auth:0.3.0\")\n+   implementation(\"work.socialhub.kbsky:stream:0.3.0\")\n}\n```\n\n### Snapshot\n\n```kotlin:build.gradle.kts\nrepositories {\n+   maven { url = uri(\"https://repo.repsy.io/mvn/uakihir0/public\") }\n}\n\ndependencies {\n+   implementation(\"work.socialhub.kbsky:core:0.4.0-SNAPSHOT\")\n+   implementation(\"work.socialhub.kbsky:auth:0.4.0-SNAPSHOT\")\n+   implementation(\"work.socialhub.kbsky:stream:0.4.0-SNAPSHOT\")\n}\n```\n\n### Using as part of a regular Java project\n\nAll of the above can be added to and used in regular Java projects, too. All you have to do is to use the suffix `-jvm` when listing the dependency.\n\nHere is a sample Maven configuration:\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ework.socialhub.kbsky\u003c/groupId\u003e\n    \u003cartifactId\u003ecore-jvm\u003c/artifactId\u003e\n    \u003cversion\u003e[VERSION]\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n### Starting a Session\n\n#### Authentication with Password\n\nTo start a session by specifying a handle and password, do as follows:\n\n```kotlin\nval response = BlueskyFactory\n    .instance(BSKY_SOCIAL.uri)\n    .server()\n    .createSession(\n        ServerCreateSessionRequest().also {\n            it.identifier = HANDLE\n            it.password = PASSWORD\n        }\n    )\n\nprintln(response.data.accessJwt)\n```\n\nTo access various resources with the obtained access token, execute the following:\n\n```kotlin\nval auth = BearerTokenAuthProvider(accessJwt)\n\nBlueskyFactory\n    .instance(BSKY_SOCIAL.uri)\n    .feed()\n    .post(\n        FeedPostRequest(auth).also {\n            it.text = \"Hello World!\"\n        }\n    )\n```\n\n#### Authentication with OAuth\n\nAuthentication using a password is gradually being replaced with OAuth. For more details on OAuth authentication, please\nrefer to [Authentication via OAuth](./docs/OAUTH.md).\n\n### PLC Directory\n\n```kotlin\nval response = PLCDirectoryFactory\n    .instance()\n    .DIDDetails(did)\n\nprintln(checkNotNull(response.data.alsoKnownAs)[0])\n```\n\n### SubscribeRepos (stream)\n\n```kotlin\nval stream = ATProtocolStreamFactory\n    .instance(\n        apiUri = BSKY_SOCIAL.uri,\n        streamUri = BSKY_NETWORK.uri\n    )\n    .sync()\n    .subscribeRepos(\n        SyncSubscribeReposRequest().also {\n            it.filter = listOf(\n                \"app.bsky.feed.post\"\n            )\n        }\n    )\n\nstream.eventCallback(\n    object : EventCallback {\n        override fun onEvent(\n            cid: String?,\n            uri: String?,\n            record: RecordUnion\n        ) {\n            print(record)\n        }\n    })\n```\n\n## License\n\nMIT License\n\n## Author\n\n[Akihiro Urushihara](https://github.com/uakihir0)\n\n[khttpclient]: https://github.com/uakihir0/khttpclient\n\n[badge-android]: http://img.shields.io/badge/-android-6EDB8D.svg\n\n[badge-android-native]: http://img.shields.io/badge/support-[AndroidNative]-6EDB8D.svg\n\n[badge-wearos]: http://img.shields.io/badge/-wearos-8ECDA0.svg\n\n[badge-jvm]: http://img.shields.io/badge/-jvm-DB413D.svg\n\n[badge-js]: http://img.shields.io/badge/-js-F8DB5D.svg\n\n[badge-js-ir]: https://img.shields.io/badge/support-[IR]-AAC4E0.svg\n\n[badge-nodejs]: https://img.shields.io/badge/-nodejs-68a063.svg\n\n[badge-linux]: http://img.shields.io/badge/-linux-2D3F6C.svg\n\n[badge-windows]: http://img.shields.io/badge/-windows-4D76CD.svg\n\n[badge-wasm]: https://img.shields.io/badge/-wasm-624FE8.svg\n\n[badge-apple-silicon]: http://img.shields.io/badge/support-[AppleSilicon]-43BBFF.svg\n\n[badge-ios]: http://img.shields.io/badge/-ios-CDCDCD.svg\n\n[badge-mac]: http://img.shields.io/badge/-macos-111111.svg\n\n[badge-watchos]: http://img.shields.io/badge/-watchos-C0C0C0.svg\n\n[badge-tvos]: http://img.shields.io/badge/-tvos-808080.svg\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuakihir0%2Fkbsky","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuakihir0%2Fkbsky","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuakihir0%2Fkbsky/lists"}