{"id":18425546,"url":"https://github.com/azerion/phaser-amazon-cognito","last_synced_at":"2026-02-23T00:11:02.247Z","repository":{"id":57134134,"uuid":"75382850","full_name":"azerion/phaser-amazon-cognito","owner":"azerion","description":"A Phaser plugin that adds User Login/Sync support trough Amazon Cognito Identity/Sync","archived":false,"fork":false,"pushed_at":"2017-01-24T12:51:16.000Z","size":1006,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-05-11T19:22:06.169Z","etag":null,"topics":["amazon","phaser-plugin","registration","user-pool"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/azerion.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-12-02T09:49:38.000Z","updated_at":"2021-04-12T15:17:07.000Z","dependencies_parsed_at":"2022-09-11T16:32:58.969Z","dependency_job_id":null,"html_url":"https://github.com/azerion/phaser-amazon-cognito","commit_stats":null,"previous_names":["orange-games/phaser-amazon-cognito"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azerion%2Fphaser-amazon-cognito","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azerion%2Fphaser-amazon-cognito/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azerion%2Fphaser-amazon-cognito/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azerion%2Fphaser-amazon-cognito/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/azerion","download_url":"https://codeload.github.com/azerion/phaser-amazon-cognito/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247687962,"owners_count":20979571,"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":["amazon","phaser-plugin","registration","user-pool"],"created_at":"2024-11-06T05:04:20.951Z","updated_at":"2025-10-25T15:48:36.343Z","avatar_url":"https://github.com/azerion.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Phaser Amazon Cognito\n=====================\nA Phaser plugin that adds user register/login support trough amazon cognito.\n\nKey Features:\n* Works on mobile and desktop\n* Included TypeScript support\n* Async library with promise calls\n* Easy to use as phaser plugin\n\nGetting Started\n---------------\nFirst you want to get a fresh copy of the plugin. You can get it from this repo or from npm, ain't that handy.\n```\nnpm install @orange-games/phaser-amazon-cognito --save-dev\n```\n\nNext up you'd want to add it to your list of js sources you load into your game:\n```html\n\u003cscript src=\"path/to/phaser-amazon-cognito.js\"\u003e\u003c/script\u003e\n```\n\nAfter adding the script to the page you can activate it by enabling the plugin:\n```javascript\ngame.add.plugin(Fabrique.Plugins.Cognito);\n```\n\n#####Note\nIf you are using typescript, you have to user typescript 2.0.0 or higher for the promises to work.\n\nUsage\n-----\nFirst off you want to set the user pool info using the userPoolId and clientId.\n```javascript\ngame.cognito.setPoolInfo('\u003cyour_pool_id\u003e', '\u003cyour_client_id\u003e');\n```\n\n#####Registration\nRegister a new user to the user pool.\n```javascript\ngame.cognito.register('\u003cusername\u003e', '\u003cpassword\u003e', '\u003cemail\u003e', null).then(function(user) {\n    console.log('Registration worked!', user);\n}).catch(function(error) {\n    console.log('Registration failed:', error);\n});\n```\n\n#####Confirm Registration\nAn account has to be confirmed after registration. The code will be in the inbox of the users email.\n```javascript\ngame.cognito.confirmRegistration('\u003cconfirmation_code\u003e').then(function() {\n    console.log('Confirmation worked!');\n}).catch(function(error) {\n    console.log('Confirmation failed:', error);\n});\n```\n\n#####Resend Confirmation \nResend conformation mail to users email. Will only work if user is not confirmed yet.\n```javascript\ngame.cognito.resendConfirmation().then(function() {\n    console.log('Confirmation resend!');\n}).catch(function(error) {\n    console.log('Failed to resend confirmation:', error);\n});\n```\n\n#####Reset Password\nSends a reset code to the user's email address.\n```javascript\ngame.cognito.resetPassword().then(function() {\n    console.log('Password has been reset!');\n}).catch(function(error) {\n    console.log('Failed to reset password:', error);\n});\n```\n\n#####Confirm Password Reset\nUse the reset code given in the reset email to change password.\n```javascript\ngame.cognito.confirmResetPassword('\u003cconfirmation_code\u003e', '\u003cnew_password\u003e').then(function() {\n    console.log('Password has been changed!');\n}).catch(function(error) {\n    console.log('Failed to change password:', error);\n});\n```\n\n#####Change Password\nChanges the password for the current user. The user has to be logged in.\n```javascript\ngame.cognito.changePassword('old_password', 'new_password').then(function() {\n    console.log('Password has been change!');\n}).catch(function(error) {\n    console.log('Failed to change password:', error);\n});\n```\n\n#####Login\nLogs in a user from the user pool.\n```javascript\ngame.cognito.login('\u003cusername\u003e', '\u003cpassword\u003e').then(function(state) {\n    console.log('LoggedIn!', state.user, state.sessionToken);\n}).catch(function(error) {\n    console.log('Login failed:', error);\n});\n```\n\n#####Logout\nLogs out a user from the user pool.\n```javascript\ngame.cognito.logout();\n```\n\n#####Loading User From LocalStorage\nLoads the userState from the localStorage on the device.\n```javascript\ngame.cognito.loadStorageUser();\n```\n\n#####Validate Session\nChecks if a session has been set. Does not actually check if the user is logged in. Can be used to check if the loadedStorageUser had a session.\n```javascript\ngame.cognito.validateSession().then(function() {\n    console.log('Valid session!');\n}).catch(function(error) {\n    console.log('Invalid session:', error);\n});\n```\n\n#####Setting User\nMost commands will use the last used user, if you want to call verify on a different user for example you need to call this first. Login or register will automatically set this.\n```javascript\ngame.cognito.setUser('\u003cusername\u003e');\n```\n\nCredits\n-------\nThis library uses the amazon-cognito-identity-js library provided by amazon. (https://github.com/aws/amazon-cognito-identity-js)\n\nDisclaimer\n----------\nWe at OrangeGames just love playing and creating awesome games. We aren't affiliated with Phaser.io. We just needed some awesome login handling in our awesome HTML5 games. Feel free to use it for enhancing your own awesome games!\n\nPhaser Amazon Cognito is distributed under the MIT license. All 3rd party libraries and components are distributed under their\nrespective license terms.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazerion%2Fphaser-amazon-cognito","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fazerion%2Fphaser-amazon-cognito","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazerion%2Fphaser-amazon-cognito/lists"}