Can we call keycloak rest api from keycloak js plugin


I am using the keycloak js plugin in front-end single-page application I want to make a call to the keycloak to update the roles from keycloak js plugin. but keycloak is not allowing to call the restapi of keycloak from the plugin.

Please help me to resolve the issue.
Thanks in Advance.