---
title: "How to Add the Moesif API Observability Add-On to Your Heroku Applications"
description: "Heroku applications can add the Moesif API Observability add-on to analyze API traffic and support monetization. The setup uses either the Heroku CLI or Dashboard: the CLI command is heroku addons:create moesif, while the UI path goes through Resources, Find more add-ons, and Metrics and Analytics. Provisioning creates a MOESIF_APPLICATION_ID config variable, and the application then requires the Moesif SDK initialized with that value. The guide also covers copying the variable into a local .env file with Heroku Local and excluding that file from Git through .gitignore. Once configured, API events should flow into Moesif for live logs, time-series metrics, funnels, retention, alerting, and billing features, while Heroku handles add-on billing and user management."
---

# How to Add the Moesif API Observability Add-On to Your Heroku Applications

[Heroku](https://yomu.fyi/company/heroku) · Matt Tanner · Apr 16, 2025

**Type:** Tutorial

## Summary

Heroku applications can add the Moesif API Observability add-on to analyze API traffic and support monetization. The setup uses either the Heroku CLI or Dashboard: the CLI command is heroku addons:create moesif, while the UI path goes through Resources, Find more add-ons, and Metrics and Analytics. Provisioning creates a MOESIF\_APPLICATION\_ID config variable, and the application then requires the Moesif SDK initialized with that value. The guide also covers copying the variable into a local .env file with Heroku Local and excluding that file from Git through .gitignore. Once configured, API events should flow into Moesif for live logs, time-series metrics, funnels, retention, alerting, and billing features, while Heroku handles add-on billing and user management.

## Context

The guide addresses the need to understand API performance, usage, user behavior, errors, and business value through specialized API analytics, while reducing the setup and administrative overhead of integrating those capabilities with a Heroku application.

## Approach / What changed

Provision the Moesif add-on through the Heroku CLI or Dashboard, use the generated MOESIF\_APPLICATION\_ID when initializing the Moesif SDK, replicate the variable locally through Heroku Local, protect the resulting .env file from source control, and open Moesif to analyze incoming events and configure monetization.

## Takeaways

- Provisioning the add-on adds a MOESIF\_APPLICATION\_ID config variable containing the write-only API token that identifies the application with Moesif.
- The application must initialize the Moesif SDK with MOESIF\_APPLICATION\_ID; a Node application can retrieve it through process.env.MOESIF\_APPLICATION\_ID.
- Heroku Local can copy the config value into .env, which should be excluded from Git by adding .env to .gitignore.

**Tags:** [API](https://yomu.fyi/topic/api), [Data Analytics](https://yomu.fyi/topic/data-analytics), [Heroku](https://yomu.fyi/topic/heroku), [Observability](https://yomu.fyi/topic/observability)

- Source: [Heroku](https://www.heroku.com/blog/add-moesif-api-observability-to-your-heroku-applications)
- Source URL: https://www.heroku.com/blog/add-moesif-api-observability-to-your-heroku-applications
- Ingested by Yomu: 2026-09-10T04:02:06.256Z

[Read original post](https://www.heroku.com/blog/add-moesif-api-observability-to-your-heroku-applications)
