Installation
Any language: REST API · JavaScript/TypeScript: npm · Java: GitHub
Requirements
HTTP
No SDK needed. Any HTTP client works: curl, Python, Go, Ruby, PHP, etc.
- Portal endpoint and auth token
- That's it.
JavaScript
- Node.js 18+
- TypeScript 4.5+ (optional)
- Portal endpoint and auth token
Java
- Java 17+
- Portal endpoint and auth token
Install
HTTP
Nothing to install. Set your base URL and token:
export BASE_URL=http://localhost:3000
export AUTH_TOKEN=your-secret-token
JavaScript
npm install portal-sdk
Or yarn add portal-sdk / pnpm add portal-sdk.
Java
Gradle (build.gradle or build.gradle.kts):
repositories {
maven { url 'https://jitpack.io' }
}
dependencies {
implementation 'com.github.PortalTechnologiesInc:java-sdk:0.4.0'
}
Maven (pom.xml):
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
<dependency>
<groupId>com.github.PortalTechnologiesInc</groupId>
<artifactId>java-sdk</artifactId>
<version>0.4.0</version>
</dependency>
Use
HTTP
# Health check
curl -s $BASE_URL/health
# All requests use Bearer auth
curl -s $BASE_URL/version \
-H "Authorization: Bearer $AUTH_TOKEN"
See REST API for the full reference and async polling pattern.
JavaScript
import { PortalClient } from 'portal-sdk';
const client = new PortalClient({
baseUrl: 'http://localhost:3000',
authToken: 'your-auth-token'
});
Java
import cc.getportal.PortalClient;
import cc.getportal.PortalClientConfig;
PortalClient client = new PortalClient(
PortalClientConfig.create("http://localhost:3000", "your-auth-token")
);
See API Reference and the Java SDK.
Compatibility: the SDK
major.minorversion must match the SDK Daemon (getportal/sdk-daemon)major.minor. Patch versions are independent. See Versioning & Compatibility.