diff --git a/src/utils/public/buildAuthorization.ts b/src/utils/public/buildAuthorization.ts index 4419bc6..738710a 100644 --- a/src/utils/public/buildAuthorization.ts +++ b/src/utils/public/buildAuthorization.ts @@ -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: