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

@altravia/openapi

v1.4.2

Published

Official OpenApi NodeJS Client

Downloads

162

Readme

OpenApi NodeJS Client

Installation

npm install @altravia/openapi
const OpenApi = require('@altravia/openapi').default;

Usage

In order to use the client, you need an active openapi.it account. You can register for free on developers.openapi.it.

We can now initialize the client with the credentials that we find in our dashboard and a valid token

const client = await OpenApi.init('production', [email protected], your_production_api_key, your_token);

Where production (or test) is the environment we want to work in; please note that API Keys and tokens for the production and test environment are different.

If you want to see your active tokens, please visit developers.openapi.it/tokens.

Besides, the client will automatically renew the provided token when needed.

Generate a token

If we don't have a token yet, we can easily generate a new one giving either the full scope or pass just the base-url as a shorthand, which will give us access to all the endpoints and methods of the web service:

const scopes = [
    "PUT:ws.messaggisms.com/messages",
    "GET:ws.firmadigitale.com/richiesta",
    "POST:ws.firmadigitale.com/richiesta",
    'imprese.altravia.com',
    'pa.openapi.it',
    // Both syntax are accepted
];

let client = await OpenApi.init('test', [email protected], your_api_key);
const token = await client.generateToken(scopes);

// The new token will be set and returned, 
// we can now save on a database if needed ...

// The client is now ready to make requests

Please note that wildcards for base urls are not supported at the moment:

// This will work
const token = await client.generateToken('*:pa.openapi.it/*');
// This is equivalent to the previous (just a shortcut)
const token = await client.generateToken('pa.openapi.it');

// This will NOT work
const token = await client.generateToken('*:*/*');

Heads up: undefined methods

The client will instantiate only the instances needed based on the provided token: if you get undefined method when you attempt to run a request, please check if you have all the required permissions.

Make requests

Once the client has been initialized, we can start making requests: all the available methods will be loaded based on the provided token.

As an example, let's request the list of all cities in a given CAP

const cities = await client.comuni.getCitiesByCap('00132')
try {
} catch(err) {
    // err handling logic...
}

// The client uses promises, so we can choose the syntax we prefer
client.comuni.getCitiesByCap('00132')
    .then(res => {
        
    })
    .catch(err => {

    })

Or a list of companies in Rome

const imprese = await client.imprese.search({ provincia: 'RM' })

The library is typed, so you will get hints in supported IDEs of all the available methods.

Currently, those are the available web services:

While most of them are straight forward, some may need additional explanation. Please check out the more comprehensive documentation:

VISENGINE

SMS