{"id":15722450,"url":"https://github.com/defold/extension-kaiads","last_synced_at":"2025-10-10T19:37:46.029Z","repository":{"id":146435025,"uuid":"339533569","full_name":"defold/extension-kaiads","owner":"defold","description":"Integration of the KaiAds SDK with the Defold game engine","archived":false,"fork":false,"pushed_at":"2024-04-15T07:59:32.000Z","size":44,"stargazers_count":5,"open_issues_count":1,"forks_count":3,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-10-29T20:05:19.278Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/defold.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,"publiccode":null,"codemeta":null}},"created_at":"2021-02-16T21:16:12.000Z","updated_at":"2024-10-06T18:21:01.000Z","dependencies_parsed_at":"2024-04-15T09:04:04.358Z","dependency_job_id":null,"html_url":"https://github.com/defold/extension-kaiads","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/defold/extension-kaiads","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defold%2Fextension-kaiads","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defold%2Fextension-kaiads/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defold%2Fextension-kaiads/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defold%2Fextension-kaiads/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/defold","download_url":"https://codeload.github.com/defold/extension-kaiads/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defold%2Fextension-kaiads/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279005033,"owners_count":26083827,"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-10-10T02:00:06.843Z","response_time":62,"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":"2024-10-03T22:07:44.132Z","updated_at":"2025-10-10T19:37:45.978Z","avatar_url":"https://github.com/defold.png","language":"C++","funding_links":[],"categories":["Libraries"],"sub_categories":["Programming Language"],"readme":"# KaiAds for Defold\nThis is an integration of the KaiAds SDK with the Defold game engine. The integration is created as a Defold native extension.\n\n## Installation\nTo use KaiAds in your Defold project, add the following URL to your game.project dependencies:\n\nhttps://github.com/defold/extension-kaiads/archive/main.zip\n\nWe recommend using a link to a zip file of [a specific release](https://github.com/refold/extension-kaiads/releases).\n\n## Usage\nThe following functions are available from Lua:\n\n* `kaiads.init(publisher)` - Initialize KaiAds with your publisher id\n* `kaiads.set_listener(fn)` - Callback function which will receive ad events\n* `kaiads.preload(configuration)` - Preload an ad using the provided JSON encoded Lua table with ad configuration values (see below)\n* `kaiads.show()` - Show the ad if it was successfully preloaded (event == kaiads.PRELOAD_OK)\n\nThe following ad events are available:\n\n* `PRELOAD_ERROR` - Error when preloading ad\n* `PRELOAD_OK` - Ad successfully preloaded\n* `SHOW_ERROR` - Error when showing ad\n* `AD_DISPLAY` - Ad successfully displayed on device\n* `AD_CLICK` - User clicked the ad\n* `AD_CLOSE` - User closed the ad\n\n### Configuration\nPossible values in the configuration table:\n\n* `app` = Optional, application name, used for reporting, for your own convenience\n* `slot` = Optional, ad slot name, used for reporting, for your own convenience\n* `container` = Id of HTML div to load banner ad in\n* `test` = Optional. Enable test mode. Please set this to 1 when testing the ad, 0 or omitted when in production.\n\nRefer to [KaiAds SDK documentation](https://www.kaiads.com/publishers/sdk.html) for more information on how to configure ads.\n\n### Example\n```Lua\nlocal json = require \"kaiads.json\"\n\nlocal function on_kaiads_event(self, event, code)\n\tif event == kaiads.PRELOAD_OK then\n\t\tprint(\"KaiAds has successfully preloaded an ad\")\n\t\tkaiads.show()\n\telseif event == kaiads.AD_DISPLAY then\n\t\tprint(\"KaiAds is showing an ad\")\n\telseif event == kaiads.AD_CLOSE then\n\t\tprint(\"The user closed the ad!\")\n\telseif event == kaiads.AD_CLICK then\n\t\tprint(\"The user clicked on the ad!\")\n\telse\n\t\tprint(\"Something went wrong\", code)\n\tend\nend\n\nfunction init(self)\n\tif kaiads then\n\t\tkaiads.set_listener(on_kaiads_event)\n\t\tkaiads.init(\"2b30c65e-efde-4930-990e-ded207899766\")\n\t\tlocal fullscreen_config = {\n\t\t\tapp = \"mygame\",\n\t\t\tslot = \"gameover\",\n\t\t}\n\t\tkaiads.preload(json.encode(fullscreen_config))\n\tend\nend\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdefold%2Fextension-kaiads","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdefold%2Fextension-kaiads","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdefold%2Fextension-kaiads/lists"}