Satisfactory Dedicated Server API
The satisfactory-dedicated-server-api
package provides a TypeScript / JavaScript client to interact with your Satisfactory Dedicated Server. With this package, you can:
- Manage server options
- Create, load, and save games
- Apply advanced game settings
- Query server state
- Run server commands
- Handle authentication (passwordless or password-based)
This guide is designed to help you get started quickly, whether you are a newcomer or an experienced developer.
Quick Start / Experienced Users
If you already know the basics and want a fast reference:
-
Install the package
- npm
- Yarn
npm install satisfactory-dedicated-server-api
yarn add satisfactory-dedicated-server-api
-
Import and initialize the API client
import { SatisfactoryApi } from 'satisfactory-dedicated-server-api';
const api = new SatisfactoryApi('127.0.0.1', 7777); -
Fetch and trust the server certificate
await api.initCertificate();
-
Perform a health check
const health = await api.healthCheck();
-
Log in (passwordless or password-based)
await api.passwordlessLogin(MinimumPrivilegeLevel.ADMINISTRATOR);
-
Refer to the API Reference for full details on methods, options, and error handling.
Installation
Install the package using npm or yarn:
- npm
- Yarn
npm install satisfactory-dedicated-server-api
yarn add satisfactory-dedicated-server-api
Basic Usage
Import and Initialize
import { SatisfactoryApi, MinimumPrivilegeLevel } from 'satisfactory-dedicated-server-api';
// Create a new API client instance connecting to your server at 127.0.0.1:7777
const api = new SatisfactoryApi('127.0.0.1', 7777);
Fetch and Trust the Server Certificate
Before using the API, you must fetch and trust the server's SSL certificate:
await api.initCertificate();
- This ensures the certificate is loaded and trusted by nodejs
SSL Certificates and Hostname Considerations
The API communicates with the server over HTTPS, which requires a valid SSL certificate. Node.js enforces two checks:
- Certificate validity – Is the certificate trusted by your system?
- Hostname matching – Does the certificate hostname match the server hostname you are connecting to?
If you connect using a local IP or a hostname that does not match the certificate, you may encounter a hostname mismatch error during TLS verification.
To bypass this in development or local testing, you can disable strict SSL verification:
const api = new SatisfactoryApi('127.0.0.1', 7777, { skipSSLVerification: true });
⚠️ Note: Only use this option in trusted environments (like local testing).
Do not disable SSL verification in production, as it removes protection against man-in-the-middle attacks.
For a proper fix, see Creating a Proper Self-Signed Certificate below.
✅ Creating a Proper Self-Signed Certificate
Instead of bypassing SSL checks, you can generate a self-signed certificate that matches your server’s hostname or IP. This ensures secure SSL validation without disabling hostname verification.
-
Go to your FactoryGame directory
-
Create a folder named
Certificates
inFactoryGame\
-
Create a file named
server.cnf
with the following content (replace<YOUR_IP_OR_HOSTNAME>
,<YOUR_IP>
, and<YOUR_HOSTNAME>
accordingly):[req]
default_bits = 2048
prompt = no
default_md = sha256
req_extensions = req_ext
distinguished_name = dn
[dn]
CN = <YOUR_IP_OR_HOSTNAME>
[req_ext]
subjectAltName = @alt_names
[alt_names]
IP.1 = <YOUR_IP>
DNS.1 = <YOUR_HOSTNAME> -
Run the following OpenSSL command in the
Certificates
folder to generate the key and certificate:openssl req -x509 -nodes -days 365 \
-newkey rsa:2048 \
-keyout private_key.pem \
-out cert_chain.pem \
-config server.cnf -extensions req_ext -
Restart your Satisfactory Dedicated Server to use the new certificate.
✅ After this setup your client can connect securely without using skipSSLVerification, and you keep the full security benefits of TLS while still working locally.
Health Check
The health check verifies that your server is online and responding.
const health = await api.healthCheck();
if (health.success) {
console.log('Server is online');
} else {
console.error('Server unreachable:', health.message);
}
- Returns
success: true
if the server responded, otherwisesuccess: false
with an error message. - Optionally provide custom client data or increase retries if needed.
✅ Quick way to confirm the server is reachable before performing other actions.
Authentication
The API requires authentication for most actions. You can log in using passwordless or password-based methods.
Passwordless Login
await api.passwordlessLogin(MinimumPrivilegeLevel.ADMINISTRATOR);
- Logs in without a password.
- Returns an authentication token stored automatically.
- Use
MinimumPrivilegeLevel
to request permissions (e.g.,ADMINISTRATOR
).
Password Login
await api.passwordLogin(MinimumPrivilegeLevel.ADMINISTRATOR, 'myAdminPassword');
- Logs in with a password.
- Returns and stores an authentication token.
- Useful when passwordless login is not enabled.
✅ After login, your API client can perform authenticated actions like managing games or server settings.
Query Server State
Retrieve the current status of your server.
const state = await api.queryServerState();
console.log(state.data);
- Returns info such as number of players online, active sessions, and more.
- Useful to check server status before performing actions.
Manage Server Options
Configure your server’s behavior.
import { ServerOptions, serverOptionsToDict } from 'satisfactory-dedicated-server-api';
const options: ServerOptions = {
DSAutoPause: true,
AutosaveInterval: 10,
};
await api.applyServerOptions(options);
DSAutoPause
pauses the server when no players are connected.AutosaveInterval
sets the save frequency (minutes).- Other options include
DSAutoSaveOnDisconnect
andNetworkQuality
. serverOptionsToDict
converts settings to the correct format automatically.
Advanced Game Settings
Customize gameplay rules and player abilities.
import { AdvancedGameSettings, AdvancedGameSettingsToDict } from 'satisfactory-dedicated-server-api';
const settings: AdvancedGameSettings = {
GodMode: true,
NoPower: true,
};
await api.applyAdvancedGameSettings(settings);
GodMode
makes players invincible.NoPower
disables power requirements for buildings.- Other options unlock tiers, remove build costs, or enable flight.
AdvancedGameSettingsToDict
converts settings to server format.
Game Management
Create a New Game
Start a new game session.
import { NewGameData } from 'satisfactory-dedicated-server-api';
const gameData: NewGameData = {
SessionName: 'FactoryWorld1',
MapName: 'Desert',
AdvancedGameSettings: { GodMode: true },
};
await api.createNewGame(gameData);
SessionName
is required.MapName
andStartingLocation
are optional.- Can include
AdvancedGameSettings
orCustomOptionsOnlyForModding
.
Save and Load Games
await api.saveGame('MySave1');
await api.loadGame('MySave1');
saveGame(saveName)
saves the current state.loadGame(saveName)
loads a previous save.- Enable advanced settings when loading:
await api.loadGame('MySave1', true);
✅ Useful for testing, backups, or switching sessions.
Running Commands
Execute console commands on the server.
await api.runCommand('GiveAllItems');
- Sends commands as if typed in the console.
- Useful for debugging, testing, or giving items.
Shutdown Server
Stop the server safely.
await api.shutdown();
// May restart automatically if configured as a service
- Sends a shutdown command.
- Useful for maintenance or updates.
Notes
- All API requests use HTTPS; call
initCertificate()
before any actions. FG.
prefix in settings is applied automatically by utility functions.- Methods like
uploadSaveGame()
are not implemented yet. - Use
MinimumPrivilegeLevel
to ensure sufficient permissions. - Handle errors using
APIError
andInvalidParameterError
.
Next Steps
- Explore the full API in API Reference.
- Combine
ServerOptions
andAdvancedGameSettings
for custom setups. - Handle failures programmatically using error classes. Learn more in the Error Handling Guid.