Official Java SDK for Stream Chat
Official Java API client for Stream Chat, a service for building chat applications.
Explore the docs Β»
JavaDoc
Β·
Code Samples
Β·
Report Bug
Β·
Request Feature
You can sign up for a Stream account at our Get Started page.
You can use this library to access chat API endpoints server-side.
For the client-side integrations (web and mobile) have a look at the JavaScript, iOS and Android SDK libraries (docs).
The Stream chat Java SDK requires Java 11+. It supports latest LTS.
The Stream chat Java SDK is compatible with Groovy, Scala, Kotlin and Clojure.
dependencies {
implementation "io.getstream:stream-chat-java:$stream_version"
}
<dependency>
<groupId>io.getstream</groupId>
<artifactId>stream-chat-java</artifactId>
<version>$stream_version</version>
</dependency>
dependencies {
implementation 'io.getstream:stream-chat-java:$stream_version'
}
You can see an example project at GetStream/stream-chat-groovy-example.
dependencies {
implementation 'io.getstream:stream-chat-java:$stream_version'
}
You can see an example project at GetStream/stream-chat-scala-example.
dependencies {
implementation("io.getstream:stream-chat-java:$stream_version")
}
You can see an example project at GetStream/stream-chat-kotlin-example.
:dependencies [[io.getstream/stream-chat-java "$stream_version"]]
You can see an example project at GetStream/stream-chat-clojure-example.
This SDK uses lombok (code generation), retrofit (http client), jackson (json) and jjwt (jwt).
You can find the exact versions in build.gradle.
If you have conflicts with our dependencies, you can use the shadowed (shaded) version of the library:
io.getstream:stream-chat-java-all:1.26.2
To configure the SDK you need to provide required properties
Property | ENV | Default | Required |
---|---|---|---|
io.getstream.chat.apiKey | STREAM_KEY | - | Yes |
io.getstream.chat.apiSecret | STREAM_SECRET | - | Yes |
io.getstream.chat.timeout | STREAM_CHAT_TIMEOUT | 10000 | No |
io.getstream.chat.url | STREAM_CHAT_URL | https://chat.stream-io-api.com | No |
You can also use your own CDN by creating an implementation of FileHandler and setting it this way
Message.fileHandlerClass = MyFileHandler.class
All setup must be done prior to any request to the API.
Java |
System.out.println(App.get().request()); |
Groovy |
println App.get().request() |
Scala |
println(App.get.request) |
Kotlin |
println(App.get().request()) |
Clojure |
println (.request (App/get)) |
Head over to DOCS.md for code snippets.
- If you get this exception:
java.lang.ClassNotFoundException: io.jsonwebtoken.SignatureAlgorithm
:
See shadowed version.
We welcome code changes that improve this library or fix a problem, please make sure to follow all best practices and add tests if applicable before submitting a Pull Request on Github. We are very happy to merge your code in the official repository. Make sure to sign our Contributor License Agreement (CLA) first. See our license file for more details.
Head over to CONTRIBUTING.md for some development tips.
We've recently closed a $38 million Series B funding round and we keep actively growing. Our APIs are used by more than a billion end-users, and you'll have a chance to make a huge impact on the product within a team of the strongest engineers all over the world.
Check out our current openings and apply via Stream's website.