{"id":15722718,"url":"https://github.com/playfab/luasdk","last_synced_at":"2025-05-07T21:44:00.597Z","repository":{"id":10849942,"uuid":"66974900","full_name":"PlayFab/LuaSdk","owner":"PlayFab","description":"PlayFab Lua SDK for LuaDist command-line, Defold, and more","archived":false,"fork":false,"pushed_at":"2022-05-18T19:56:55.000Z","size":5289,"stargazers_count":40,"open_issues_count":1,"forks_count":10,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-03-31T14:21:57.436Z","etag":null,"topics":["corona","defold-game-engine","lua","playfab"],"latest_commit_sha":null,"homepage":"https://api.playfab.com/sdks/luasdk","language":"Lua","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PlayFab.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}},"created_at":"2016-08-30T20:20:28.000Z","updated_at":"2024-11-03T14:06:00.000Z","dependencies_parsed_at":"2022-08-09T11:40:19.076Z","dependency_job_id":null,"html_url":"https://github.com/PlayFab/LuaSdk","commit_stats":null,"previous_names":[],"tags_count":115,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PlayFab%2FLuaSdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PlayFab%2FLuaSdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PlayFab%2FLuaSdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PlayFab%2FLuaSdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PlayFab","download_url":"https://codeload.github.com/PlayFab/LuaSdk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252961829,"owners_count":21832189,"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","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":["corona","defold-game-engine","lua","playfab"],"created_at":"2024-10-03T22:09:03.576Z","updated_at":"2025-05-07T21:44:00.557Z","avatar_url":"https://github.com/PlayFab.png","language":"Lua","readme":"# LuaSdk README\n\n## 1. Community Support\n\nThis is a community supported SDK. \n\nFor new and existing users, you can use the current version as it is. The team at Microsoft would no longer be providing official support for those using this SDK. You can continue to get community support and updates at [PlayFab forums](https://community.playfab.com/index.html).\n\nWe are currently looking for reliable community partners to provide long-term support for this SDK. If you are interested to take ownership and provide future maintenance, let us know. \n\nWhat you have to do: \n* Fork this repo\n* Push your updates\n* Make sure you follow the Apache License, Version 2.0 guidelines for reproduction and modification, and document that Microsoft PlayFab is the original creator\n* Go to [PlayFab forums](https://community.playfab.com/index.html)\n* Write a post with a link to your forked repo so everyone knows about them\n\nWe're excited to hear from you. Thank you for your support and happy coding.\n\n## 2. Overview:\n\nThe PlayFab LuaSdk includes the files needed to make PlayFab HTTPS API calls within a Lua Project.\n\nCurrent supported platforms:\n* LuaDist console for Windows - Useful for evaluating/debugging\n* Defold - See our [Defold Readme](https://github.com/PlayFab/LuaSdk/tree/master/Defold)\n* Corona - See our [Corona Readme](https://github.com/PlayFab/LuaSdk/tree/master/Corona)\n* If your favorite Lua-engine/environment is not listed, let us know on the [Forums](https://community.playfab.com/index.html).\n\n\n## 3. Prerequisites:\n\n* Users should be very familiar with the topics covered in our [getting started guide](https://api.playfab.com/docs/general-getting-started).\n\nTo connect to the PlayFab service, your machine must be running TLS v1.2 or better.\n* For Windows, this means Windows 7 and above\n* [Official Microsoft Documentation](https://msdn.microsoft.com/en-us/library/windows/desktop/aa380516%28v=vs.85%29.aspx)\n* [Support for SSL/TLS protocols on Windows](http://blogs.msdn.com/b/kaushal/archive/2011/10/02/support-for-ssl-tls-protocols-on-windows.aspx)\n\n\n## 4. Contents:\n\n* PlayFabClientSDK - All files neccessary to make API calls to the PlayFab Client API\n * This is the SDK you should include in your game, and distribute to your players\n* PlayFabServerSdk - All files neccessary to make API calls to the PlayFab Server and Matchmaker API\n * This is the sdk you should optionally include in your live-server (if you have one)\n * For the security of your title, do not distribute any build which contains your devSecretKey\n* PlayFabSdk - Contains all API methods\n * Generally for evaluation or debugging, and some special case live-servers\n * For the security of your title, do not distribute any build which contains your devSecretKey\n\n\n## 5. LuaDist Example Instructions:\n\n* Download PlayFab LuaSdk, copy PlayFabClientSDK/PlayFab into your project folder\n * Specifically, your PlayFabClientApi.lua file should be located: {YourLuaProjectFolder}/PlayFab/PlayFabClientApi.lua\n* Add the following code in your main project (such as: {YourLuaProjectFolder}/main.lua)\n```Lua\nlocal json = require(\"PlayFab.json\")\nlocal PlayFabClientApi = require(\"PlayFab.PlayFabClientApi\")\n-- Always set your titleId first, before making any API calls\nPlayFabClientApi.settings.titleId = nil -- TODO: Set this to your string titleId you created on PlayFab Game Manager website\n\n-- After the above setup is complete, you can make a Login API call\nlocal loginRequest = {\n    -- https://api.playfab.com/Documentation/Client/method/LoginWithCustomID\n    CustomId = \"TestCustomId\",\n    CreateAccount = true\n}\nPlayFabClientApi.LoginWithCustomID(loginRequest, function(result) print(\"Login Successful: \" .. result.PlayFabId) end, function(error) print(\"Login Failed: \" .. error.errorMessage) end)\n\n-- After login, the full client API will fuction properly\n-- PlayFabClientApi.GetTitleData( etc etc etc )\n```\n\nAlternately, from the console, you can run the playfab API tests by runing the following console command from windows (Lua.exe must be in your path environment variable):\n```\nlua PlayFabTesting/TestPlayFabConsole.lua\n```\n\n\n## 6. Defold Example Instructions:\n\n* Download and install defold\n* Set a project-dependency to our Defold Client Example\n * Details here: https://github.com/PlayFab/LuaSdk/tree/master/Defold\n* The following example script sets up PlayFab to a GUI element:\n```Lua\nlocal PlayFabClientApi = require(\"PlayFab.PlayFabClientApi\")\nlocal IPlayFabHttps = require(\"PlayFab.IPlayFabHttps\")\nlocal PlayFabHttps_Defold = require(\"PlayFab.PlayFabHttps_Defold\")\n\nIPlayFabHttps.SetHttp(PlayFabHttps_Defold) -- The auto import magic doens't work if you set the name, so you have to set the reference\nPlayFabClientApi.settings.titleId = \"6195\"\n\nfunction init(self)\n    local loginRequest = {\n        -- https://api.playfab.com/Documentation/Client/method/LoginWithCustomID\n        CustomId = \"TestCustomId\",\n        CreateAccount = true\n    }\n    PlayFabClientApi.LoginWithCustomID(loginRequest, function(result) print(\"Login Successful: \" .. result.PlayFabId) end, function(error) print(\"Login Failed: \" .. error.errorMessage) end)\nend\n\n-- After login, the full client API will fuction properly\n-- PlayFabClientApi.GetTitleData( etc etc etc )\n-- Try linking more api calls to buttons!\n```\n* Link the file to a gui script and run!\n\n\n## 7. Troubleshooting:\n\nFor a complete list of available APIs, check out the [online documentation](http://api.playfab.com/Documentation/).\n\n#### Contact Us\nWe love to hear from our developer community!\nDo you have ideas on how we can make our products and services better?\n\nOur Developer Success Team can assist with answering any questions as well as process any feedback you have about PlayFab services.\n\n[Forums, Support and Knowledge Base](https://community.playfab.com/index.html)\n\n\n## 8. Copyright and Licensing Information:\n\n  Apache License --\n  Version 2.0, August 2016\n  http://www.apache.org/licenses/\n  Full details available within the LICENSE file.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplayfab%2Fluasdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplayfab%2Fluasdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplayfab%2Fluasdk/lists"}