Configuring the Management API
The Dashboard of the Moesif Developer Portal is powered by Moesif Embedded Templates which utilizes Moesif’s Management API. This functionality enables charts and visualizations in Moesif to be seamlessly displayed within the developer portal. Additionally, the management API allows Stripe to display plans and prices within the developer portal.
Creating a Management Token for API Access
To enable API access for Stripe to retrieve plans and prices, and for the Developer Portal to utilize embedded templates, follow these steps to create a management token:
- Navigate to Your Moesif Profile:
- Go to Profile > API Keys.
- Configure Token Permissions:
- Set read access for the following resources:
- User
- Company
- Plans
- Price
- Workspaces
- Public Workspaces
- Set read access for the following resources:
- Set an Expiration Date (Optional):
- Specify an expiration date for the token if needed.
- Generate the Token:
- Click Generate Token to complete the process.
Copy the generated key for later use. The generated token will be essential for integrating Moesif Embedded Templates and Stripe into the Developer Portal.
Updating Environment Variables
To integrate the management token and templates, update the environment variables for your development setup.
Environment Variables for Node
- Open the
my-dev-portal-api/.env
file. - Replace the following lines with the correct values:
MOESIF_MANAGEMENT_TOKEN="your Moesif management token"
- Save the
.env
file to ensure the updated values are persisted.
Environment Variables for Docker
- Open the
distribution/docker-compose.yml
file. - Add or update the following entries in the relevant service configuration under
environment
:
dev-portal-api:
environment:
- MOESIF_MANAGEMENT_TOKEN="your Moesif management token"
- Save the
docker-compose.yml
file to ensure the updated values are persisted.
Next Steps
After updating the environment variables, save the changes and proceed to configuring the dashboards.