Product · · 2 min read

Introducing the TalkJS Kotlin Data API

A native, real-time Kotlin SDK for Android and JVM apps. Connect as a user, subscribe to chat data, and build fully custom chat experiences.

Introducing the TalkJS Kotlin Data API

Today, we’re introducing the TalkJS Kotlin Data API, a native, real-time SDK for connecting to TalkJS from Kotlin applications, including Android and JVM environments. 

The Kotlin Data API allows your app to connect as a specific user and read, subscribe to, and update chat data directly. It’s designed for modern mobile development and gives you full control over how chat is rendered in your application.

It’s available now on Maven Central as com.talkjs:core

Built for native Android development

The Kotlin Data API is designed to fit naturally into modern Android architecture. It provides native coroutine support, real-time updates via WebSockets, and a user-scoped authentication model. 

With the Data API, you can implement a fully-custom chat interface to fit your needs.

You manage the UI. TalkJS handles the real-time data layer.

Multi-platform by design

The SDK is built using Kotlin Multiplatform and currently supports:

This allows you to share chat-related logic across Android apps, desktop tools, or other JVM-based services.

Direct access to chat data

The Kotlin Data API is designed for native client applications where you need direct access to chat data and want to build your own chat UI. 

Each session connects as a single user. With a session established, you can:

Where it fits in the TalkJS ecosystem

The Kotlin Data API is the next step toward expanding native platform support across TalkJS. It complements other integration options across the TalkJS platform.

Prebuilt chat UI

Use UI Component SDKs for React Native, Flutter, React, and other popular frontend frameworks for a fully customizable, drop-in chat interface. 

Real-time chat data (client-side)

Use the Kotlin Data API for native Android applications, or the JavaScript Data API for browser and Node.js environments, to keep control over the interface and direct access to chat data.

Server or administrative access

Use the REST API for backend systems and server-wide admin operations.

Getting started

To get started, add the com.talkjs:core package to your project:

dependencies {
    implementation("com.talkjs:core:<latest_version>")
}

Replace <latest_version> with the latest available version. Then create a session:

import com.talkjs.core.TalkSessionOptions
import com.talkjs.core.getTalkSession

val session = getTalkSession(
    TalkSessionOptions(
        appId = "<APP_ID>", // Replace with your own app ID
        userId = "<USER_ID>", // Replace with a user ID
    )
)

You can then retrieve conversations, send messages, and subscribe to real-time updates.

Explore the Kotlin Data API documentation and begin building fully native chat experiences in your Kotlin applications.