{"id":19466915,"url":"https://github.com/jaredkrinke/ez-steam-api","last_synced_at":"2026-05-04T18:38:03.038Z","repository":{"id":182681606,"uuid":"668473267","full_name":"jaredkrinke/ez-steam-api","owner":"jaredkrinke","description":"A simple, synchronous C API for (in-game) Steam achievements, leaderboards, and language selection, along with a JavaScript FFI wrapper","archived":false,"fork":false,"pushed_at":"2024-02-03T18:04:39.000Z","size":42,"stargazers_count":3,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-26T14:57:52.390Z","etag":null,"topics":["c","javascript","steam","steamworks","wrapper"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/ez-steam-api","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit-0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jaredkrinke.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-07-19T22:34:57.000Z","updated_at":"2025-09-12T02:10:14.000Z","dependencies_parsed_at":"2023-07-20T23:28:54.333Z","dependency_job_id":"f151bfcf-3842-4f68-bf00-d4bb2a90028b","html_url":"https://github.com/jaredkrinke/ez-steam-api","commit_stats":null,"previous_names":["jaredkrinke/ez-steam-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jaredkrinke/ez-steam-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaredkrinke%2Fez-steam-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaredkrinke%2Fez-steam-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaredkrinke%2Fez-steam-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaredkrinke%2Fez-steam-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jaredkrinke","download_url":"https://codeload.github.com/jaredkrinke/ez-steam-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaredkrinke%2Fez-steam-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32620367,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-04T10:08:07.713Z","status":"ssl_error","status_checked_at":"2026-05-04T10:08:02.005Z","response_time":58,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","javascript","steam","steamworks","wrapper"],"created_at":"2024-11-10T18:31:42.285Z","updated_at":"2026-05-04T18:38:03.002Z","avatar_url":"https://github.com/jaredkrinke.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ez-steam-api\nThis is a synchronous/blocking, flat, C-style wrapper around the [Steamworks SDK](https://partner.steamgames.com/doc/sdk), originally designed for use via foreign function interfaces.\n\nThis repository also includes [a Node/JavaScript wrapper](js/README.md) that is based on [Koffi](https://koffi.dev/). I used that wrapper for an Electron-based game on Steam.\n\n## Motivation\nThe Steamworks API is native C++, with an optional flat/C-style API. Unfortunately, I found both provided options cumbersome in my project, for a few reasons:\n\n* Callbacks are designed to be polled each frame--a hassle for event-driven environments\n* Callbacks and call results are C++ member functions, with no out-of-the-box support for blocking (synchronous results) or promises\n* The language I was using (JavaScript) doesn't have a good C++ interop story (whereas C interop is ubiquitous)\n\n## Design\nInternally, ez-steam-api spins up a thread for running Steam's callbacks and takes care of marshaling results back to calling threads (who just see a trivial synchronous API).\n\nThe synchronous, flat API can be trivially used with C-based foreign function interfaces that many languages provide. See the JavaScript wrapper in this repository for an example.\n\n## Functionality and status\nCurrently, this library only exposes the functionality I needed for my game (listed below). Note: The code quality is \"hobby ready\" (as opposed to \"production ready\"). I have tested on Windows (VS 2019) and Linux (G++ 9) only.\n\n* Retrieve player's \"persona name\" (display name)\n* Retrieve the player's preferred language for this game\n* Get, set, and persist achievements\n* Set leaderboard scores\n* Retrieve friends' leaderboard scores\n\nFeel free to open an issue or pull request to add additional functionality.\n\n## Usage\nFor Electron/Node/JavaScript usage, see [the README for the npm package](js/README.md).\n\nHere is an example using the C API:\n\n```c\n#include \u003cstdlib.h\u003e\n#include \u003cstdio.h\u003e\n#include \"ez-steam-api.h\"\n\nint main(int argc, char** argv) {\n    unsigned int app_id = 12345; // Replace with your app id\n    int should_exit = 0;\n\n    // Initialize Steam\n    if (!ez_steam_start(app_id, \u0026should_exit)) {\n        return -1;\n    }\n    else if (should_exit) {\n        return 0;\n    }\n\n    // Print the user's \"persona\" (display) name\n    char* name = 0;\n    if (ez_steam_user_name_get(\u0026name)) {\n        printf(\"Name: %s\\n\", name);\n        ez_steam_string_free(name);\n    }\n\n    // Print the user's language selection for this app/game\n    char *language = 0;\n    if (ez_steam_app_language_get(\u0026language)) {\n        printf(\"Language: %s\\n\", language);\n        ez_steam_string_free(language);\n    }\n\n    // Set an achievement (this assumes an achievement named \"FOOBAR\" exists for the app)\n    int newly_achieved = 0;\n    if (ez_steam_achievement_set(\"FOOBAR\", \u0026newly_achieved) \u0026\u0026 newly_achieved) {\n        ez_steam_achivements_store();\n    }\n\n    // Get a friend leaderboard (this assumes a leaderboard named \"Score\" exists for the app)\n    unsigned long long leaderboard = 0;\n    if (ez_steam_leaderboard_get(\"Score\", \u0026leaderboard)) {\n        char *json = 0;\n        if (ez_steam_leaderboard_get_friend_scores(leaderboard, \u0026json)) {\n            printf(\"Leaderboard as JSON: %s\\n\", json);\n            ez_steam_string_free(json);\n        }\n    }\n\n    ez_steam_stop();\n    return 0;\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaredkrinke%2Fez-steam-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaredkrinke%2Fez-steam-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaredkrinke%2Fez-steam-api/lists"}