Skip to content

Commit

Permalink
chore: deprecate buildAuthorization
Browse files Browse the repository at this point in the history
  • Loading branch information
wescopeland committed Oct 12, 2024
1 parent 5a37923 commit 6162a84
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/utils/public/buildAuthorization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,19 @@ import type { ApiAuthorization } from "./models";
* webApiKey: "LtjCwW16nJI7cqOyPIQtXk8v1cfF0tmO"
* });
* ```
*
* @deprecated You can just pass your API key directly to the functions instead, eg:
* ```ts
* const game = await getGame(webApiKey, { gameId: 14402 });
* ```
*/
export const buildAuthorization = (
options: ApiAuthorization
): ApiAuthorization => {
if (!options.username || !options.webApiKey) {
if (
typeof options !== "string" &&
(!options.username || !options.webApiKey)
) {
throw new Error(`
buildAuthorization() requires an object containing a
username and webApiKey. eg:
Expand Down

0 comments on commit 6162a84

Please sign in to comment.