
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@4players/fleet
Advanced tools
Official TypeScript SDK for ODIN Fleet - Game Server Deployment Platform
Official TypeScript SDK for ODIN Fleet — Deploy and manage game servers globally.
npm install @4players/fleet
yarn add @4players/fleet
pnpm add @4players/fleet
import { FleetClient } from '@4players/fleet';
// Create client with your API token
const client = new FleetClient({
apiToken: 'your-api-token-from-console.4players.io'
});
// Select an app to work with
client.selectApp(123456);
// List all servers
const servers = await client.getServers();
console.log(servers);
// Create a new deployment
const deployment = await client.createDeployment({
name: 'EU Production',
serverConfigId: 789,
numInstances: 3,
placement: {
constraints: {
country: 'de',
city: 'frankfurt',
cityDisplay: '',
continent: '',
isProtected: false
}
}
});
import { FleetClient } from '@4players/fleet';
// Client works directly in browsers with native fetch
const client = new FleetClient({ apiToken: userToken });
// List available locations
const locations = await client.getLocations();
import { FleetClient } from '@4players/fleet';
const client = new FleetClient({
apiToken: process.env.FLEET_API_TOKEN!
});
client.selectApp(Number(process.env.FLEET_APP_ID));
// Start all servers
await client.startAllServersForApp();
import { FleetClient } from 'npm:@4players/fleet';
const client = new FleetClient({
apiToken: Deno.env.get('FLEET_API_TOKEN')!
});
// List all apps
const apps = await client.getApps();
// Create a new app
const app = await client.createApp({ name: 'My Game' });
// Select an app for subsequent operations
client.selectApp(app.data.id);
// List all images
const images = await client.getImages();
// Create a Docker image reference
const image = await client.createImage({
name: 'GameServer',
version: '1.0.0',
type: 'dockerImage',
os: 'linux',
dockerImage: {
imageName: 'ghcr.io/myorg/gameserver:1.0.0',
registryId: 123
}
});
// List all configs
const configs = await client.getConfigs();
// Create a new config
const config = await client.createConfig({
name: 'Production',
binaryId: image.data.id,
resourcePackageSlug: 'standard',
ports: [
{ name: 'Game Port', targetPort: 7777, protocols: ['udp'] }
],
env: [
{ key: 'SERVER_NAME', value: 'Production', type: 'static' }
],
mounts: [],
restartPolicy: { condition: 'any' }
});
// List all deployments
const deployments = await client.getDeployments();
// Create a deployment (starts servers)
const deployment = await client.createDeployment({
name: 'EU Production',
serverConfigId: config.data.id,
numInstances: 3,
placement: {
constraints: {
country: 'de',
city: 'frankfurt',
cityDisplay: '',
continent: '',
isProtected: false
}
}
});
// Scale deployment
await client.updateDeployment(deployment.data.id, {
name: 'EU Production',
numInstances: 5
});
// Delete deployment (stops all servers)
await client.deleteDeployment(deployment.data.id);
// List all running servers
const servers = await client.getServers();
// Get server details
const server = await client.getServer(serverId);
// Server lifecycle
await client.startServer(serverId);
await client.stopServer(serverId);
await client.restartServer(serverId);
// Get server logs
const logs = await client.getServerLogs(serverId, {
tail: 100,
timestamps: true
});
// Update server metadata for matchmaking
await client.updateServerMetadata(serverId, {
instance_state: 'occupied',
game_mode: 'deathmatch',
player_count: 8,
max_players: 16,
map_name: 'de_dust2'
});
// Mark server as available
await client.updateServerMetadata(serverId, {
instance_state: 'idle',
player_count: 0
});
// Create a backup
await client.createBackup(serverId, { name: 'Pre-update backup' });
// Restore from backup
await client.restoreBackup(serverId);
// Get download URL
const { data } = await client.getBackupDownloadUrl(serverId);
// Start/stop all servers for an app
await client.startAllServersForApp();
await client.stopAllServersForApp();
// Start/stop servers for a specific deployment
await client.startServersForDeployment(deploymentId);
await client.stopServersForDeployment(deploymentId);
The SDK provides typed error classes for different failure scenarios:
import {
FleetClient,
FleetError,
FleetAuthError,
FleetNotFoundError,
FleetNoAppSelectedError
} from '@4players/fleet';
try {
const servers = await client.getServers();
} catch (error) {
if (error instanceof FleetAuthError) {
console.error('Invalid API token');
} else if (error instanceof FleetNoAppSelectedError) {
console.error('Please select an app first');
} else if (error instanceof FleetNotFoundError) {
console.error('Resource not found');
} else if (error instanceof FleetError) {
console.error('Fleet API error:', error.message, error.statusCode);
}
}
All request and response types are available:
import type {
App,
Server,
ServerConfig,
Binary,
AppLocationSetting,
Location,
// Request types
StoreServerConfigRequest,
StoreAppLocationSettingRequest,
// Full OpenAPI types for advanced usage
paths,
components,
operations
} from '@4players/fleet';
const client = new FleetClient({
// Required: API token from console.4players.io
apiToken: 'your-api-token',
// Optional: Custom base URL (default: https://fleet.4players.io/api)
baseUrl: 'https://custom-fleet-url.com/api',
// Optional: Custom fetch implementation
fetch: customFetch
});
MIT © 4Players GmbH
FAQs
Official TypeScript SDK for ODIN Fleet - Game Server Deployment Platform
We found that @4players/fleet demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.