Skip to content

Plugin overview ​

This repository contains publishable TypeScript packages that encapsulate shared Investec Online platform business logic. The platform consumes the published packages. Consuming teams can contribute additional API calls, mappings, and configuration when the change fits an existing plugin's purpose.

The Web Platform team governs package boundaries and platform adoption. Contact the team before creating a plugin or making a substantial change to security, state lifecycle, shared architecture, or a published contract.

Workspace structure ​

  • each plugin is a top-level Nx library;
  • each publishable package has its own package.json, project.json, and .azure-pipelines.yml;
  • src/index.ts defines the public contract;
  • VitePress documentation lives in docs/;
  • plugins-demo is the local harness for exercising plugin APIs.

Plugin packages ​

PackageResponsibilityMain exportsConsumer-installable?
@investec/plugins-adobe-analyticsStandardised Adobe Analytics event building and data-layer dispatchAdobeAnalyticsNo — platform-only
@investec/plugins-client-type-routerRoute URL context to clientType and shell interaction staterouteClientTypeBasedOnUrl, DEFAULT_ROUTE_RULESNo — platform-only
@investec/plugins-cobrowsePrivacy-first Cobrowse.io lifecycle, session codes, cross-origin iframe bridging, and redactionInvestecCobrowse, cobrowseNo — platform-only
@investec/plugins-experience-managerDetermine pre-login and post-login destinationsdetermineJourneyPreLogin, determineJourneyAfterLogin, decodeDestinationNo — platform-only
@investec/plugins-feature-flags-builderLegacy feature-flag aggregation from gateway endpointsgetUserFeaturesWebNo — platform-only
@investec/plugins-feature-libraryFeature-registry loading, favourites, eligibility, Adobe Target overrides, and searchgetWebFeatures, checkFeatureRequirements, featureSearch, addFavouriteFeatureNo — platform-only
@investec/plugins-left-nav-builderBuild left-nav items from menu state and client contextleftNavBuilder, getLoggedInMenuStateNo — platform-only
@investec/plugins-livechatNICE CXone chat wrapper with thread recovery and browser eventsLiveChatYes — approved exception (see livechat.md)
@investec/plugins-menu-builderAggregate multiple menu APIs into one menu modelmenuBuilder, setupMenuNo — platform-only
@investec/plugins-personalisationAdobe Target content retrieval and profile-update helpersgetAdobeTargetDataByTemplate, postProfileUpdatesByTemplateNo — platform-only
@investec/plugins-portfolio-builderPortfolio aggregation, totals, contact data, and portfolio streamingportfolioBuilder, portfolioNo — platform-only
@investec/plugins-profiles-builderRetrieve and normalise client profilesprofilesBuilder, getProfilesNo — platform-only
@investec/plugins-toggles-builderLegacy toggle and feature-disable mappinggetToggles, mapToggles, removeToggledFeaturesNo — platform-only

Integration model ​

The packages fall into four groups.

Stateful shell builders ​

These packages expose ReplaySubject-based state objects, expect environment and auth context to be injected first, and emit updates incrementally.

Shell routing and journey helpers ​

These packages are pure or mostly pure decision layers that map URL or auth context to navigation outcomes and shell chrome state.

Discovery and personalisation ​

These packages decide what a customer can see, open, or be shown, often by combining feature-registry data with authenticated client context.

External integrations ​

These packages wrap third-party systems behind a smaller platform-facing API.

Consumer expectations ​

Before using a plugin:

  1. import from the package root, not from internal file paths;
  2. set any exported activeEnvironment value before making calls;
  3. inject required state such as authResponse, clientType, or menu data before triggering builder functions;
  4. treat exported subjects and mutable module-level caches as application-lifetime state unless the package exposes an explicit reset path.

How consumers extend plugin behaviour ​

Use one of two extension paths.

For application-owned behaviour:

  1. shaping the plugin input;
  2. wrapping the emitted output in app-owned state;
  3. composing application-specific rules after the plugin result;
  4. using any explicit extension hook the package exposes.

For shared platform business logic, contribute to the existing plugin by adding the approved API helper, configuration entry, mapping, type, test, and documentation. Do not reproduce the same shared rule in multiple consumers.

Use Plugin change governance to decide whether an AI or contributor can make the change directly or must first obtain platform-team approval.

Legacy packages ​

feature-flags-builder and toggles-builder are legacy compatibility layers. They remain useful when the platform still expects their data shape, but they are not the preferred place to introduce new entitlement logic.

For the standards contributors and agents must follow when expanding a shared plugin, start with Plugin change governance, Get started, and Extension patterns.