Dependencies
Before you can use the Controller API, you need to add our dependencies to your project. Please refer to following guides, depending on your platform:Initialization
After adding the dependencies, you can initialize the Controller API.Initialize with Default Configuration
If you are using the Controller API in any platform, we automatically set the secret token withCONTROLLER_SECRET environment variable.
- Kotlin
- Java
Connect with Secret Token
- Kotlin
- Java
You can find your secret in
<installation-dir>/components/.secrets/auth.secretBest Practices
- Multiple Instances: Don’t create multiple instances of the Controller API. While it’s possible to create multiple instances, we don’t recommend it. Just create a single instance and use it everywhere (preferred with dependency injection).
- Asynchronous Operations: Use
Coroutinesfor asynchronous operations in Kotlin, orCompletableFuturefor Java. We don’t recommend using our API in sync operations. - Error Handling: We don’t throw any exceptions, we return
nullorFutureobjects. You should handle errors by yourself.