You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
SmokeAPI/src/store_mode/store_api.cpp

19 lines
626 B
C++

#include <store_mode/store_api.hpp>
#include <koalabox/http_client.hpp>
namespace store::api {
std::optional<StoreConfig> fetch_store_config() noexcept {
try {
const String url =
"https://raw.githubusercontent.com/acidicoala/public-entitlements/main/steam/v2/store_config.json";
const auto kg_config_json = koalabox::http_client::fetch_json(url);
return kg_config_json.get<StoreConfig>();
} catch (const Exception& e) {
LOG_ERROR("Failed to fetch Store config from GitHub: {}", e.what())
return std::nullopt;
}
}
}