SDK Integration
Build integrations with explicit timeouts and a scoped service identity.
Create a client#
The reference JavaScript SDK provides typed resource methods and normalizes API errors. Inject the endpoint and token through configuration rather than placing credentials in application source.
import { UniverseClient } from "@digital-universe/sdk";
const client = new UniverseClient({
endpoint: "https://api.universe.example",
token: process.env.DU_TOKEN,
timeoutMs: 10000
});
const services = await client.services.list({
project: "catalog",
environment: "staging"
});Keep retries bounded#
Configure a maximum attempt count and an overall deadline. Use idempotency keys for create operations that may be retried after a connection interruption. Do not retry a failed write unless its semantics are understood.
| Option | Suggested starting value |
|---|---|
timeoutMs | 10000 |
maxAttempts | 3 |
retryBackoffMs | 250 |
Test without production credentials#
Use a mocked transport and fixture responses for unit tests. Integration tests should use an isolated project with a restricted service identity and an explicit cleanup policy.