Overview
The StrataGateway TypeScript SDK is intended to provide a typed interface over the StrataGateway REST API, enabling infrastructure automation with first-class TypeScript support.
The StrataGateway TypeScript SDK is currently planned and is not yet publicly available. Package names, methods, resource types, authentication behavior, and SDK interfaces may change before release.
Planned installation
The SDK is not yet published to npm. The command below illustrates the planned installation method.
Illustrative package name
Install (illustrative)
npm install @stratagateway/sdkImportant: The final package name and distribution method will be confirmed before public release.
Status: Planned
Client setup
Initialize the SDK client with your API token. The example below uses the planned preview syntax.
Preview syntax
Client initialization (preview)
import { StrataGateway } from "@stratagateway/sdk";
const strata = new StrataGateway({
token: process.env.STRATA_API_TOKEN,
});Note: This syntax is illustrative. The final SDK may use a different instantiation pattern. Do not assume the package currently resolves from npm.
Authentication
The SDK is expected to use the same API token authentication model as the REST API.
Set your API token via the STRATA_API_TOKENenvironment variable and pass it to the client.
Authentication via environment variable
import { StrataGateway } from "@stratagateway/sdk";
const strata = new StrataGateway({
token: process.env.STRATA_API_TOKEN,
});Security
Never hardcode API tokens directly into source code or commit them to version control. Use environment variables or a secrets manager.
See Authentication for the API token model.
Creating an instance
Provision a new compute instance using the planned instances resource. The example below uses illustrative SDK API syntax.
Illustrative SDK API
Create instance (preview)
const instance = await strata.instances.create({
name: "web-prod-01",
region: "fra-1",
plan: "compute-standard",
image: "ubuntu-24.04-lts",
sshKeys: ["key_8f3a9b1c"],
});
console.log(instance.id);Illustrative result
Illustrative response
{
id: "inst_7a91c2",
name: "web-prod-01",
status: "provisioning",
region: "fra-1"
}Provisioning is expected to be asynchronous. The initial response returns a provisioning status. Final provisioning times are not yet defined and may vary by region, plan, and platform load.
Listing instances
List all instances or retrieve a single instance by its identifier.
List all instances
List instances
const instances = await strata.instances.list();
for (const instance of instances.data) {
console.log(instance.name, instance.status);
}Get a single instance
Get instance
const instance = await strata.instances.get("inst_7a91c2");Exact response types are not finalized.
Working with networks
Create and manage private networks using the planned networks resource.
Preview syntax
Create network (preview)
const network = await strata.networks.create({
name: "production-private",
region: "fra-1",
cidr: "10.10.0.0/24",
});See Networking for the network resource model.
Working with firewalls
Create and manage firewall policies using the planned firewalls resource.
Preview syntax
Create firewall (preview)
const firewall = await strata.firewalls.create({
name: "web-production",
rules: [
{
direction: "inbound",
protocol: "tcp",
port: "443",
source: "0.0.0.0/0",
action: "allow",
},
],
});See Firewalls for the firewall policy model.
SSH keys
Manage SSH keys for instance access using the planned SSH keys resource.
Preview syntax
Add SSH key (preview)
const key = await strata.sshKeys.create({
name: "Personal Laptop",
publicKey: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAI...",
});Security note: The SDK must only receive public SSH key material. Private keys must remain on the user's trusted device.
See SSH Keys for the key management model.
Error handling
Illustrative TypeScript error handling pattern:
Try/catch example
try {
await strata.instances.get("inst_example");
} catch (error) {
console.error(error);
}A planned typed error class concept:
In Development
Planned StrataError concept
class StrataError extends Error {
code: string;
message: string;
requestId: string;
status: number;
constructor(code: string, message: string, requestId: string, status: number) {
super(message);
this.name = "StrataError";
this.code = code;
this.requestId = requestId;
this.status = status;
}
}Possible properties:
The final SDK error hierarchy is still being designed.
Type safety
The SDK is intended to provide comprehensive TypeScript definitions for:
Illustrative type definition:
Illustrative
Illustrative InstanceStatus type
type InstanceStatus =
| "provisioning"
| "running"
| "stopped"
| "rebuilding"
| "deleting"
| "error";Async operations
Infrastructure operations such as provisioning, rebuilding, and deleting are expected to be asynchronous. The SDK is planned to return an initial response with a provisioning status.
Async provisioning pattern
const instance = await strata.instances.create({...});
console.log(instance.status);
// "provisioning"Do not assume specific polling intervals or provisioning time guarantees. Final SDK helpers for waiting/polling are still under design.
Environment variables
The SDK is expected to respect the following environment variable:
Environment variable
STRATA_API_TOKEN=your_token_hereNode.js usage:
Node.js environment access
const token = process.env.STRATA_API_TOKEN;REST API relationship
The TypeScript SDK is intended to provide typed abstractions over the same platform API used by the REST API, CLI, and other tooling.
Architecture layer
TypeScript Application
→ StrataGateway SDK
→ REST API
→ StrataGateway Control PlaneSee REST API for the underlying HTTP resource model.
Next steps
Next
Python SDKREST API
Resource-oriented HTTP API reference.
Authentication
Token-based authentication and identity boundaries.
CLI
Terminal-native infrastructure workflows.
Python SDK
Python client workflows for infrastructure automation.
Terraform Provider
Declarative infrastructure-as-code provisioning.
Cloud Compute
Provision and manage compute instances.
Was this page helpful?