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.
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.
Request logging
Drill down from insights to individual requests or use powerful filtering to understand how consumers have interacted with your API. Configure exactly what is included in the logs to meet your requirements.
API monitoring & alerting
Get notified immediately if something isn't right using custom alerts, synthetic uptime checks and heartbeat monitoring. Notifications can be delivered via email, Slack or Microsoft Teams.
Installation
You can install this library in your project using npm or yarn:
1npm install apitally
or
1yarn add apitally
Usage
Our comprehensive setup guides include
all the details you need to get started.
Express
This is an example of how to use the Apitally middleware with an Express
application. For further instructions, see our
setup guide for Express.
This is an example of how to register the Apitally plugin with a Fastify
application. For further instructions, see our
setup guide for Fastify.
The Apitally plugin requires the
fastify-plugin package to be
installed.
1npm install fastify-plugin
1const fastify = require("fastify")({ logger: true });
2const { apitallyPlugin } = require("apitally/fastify");
34fastify.register(apitallyPlugin, {
5clientId: "your-client-id",
6env: "dev", // or "prod" etc.7});
89// Wrap your routes in a plugin, so Apitally can detect them10fastify.register((instance, opts, done) => {
11 instance.get("/", (request, reply) => {
12 reply.send("hello");
13 });
14 done();
15});
Note: If your project uses ES modules you can use await fastify.register(...) and don't need to wrap your routes in a plugin. See the Fastify V4 migration guide for more details.
Koa
This is an example of how to use the Apitally middleware with a Koa application.
For further instructions, see our
setup guide for Koa.