@parameter1/base-cms-marko-web-omeda-identity-x
v4.74.0
Published
Marko Omeda+IdentityX integration tools
Downloads
3,826
Keywords
Readme
BaseCMS Marko Omeda+IdentityX Integrations
Omeda+IdentityX components for BaseCMS/Marko websites.
Based on the identity provider(s) in use, install and configure only one of these packages. The other packages can be installed separately if needed, but this package should be the only one configured.
- omeda-identity-x: For sites with both Omeda and IdentityX.
- omeda: For sites with Omeda, but without IdentityX.
- identity-x: For sites with IdentityX, but without Omeda.
Additional information can be found in the Omeda and IdentityX API documentation.
Configuration
All configuration data must be passed to the middleware when loaded (See Middleware Setup below.)
| Property | Required? | Description | Default value |
| - | - | - | - |
| brandKey
| Yes | The Omeda Brand key (such as orgcd
).
| clientKey
| No | The Omeda client key (such as client_orgc
.) Required if sending deployment optIns via the underlying omeda package! marko-web-omeda docs
| appId
| Yes | The Omeda application API read token
| inputId
| Yes | The Omeda application API write token
| rapidIdentProductId
| Yes | The Omeda identifier for a Website product (ProductType=7).
| idxConfig
| Yes | An instance of the IdentityX configuration class (see marko-web-identity-x#1) | n/a
| idxRouteTemplates
| Yes | An object containing the Marko templates to use for each IdentityX endpoint. (see marko-web-identity-x#2)
| omedaPromoCodeCookieName
| No | The name of the cookie to look for a persisted/original promo code. | omeda_promo_code
|
| omedaPromoCodeDefault
| No | The default promo code to send with all Omeda requests. Falls back to input ID default configured by Omeda. |
| idxOmedaRapidIdentifyProp
| No | The property (in the express app context) where the O+IdX rapid identification service is located. | $idxOmedaRapidIdentify
|
| omedaGraphQLClientProp
| No | The property (in the express app context) where the Omeda GraphQL client is located. | $omedaGraphQLClient
|
| omedaRapidIdentifyProp
| No | The property (in the express app context) where the Omeda rapid identification service is located. | $omedaRapidIdentify
|
| appendBehaviorToHook
| No | An array of objects defining behaviors to append to rapid identification calls.
| appendBehaviorToHook[].hook
| | The name of the hook, such as onLoginLinkSent
| appendBehaviorToHook[].behaviorId
|| The Omeda Behavior ID to append to the rapid identification call.
| appendDemographicToHook
| No | An array of objects defining demographics to append to rapid identification calls.
| appendDemographicToHook[].hook
| | The name of the hook, such as onLoginLinkSent
| appendDemographicToHook[].demographicId
|| The Omeda Demographic ID to append.
| appendDemographicToHook[].valueIds
|| An array of Omeda Demographic Value IDs (Int
s) to append
| appendDemographicToHook[].writeInValue
|| A string to include as an OEC/Other value
| appendPromoCodeToHook
| No | An array of objects defining demographics to append to rapid identification calls.
| appendPromoCodeToHook[].hook
| | The name of the hook, such as onLoginLinkSent
| appendPromoCodeToHook[].promoCode
|| The Omeda Promo Code (String
) to append.
Usage
This package:
- Configures the underlying omeda and identity-x packages
- Hooks into the IdentityX library to push Omeda data to IdX and push IdX data to Omeda when profile updates happen
- Makes the rapid identification endpoint (
/__idx/omeda-rapid-ident
) available on a base-cms website - (Optional) Provides a Vue component to call the rapid identification endpoint
1. Middleware Setup
To make the local omeda mountpoint available, load the middleware exported by this package. For most applications, this will be done in the startServer
function passed to the marko-web package.
See config section above and the Omeda and IdentityX package documentation for available configurations.
const handler = require('@parameter1/base-cms-marko-web-omeda-identity-x');
const omedaConfig = require('./config/omeda');
const idXConfig = require('./config/identity-x');
const idxRouteTemplates = require('./templates/user');
startServer({
onStart: async (app) => {
handler(app, {
...omedaConfig,
idxConfig,
idxRouteTemplates,
})
},
}
It can also be loaded as a standard Express route middleware.
module.exports = (app) => {
handler(app, { ...omedaConfig, idxConfig, idxRouteTemplates });
};
2. Rapid Identification
To use the Rapid Identification hook, load the Vue component in your Browser config. When enabled, the Omeda Rapid Identification API will be called automatically when the oly_enc_id
URL query parameter is present.
import OmedaIdentityX from '@parameter1/base-cms-marko-web-omeda-identity-x/browser';
export default (Browser) => {
OmedaIdentityX(Browser);
};