{"metadata":{"image":[],"title":"","description":""},"api":{"url":"","auth":"required","results":{"codes":[]},"settings":"","params":[]},"next":{"description":"","pages":[]},"title":"Javascript API","type":"basic","slug":"javascript-api","excerpt":"","body":"Open a particular dialog\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"UserKitWidget.open(dialog);\",\n      \"language\": \"javascript\",\n      \"name\": \"UserKitWidget.open(dialog)\"\n    }\n  ]\n}\n[/block]\nIf the dialog you are attempting to open requires a login, the user will be prompted to login first.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Page ID\",\n    \"h-1\": \"Description\",\n    \"h-2\": \"Login Required?\",\n    \"0-0\": \"change_password\",\n    \"1-0\": \"forgot_password\",\n    \"2-0\": \"login\",\n    \"3-0\": \"register\",\n    \"4-0\": \"settings\",\n    \"5-0\": \"request_phone_verification_code\",\n    \"6-0\": \"\",\n    \"0-1\": \"Provides a form allowing users to change their current password\",\n    \"0-2\": \"Yes\",\n    \"1-1\": \"Prompts the user to enter the identifier used to login. They will receive an email with instructions to reset their password.\",\n    \"1-2\": \"No\",\n    \"2-2\": \"No\",\n    \"2-1\": \"Login form\",\n    \"3-1\": \"User registration form\",\n    \"3-2\": \"No\",\n    \"4-1\": \"Displays a form with the options for the current user to manage their user information\",\n    \"4-2\": \"Yes\",\n    \"5-1\": \"Used to validate phone numbers and change how a user logs in\",\n    \"5-2\": \"No\"\n  },\n  \"cols\": 3,\n  \"rows\": 6\n}\n[/block]\nClose all open dialogs\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"UserKitWidget.dismiss();\",\n      \"language\": \"text\",\n      \"name\": \"UserKitWidget.dismiss();\"\n    }\n  ]\n}\n[/block]\nLogout current user\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"UserKit.logout();\",\n      \"language\": \"javascript\",\n      \"name\": \"UserKit.logout()\"\n    }\n  ]\n}\n[/block]\nGet current user data\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"UserKit.getUser();\",\n      \"language\": \"text\",\n      \"name\": \"UserKit.getUser()\"\n    }\n  ]\n}\n[/block]\nCheck if user is currently logged in\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"UserKit.isLoggedIn();\",\n      \"language\": \"text\",\n      \"name\": \"UserKit.isLoggedIn()\"\n    }\n  ]\n}\n[/block]","updates":[],"order":2,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"58471465889b6c2d00fb8583","parentDoc":null,"category":{"sync":{"isSync":false,"url":""},"pages":[],"title":"Javascript Widget","slug":"javascript-widget","order":1,"from_sync":false,"reference":false,"_id":"5846c4ee5d064323007b1774","project":"5589ceae9883a40d00c433f3","createdAt":"2016-12-06T14:02:22.621Z","__v":0,"version":"5589ceae9883a40d00c433f6"},"version":{"version":"1.0","version_clean":"1.0.0","codename":"","is_stable":true,"is_beta":true,"is_hidden":false,"is_deprecated":false,"categories":["5589ceaf9883a40d00c433f7","559ab19d2100d117005f1269","57d4a754899ab90e00105e5d","5807813b6d24211900953b99","5819154bf62fee0f00949855","5841d27cae05ac2500ba2680","5846c4ee5d064323007b1774","589e29c72793e937001c15c5","5cf0460e272f2c0014a80d17","5cf047bde14258005d7a374e","5db6fa2c7f86fa004ff2c35b","5e349a6a02520b006458b0ae","5e4c89eafd907100654072f2","5e4d7a1feca7f90018b15b9b","5e4eff0ec3399b005118d83a"],"_id":"5589ceae9883a40d00c433f6","releaseDate":"2015-06-23T21:25:02.865Z","__v":15,"createdAt":"2015-06-23T21:25:02.865Z","project":"5589ceae9883a40d00c433f3"},"__v":0,"user":"555297897e64980d008d3baf","createdAt":"2016-12-06T19:41:25.213Z","project":"5589ceae9883a40d00c433f3","githubsync":""}
Open a particular dialog [block:code] { "codes": [ { "code": "UserKitWidget.open(dialog);", "language": "javascript", "name": "UserKitWidget.open(dialog)" } ] } [/block] If the dialog you are attempting to open requires a login, the user will be prompted to login first. [block:parameters] { "data": { "h-0": "Page ID", "h-1": "Description", "h-2": "Login Required?", "0-0": "change_password", "1-0": "forgot_password", "2-0": "login", "3-0": "register", "4-0": "settings", "5-0": "request_phone_verification_code", "6-0": "", "0-1": "Provides a form allowing users to change their current password", "0-2": "Yes", "1-1": "Prompts the user to enter the identifier used to login. They will receive an email with instructions to reset their password.", "1-2": "No", "2-2": "No", "2-1": "Login form", "3-1": "User registration form", "3-2": "No", "4-1": "Displays a form with the options for the current user to manage their user information", "4-2": "Yes", "5-1": "Used to validate phone numbers and change how a user logs in", "5-2": "No" }, "cols": 3, "rows": 6 } [/block] Close all open dialogs [block:code] { "codes": [ { "code": "UserKitWidget.dismiss();", "language": "text", "name": "UserKitWidget.dismiss();" } ] } [/block] Logout current user [block:code] { "codes": [ { "code": "UserKit.logout();", "language": "javascript", "name": "UserKit.logout()" } ] } [/block] Get current user data [block:code] { "codes": [ { "code": "UserKit.getUser();", "language": "text", "name": "UserKit.getUser()" } ] } [/block] Check if user is currently logged in [block:code] { "codes": [ { "code": "UserKit.isLoggedIn();", "language": "text", "name": "UserKit.isLoggedIn()" } ] } [/block]