Skip to content

Commit

Permalink
deprecate TwitchApiCallOptions#version
Browse files Browse the repository at this point in the history
  • Loading branch information
d-fischer committed Dec 14, 2020
1 parent 850f348 commit 4bc42a0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
8 changes: 4 additions & 4 deletions packages/twitch-api-call/src/TwitchApiCallOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@ export interface TwitchApiCallOptions {
scope?: string;

/**
* The Kraken API version to request with. Defaults to 5.
* Unused.
*
* If `type` is not `'kraken'`, this will be ignored.
* Twitch removed Kraken v3 long ago, so this serves no purpose anymore.
*
* Note that v3 will be removed at some point and v5 will be the only Kraken version left, so you should only use this option if you want to rewrite everything in a few months.
* This only still exists for compatibility in TypeScript.
*
* Internally, only v5 and Helix are used.
* @deprecated No replacement.
*/
version?: number;

Expand Down
5 changes: 1 addition & 4 deletions packages/twitch-api-call/src/apiCall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@ export async function callTwitchApiRaw(
const url = getTwitchApiUrl(options.url, type);
const params = stringify(options.query, { arrayFormat: 'repeat' });
const headers = new Headers({
Accept:
type === TwitchApiCallType.Kraken
? `application/vnd.twitchtv.v${options.version || 5}+json`
: 'application/json'
Accept: type === TwitchApiCallType.Kraken ? 'application/vnd.twitchtv.v5+json' : 'application/json'
});

let body: string | undefined;
Expand Down

0 comments on commit 4bc42a0

Please sign in to comment.