{"id":30031770,"url":"https://github.com/aptabase/aptabase-cpp","last_synced_at":"2025-08-06T20:48:48.162Z","repository":{"id":299072196,"uuid":"1001959223","full_name":"aptabase/aptabase-cpp","owner":"aptabase","description":null,"archived":false,"fork":false,"pushed_at":"2025-07-23T18:27:47.000Z","size":27,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-07-23T21:14:40.758Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aptabase.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-14T12:09:21.000Z","updated_at":"2025-07-23T18:27:50.000Z","dependencies_parsed_at":"2025-06-14T14:28:24.369Z","dependency_job_id":"d0cd2d6c-86ba-438f-bc70-a4d004b563fa","html_url":"https://github.com/aptabase/aptabase-cpp","commit_stats":null,"previous_names":["bloodredtape/aptabase-cpp","aptabase/aptabase-cpp"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/aptabase/aptabase-cpp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aptabase%2Faptabase-cpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aptabase%2Faptabase-cpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aptabase%2Faptabase-cpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aptabase%2Faptabase-cpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aptabase","download_url":"https://codeload.github.com/aptabase/aptabase-cpp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aptabase%2Faptabase-cpp/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269153442,"owners_count":24369359,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-06T02:00:09.910Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-08-06T20:48:47.268Z","updated_at":"2025-08-06T20:48:48.136Z","avatar_url":"https://github.com/aptabase.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Aptabase](https://aptabase.com/og.png)\r\n\r\n# C++ SDK for Aptabase\r\n\r\n## Design Goals\r\n\r\nThe Aptabase Client SDK for C++ was designed with versatility and flexibility as core principles, enabling integration across a wide spectrum of applications, from video games to web servers. This chapter outlines the design goals that guided the development of this SDK.\r\n\r\n### Adaptability to Various Execution Models\r\n\r\nOne of the primary design goals was to support different execution models, accounting for the diverse ways applications handle timing and processing:\r\n\r\n- **Application-Loop Ticking**: Support for applications that operate on a frame-by-frame basis, where the analytics events can be transported during the loop\r\n- **Thread-based Processing**: Compatibility with systems that prefer to allocate dedicated threads for analytics operations\r\n- **Boost-like Asynchronous Implementation**: Support for applications using asynchronous programming patterns similar to Boost.Asio, allowing for non-blocking operations (Work in progress)\r\n\r\n### Abstraction of Networking Implementation\r\n\r\nC++ offers numerous approaches to handling HTTP requests, ranging from platform-specific APIs to third-party libraries. To accommodate this diversity, we:\r\n\r\n- Implemented an abstract interface for HTTP operations, allowing different HTTP client implementations to be plugged in\r\n- Provided default implementations for cpp-httplib and boost, while making it easy to substitute custom networking code\r\n\r\n## Integration\r\n\r\nAptabase-cpp uses CMake as it's build system. It's user's responsibility to supply all dependencies. Also supplied networking implementation does not compile by default. \r\n\r\nCMake example with boost enabled\r\n\r\n```cmake\r\n# Code to include boost and openssl dependencies\r\n# Based on your setup, it may be add_subdirectory or find_package\r\n\r\nset(CMAKE_APTABASE_USE_BOOST ON)\r\nadd_subdirectory(path/to/aptabase-cpp)\r\n```\r\n\r\nCMake example with cpp-httplib enabled\r\n\r\n```cmake\r\n# Code to include cpp-httplib and openssl dependencies\r\n# Based on your setup, it may be add_subdirectory or find_package\r\n\r\nset(CMAKE_APTABASE_USE_HTTPLIB ON)\r\nadd_subdirectory(path/to/aptabase-cpp)\r\n```\r\n\r\n## Examples\r\n\r\nHere is minimal aptabase-cpp example, required to submit your first event to analytics system\r\n\r\n```c++\r\n#include \u003captabase/analytics.hpp\u003e\r\n#include \u003captabase/provider/worker_provider.hpp\u003e\r\n#include \u003captabase/net/httplib.hpp\u003e\r\n\r\nint main(){\r\n    std::string aptabase_app_key = \"\u003cYour app key\u003e\";\r\n    std::string aptabase_app_url = \"https://your.aptabase.url\"\r\n    bool aptabase_is_debug = true;\r\n\r\n    Aptabase::Analytics aptabase(\r\n\t\tstd::make_unique\u003cAptabase::HttplibHttpClient\u003e(),\r\n\t\taptabase_app_key,\r\n\t\taptabase_app_url\r\n\t\taptabase_is_debug\r\n    );\r\n\r\n    aptabase.StartSession();\r\n\taptabase.RecordEvent(\"TestEvent1\");\r\n    aptabase.EndSession();\r\n}\r\n\r\n```\r\n\r\nEvent may have additional attributes of std::string, float or double types\r\n\r\n```c++\r\n\r\naptabase.RecordEvent(\"TestEvent1\", {{\"Attribute1\", 0.f}, {\"Attribute2\", 234.0}, {\"Attribute3\", \"Value\"}});\r\n\r\n```\r\n\r\nBy default, unique sessionId is generated each StartSession call.\r\nCustom sessionId also can be provided.\r\n\r\n```c++\r\nstd::string customSessionId = \"12345\";\r\n\r\naptabase.StartSession(customSessionId);\r\naptabase.RecordEvent(\"TestEvent1\");\r\naptabase.EndSession();\r\n```\r\n\r\nSystem attributes can be supplied and/or changed in runtime.\r\n\r\n```c++\r\n\r\naptabase.SetLocale(\"en-US\");\r\naptabase.SetAppVersion(\"0.0.1\");\r\naptabase.SetOsName(\"Linux\");\r\naptabase.SetOsVersion(\"5.17\");\r\n\r\naptabase.SetDebug(true);\r\naptabase.RecordEvent(\"TestEvent1\");\r\naptabase.SetDebug(false);\r\naptabase.RecordEvent(\"TestEvent1\");\r\n```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faptabase%2Faptabase-cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faptabase%2Faptabase-cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faptabase%2Faptabase-cpp/lists"}