Installation Instructions
These instructions apply to self-hosted Backstage only.
Install the plugin
bash
yarn --cwd packages/app add @segment backstage-plugin-analytics-module-segment
Import it into your Backstage application
typescript
// packages/app/src/apis.ts
import {
analyticsApiRef,
configApiRef,
identityApiRef,
} from '@backstage/core-plugin-api';
import { SegmentAnalytics } from '@segment/backstage-plugin-analytics-module-segment';
export const apis: AnyApiFactory[] = [
// Instantiate and register the SegmentAnalytics API Implementation.
createApiFactory({
api: analyticsApiRef,
deps: { configApi: configApiRef, identityApi: identityApiRef },
factory: ({ configApi, identityApi }) =>
SegmentAnalytics.fromConfig(configApi, {
identityApi,
}),
}),
];
Optionally configure user anonymization (by default, this analytics plugin identifies the user taking actions as the logged in Backstage User's entity reference string)
typescript
// packages/app/src/apis.ts
import {
analyticsApiRef,
configApiRef,
identityApiRef,
} from '@backstage/core-plugin-api';
import { SegmentAnalytics } from '@segment/backstage-plugin-analytics-module-segment';
export const apis: AnyApiFactory[] = [
// Instantiate and register the SegmentAnalytics API Implementation.
createApiFactory({
api: analyticsApiRef,
deps: { configApi: configApiRef, identityApi: identityApiRef },
factory: ({ configApi, identityApi }) =>
SegmentAnalytics.fromConfig(configApi, {
identityApi,
userIdTransform: 'sha-256',
}),
}),
];
Configure the plugin
yaml
// app-config.yaml
app:
analytics:
segment:
writeKey: abcABCfooBARtestKEY
Things to Know
- This plugin requires an active workspace with Segment .
- This plugin uses Analytics.js Source .
- You'll need a Segment Write Key to use this plugin.
Changelog
This changelog is produced from commits made to the Twilio Segment plugin since about 1 year ago. It may not contain information about all commits. Releases and version bumps are intentionally omitted. This changelog is generated by AI.
Breaking Changes
- Target Backstage v1.35 which may require an upgrade if your app uses an older Backstage version #21 8 months ago
Features
- Update to Backstage v1.35 following the upgrade helper. Exclude yarn 4 changes #21 8 months ago
Maintenance
- Prepare package publishing and changelog generation #22 8 months ago
Set up Backstage in minutes with Roadie
Focus on using Backstage, rather than building and maintaining it.
