Skip to content

Latest commit

 

History

History
76 lines (53 loc) · 5.17 KB

File metadata and controls

76 lines (53 loc) · 5.17 KB

Donate

Overview

Available Operations

  • getGoal - Get this month's donation goal progress

getGoal

Public — no auth required. Aggregated per calendar month (UTC). Carries no per-donor amounts.

Example Usage

import { SteamSets } from "@steamsets/client-ts";

const steamSets = new SteamSets({
  token: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await steamSets.donate.getGoal();

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { SteamSetsCore } from "@steamsets/client-ts/core.js";
import { donateGetGoal } from "@steamsets/client-ts/funcs/donateGetGoal.js";

// Use `SteamSetsCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const steamSets = new SteamSetsCore({
  token: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await donateGetGoal(steamSets);
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("donateGetGoal failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.DonateGetGoalResponse>

Errors

Error Type Status Code Content Type
errors.ErrorModel 500 application/problem+json
errors.SDKError 4XX, 5XX */*