pterowraptyl
    Preparing search index...

    Class AccountsModule

    Module for accessing Pterodactyl client account endpoints. This module provides methods to access account details, 2fa, update account information, etc.

    const account = await ptero.accounts.getAccount();
    console.log(account);
    Index

    Constructors

    Methods

    • Enables two-factor authentication for the authenticated user. This method requires the user's password and the code generated by the 2fa app (e.g. Google Authenticator). *

      Parameters

      Returns Promise<{ tokens: string[] }>

      const twoFaEnable = await ptero.accounts.enableTwoFa({code: twoFaCode, password: "userPassword"});
      console.log("Two-factor authentication enabled:", twoFaEnable);
    • Get the account details of the authenticated user.

      Returns Promise<Account>

      const account = await ptero.accounts.getAccount();
      console.log(account);
    • Generates string for 2fa QR code which can be used to set up 2fa in Pterodactyl.

      Returns Promise<TwoFactor>

      const twoFa = await ptero.accounts.getTwoFa();
      console.log(twoFa);