MCPcopy Index your code
hub / github.com/apitally/apitally-js

github.com/apitally/apitally-js @v0.25.7

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.25.7 ↗ · + Follow
299 symbols 973 edges 92 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

  <img alt="Apitally logo" src="https://assets.apitally.io/logos/logo-horizontal-new-light.png" width="220">

API monitoring & analytics made simple

Metrics, logs, traces, and alerts for your APIs — with just a few lines of code.

Apitally dashboard

Apitally SDK for Node.js

Tests Codecov npm

Apitally is a simple API monitoring and analytics tool that makes it easy to understand API usage, monitor performance, and troubleshoot issues. Get started in minutes by just adding a few lines of code. No infrastructure changes required, no dashboards to build.

Learn more about Apitally on our 🌎 website or check out the 📚 documentation.

Key features

API analytics

Track traffic, error and performance metrics for your API, each endpoint and individual API consumers, allowing you to make informed, data-driven engineering and product decisions.

Request logs

Drill down from insights to individual API requests or use powerful search and filters to find specific requests. View correlated application logs and traces for a complete picture of each request, making troubleshooting faster and easier.

Error tracking

Understand which validation rules in your endpoints cause client errors. Capture error details and stack traces for 500 error responses, and have them linked to Sentry issues automatically.

API monitoring & alerts

Get notified immediately if something isn't right using custom alerts, synthetic uptime checks and heartbeat monitoring. Alert notifications can be delivered via email, Slack and Microsoft Teams.

Supported frameworks

Framework Supported versions Setup guide
Express 4.x, 5.x Link
Fastify 4.x, 5.x Link
NestJS 9.x, 10.x, 11.x Link
AdonisJS 6.x Link
Hono * 4.x Link
H3 2.x Link
Elysia 1.x Link
Koa 2.x, 3.x Link
Hapi 21.x Link

* For Hono on Cloudflare Workers use our Serverless SDK instead.

Apitally also supports many other web frameworks in Python, Go, .NET and Java via our other SDKs.

Getting started

If you don't have an Apitally account yet, first sign up here. Then create an app in the Apitally dashboard. You'll see detailed setup instructions with code snippets you can copy and paste. These also include your client ID.

See the SDK reference for all available configuration options, including how to mask sensitive data, customize request logging, and more.

Express

Install the SDK:

npm install apitally

Then add the Apitally middleware to your application:

const express = require("express");
const { useApitally } = require("apitally/express");

const app = express();
app.use(express.json());

useApitally(app, {
  clientId: "your-client-id",
  env: "dev", // or "prod" etc.
});

For further instructions, see our setup guide for Express.

Fastify

Install the SDK with the fastify-plugin peer dependency:

npm install apitally fastify-plugin

Then register the Apitally plugin with your application:

import Fastify from "fastify";
import { apitallyPlugin } from "apitally/fastify";

const fastify = Fastify({ logger: true });

await fastify.register(apitallyPlugin, {
  clientId: "your-client-id",
  env: "dev", // or "prod" etc.
});

Note: If your project uses CommonJS you need to wrap your routes in a plugin, so Apitally can detect them.

For further instructions, see our setup guide for Fastify.

NestJS

Install the SDK:

npm install apitally

Then add the Apitally middleware to your application:

import { NestFactory } from "@nestjs/core";
import { useApitally } from "apitally/nestjs";
import { AppModule } from "./app.module";

async function bootstrap() {
  const app = await NestFactory.create(AppModule);

  await useApitally(app, {
    clientId: "your-client-id",
    env: "dev", // or "prod" etc.
  });

  // ...
}

bootstrap();

For further instructions, see our setup guide for NestJS.

AdonisJS

Install the SDK:

npm install apitally

Then use the following Ace command to configure Apitally in your AdonisJS application:

node ace configure apitally/adonisjs

For further instructions, see our setup guide for AdonisJS.

Hono

Install the SDK:

npm install apitally

Then add the Apitally middleware to your application:

import { Hono } from "hono";
import { useApitally } from "apitally/hono";

const app = new Hono();

useApitally(app, {
  clientId: "your-client-id",
  env: "dev", // or "prod" etc.
});

For further instructions, see our setup guide for Hono.

H3

Install the SDK:

npm install apitally

Then register the Apitally plugin with your application:

import { H3 } from "h3";
import { apitallyPlugin } from "apitally/h3";

const app = new H3({
  plugins: [
    apitallyPlugin({
      clientId: "your-client-id",
      env: "dev", // or "prod" etc.
    }),
  ],
});

For further instructions, see our setup guide for H3.

Elysia

Install the SDK:

npm install apitally

Then add the Apitally plugin to your application:

import { Elysia } from "elysia";
import { apitallyPlugin } from "apitally/elysia";

const app = new Elysia()
  .use(
    apitallyPlugin({
      clientId: "your-client-id",
      env: "dev", // or "prod" etc.
    }),
  )
  .get("/", () => "hello");

For further instructions, see our setup guide for Elysia.

Koa

Install the SDK:

npm install apitally

Then add the Apitally middleware to your application:

const Koa = require("koa");
const { useApitally } = require("apitally/koa");

const app = new Koa();

useApitally(app, {
  clientId: "your-client-id",
  env: "dev", // or "prod" etc.
});

For further instructions, see our setup guide for Koa.

Hapi

Install the SDK:

npm install apitally

Then register the Apitally plugin with your application:

const Hapi = require("@hapi/hapi");
const { apitallyPlugin } = require("apitally/hapi");

const init = async () => {
  const server = Hapi.server({
    port: 3000,
    host: "localhost",
  });

  await server.register({
    plugin: apitallyPlugin({
      clientId: "your-client-id",
      env: "dev", // or "prod" etc.
    }),
  });
};

init();

For further instructions, see our setup guide for Hapi.

Getting help

If you need help please create a new discussion on GitHub or email us at support@apitally.io. We'll get back to you as soon as possible.

License

This library is licensed under the terms of the MIT license.

Extension points exported contracts — how you extend this code

Request (Interface)
(no doc)
src/elysia/plugin.ts
ContainerBindings (Interface)
(no doc)
src/adonisjs/provider.ts
FastifyReply (Interface)
(no doc)
src/fastify/plugin.ts
ContextVariableMap (Interface)
(no doc)
src/hono/middleware.ts
Request (Interface)
(no doc)
src/hapi/plugin.ts
H3EventContext (Interface)
(no doc)
src/h3/plugin.ts
Logger (Interface)
(no doc)
src/common/logging.ts
Request (Interface)
(no doc)
src/express/middleware.ts

Core symbols most depended-on inside this repo

logRequest
called by 26
src/common/requestLogger.ts
getPackageVersion
called by 21
src/common/packageVersions.ts
isEnabled
called by 18
src/common/client.ts
handleShutdown
called by 18
src/common/client.ts
parseContentLength
called by 18
src/common/headers.ts
getInstance
called by 17
src/common/client.ts
clear
called by 17
src/common/requestLogger.ts
convertHeaders
called by 16
src/common/requestLogger.ts

Shape

Function 137
Method 100
Class 48
Interface 14

Languages

TypeScript100%

Modules by API surface

src/common/requestLogger.ts31 symbols
src/common/client.ts21 symbols
src/common/spanCollector.ts18 symbols
tests/nestjs-fastify/app.controller.ts14 symbols
tests/nestjs-express/app.controller.ts14 symbols
src/express/utils.js13 symbols
src/express/middleware.ts13 symbols
src/adonisjs/provider.ts10 symbols
src/koa/middleware.ts9 symbols
src/fastify/plugin.ts9 symbols
src/common/tempGzipFile.ts9 symbols
src/common/serverErrorCounter.ts8 symbols

For agents

$ claude mcp add apitally-js \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page