Skip to content

Commit

Permalink
Add analytics workspace
Browse files Browse the repository at this point in the history
Signed-off-by: David Festal <[email protected]>
  • Loading branch information
davidfestal committed Jun 6, 2024
1 parent 4f41875 commit b51fc44
Show file tree
Hide file tree
Showing 11 changed files with 136 additions and 0 deletions.
3 changes: 3 additions & 0 deletions workspaces/analytics/plugins-list.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
plugins/analytics-module-ga:
plugins/analytics-module-ga4:
plugins/analytics-module-newrelic-browser:
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dynamicPlugins:
frontend:
backstage.plugin-analytics-module-ga:
apiFactories:
- importName: gaAnalyticsApi
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Copyright 2024 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import {
AnyApiFactory,
analyticsApiRef,
configApiRef,
createApiFactory,
identityApiRef,
} from '@backstage/core-plugin-api';
import { GoogleAnalytics } from './apis/implementations/AnalyticsApi';

export const gaAnalyticsApi: AnyApiFactory = createApiFactory({
api: analyticsApiRef,
deps: { configApi: configApiRef, identityApi: identityApiRef },
factory: ({ configApi, identityApi }) =>
GoogleAnalytics.fromConfig(configApi, {
identityApi,
}),
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "backstage.plugin-analytics-module-ga",
"exposedModules": {
"PluginRoot": "./src/api.ts"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dynamicPlugins:
frontend:
backstage.plugin-analytics-module-ga4:
apiFactories:
- importName: ga4AnalyticsApi
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Copyright 2024 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import {
AnyApiFactory,
analyticsApiRef,
configApiRef,
createApiFactory,
identityApiRef,
} from '@backstage/core-plugin-api';
import { GoogleAnalytics4 } from './apis/implementations/AnalyticsApi';

export const ga4AnalyticsApi: AnyApiFactory = createApiFactory({
api: analyticsApiRef,
deps: { configApi: configApiRef, identityApi: identityApiRef },
factory: ({ configApi, identityApi }) =>
GoogleAnalytics4.fromConfig(configApi, {
identityApi,
}),
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "backstage.plugin-analytics-module-ga4",
"exposedModules": {
"PluginRoot": "./src/api.ts"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dynamicPlugins:
frontend:
backstage.plugin-analytics-module-newrelic-browser:
apiFactories:
- importName: newRelicBrowserAnalyticsApi
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Copyright 2024 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import {
AnyApiFactory,
analyticsApiRef,
configApiRef,
createApiFactory,
identityApiRef,
} from '@backstage/core-plugin-api';
import { NewRelicBrowser } from './apis/implementations/AnalyticsApi';

export const newRelicBrowserAnalyticsApi: AnyApiFactory = createApiFactory({
api: analyticsApiRef,
deps: { configApi: configApiRef, identityApi: identityApiRef },
factory: ({ configApi, identityApi }) =>
NewRelicBrowser.fromConfig(configApi, {
identityApi,
}),
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "backstage.plugin-analytics-module-newrelic-browser",
"exposedModules": {
"PluginRoot": "./src/api.ts"
}
}
1 change: 1 addition & 0 deletions workspaces/analytics/ref
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
b6a829284e0f4e10e6f7d9036cab71e2068a8829

0 comments on commit b51fc44

Please sign in to comment.