Skip to content

@loontail/minecraft-kit v0.8.14 / asAzureClientId

Function: asAzureClientId()

ts
function asAzureClientId(raw): AzureClientId

Validate raw as an Azure AD application id and brand it as AzureClientId. Throws MinecraftKitError(INVALID_INPUT) if the input is empty or does not match the GUID-ish shape Azure uses (hex characters and dashes, at least 8 characters).

Parameters

ParameterType
rawstring

Returns

AzureClientId

Example

ts
import { asAzureClientId } from "@loontail/minecraft-kit";

const clientId = asAzureClientId(process.env.MSA_CLIENT_ID ?? "");
await kit.auth.authorizationCode.run({ clientId, onOpenBrowser });

Source

src/auth/client-id.ts:44

MIT License