Including the SDK

Language-specific instructions to include the SDK in your project are given below.


To use the Diatheke SDK in a C++ project, you must first download the SDK from Github.

git clone

To simplify the build process, the C++ SDK uses CMake, although it is possible to use a different build system with some additional work. Details for building and including the SDK in a C++ project are described in detail in this README file.


The Go SDK supports Go modules and requires Go 1.14 or later. To use the SDK, import this package into your application. For v2 of the SDK and later, be sure to include the version prefix in the import path (e.g., v2, v3, etc.).

import ""
When using Go, it is not necessary to download the SDK using git. The `go build` command will automatically fetch the sdk-diatheke code from GitHub to use in your Go project.


The Python SDK requires Python v3.5.0 or greater. The SDK may be installed from GitHub using pip as shown below, where <VERSION> is the specific version of the SDK the application is targeting (e.g., v1.3.0, v2.1.0, etc.)

# Replace <VERSION> with the desired SDK version
pip install "git+<VERSION>#egg=cobalt-diatheke&subdirectory=grpc/py-diatheke"

To get v1.3.0

pip install "git+"

To get v2.1.0

pip install "git+"

To get the latest master (not recommended for production)

pip install "git+"

Once installed, simply import the Diatheke module to use the SDK:

import diatheke


Swift Package Manager

The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift compiler.

Once you have your Swift package set up, adding swift-cubic as a dependency is as easy as adding it to the dependencies value of your Package.swift.

dependencies: [
    .package(url: "", .upToNextMajor(from: "2.1.0"))

Android (Java)

Support for Android/Java is provided via our official Maven package hosted on GitHub Packages. We provide two versions of the Java library, a full version and a lite version. Android users should use the lite version with its size and speed optimiaztions designed for mobile applications. All other Java users are encouraged to use the full version, which has better compatibility and more tooling.

This documentation assumes the use of Gradle for the build process. Integrating into the Gradle build process is a two step process. First you need to add a definition for Cobalt’s GitHub Maven Repository. Once this is done, adding SDK-Diatheke as a dependency is straight forward.

Adding Cobalt’s GitHub Maven Repository

In depth documentation for this step can be found in GitHub’s documentation.


GitHub requires that you authenticate with them, even for pulling a public package. You must create a Personal Access Token from GitHub via The generated token only needs access to read:packages.

Note: tokens should be kept private. We suggest storing it in that is then added to your .gitignore file. This file should have your username and token like this:

GITHUB_USER="<Your_GitHub_Username>"                     # Such as `cobaltspeech`
GITHUB_TOKEN="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" # Token generated from

Defining the Maven Repository

You can now point Gradle to our Maven repository with the credentials defined above. You will need to add that definition to the top level build.gradle file, typically under the allprojects.repositories section. The following will load your username and PAT from the file and then define the url and credentials to reach the Maven repository containing the SDK-Diatheke package.

// File: /build.gradle
buildscript { ... }
allprojects {
    repositories {
        // These two are usually already in your project.
        google()  // Adds
        jcenter() // Adds

        ////////// START //////////
        // First we load the username and access token from the file
        def githubPropertiesFile = rootProject.file("")
        def githubProperties = new Properties()
        githubProperties.load(new FileInputStream(githubPropertiesFile))

        // Now we define the new maven repository.
        maven {
            url = uri("")
            credentials {
               username = githubProperties['GITHUB_USER']  // Your github username
               password = githubProperties['GITHUB_TOKEN'] // Personal Access Token created from
        ////////// END //////////

Importing the SDK

Now we need to pull from the package from that defined Maven Repository. In your app/build.gradle, you will need to add the new dependencies.

// File: /app/build.gradle
plugins {...}
android {...}
dependencies {
    ... // Your other pre-existing dependencies.

    // Here we add the sdk-diatheke client library.
    implementation('com.cobaltspeech.diatheke:sdk-diatheke-lite:2.0.0-rc1') {
        // Note: we exclude the protobuf-javalite here because we import it below.
        exclude group: '', module: 'protobuf-javalite'
    // These dependencies allow your application to use gRPC over HTTP.
    implementation ''
    implementation 'com.squareup.okhttp:okhttp:2.7.5'
    implementation 'io.grpc:grpc-core:1.33.0'
    implementation 'io.grpc:grpc-stub:1.33.0'
    implementation 'io.grpc:grpc-okhttp:1.33.0'
    // end sdk-diatheke client library/dependencies