Streem Server SDK for Java & Kotlin

Related tags

SDK kotlin java sdk streem
Overview

Streem Server SDK for Java & Kotlin

Server-side JVM library for interacting with the Streem API, and generation of Streem Tokens for use in client SDKs or Embedded SSO.

Installation

Add the Streem SDK dependency to your project's build.gradle file:

dependencies {
    implementation("pro.streem:streem-server-sdk:0.1.1")
}

Usage

Initialization

Initialize the library with your API Key ID and Secret:

Kotlin

val streem = Streem.getInstance(
    apiKeyId = yourApiKeyId,
    apiKeySecret = yourApiKeySecret,
    apiEnvironment = targetEnvironment, // optional, defaults to "prod-us"
)

Java

var streem = Streem.getInstance(
    yourApiKeyId,
    yourApiKeySecret,
    targetEnvironment // optional, defaults to "prod-us"
);

Streem Tokens

To create a Streem Token, call the buildToken() method and then specify the details for the currently logged-in user via either a lambda block (Kotlin) or the returned TokenBuilder (Java):

Kotlin

val user = // an object that describes your logged-in user

// the user's ID is required to construct a token
val token = streem.buildToken(user.id) {
    // these fields are not required, but are recommended
    name = user.name
    email = user.email
    avatarUri = user.avatarUri

    // optional fields
    // Determines how long this token is valid for starting a session
    // (5 minutes is the default)
    tokenExpiration = Duration.ofMinutes(5))
    // Once the session has started, how long can the user remain logged in
    // (4 hours is the default) 
    sessionExpiration = Duration.ofHours(4)
}

Java

var user = // an object that describes your logged-in user

// the user's ID is required to construct a token
var token = streem.buildToken(user.id)
        // these fields are not required, but are recommended
        .name(user.name)
        .email(user.email)
        .avatarUri(user.avatarUri)

        // optional fields
        // Determines how long this token is valid for starting a session
        // (5 minutes is the default)
        .tokenExpiration(Duration.ofMinutes(5)) 
        // Once the session has started, how long can the user remain logged in
        // (4 hours is the default) 
        .sessionExpiration(Duration.ofHours(4))

        // Finally, call `build()` to generate the token string
        .build();

Embedded SSO

Embedded SSO allows you to create Streem Tokens server-side, and automatically log your users into the Streem web application.

First, provide the token created above to your front-end browser client. Next, place the token in the hash portion of any Streem web application URL, by appending #token=... with your token.

For example, to create an iframe to the root page in Streem, you might have:

<iframe src="https://{company-code}.streempro.app#token={token}" />

Be sure to substitute {company-code} and {token} for the correct values.

Streem Client SDKs

If using the iOS or Android SDKs, you will provide the Streem Token to the client, and pass to the Streem SDK via Streem.identify() (iOS) or Streem.login() (Android). More details can be found in the documentation of the individual SDKs.

API Reference

License

This repo is available as open source under the terms of the MIT License.

You might also like...
Implement a Casper Kotlin SDK to interact with the Casper network.
Implement a Casper Kotlin SDK to interact with the Casper network.

CSPR-Kotlin-SDK Kotlin SDK library for interacting with a CSPR node. What is CSPR-Kotlin-SDK? SDK to streamline the 3rd party Kotlin client integratio

Android Word/Letter Tracing SDK is a complet solution to build apps for kids learning in pure kotlin
Android Word/Letter Tracing SDK is a complet solution to build apps for kids learning in pure kotlin

Android Word/Letter Tracing SDK is a complet solution to build apps for kids learning in pure kotlin. It supports all kind of shapes and all language letters e.g. english, arabic, Urdu, hindi etc.

AWS SDK for Android. For more information, see our web site:

AWS SDK for Android For new projects, we recommend interacting with AWS using the Amplify Framework. The AWS SDK for Android is a collection of low-le

Countly Product Analytics Android SDK
Countly Product Analytics Android SDK

Countly Android SDK We're hiring: Countly is looking for Android SDK developers, full stack devs, devops and growth hackers (remote work). Click this

Android Real Time Chat & Messaging SDK
Android Real Time Chat & Messaging SDK

Android Chat SDK Overview Applozic brings real-time engagement with chat, video, and voice to your web, mobile, and conversational apps. We power emer

Evernote SDK for Android

Evernote SDK for Android version 2.0.0-RC4 Evernote API version 1.25 Overview This SDK wraps the Evernote Cloud API and provides OAuth authentication

Air Native Extension (iOS and Android) for the Facebook mobile SDK

Air Native Extension for Facebook (iOS + Android) This is an AIR Native Extension for the Facebook SDK on iOS and Android. It has been developed by Fr

Android Chat SDK built on Firebase
Android Chat SDK built on Firebase

Chat21 is the core of the open source live chat platform Tiledesk.com. Chat21 SDK Documentation Features With Chat21 Android SDK you can: Send a direc

Liquid SDK (Android)

Liquid Android SDK Quick Start to Liquid SDK for Android This document is just a quick start introduction to Liquid SDK for Android. We recommend you

Releases(v0.1.1)
Owner
Streem, Inc.
Streem, Inc.
Segmenkt - The SegmenKT Kotlin SDK is a Kotlin-first SDK for Segment

SegmenKT Kotlin SDK The SegmenKT Kotlin SDK is a Kotlin-first SDK for Segment. I

UNiDAYS 0 Nov 25, 2022
Sdk-android - SnapOdds Android SDK

Documentation For the full API documentation go to https://snapodds.github.io/sd

Snapodds 0 Jan 30, 2022
Frogo SDK - SDK Core for Easy Development

SDK for anything your problem to make easier developing android apps

Frogobox 10 Dec 15, 2022
Java/Kotlin WE contract SDK.

we-contract-sdk Java/Kotlin contract SDK used for building Docker smart contracts. All transaction handling is done via methods of a single class mark

Waves Enterprise 19 Oct 10, 2022
Its measurement app made using kotlin with sceneform sdk by google

ARCORE MEASUREMENT This app is build using sceneform sdk for android using kotlin language It helps you measure the distance between multiple points i

Kashif Mehmood 39 Dec 9, 2022
Storyblok Kotlin Multiplatform SDK sample (Android, JVM, JS)

storyblok-mp-SDK-sample *WIP* ... a showcase of the Storyblok Kotlin Multiplatform Client SDK. (Android, JVM, JS, iOS, ...) What's included ?? • About

Mike Penz 6 Jan 8, 2022
Kotlin Multi Platform SDK

Xeon SDK (work-in-progress ?? ??️ ??‍♀️ ⛏ ) Development Version Release This Is Latest Release ~ In Development $version_release = ~ What's New?? * I

Frogobox 3 Oct 15, 2021
NextPay Kotlin SDK

Welcome to nextpay-kt ?? Connect to NextPay.ir payment gateway in easy way. ?? Homepage Setup Kotlin KTS 1- Add mavenCentral() to your repositories se

Farhad 5 Nov 6, 2021
WalletConnect Kotlin SDK v2

WalletConnect V2 - Kotlin Kotlin implementation of WalletConnect v2 protocol for Android applications. Requirements Android min SDK 21 Java 11 Install

WalletConnect Labs 11 Dec 22, 2021
Official Appwrite Kotlin SDK 💙🧡

Appwrite Kotlin SDK This SDK is compatible with Appwrite server version 0.11.x. For older versions, please check previous releases. This is the Kotlin

Appwrite 47 Nov 26, 2022