@janus-idp/backstage-plugin-matomo-backend v1.4.6
Matomo Backend
This is the matomo backend plugin that act as a proxy with matomo instance.
Plugin will inject the auth token and ensure that the request are only read only operations.
Matomo API cannot be used as proxy layer due to the token auth it follows. Thus this plugin will act as proxy layer
Getting Started
Installing the NPM package
yarn add --cwd packages/backend @janus-idp/plugin-matomo-backend
Installing the plugin
Adding the plugin to the legacy backend
- Create a new file
packages/backend/src/plugins/matomo.ts
, and add the following
import { Router } from 'express';
import { createRouter } from '@janus-idp/plugin-matomo-backend';
import { PluginEnvironment } from '../types';
export default async function createPlugin(
env: PluginEnvironment,
): Promise<Router> {
return await createRouter({
config: env.config,
});
}
- Next we wire this into overall backend router by editing the
packages/backend/src/index.ts
file:
import matomo from './plugins/matomo';
// ...
async function main() {
// ...
// Add this line under the other lines that follow the useHotMemoize pattern
const matomoEnv = useHotMemoize(module, () => createEnv('matomo'));
// ...
// Insert this line under the other lines that add their routers to apiRouter in the same way
apiRouter.use('/matomo', await matomo(matomoEnv));
// ...
}
Adding the plugin to the new backend
Add the following to your packages/backend/src/index.ts
file:
const backend = createBackend();
// Add the following line
backend.add(import('@janus-idp/backstage-plugin-matomo-backend/alpha'));
backend.start();
Plugin Configurations
Add the following configurations into your app-config.yaml
file:
matomo:
apiToken: ${MATOMO_API_TOKEN}
apiUrl: ${MATOMO_API_URL}
10 hours ago
8 days ago
8 days ago
9 days ago
10 days ago
14 days ago
24 days ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
2 months ago
2 months ago
2 months ago
3 months ago
3 months ago
3 months ago
4 months ago
4 months ago
5 months ago
5 months ago
5 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
7 months ago
7 months ago
8 months ago