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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@oddbit/nexudus

v0.2.9

Published

Nexudus API client

Readme

@oddbit/nexudus

License NPM version Total NPM downloads Travis build status

An easy to use and Typscript friendly API client for Nexudus.

Admin API

The admin API requires a registered Nexudus "App" and an auth token.

The Nexudus Spaces API allows you to develop Apps and modules that extend the Nexudus Spaces platform. You can implment features that your business may require or even create solutions that can be sold to other Nexudus Spaces customers.

In order to create an App you need a Nexudus account for your business or if you have set up a "test space" for sandbox testing (perhaps you should check first with Nexudus to see what they advice: [email protected]).

Log in to your space and enter the "Apps list" and create an entry for your own App: https://spaces.nexudus.com/Apps/Applications

Select all the permissions that are matching the API endpoints that you intend to be using.

Usage

Before you can use the admin API client you must complete an installation request that Nexudus will push to your endpoint when a someone is choosing to activate/install your App.

Please read the official API documentation to learn more about the variables that are passed in the requests.query that is used to initialize AppInstallationRequest in the example below.

Consuming installation request

import * as nexudus from "@oddbit/nexudus";

function apiEndoint(request, response) {
    // Store your secret/public app keys safely somewhere...
    const application = new nexudus.Application(SECRET_APP_KEY, PUBLIC_APP_KEY);

    const installationRequest = new nexudus.AppInstallationRequest(request.query);

    try {
        application.validate(installationRequest);
    } catch(err) {
        response.status(401).send("The installation request was not valid");
        return;
    }
    const apiAuthToken = application.createAuthToken(installationRequest);

    // ...
    // Store the apiAuthToken somewhere in your database
    // ...
    // Do other stuffs
    // ...

    response.status(200).send("Install succsess!");
}

Fetch all businesses

In the example below, we're fetching all Business objects that a certain account. See the documentation the official documentation for how Nexudus is organizing the hierarchy and relationships between businesses, user, coworkers and check-ins.

import * as nexudus from "@oddbit/nexudus";

const apiClient = new nexudus.AdminApiClient(apiAuthToken);
const nexudusBusinessList = await apiClient.getBusinesses();
nexudusBusinessList.forEeach(nexudusBusiness => {
    console.log(`Got business '${nexudusBusiness.Name}' with id: ${nexudusBusiness.Id}`);
});

Fetch businesses and filter results

Currently it's only supported to filter the results by "time of update", which allows you to only fetch records that has been updated after a certain point in time.

const timestamp = new Date(2015, 3, 1);
const nexudusBusinessList = await apiClient.getBusinesses({updatedAfter: timestamp.getTime()});

Fetch single businesses

// You must know the Nexudus ID of the business
const nexudusBusiness = await apiClient.getBusiness(12345);

Update

The API client will perform an update if the data object contains an Id. The operation will fail if Nexudus does not know of any corresponding object with that id (i.e. if it hasn't been created yet).

const nexudusBusiness = {
   "Id": 123456,
   "Name": "Kumpul Coworking Space",
   "WebAddress": "https://www.kumpul.co"
} as nexudus.Business;
await apiClient.saveBusiness(nexudusBusiness);

Create

The API client will create a new record at Nexudus if there is no Id attribute present.

const nexudusBusiness = {
   "Name": "Kumpul Coworking Space",
   "WebAddress": "https://www.kumpul.co"
} as nexudus.Business;
await apiClient.saveBusiness(nexudusBusiness);

Delete

// You must know the Nexudus ID of the business
await apiClient.deleteBusiness(12345);

Public API

The public API is designed to work with the public resources of the space and also member restricted resources. The API is using the member's email and password for authentication, which makes it easier to use and apply in your application. But it is also restricted in its powers. You can't do things like "check in" or "check out".

Usage

In the example below, we're fetching the Coworker object of the user "[email protected]" at Nexudus. See the documentation on the difference between "User" and "Coworker" at Nexudus's API documentation.

The API client is throwing a HTTP 401 error if username or password is wrong.

import * as nexudus from "@oddbit/nexudus";

const apiClient = new nexudus.PublicApiClient("kumpul", "[email protected]", "secretPassword");

try {
    const nexudusCoworker = await apiClient.getCoworker();
} catch (err) {
    console.log(`You just got yourself a HTTP ${err.statusCode} error: ${err.message}`);
}