Skip to main content

Overview

The SkyTeamModule allows airline games to integrate with the SkyTeam alliance platform. This module handles client-server communication, API authentication, and real-time event synchronization.

Prerequisites

Before integrating the module, ensure you have:
  • A ROBLOX game with HTTP requests enabled
  • An API token from SkyTeam (contact alliance administrators)
  • TypeScript/roblox-ts setup (recommended) or Luau

Installation

1

Enable HTTP Requests

Enable HttpService in your game settings:
  1. Open Game Settings in ROBLOX Studio
  2. Navigate to Security
  3. Enable “Allow HTTP Requests”
2

Add the Module

Place the SkyTeamModule in your game’s ServerScriptService or import it via your package manager:
import SkyTeamModule from "@skyteam/module";
3

Configure the Module

Create a new instance of the module with your settings:
apps/models/src/loader/main.server.ts
import SkyTeamModule from "module";

const SkyTeam = new SkyTeamModule({
  TOKEN: "your-api-token-here",
  Flags: ["feature-flag-1", "feature-flag-2"],
});

SkyTeam.Initialize();
Store your API token securely. Never commit tokens to version control.
4

Verify Installation

Check the server output for initialization messages. If successful, you should see no errors and the RemoteEvent .SKYTEAM_CLIENT_RUNTIME will be created in ReplicatedStorage.

Configuration

Settings Interface

The module accepts a Settings object with the following properties:
apps/models/src/module/index.ts
export interface Settings {
  TOKEN: string;      // Your SkyTeam API authentication token
  Flags: string[];    // Feature flags for your airline
}
PropertyTypeRequiredDescription
TOKENstringYesAuthentication token provided by SkyTeam
Flagsstring[]YesArray of feature flags for experimental features

API Endpoint

By default, the module connects to:
public API: string = "http://localhost:4000";
For production, update this to your SkyTeam API endpoint:
const SkyTeam = new SkyTeamModule({
  TOKEN: process.env.SKYTEAM_TOKEN,
  Flags: ["production"],
});

SkyTeam.API = "https://api.skyteam.dev";
SkyTeam.Initialize();

Module Architecture

Server-Side Components

The module creates the following components when initialized:
  1. RemoteEvent - Named .SKYTEAM_CLIENT_RUNTIME in ReplicatedStorage
  2. Client Scripts - Automatically distributed to PlayerGui for each player
  3. HTTP Service Testing - Validates that HTTP requests are enabled

Client Communication

The module uses a typed event system for client-server communication:
apps/models/src/module/shared/CommunicationTypes.d.ts
export interface EventTypes {
  SERVER_INIT_ERROR: ServerInitErrorArgs;
  UNKNOWN: UnknownArgs;
}

export interface ServerInitErrorArgs {
  Body: string;
}

Error Handling

The module includes built-in error handling for common issues:

HTTP Service Not Enabled

If HTTP requests are disabled, players will receive a SERVER_INIT_ERROR event:
apps/models/src/module/index.ts
this.TestServices().catch((err) => {
  warn(err);
  this.InitalizationError = err;
  this.PublicError("SERVER_INIT_ERROR", {
    Body: `SkyTeam module failed to initialize. Please contact a developer. Error: ${err}`,
  });
});

Late-Joining Players

Players who join after an initialization error will still receive the error notification:
apps/models/src/module/index.ts
Players.PlayerAdded.Connect((Player) => {
  const ClientScript = script.WaitForChild("client").Clone();
  ClientScript.Parent = Player.WaitForChild("PlayerGui");

  if (this.InitalizationError) {
    this.PublicError("SERVER_INIT_ERROR", {
      Body: this.InitalizationError,
    });
  }
});

Best Practices

Never hardcode your API token in scripts. Use environment variables or secure configuration systems:
// Bad
const TOKEN = "abc123token";

// Good
const TOKEN = game:GetService("ServerStorage"):FindFirstChild("Config").Token.Value;
Monitor the InitalizationError property to detect issues:
if (SkyTeam.InitalizationError) {
  warn("SkyTeam failed to initialize:", SkyTeam.InitalizationError);
  // Implement fallback behavior
}
Use feature flags to enable experimental features or airline-specific functionality:
const SkyTeam = new SkyTeamModule({
  TOKEN: apiToken,
  Flags: [
    "enable-miles-tracking",
    "advanced-analytics",
    "beta-features"
  ],
});

Testing

Test your integration in ROBLOX Studio:
  1. Start a local server test
  2. Check the Output window for initialization messages
  3. Verify the RemoteEvent exists in ReplicatedStorage
  4. Test with HttpService disabled to verify error handling

Troubleshooting

IssueSolution
Module fails to initializeVerify HTTP requests are enabled in game settings
”Invalid API key” errorsCheck that your TOKEN is correct and active
Client scripts not loadingEnsure the module script contains a client child
RemoteEvent not foundVerify Initialize() was called after construction

Next Steps

API Integration

Learn how to use the SkyTeam API from your game

Discord Setup

Connect your airline to Discord notifications

Build docs developers (and LLMs) love