Skip to main content

Getting Started

Welcome! This guide walks you through the minimum 3 steps to get Octopus SDK running in your app.

  • Step 1: Request your API key
  • Step 2: Install the SDK
  • Step 3: Display the UI

1) Get an API Key

Fill out the form to request your API key. Required fields: Email, First Name, Last Name. Company is optional.

Request an API Key

Fill in the details to receive your sandbox API key.

Company or project name.

2) Install the SDK

Choose your platform and install the SDK:

Add Maven Central and the dependencies in your Gradle files:

// build.gradle (project)
allprojects {
repositories {
google()
mavenCentral()
}
}

// build.gradle (module)
dependencies {
// Core SDK functionalities
implementation("com.octopuscommunity:octopus-sdk:<latest>")
// Compose UI components — required for step 3
implementation("com.octopuscommunity:octopus-sdk-ui:<latest>")

// Compose and Navigation, used directly by the step 3 snippet.
// The SDK uses them internally but does not expose them to your
// compile classpath, so declare them yourself.
implementation("androidx.activity:activity-compose:<latest>")
implementation("androidx.navigation:navigation-compose:<latest>")
}

Initialize the SDK early in your app (e.g., Application):

import com.octopuscommunity.sdk.OctopusSDK
import com.octopuscommunity.sdk.domain.model.ConnectionMode

class MyApp : Application() {
override fun onCreate() {
super.onCreate()
OctopusSDK.initialize(
context = this,
apiKey = BuildConfig.OCTOPUS_API_KEY, // store securely
connectionMode = ConnectionMode.OctopusAuth
)
}
}
Why connectionMode is explicit here

ConnectionMode.OctopusAuth lets Octopus handle sign-in, which is what makes the 3-step path work with no further wiring. The default is ConnectionMode.SSO() — your app owns the user — and in that mode the UI requires an onNavigateToLogin callback: without it the SDK throws as soon as a community screen renders. Pick SSO once you are ready to wire it, and follow the SDK Setup Guide rather than this page.

Replace <latest> with the current version and inject your API key via secure config.

3) Display the UI

Once the SDK is installed and initialized, present the community UI:

Add the OctopusHomeScreen composable — a complete screen with its own Scaffold and top bar. It navigates to the Octopus sub-screens through a NavHostController you own, so register octopusComposables() on the same NavHost:

import androidx.activity.compose.setContent
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.ui.Modifier
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import androidx.navigation.compose.rememberNavController
import com.octopuscommunity.sdk.ui.home.OctopusHomeScreen
import com.octopuscommunity.sdk.ui.octopusComposables

// in your Activity's onCreate
setContent {
val navController = rememberNavController()

NavHost(navController = navController, startDestination = "Home") {
composable("Home") {
OctopusHomeScreen(
navController = navController,
modifier = Modifier.fillMaxSize()
)
}

octopusComposables(navController = navController)
}
}

Use OctopusHomeContent instead to embed the community inside your own layout (a tab, a bottom sheet, your own Scaffold). The sample app in the Android repository ships one build variant per integration mode, so you can run the one closest to your app (it needs your API key in local.properties).