Quickstart
Get your first cloud service provisioned and ready in minutes.
You'll need an API key to follow this guide. See Authentication to create one.
1
Install the SDK
Install the PLATFORMA SDK using your preferred package manager:
npm install @platforma/sdk2
Initialize the client
Create a new file and initialize the PLATFORMA client with your API key:
import { Platforma } from "@platforma/sdk";
const client = new Platforma({
apiKey: process.env.PLATFORMA_API_KEY,
baseUrl: "https://api.platforma.cloud",
});3
List available products
Query the product catalog to see what services are available:
const products = await client.products.list({
status: "active",
limit: 10,
});
console.log(products.data);
// [{ id: "prod_vm_small", name: "Small VM", ... }, ...]4
Create your first order
Place an order for a cloud resource:
const order = await client.orders.create({
customer_id: "cust_abc123",
items: [
{
product_id: "prod_vm_small",
quantity: 1,
configuration: {
region: "eu-west-1",
os: "ubuntu-22.04",
},
},
],
});
console.log(order.id); // "ord_xyz789"
console.log(order.status); // "pending"5
Check provisioning status
Monitor the order status as the resource is provisioned:
const status = await client.orders.get(order.id);
console.log(status.status); // "provisioned"
console.log(status.resources[0]); // { type: "vm", ip: "10.0.1.42", ... }