{"_id":"58471465889b6c2d00fb8583","parentDoc":null,"category":{"_id":"5846c4ee5d064323007b1774","project":"5589ceae9883a40d00c433f3","__v":0,"version":"5589ceae9883a40d00c433f6","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-12-06T14:02:22.621Z","from_sync":false,"order":1,"slug":"javascript-widget","title":"Javascript Widget"},"version":{"_id":"5589ceae9883a40d00c433f6","__v":10,"project":"5589ceae9883a40d00c433f3","createdAt":"2015-06-23T21:25:02.865Z","releaseDate":"2015-06-23T21:25:02.865Z","categories":["5589ceaf9883a40d00c433f7","559ab19d2100d117005f1269","57d4a754899ab90e00105e5d","5807813b6d24211900953b99","5819154bf62fee0f00949855","5841d27cae05ac2500ba2680","5846c4ee5d064323007b1774","589e29c72793e937001c15c5","5cf0460e272f2c0014a80d17","5cf047bde14258005d7a374e"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"__v":0,"user":"555297897e64980d008d3baf","project":"5589ceae9883a40d00c433f3","githubsync":"","updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-12-06T19:41:25.213Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":2,"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]","excerpt":"","slug":"javascript-api","type":"basic","title":"Javascript API"}
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]