Official Node.js client for the Nitrozen.io changelog API.
Requires Node.js 18 or later.
npm install nitrozenioconst { ApiClient, ProjectsApi, EntriesApi } = require('nitrozenio');
// Create a client with your API token
const client = ApiClient.create('YOUR_API_TOKEN');
// List your projects
const projects = new ProjectsApi(client);
const { data } = await projects.projectsGet();
console.log(data); // Project[]
// Create a changelog entry
const entries = new EntriesApi(client);
const { data: entry } = await entries.projectsProjectEntriesPost(
data[0].id,
{ title: 'New feature', content: 'We shipped something great.', category: 'new' }
);
console.log(entry);Create an API token on the API Tokens page, then pass it to ApiClient.create():
const { ApiClient } = require('nitrozenio');
// Static token
const client = ApiClient.create('YOUR_API_TOKEN');
// Dynamic token (e.g. from a secrets manager)
const client = ApiClient.create(() => getTokenFromVault());API errors reject with a NitrozenError that carries the HTTP status code and any validation details:
const { ApiClient, ProjectsApi, NitrozenError } = require('nitrozenio');
const client = ApiClient.create('YOUR_API_TOKEN');
const projects = new ProjectsApi(client);
try {
const { data } = await projects.projectsProjectGet(999);
} catch (err) {
if (err instanceof NitrozenError) {
console.error(err.statusCode); // e.g. 404
console.error(err.message); // e.g. "Not found"
console.error(err.errors); // validation errors map, if any
}
}List endpoints accept page and perPage options and return a meta object:
const { data: entries, meta } = await entriesApi.projectsProjectEntriesGet(
projectId,
{ page: 2, perPage: 20 }
);
console.log(meta.total, meta.last_page);Pass a callback as the last argument if you prefer the Node.js callback pattern:
projects.projectsGet(function(error, data) {
if (error) throw error;
console.log(data);
});The package ships with full TypeScript declarations. No @types package needed.
import { ApiClient, ProjectsApi, NitrozenError } from 'nitrozenio';
const client = ApiClient.create('YOUR_API_TOKEN');
const api = new ProjectsApi(client);
const { data } = await api.projectsGet();
// data is typed as Project[]All methods return a Promise when called without a callback. All URIs are relative to https://nitrozen.io/api/v1.
| Method | HTTP | Description |
|---|---|---|
| tokensGet() | GET /tokens | List API tokens |
| tokensPost(body) | POST /tokens | Create an API token |
| tokensTokenDelete(id) | DELETE /tokens/{token} | Revoke an API token |
| Method | HTTP | Description |
|---|---|---|
| projectsGet() | GET /projects | List projects |
| projectsPost(body) | POST /projects | Create a project |
| projectsProjectGet(id) | GET /projects/{project} | Get a project |
| projectsProjectPut(id, body) | PUT /projects/{project} | Update a project |
| projectsProjectDelete(id) | DELETE /projects/{project} | Delete a project |
| Method | HTTP | Description |
|---|---|---|
| projectsProjectEntriesGet(id, opts?) | GET /projects/{project}/entries | List entries |
| projectsProjectEntriesPost(id, body) | POST /projects/{project}/entries | Create an entry |
| projectsProjectEntriesEntryGet(pid, eid) | GET …/entries/{entry} | Get an entry |
| projectsProjectEntriesEntryPut(pid, eid, body) | PUT …/entries/{entry} | Update an entry |
| projectsProjectEntriesEntryDelete(pid, eid) | DELETE …/entries/{entry} | Delete an entry |
| Method | HTTP | Description |
|---|---|---|
| userGet() | GET /user | Get current user |
| userUsageGet() | GET /user/usage | Get usage statistics |
| Method | HTTP | Description |
|---|---|---|
| publicProjectsSlugEntriesGet(slug) | GET /public/projects/{slug}/entries | List published entries (no auth) |
category values:
new
improvement
fix
announcement
Projects on a plan with custom categories enabled can define additional category slugs from the dashboard — any of those slugs are valid here too.