import { Latitudesh } from "latitudesh-typescript-sdk";
const latitudesh = new Latitudesh({
bearer: process.env["LATITUDESH_BEARER"] ?? "",
});
async function run() {
const result = await latitudesh.vpnSessions.create({
data: {
attributes: {
site: "SAO",
serverId: "sv_LMmAD8wyqwop2",
},
},
});
console.log(result);
}
run();{
"data": {
"id": "vpn_VLMmAD8EOwop2",
"type": "vpn_sessions",
"attributes": {
"user_name": "Cameron",
"password": "8EqcGL2tsQngWe",
"port": "8443",
"host": "fw04-mh1.maxi.host",
"region": {
"city": "São Paulo 277",
"country": "Brazil 290",
"site": {
"id": "loc_VE1Wd3wQdXnZJ",
"name": "São Paulo 277",
"slug": "SAO",
"facility": "São Paulo 277"
}
},
"expires_at": "2026-01-14T15:58:20+00:00",
"created_at": "2026-01-14T15:57:20+00:00",
"updated_at": "2026-01-14T15:57:20+00:00"
}
},
"meta": {}
}Creates a new VPN Session.
NOTE: The VPN credentials are only listed ONCE upon creation. They can however be refreshed or deleted.
import { Latitudesh } from "latitudesh-typescript-sdk";
const latitudesh = new Latitudesh({
bearer: process.env["LATITUDESH_BEARER"] ?? "",
});
async function run() {
const result = await latitudesh.vpnSessions.create({
data: {
attributes: {
site: "SAO",
serverId: "sv_LMmAD8wyqwop2",
},
},
});
console.log(result);
}
run();{
"data": {
"id": "vpn_VLMmAD8EOwop2",
"type": "vpn_sessions",
"attributes": {
"user_name": "Cameron",
"password": "8EqcGL2tsQngWe",
"port": "8443",
"host": "fw04-mh1.maxi.host",
"region": {
"city": "São Paulo 277",
"country": "Brazil 290",
"site": {
"id": "loc_VE1Wd3wQdXnZJ",
"name": "São Paulo 277",
"slug": "SAO",
"facility": "São Paulo 277"
}
},
"expires_at": "2026-01-14T15:58:20+00:00",
"created_at": "2026-01-14T15:57:20+00:00",
"updated_at": "2026-01-14T15:57:20+00:00"
}
},
"meta": {}
}Was this page helpful?