Appearance
@loontail/minecraft-kit v0.8.14 / AuthorizationCodeRunOptions
Type alias: AuthorizationCodeRunOptions
ts
type AuthorizationCodeRunOptions: {
clientId: AzureClientId;
onOpenBrowser: (url) => void | Promise<void>;
port: number;
signal: AbortSignal;
successHtml: string;
};Options accepted by kit.auth.authorizationCode.run.
Example
ts
import type { AuthorizationCodeRunOptions } from "@loontail/minecraft-kit";
const options: AuthorizationCodeRunOptions = {
onOpenBrowser: (url) => open(url),
successHtml: "<h1>Signed in — return to the launcher.</h1>",
};
const session = await kit.auth.authorizationCode.run(options);Type declaration
| Member | Type | Description |
|---|---|---|
clientId | AzureClientId | Azure AD application id. When omitted, the value of process.env.MINECRAFT_KIT_MSA_CLIENT_ID is used. Throws AUTH_MISSING_CLIENT_ID if neither is set — the library cannot ship a default client id. |
onOpenBrowser | (url) => void | Promise<void> | Called exactly once with the authorize URL. The caller is expected to open this URL in the user's system browser (e.g. / |
port | number | Loopback port to bind. Defaults to 0 (OS picks). |
signal | AbortSignal | Aborting cancels both the loopback server and the post-MS-token pipeline. |
successHtml | string | Optional HTML returned to the browser after a successful capture. |