Quickstart
Install the public npm packages.
The framework adapter uses @apirelio/core for the common event contract and bounded asynchronous transport.
npm install @apirelio/nuxt @apirelio/coreFramework integration
Enable automatic request tracking.
A Nitro server plugin captures matched server-route templates, response status, duration, sizes and explicitly allowed headers. Nuxt client navigation is not tracked.
export default defineNuxtConfig({
modules: ['@apirelio/nuxt'],
apirelio: {
service: 'billing-api',
environment: 'production',
metadataKeys: ['region'],
includeRoutes: ['/api/**'],
excludeRoutes: ['/api/health', '/api/internal/**'],
},
})
// .env — private server runtime config
NUXT_APIRELIO_API_KEY=apr_live_xxxxxxxxxCustomer context
Attach the account and application.
Use stable external IDs from your authentication model. Customer names and plans can evolve without breaking analytics history.
import { setApirelioContext } from '@apirelio/nuxt/runtime'
export default defineEventHandler((event) => {
setApirelioContext(event, {
customer: { id: 'cus_123', plan: 'growth' },
application: { id: 'shopify', name: 'Shopify' },
metadata: { region: 'eu' },
})
})Reliability
Flush safely during shutdown.
The Nitro close hook flushes pending events within a fixed timeout.
includeRoutes accepts exact paths or prefixes ending in /**. Explicit excludeRoutes always take precedence, keeping health checks, internal endpoints and presentation routes out of API analytics.
The request only appends to a bounded in-memory queue. Network delivery, retry and batching happen outside the observed response path.
Data boundary
Operational signals only.
Request and response bodies, authorization values, cookies, query values, email addresses and client IP addresses are not captured. Custom scalar metadata must be explicitly allow-listed.
Keep the ingestion key in server environment configuration. Do not expose it through client bundles or public runtime config.