BAuthentication for JavaScript