Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/uakihir0/bsky4j
Bluesky/ATProtocol client for java
https://github.com/uakihir0/bsky4j
Last synced: 2 months ago
JSON representation
Bluesky/ATProtocol client for java
- Host: GitHub
- URL: https://github.com/uakihir0/bsky4j
- Owner: uakihir0
- License: mit
- Created: 2023-03-10T16:42:52.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-17T08:02:44.000Z (11 months ago)
- Last Synced: 2024-10-28T06:59:57.925Z (3 months ago)
- Language: Java
- Size: 355 KB
- Stars: 26
- Watchers: 3
- Forks: 7
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
- awesome-atproto - Bluesky/ATProtocol client for java
README
### **If you are using this library on the JVM platform, especially with Kotlin, we recommend that you migrate to [kbsky](https://github.com/uakihir0/kbsky). This library is being migrated to maintenance only.**
# bsky4j
[![](https://jitpack.io/v/uakihir0/bsky4j.svg)](https://jitpack.io/#uakihir0/bsky4j)
Java client library for the [Bluesky](https://blueskyweb.xyz/)/ATProtocol API. This can compile with [google/j2objc]() to Objective-C library. (for iOS and Mac OS)
## How to use
It is available with jitpack.io.
```
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}dependencies {
compile 'com.github.uakihir0:bsky4j:x.y.z'
}
```### CreateSession
```java
Response response = BlueskyFactory
.getInstance(Service.BSKY_SOCIAL.getUri())
.server().createSession(
ServerCreateSessionRequest.builder()
.identifier("HANDLE")
.password("PASSWORD")
.build()
);String accessJwt = response.get().getAccessJwt();
```### SendFeed
```java
Response response = BlueskyFactory
.getInstance(Service.BSKY_SOCIAL.getUri())
.feed().post(
FeedPostRequest.builder()
.accessJwt(accessJwt)
.text("Hello World!!")
.build()
);
```### PLC Directory
```java
Response response = PLCDirectoryFactory
.getInstance().getDIDDetails(did);System.out.println(response.get().getAlsoKnownAs().get(0));
```## Author
* [@uakihir0.com](https://bsky.app/profile/uakihir0.com)
* [Twitter:@uakihir0](https://twitter.com/uakihir0)## License
This software is released under the MIT License, see LICENSE.txt.