@yaelouuu/fortnite-api 5.1.0 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/client.d.ts CHANGED
@@ -49,9 +49,9 @@ export declare class FortniteAPI {
49
49
  /**
50
50
  * Internal method to make HTTP requests
51
51
  */
52
- request<T>(endpoint: string, options?: RequestInit, version?: "v1" | "v2" | "v3"): Promise<T>;
52
+ request<T>(endpoint: string, options?: RequestInit, version?: "v1" | "v2"): Promise<T>;
53
53
  /**
54
54
  * Internal method for multipart/form-data requests (file uploads)
55
55
  */
56
- requestMultipart<T>(endpoint: string, formData: FormData, version?: "v1" | "v2" | "v3"): Promise<T>;
56
+ requestMultipart<T>(endpoint: string, formData: FormData, version?: "v1" | "v2"): Promise<T>;
57
57
  }
@@ -9,7 +9,7 @@ class BattlePassResource {
9
9
  * Get current battle pass items
10
10
  */
11
11
  async getBattlePass() {
12
- return this.client.request("/battlepass");
12
+ return this.client.request("/shop/battlepass");
13
13
  }
14
14
  }
15
15
  exports.BattlePassResource = BattlePassResource;
@@ -29,7 +29,7 @@ export declare class QuestsResource {
29
29
  *
30
30
  * **Authentication**: Requires user's personal Fortnite OAuth token
31
31
  *
32
- * **API Version**: v3
32
+ * **API Version**: v2
33
33
  *
34
34
  * **Rate Limit**: Standard API rate limits apply
35
35
  *
@@ -31,7 +31,7 @@ class QuestsResource {
31
31
  *
32
32
  * **Authentication**: Requires user's personal Fortnite OAuth token
33
33
  *
34
- * **API Version**: v3
34
+ * **API Version**: v2
35
35
  *
36
36
  * **Rate Limit**: Standard API rate limits apply
37
37
  *
@@ -56,7 +56,7 @@ class QuestsResource {
56
56
  headers: {
57
57
  "x-fortnite-token": fortniteToken,
58
58
  },
59
- }, "v3");
59
+ }, "v2");
60
60
  }
61
61
  }
62
62
  exports.QuestsResource = QuestsResource;
@@ -33,12 +33,26 @@ export declare class TournamentsResource {
33
33
  }, fortniteToken: string): Promise<any>;
34
34
  /**
35
35
  * Get tournament leaderboard
36
- * @param params.eventId - Event ID
37
- * @param params.eventWindowId - Event window ID
36
+ *
37
+ * The `leaderboardDef` parameter serves two distinct purposes depending on the tournament type:
38
+ *
39
+ * **1. Ranked Cup (rank-tier leaderboards)**
40
+ * Pass the rank-tier def ID found in `eventWindow.metadata.defaultLeaderboardByRank`.
41
+ * The server resolves this to a different internal window ID to return rank-filtered results.
42
+ * Example: `"ranked_br_division_7"`
43
+ *
44
+ * **2. Cumulative leaderboard**
45
+ * Pass the cumulative def ID found in `eventWindow.scoreLocations` where
46
+ * `isMainWindowLeaderboard === false`. The server forwards this as Epic's `sm=` query param,
47
+ * returning the combined leaderboard across all sessions in the same group (e.g. Day 1 + Day 2).
48
+ * Example: `"S40_FNCSMajor1_PlayInStage_CumulativeLeaderboardDef"`
49
+ *
50
+ * @param params.eventId - Event ID (e.g. `"epicgames_S40_FNCSMajor1_PlayInStage_EU"`)
51
+ * @param params.eventWindowId - Event window ID (e.g. `"S40_FNCSMajor1_PlayInStage_Day1_EU"`)
38
52
  * @param params.page - Page number (default: 0)
39
- * @param params.leaderboardDef - Optional leaderboard definition
40
- * @param params.accountId - Optional account ID to highlight
41
- * @param fortniteToken - Optional user's Fortnite token for personalized view
53
+ * @param params.leaderboardDef - Optional leaderboard definition ID (Ranked Cup tier or cumulative def)
54
+ * @param params.accountId - Optional account ID highlights that player in the response
55
+ * @param fortniteToken - Optional user's Fortnite access token for personalized view
42
56
  */
43
57
  getLeaderboard(params: {
44
58
  eventId: string;
@@ -49,12 +49,26 @@ class TournamentsResource {
49
49
  }
50
50
  /**
51
51
  * Get tournament leaderboard
52
- * @param params.eventId - Event ID
53
- * @param params.eventWindowId - Event window ID
52
+ *
53
+ * The `leaderboardDef` parameter serves two distinct purposes depending on the tournament type:
54
+ *
55
+ * **1. Ranked Cup (rank-tier leaderboards)**
56
+ * Pass the rank-tier def ID found in `eventWindow.metadata.defaultLeaderboardByRank`.
57
+ * The server resolves this to a different internal window ID to return rank-filtered results.
58
+ * Example: `"ranked_br_division_7"`
59
+ *
60
+ * **2. Cumulative leaderboard**
61
+ * Pass the cumulative def ID found in `eventWindow.scoreLocations` where
62
+ * `isMainWindowLeaderboard === false`. The server forwards this as Epic's `sm=` query param,
63
+ * returning the combined leaderboard across all sessions in the same group (e.g. Day 1 + Day 2).
64
+ * Example: `"S40_FNCSMajor1_PlayInStage_CumulativeLeaderboardDef"`
65
+ *
66
+ * @param params.eventId - Event ID (e.g. `"epicgames_S40_FNCSMajor1_PlayInStage_EU"`)
67
+ * @param params.eventWindowId - Event window ID (e.g. `"S40_FNCSMajor1_PlayInStage_Day1_EU"`)
54
68
  * @param params.page - Page number (default: 0)
55
- * @param params.leaderboardDef - Optional leaderboard definition
56
- * @param params.accountId - Optional account ID to highlight
57
- * @param fortniteToken - Optional user's Fortnite token for personalized view
69
+ * @param params.leaderboardDef - Optional leaderboard definition ID (Ranked Cup tier or cumulative def)
70
+ * @param params.accountId - Optional account ID highlights that player in the response
71
+ * @param fortniteToken - Optional user's Fortnite access token for personalized view
58
72
  */
59
73
  async getLeaderboard(params, fortniteToken) {
60
74
  const { eventId, eventWindowId, page = 0, leaderboardDef, accountId, } = params;
@@ -85,7 +99,7 @@ class TournamentsResource {
85
99
  * @param fortniteToken - User's Fortnite access token (from OAuth flow)
86
100
  */
87
101
  async getTracker(accountId, fortniteToken) {
88
- return this.client.request(`/tournament-tracker?accountId=${accountId}`, {
102
+ return this.client.request(`/events/tracker?accountId=${accountId}`, {
89
103
  headers: {
90
104
  "x-fortnite-token": fortniteToken,
91
105
  },
@@ -108,7 +122,7 @@ class TournamentsResource {
108
122
  if (options?.requiredTournaments) {
109
123
  params.append("requiredTournaments", options.requiredTournaments.toString());
110
124
  }
111
- return this.client.request(`/tournament-eligibility?${params.toString()}`, {
125
+ return this.client.request(`/events/tracker/eligibility?${params.toString()}`, {
112
126
  headers: {
113
127
  "x-fortnite-token": fortniteToken,
114
128
  },
@@ -43,7 +43,7 @@ class WeaponsResource {
43
43
  * Get rarity definitions (colors, display names, backend values)
44
44
  */
45
45
  async getRarityDefinitions() {
46
- return this.client.request("/rarity", {}, "v2");
46
+ return this.client.request("/weapons/rarity", {}, "v2");
47
47
  }
48
48
  }
49
49
  exports.WeaponsResource = WeaponsResource;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yaelouuu/fortnite-api",
3
- "version": "5.1.0",
3
+ "version": "6.0.0",
4
4
  "description": "SDK for Fortnite Tournaments API by Royal Arena - Author : Yael Brinkert",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",