Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

3 Commits

Repository files navigation

ThreadSync Java SDK

Official Java SDK for the ThreadSync enterprise data integration API.

Java 11+License: MITVersion

Installation

Preview: SDKs are in preview and installed from GitHub via JitPack. Maven Central packages will be available at GA.

Gradle

// Add JitPack repository
repositories {
maven { url 'https://jitpack.io' }
}
dependencies {
implementation 'com.github.threadsync-infrastructure:threadsync-java:main-SNAPSHOT'
}

Maven

<!-- Add JitPack repository -->
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependency>
<groupId>com.github.threadsync-infrastructure</groupId>
<artifactId>threadsync-java</artifactId>
<version>main-SNAPSHOT</version>
</dependency>

Quick Start

importio.threadsync.sdk.ThreadSync;
importio.threadsync.sdk.models.*;
publicclassQuickStart {
publicstaticvoidmain(String[] args) {
// Initialize the clientThreadSyncts = ThreadSync.builder()
.bearerToken(System.getenv("THREADSYNC_API_TOKEN"))
.build();
// Connect to SalesforceConnectionsf = ts.connections().create("salesforce");
// Connect to your data warehouseConnectiondest = ts.connections().create("snowflake");
// Create a real-time syncSyncsync = ts.sync().create(
SyncConfig.builder()
.source(newEndpoint(sf.getId(), "Contact"))
.destination(newEndpoint(dest.getId(), "contacts"))
.schedule("realtime")
.build()
);
System.out.printf("Sync created: %s%n", sync.getId());
}
}

Configuration

ThreadSyncts = ThreadSync.builder()
.bearerToken("sk_test_...") // API key or JWT from /v1/auth/token
.baseUrl("https://api.threadsync.io") // Default
.connectTimeout(Duration.ofSeconds(10))
.readTimeout(Duration.ofSeconds(30))
.build();

Error Handling

try {
Connectionconn = ts.connections().get("conn_nonexistent");
} catch (ThreadSyncExceptione) {
System.err.println("Code: " + e.getCode()); // NOT_FOUNDSystem.err.println("Message: " + e.getMessage()); // Connection not foundSystem.err.println("Request ID: " + e.getRequestId()); // req_...
}

Documentation

License

MIT - see LICENSE for details.

About

Official Java SDK for ThreadSync's LLM Gateway and Magic Runtime. Multi-provider governed AI access with policy controls and audit trails.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages