https://github.com/shinigami92/satisfactory-server-api-client
Universal Satisfactory Server API client for JavaScript
https://github.com/shinigami92/satisfactory-server-api-client
api-client api-wrapper coffeestain dedicated-server esm fetch fetch-api ky satisfactory typescript
Last synced: 3 months ago
JSON representation
Universal Satisfactory Server API client for JavaScript
- Host: GitHub
- URL: https://github.com/shinigami92/satisfactory-server-api-client
- Owner: Shinigami92
- Created: 2024-09-10T16:28:30.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-09-18T17:04:38.000Z (9 months ago)
- Last Synced: 2025-03-15T13:49:58.441Z (3 months ago)
- Topics: api-client, api-wrapper, coffeestain, dedicated-server, esm, fetch, fetch-api, ky, satisfactory, typescript
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/satisfactory-server-api-client
- Size: 253 KB
- Stars: 12
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Satisfactory Server API Client

[](https://www.npmjs.com/package/satisfactory-server-api-client)
[](https://www.npmjs.com/package/satisfactory-server-api-client)This is an unofficial HTTP API wrapper for Satisfactory Dedicated Server API.
The project is in an early state and will not document changelogs until v1.0.0 release.
If you want a specific API Endpoint prioritized, please open an issue.Official API Docs can be found at `Steam/steamapps/common/Satisfactory/CommunityResources/DedicatedServerAPIDocs.md` or at [satisfactory.wiki.gg HTTPS API](https://satisfactory.wiki.gg/wiki/Dedicated_servers/HTTPS_API).
You can obtain an `accessToken` by executing `server.GenerateAPIToken` in your server console.
## Usage
```ts
import { createClient } from "satisfactory-server-api-client";// If your dedicated server uses a self-signed certificate (generated by default),
// you can disable SSL verification by configuring the following environment variable.
//process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";const client = createClient({
accessToken: "",
});client.v1
.HealthCheck({
data: {
clientCustomData: "",
},
})
.then((response) => {
console.log("HealthCheck Response:", response);
});client.v1.VerifyAuthenticationToken().then(() => {
// response will be an empty string if valid
});client.v1.QueryServerState().then((response) => {
console.log("QueryServerState Response:", response);
});client.v1.GetServerOptions().then((response) => {
console.log("GetServerOptions Response:", response);
});client.v1.GetAdvancedGameSettings().then((response) => {
console.log("GetAdvancedGameSettings Response:", response);
});client.v1
.PasswordlessLogin({
data: {
minimumPrivilegeLevel: PrivilegeLevel.NotAuthenticated,
},
})
.then((response) => {
console.log("PasswordlessLogin Response:", response);
});client.v1
.PasswordLogin({
data: {
minimumPrivilegeLevel: PrivilegeLevel.NotAuthenticated,
password: "your-password",
},
})
.then((response) => {
console.log("PasswordLogin Response:", response);
});client.v1
.ApplyAdvancedGameSettings({
data: {
appliedAdvancedGameSettings: {
"FG.GameRules.NoPower": "False",
},
},
})
.then(() => {
// response will be an empty string if valid
});client.v1
.ClaimServer({
data: {
serverName: "your-server",
adminPassword: "your-password",
},
})
.then((response) => {
console.log("ClaimServer Response:", response);
});client.v1
.RenameServer({
data: {
serverName: "Shinigami-PC localhost",
},
})
.then(() => {
// response will be an empty string if valid
});client.v1.EnumerateSessions().then((response) => {
console.log("EnumerateSessions Response:", response);
});
```## See Also
- [wolveix/satisfactory-server](https://github.com/wolveix/satisfactory-server) - A Docker image for running a Satisfactory Dedicated Server.
- [satisfactory-server-prometheus-exporter](https://github.com/Shinigami92/satisfactory-server-prometheus-exporter) - A Prometheus Exporter for Satisfactory Dedicated Server.