CDS
The Zephr CDS plugin checks subscription information for users with CDS as they log into Zephr. Product grants are then added or removed as necessary to reflect the current state of active subscriptions in CDS.
Behaviour
- On user sign up or sign in, the plugin will query CDS using the user’s email address.
- If a corresponding record is found in CDS, the value of the
customerStatus
field for the user is checked. - If the value of the field is
A
(active), the plugin then checks the value of thespecialProductCode
field for the user. - The value of the
specialProductCode
field is used in conjunction with the configuration that has been stored for the plugin (please see below for details) to decide whether there are products to grant or revoke for the user.
NOTE: Any product grants assigned in Zephr will not have an end date. Product grants or revocation of product grants are only performed by the plugin on each user sign in. This means that if you have a long duration for user sessions, subscriptions that may have expired in CDS may still be represented by an active product grant in Zephr. If this will be a problem for your use case, it is recommended that you investigate a periodic process to compare CDS subscription data with active Zephr product grants.
Configuring the CDS Extension
To enable the CDS Extension within Zephr, navigate to Settings > Extensions > CDS. If you cannot see the CDS option in your list of Extensions, email support@zephr.com.
There are 2 main configuration sections for this integration:
- CDS Data API
- Product Mapping
CDS Data API
In this section, you will need to provide:
- CDS App ID
- Password
These will be available from your CDS account. If you do not know these details, please contact CDS directly.
Product mapping
This section has a single input field titled CDS Product ID to Zephr Product ID mapping which accepts a JSON object with the following structure:
{ "<prodId>": { "<specialProductCode1>": "<zephrProductSlug1>", "<specialProductCode2>": "<zephrProductSlug2>", "<specialProductCode3>": [ "<zephrProductSlug1>", "<zephrProductSlug2>" ] } }
The value of your CDS prodId
key should be an object, where the keys are the possible values of the specialProductCode
field and the values of each key is either a string corresponding to a single Zephr product ID, or an array of strings corresponding to one or more Zephr product IDs.
For example, if you have a prodId
of ABC, specialProductCode
values of X, Y and Z, these could be mapped to my-zephr-product-1
and my-zephr-product-2
as so:
{ "ABC": { "X": "my-zephr-product-1", "Y": "my-zephr-product-2", "Z": [ "my-zephr-product-1", "my-zephr-product-2" ] } }
Your Zephr Product slug is the name of your Product, with hyphens instead of spaces. For example, a Product called Gold would have the Product slug gold
. A Product called Gold Annual would have the Product slug gold-annual
.
With the configuration as above, when a user signs in to your site:
- If they are not active in CDS, no product grants will be added to their user record.
- If they do not exist in CDS, no product grants will be added to their user record.
- If they are active in CDS and have a
specialProductCode
value of X, they will be grantedmy-zephr-product-1
. - If they are active in CDS and have a
specialProductCode
value of Y, they will be grantedmy-zephr-product-2
. - If they are active in CDS and have a
specialProductCode
value of Z, they will be granted bothmy-zephr-product-1
andmy-zephr-product-2
. - If they are active and currently have access to
my-zephr-product-1
andmy-zephr-product-2
, but on a subsequent sign in, have aspecialProductCode
value of Y, then their access tomy-zephr-product-1
will be revoked, leaving them with an active grant formy-zephr-product-2
(the configured value for Y).
Activate Plugin
Once you’ve input the relevant details, confirm which of your Sites the extension should be active on. To do this, use the toggles for each site under the Activate Plugin section, or choose Select All Sites.
Once completed, click Save. Your extension is now enabled.