Skip to content
Kysune edited this page May 5, 2019 · 10 revisions

Constructor options

const { Client } = require('epicgames-client');

let client = new Client({
  
  email: '',
  password: '',

  debug: null, // if you need console/file output with logs. Simple you can use `console.log`
  useWaitingRoom: true, // false to ignore waiting room (epicgames load balancer)

  http: {
    // settings for lib https://github.com/request/request
  }

});

Properties

  • build - Desktop's launcher version
  • UEBuild - Unreal Engine version
  • appName - Application name, everytime Launcher.
  • account - logged account's object
    • id
    • displayName
    • firstName
    • lastName
    • email
    • ageGroup
    • country
    • preferredLanguage
    • lastLogin
    • failedLoginAttempts

Methods

init()

Initialize client

login(options)

Login to an account.

  • options [Object] (optional)
    • email [String] (optional)
    • password [String] (optional)
    • twoFactorCode [String|Number|Function] (optional)

register(options)

Register an account.

  • options [Object]
    • country [String] - e.g. US, PL
    • firstName [String]
    • lastName [String]
    • displayName [String]
    • email [String]
    • password [String]
    • recaptchaResponse [String]

resendEmailVerification()

Resend e-mail verification.

logout()

Kill account's session on epicgames servers.

enableTwoFactor(type, twoFactorCode)

Enable two factor authentication. Returns object with secret and otpauth if successed or false on failature.

  • type [String] - authenticator or email
  • twoFactorCode [String|Integer|Function] Function have two parameters secret and otpauth
await client.enableTwoFactor('authenticator', (secret, otpauth) => {
  fs.writeFileSync('./secret.txt', secret);
  return authenticator.generateToken(secret);
})

disableTwoFactor(type)

Disable two factor authentication. Returns true or false.

  • type [String] - authenticator or email

isID(value)

Checks if value is account's id.

  • value [String]

isDisplayName(value)

Checks if value is account's display name.

  • value [String]

getEpicDomains()

Returns array of domains using by EpicGames.

runGame(game, options)

Returns game object or false if can't run game.

  • game [Object] - game library, e.g. epicgames-fortnite-client
  • options [Object] (optional) - game library constructor options

setLanguage(language)

  • language [String] - e.g. en, en-US, pl, pl-PL

getProfile(user)

Returns User object or false if user not found.

  • user [String] - user's display name or id

getProfiles(arr)

Returns array of User objects.

  • arr [Array] - Array with names or ids (can be mixed)

lookup(displayName)

Returns account's id, display name and extarnalAuths or false if user not found. I recommend use getProfile method.

  • displayName [String] - user's display name

getFriends([includePending=false])

Returns array of your friends (Friend objects).

  • includePending [Boolean] (optional) - whether including pending friends (invite requests).

getPendingFriends()

Returns array of your pending friends.

hasFriend(user)

Verifying given account is your friend.

  • user [String] - user's display name or id

getFriendsBlocklist()

Returns array of your blacklisted friends.

blockFriend(user)

Blocking a friend. Returns Friend or false depending on whether the operation was successful.

  • user [String] - user's display name or id

removeFriend(user)

Removing a friend. Returns Friend or false depending on whether the operation was successful.

  • user [String] - user's display name or id

inviteFriend(user)

Sending a friend invite request. Returns Friend or false depending on whether the operation was successful.

  • user [String] - user's display name or id

acceptFriendRequest(user)

Accepting friend's invitation. Alias for method inviteFriend

  • user [String] - user's display name or id

declineFriendRequest(user)

Declining friend's invitation. Alias for method removeFriend

  • user [String] - user's display name or id

getLauncherInfo()

Returns object with informations about the current client (build etc.).

getLauncherStatus()

Returns "DEPRECATED" or "NOT_DEPRECATED"