Skip to content
Go to file

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Readership Locations

This is a simple example of an application that consumes the Mendeley API. For more information about the API, see the developer portal.

This is a revised version, now using the Mendeley Javascript SDK to communicate with the server.

About the application

A JavaScript example page showing document reader locations plotted onto a world map. The example takes advantage of matching country names in the SVG map and the reading statistics by country of a catalog document. A color with an alpha value is used to fill country regions so that it reflects the relative number of readers

** API response **
"reader_count_by_country": {
      "Ireland": 2,
      "United Kingdom": 1
 ** SVG document **
 <path id="GB" title="United Kingdom" class="land" d="M459.38,281l-1.5,3.29l-2.12,-0.98l-1.73…" />
 <path id="IE" title="Ireland" class="land" d="M457.88,284.29L458.34,287.65L456.22,291.77L451…" />

This sample code illustrates:

  • using the API from Javascript as a client side app
  • implicit OAuth flow to obtain an access token
  • fetching user documents
  • requesting readership statistics for catalog documents

How to run

  1. Clone this git repository onto your machine.

  2. Using bower run the following command:

     $ bower install
  3. Go to the Mendeley developers site, sign-in with your Mendeley account details and click on "My Apps" and follow the instructions to register a new application and get your ClientID.

  1. Run this command to enable the authentication script:
  • On Mac OS / Unix

        $ cp bower_components/mendeley-javascript-sdk/examples/oauth-config.implicit-grant.js.dist application/oauth-config.js
  • On Windows

        $ copy bower_components/mendeley-javascript-sdk/examples/oauth-config.implicit-grant.js.dist application/oauth-config.js
  1. Fill in your ClientID in the application/oatuh-config.js file.

  2. Run the following commands:

     $ npm install
     $ npm start
  • Note: If you get an error, try running the first command as sudo npm install
  1. Go to http://localhost:8111/application/ in your browser and you should be redirected to log-in to Mendeley. Once logged in you'll be redirected back to the application.

Suggestions for exploration

Once you've understood how the sample code works, try enhancing it by:

  • Cache the results of catalog document responses to avoid repeatedly performing identical API requests each time the user changes document in the popup menu


No description, website, or topics provided.



No releases published


No packages published
You can’t perform that action at this time.