Add Dependencies
Add the Cloud API to your build configuration. The version is fetched automatically from our Maven repository.Plugin Setup
Add the SimpleCloud API plugin as a dependency in your plugin descriptor:- Paper/Spigot (plugin.yml)
- Velocity (velocity-plugin.json)
- BungeeCord (bungee.yml)
Initialize the API
Default Configuration
When running inside a SimpleCloud server, the API auto-configures from environment variables:- Java
- Kotlin
Custom Configuration
For standalone applications or custom setups, provide configuration options:- Java
- Kotlin
Environment Variables
The API reads these environment variables by default:| Variable | Default | Description |
|---|---|---|
SIMPLECLOUD_NETWORK_ID | "default" | Your network identifier |
SIMPLECLOUD_NETWORK_SECRET | "" | Authentication secret |
SIMPLECLOUD_CONTROLLER_URL | "https://controller.platform.simplecloud.app" | Controller API endpoint |
SIMPLECLOUD_NATS_URL | "nats://platform.simplecloud.app:4222" | NATS server for events |
Inside SimpleCloud servers, these variables are set automatically. You only need to configure them for standalone applications or external services.
Best Practices
Use a single API instance
Use a single API instance
Create one
CloudApi instance and reuse it. Use dependency injection if your framework supports it.Handle async operations properly
Handle async operations properly
All API methods return
CompletableFuture. Don’t block on the main thread.Clean up event subscriptions
Clean up event subscriptions
Subscriptions implement
AutoCloseable. Close them when done.