npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

fidem

v0.2.0

Published

Node module to access Fidem API.

Readme

fidem

Codeship Status for sguimont/fidem

Fidem node module provides an easy access to Fidem API.

Install

npm install fidem

Usage

var fidem = require('fidem');

// Create a client.
var client = fidem.createClient({
  key: '1foakd92klda034kdkqsl',
  secret: '1kkdq45kQdd3LQDazep'
});

// Log action.
client.logAction({
  type: 'viewShow',
  data: {
    id: 'show1',
    name: 'The Big Show'
  }
}).then(function (result) {
  // ...
})

// Authenticate a user.
client.authenticate({
  username: 'johnny',
  password: 'mySecretPassword'
})
// Retrieve a user by token.
.then(function (token) {
  return client.getUserByToken(token);
})
.then(function (user) {
  // ...
});

fidem.createClient(config)

Create a new API client.

* @param {object} config
* @param {string} config.key API key.
* @param {string} config.secret API secret.
* @param {string} [config.hostname="services.fidemapps.com"] Hostname.
* @param {string} [config.protocol=http] Protocol (http or https).
* @param {string} [config.port=80|443] Port.
* @returns {Client}
var client = fidem.createClient({
  key: '1foakd92klda034kdkqsl',
  secret: '1kkdq45kQdd3LQDazep'
});

client.authenticate(credentials, [cb])

Get an authentication token for the credentials provided.

* @param {object} credentials
* @param {string} credentials.username Username.
* @param {string} credentials.password Password.
* @param {Function} [cb] Optional callback.
* @returns {Promise}
client.authenticate(credentials).then(function (res) {
  console.log(res.token); // xxx
  console.log(res.user); // {..}
});

client.request(options, [cb])

Make a custom request to the API.

* @param {object} options
   will use a session token request.
* @param {string} options.path Path of the request.
* @param {string} [options.token=null] Session token. If provided,
* @param {boolean} [options.sign=true] Sign the request
   using key and secret of the client.
* @param {string} [options.method=GET] HTTP method.
* @param {object} [options.body=null] HTTP body of the request for methods
   that supports it (POST, PUT, ...).
* @param {object} [options.headers={}] Additional headers.
* @param {object} [options.requestOptions={}] Custom options of the internal
   [request](https://github.com/mikeal/request#requestoptions-callback).
* @param {Function} [cb] Optional callback.
* @returns {Promise}
client.request({
  path: '/gamification/actions',
  method: 'POST',
  data: {
    type: 'viewShow',
    data: {
      id: 'show1',
      name: 'The Big Show'
    }
  }
});

client.getUserByToken(token, [cb])

Retrieve a user by token.

* @param {string} token Token of the user.
* @param {Function} [cb] Optional callback.
* @returns {Promise}
client.getUserByToken('Qpaldj9kd');

client.logAction(action, [cb])

Log an action.

* @param {string} action Action.
* @param {Function} [cb] Optional callback.
* @returns {Promise}
client.logAction({
  type: 'viewShow',
  data: {
    id: 'show1',
    name: 'The Big Show'
  }
});

client.createMember(accountId, [cb])

Create a member.

* @param {string} accountId If of the account.
* @param {Function} [cb] Optional callback.
* @returns {Promise}
client.createMember('demo');

client.startSession(memberId, [cb])

Start a new session.

* @param {string} memberId If of the member.
* @param {Function} [cb] Optional callback.
* @returns {Promise}
client.startSession('02Ldkzqkdu');

client.assignMemberToSession(memberId, sessionId, [cb])

Assign a member to an existing session.

* @param {string} sessionId If of the session.
* @param {string} memberId If of the member.
* @param {Function} [cb] Optional callback.
* @returns {Promise}
client.assignMemberToSession('-dkqu9j3ld', '_lqsdzoks');

License

MIT