SaaSClaw
Studio
← Back to Help Center

☕ Java SDK

Spring Boot Starter for embedding SaaSClaw in your Java applications.

Overview

The SaaSClaw Java SDK is a Spring Boot Starter that provides auto-configured client beans for the SaaSClaw REST API. Use it to create projects, trigger deploys, send agent messages, and manage files — all from your Java application with type-safe DTOs and automatic token refresh.

💡 When to use it. Server-to-server integration: your Java backend needs to programmatically create SaaSClaw projects, deploy apps, or drive the AI wizard without a browser.

Installation

Maven

<dependency>
  <groupId>com.saasclaw</groupId>
  <artifactId>saasclaw-spring-boot-starter</artifactId>
  <version>0.1.0-SNAPSHOT</version>
</dependency>

Gradle

implementation 'com.saasclaw:saasclaw-spring-boot-starter:0.1.0-SNAPSHOT'

Configuration

saasclaw:
  base-url: https://saasclaw.ai
  # Option 1: API key (recommended for servers)
  api-key: sk_...
  # Option 2: Email/password (auto-login + refresh)
  email: [email protected]
  password: secret

You only need one auth method. API keys are recommended for production — generate them from Account → API Keys in the SaaSClaw dashboard.

Quick Start

@Autowired
private SaaSClawClient client;

// List projects
List<ProjectDto> projects = client.listProjects();

// Create a project
client.createProject(new ProjectCreateRequest("My App", "desc", "spring-boot"));

// Deploy
DeployStatus status = client.deploy("my-app");

// Send agent message
MessageDto msg = client.sendMessage("my-app", sessionId, "Add a login page");

// Stream SSE responses
client.streamMessages("my-app", sessionId, "Build a dashboard", event -> {
    System.out.println(event.getType() + ": " + event.getData());
});

Authentication

The SDK supports two authentication methods:

🔒 Security: API key management endpoints require JWT (not API key) to prevent privilege escalation. Use JWT auth for key management, API keys for everything else.

Available Operations

Spring Boot Deploy Support

Beyond the SDK, SaaSClaw natively deploys Java / Spring Boot applications:

FAQ

Where is the source code?

The Java SDK is open-source at github.com/saasclawai-org/saasclaw-java-sdk. It includes 33 tests and full auto-configuration.

What Java version is required?

Java 21+ (JDK 21). The SDK uses the modern java.net.http.HttpClient for HTTP requests and SSE streaming.

Does it work without Spring Boot?

The SDK is designed as a Spring Boot Starter with auto-configuration. You can use the SaaSClawClient directly by instantiating it manually, but you'll lose the auto-configuration and bean injection.

Can I deploy Spring Boot apps from SaaSClaw?

Yes! SaaSClaw detects Spring Boot projects (@SpringBootApplication), builds them with Maven, and runs the resulting JAR via systemd. PostgreSQL databases are auto-provisioned with JDBC URLs injected as environment variables.

What's Next?