Passport JavaScript Client

JavaScript Client Library

The JavaScript client library allows you to integrate Passport with your JavaScript application.

Source Code:

Here is an example of using the PassportClient to retrieve a User by their email address via the Passport User API:

<html>
  <head>
    <script src="../lib/ClientResponse.js"></script>
    <script src="../lib/RESTClient.js"></script>
    <script src="../lib/PassportClient.js"></script>
    <script>
      var client = new PassportClient('6b87a398-39f2-4692-927b-13188a81a9a3', 'http://passport.local');
      function handleResponse (clientResponse) {
        console.info(JSON.stringify(clientResponse.successResponse.user, null, 2));
      }

      // Retrieve User by Email Address
      client.retrieveUserByEmail('user@example.com', handleResponse);
    </script>
  </head>
  <body>
    Super Awesome Application
  </body>
</html>