JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q66259F

Universal Satisfactory Server API client for JavaScript

Package Exports

  • satisfactory-server-api-client

Readme

Satisfactory Server API Client

Satisfactory

npm version npm downloads

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 GitHub wolveix/satisfactory-server Official API Docs.

You can obtain an accessToken by executing server.GenerateAPIToken in your server console.

Usage

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: "<your-access-token>",
});

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
  });