PlatformService
Reports the host platform and explicitly available features.
Required setup
Section titled “Required setup”No additional capability token. This service is available through the runtime; individual feature results still depend on the selected host.
The host is the program running your Luau code: normally the SDK’s native runner. Its provider/adapter implements an optional service. You do not need to write one to use a service already supplied by the SDK. Capabilities explains the manifest and remaining platform limits.
Example
Section titled “Example”Where to put it: replace Src/Main.luau in a project created with this SDK. This is the complete entry file.
local Window = Instance.new("Window", { Title = "LUI example", Size = UDim2.fromOffset(560, 280),})local Status = Instance.new("TextLabel", { Parent = Window, Text = "Ready", Position = UDim2.fromOffset(16, 170), Size = UDim2.new(1, -32, 0, 72),})local Platform = app:GetService("PlatformService")Status.Text = Platform.BackendName .. "; clipboard available: " .. tostring(Platform:Supports("Clipboard"))Window.Visible = trueExpected result: Reports the active host and whether clipboard support was installed/granted. It does not request permission or open a dialog.
Properties
Section titled “Properties”BackendName
Section titled “BackendName”Identifies the selected rendering host. Prefer Supports for feature decisions instead of assuming every host with this name has the same adapters.
Type: string. Read-only.
Methods
Section titled “Methods”Supports
Section titled “Supports”Checks an exact capability/feature name such as Clipboard, Storage or WindowLifecycle. An unknown name returns false. A true network grant does not bypass host destination policy.
Supports(Capability: string) -> booleanFull type declaration — for type checking and deeper reference
The declaration is generated from the SDK. Self is supplied by a colon call; read means the field cannot be assigned. See how to read this reference.
export type PlatformService = { read BackendName: string, read Supports: (Self: PlatformService, Capability: string) -> boolean,}Availability and deeper reading
Section titled “Availability and deeper reading”See platform limits before relying on host-specific behavior. The framework design specification and reflection/type sources are deeper engineering references, not extra setup required to build an app.