Home - xMistt/FortniteRuby GitHub Wiki

Here is how you can start using FortniteRuby:

To begin, you need to require FortniteRuby, create an instance of FortniteClient & authenticate.

require 'fortniteruby'

# An authorization code is a one-time code that can be used to generate an access token.
# It is a much better solution than email & password due to captcha restricting automation.

# You can get one from: https://www.epicgames.com/id/logout?redirectUrl=https%3A//www.epicgames.com/id/login%3FredirectUrl%3Dhttps%253A%252F%252Fwww.epicgames.com%252Fid%252Fapi%252Fredirect%253FclientId%253D3446cd72694c4a4485d81b77adbb2141%2526responseType%253Dcode

client = FortniteClient.new(authorization_code="cade611bedc14c8dab0c68bcf4d5d692")
client.authenticate()
Attributes
  • display_name [String] - Display name of the Epic Games account.
  • access_token [String] - Access token which can be used to perform requests on the Epic Games API.
  • refresh_token [String] - Refresh token which can be used to refresh the access token after it expires.
  • access_expires_at [DateTime] - When the access token expires (recommended to refresh token at this time).
  • refresh_expires_at [DateTime] - When the current refresh token expires.

client.authenticate()

Function to authenticate with the Epic Games API through exchange code. Recommended to do this straight after creating the FortniteClient instance to set the access_token attribute

Returns

nil


client.fetch_account(name)

Function to fetch account information and returns a FortniteUser object.

Parameters
  • name [String] - The account display name you want to find.
Returns

FortniteUser object containing display_name, id, and external_auths.