1.4.6 • Published 10 hours ago

@janus-idp/backstage-plugin-matomo-backend v1.4.6

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
10 hours ago

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

  1. 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,
  });
}
  1. 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}
1.4.6

10 hours ago

1.4.5

8 days ago

1.4.4

8 days ago

1.4.3

9 days ago

1.4.2

10 days ago

1.4.1

14 days ago

1.4.0

24 days ago

1.3.10

1 month ago

1.3.9

1 month ago

1.3.8

1 month ago

1.3.7

1 month ago

1.3.6

1 month ago

1.3.5

2 months ago

1.3.4

2 months ago

1.3.3

2 months ago

1.3.2

3 months ago

1.3.1

3 months ago

1.3.0

3 months ago

1.2.8

4 months ago

1.2.7

4 months ago

1.2.6

5 months ago

1.2.5

5 months ago

1.2.4

5 months ago

1.2.3

6 months ago

1.2.2

6 months ago

1.2.1

6 months ago

1.2.0

6 months ago

1.1.2

6 months ago

1.1.1

6 months ago

1.1.0

7 months ago

1.0.1

7 months ago

1.0.0

8 months ago