SlideShare a Scribd company logo
1 of 24
Personalizing JSS app with
Sitecore rules and GraphQL
Let’s build a rules engine and do some personalization!
Jack Spektor
- Working with Sitecore since v6.0
- Mostly work with BE, very little experience with FE - don’t
judge harshly!
Sitecore Tech Lead @ AKQA NZ
Do you love Sitecore rules as I do?
So easy to use!
So customizable!
😍😍😍
But not supported with JSS and XM Cloud
Sad…
😒😔😢
Can we still use Sitecore rules though?
- XM Cloud still has rules field
type
- And Sitecore still exposes rules
field content on Experience
Edge
- The only limitation is - it
doesn’t execute them
We’ll build our own FE rules engine!
- We’ll parse rules XML
- We’ll run rules conditions on
client-side
- And execute actions on client-
side
APIs for extensibility
- We’ll map all Sitecore rules &
actions by their IDs to equivalent
in JS
- And we’ll make APIs to easily add
new rules/actions/operators
APIs for extensibility
APIs for extensibility
APIs for extensibility
- And we’ll publish it to npm to
easily use it in NextJS app
How can we use it?
- Personalization
- A/B tests
- Shop promotions
- Business decision trees
- Etc.
Use case: Personalization
- Let’s make layout
personalization using Sitecore
rules
- We’ll introduce new field in
Sitecore for personalization
rules and render flags and we’ll
use it in JSS
Client-side personalization
Standard JSS layout render flow
request
<Placeholde
r/>
<HTML/>
component-props-
factory
page-props-
factory
Render
components
Client-side personalization
Client-side personalization render flow
request
<PersonalizedPlaceh
older/>
<HTML/>
component-props-
factory
page-props-
factory
Render
components
personalization?
Retrieve personalization
rules from Edge and run
them
Modify props
yes
no
Client-side personalization
Client-side personalization
demo
SSR Personalization
SSR personalization render flow
request
page-props-
factory plugin
<HTML/>
page-props-
factory
Render
components
personalization?
Retrieve personalization
rules from Edge and run
them
Modify props
yes
no
SSR Personalization
SSR personalization demo
SSG Personalization
SSG personalization build flow
build
Personalize-sitemap
plugin
<HTML/>
sitemap-fetcher
Return all
paths
personalization?
Retrieve personalization
rules from Edge and
parse them
Calculate all personalized
variations
yes
_scvariant01, _scvariant01, _scvariant10….
SSG Personalization
SSG personalization render flow
SSG
Identify the applied rules
based on the variantId
<HTML/>
Has variantId?
Pre-render default
variation
no
yes
_scvariant01
Pre-render variant with
rule personalization
actions applied
SSG Personalization
SSG personalization request flow
request
Calculate variantId based
on rule execution result
<HTML/>
Has
personalization?
Return the default path
no
yes
_scvariant01
Return the path with
variantId to render
Middleware to run
personalization rules
for request
First Rule
Second Rule
SSG Personalization
SSG personalization demo
Method comparison
Method Pros Cons
Client-Side Fastest response time Flickering on page load
SSR No flickering
No need for using custom
placeholder
Needs to be executed on
every request
SSG Fastest possible server-side
personalization
Max 4 rules per page
possible
Summary
- Only POC so far
- Need to cover all Sitecore rules and conditions
- Contributions welcome!
- More case studies coming (chatbot based on Sitecore
rules)
https://github.com/JackTheHack/Sitecore.JSS-Rule-Engine
Thank you!

More Related Content

Similar to Headless JS UG Presentation.pptx

Building isomorphic java script apps faster with next.js
Building isomorphic java script apps faster with next.jsBuilding isomorphic java script apps faster with next.js
Building isomorphic java script apps faster with next.jsMadhav Chaturvedi
 
SSR with Quasar Framework - JSNation 2019
SSR with Quasar Framework - JSNation 2019SSR with Quasar Framework - JSNation 2019
SSR with Quasar Framework - JSNation 2019Razvan Stoenescu
 
Professional Services Insights into Improving Sitecore XP
Professional Services Insights into Improving Sitecore XPProfessional Services Insights into Improving Sitecore XP
Professional Services Insights into Improving Sitecore XPSeanHolmesby1
 
Server-Side Rendering (SSR) with Angular Universal
Server-Side Rendering (SSR) with Angular UniversalServer-Side Rendering (SSR) with Angular Universal
Server-Side Rendering (SSR) with Angular UniversalKaty Slemon
 
Vitali zaidman Do You Need Server Side Rendering? What Are The Alternatives?
Vitali zaidman Do You Need Server Side Rendering? What Are The Alternatives?Vitali zaidman Do You Need Server Side Rendering? What Are The Alternatives?
Vitali zaidman Do You Need Server Side Rendering? What Are The Alternatives?CodeValue
 
Best of barcelona symposium experience
Best of barcelona symposium experienceBest of barcelona symposium experience
Best of barcelona symposium experienceThe Reference
 
SUGMEA - Sitecore JSS and Performance Optimization - Alex Shyba - Altudo
SUGMEA - Sitecore JSS and Performance Optimization - Alex Shyba - AltudoSUGMEA - Sitecore JSS and Performance Optimization - Alex Shyba - Altudo
SUGMEA - Sitecore JSS and Performance Optimization - Alex Shyba - Altudodharmeshharji
 
Getting started with spfx
Getting started with spfxGetting started with spfx
Getting started with spfxJenkins NS
 
Angular vs React: Building modern SharePoint interfaces with SPFx
Angular vs React: Building modern SharePoint interfaces with SPFxAngular vs React: Building modern SharePoint interfaces with SPFx
Angular vs React: Building modern SharePoint interfaces with SPFxDimcho Tsanov
 
#SitecoreJSS and #SitecoreSXA together. Is It Real? First experience!
#SitecoreJSS and #SitecoreSXA together. Is It Real? First experience!#SitecoreJSS and #SitecoreSXA together. Is It Real? First experience!
#SitecoreJSS and #SitecoreSXA together. Is It Real? First experience!Vadzim Papko
 
Client Side MVC with Backbone and Rails
Client Side MVC with Backbone and RailsClient Side MVC with Backbone and Rails
Client Side MVC with Backbone and RailsTom Z Zeng
 
SUGUK Cambridge - Display Templates & JSLink for IT Pros
SUGUK Cambridge - Display Templates & JSLink for IT ProsSUGUK Cambridge - Display Templates & JSLink for IT Pros
SUGUK Cambridge - Display Templates & JSLink for IT ProsPaul Hunt
 
SPA Editor - Adobe Experience Manager Sites
SPA Editor - Adobe Experience Manager SitesSPA Editor - Adobe Experience Manager Sites
SPA Editor - Adobe Experience Manager SitesGabriel Walt
 
Using js link and display templates
Using js link and display templatesUsing js link and display templates
Using js link and display templatesPaul Hunt
 

Similar to Headless JS UG Presentation.pptx (20)

Ng-init
Ng-init Ng-init
Ng-init
 
Building isomorphic java script apps faster with next.js
Building isomorphic java script apps faster with next.jsBuilding isomorphic java script apps faster with next.js
Building isomorphic java script apps faster with next.js
 
SSR with Quasar Framework - JSNation 2019
SSR with Quasar Framework - JSNation 2019SSR with Quasar Framework - JSNation 2019
SSR with Quasar Framework - JSNation 2019
 
Professional Services Insights into Improving Sitecore XP
Professional Services Insights into Improving Sitecore XPProfessional Services Insights into Improving Sitecore XP
Professional Services Insights into Improving Sitecore XP
 
Server side rendering review
Server side rendering reviewServer side rendering review
Server side rendering review
 
Angular meetup
Angular meetupAngular meetup
Angular meetup
 
Server-Side Rendering (SSR) with Angular Universal
Server-Side Rendering (SSR) with Angular UniversalServer-Side Rendering (SSR) with Angular Universal
Server-Side Rendering (SSR) with Angular Universal
 
Vitali zaidman Do You Need Server Side Rendering? What Are The Alternatives?
Vitali zaidman Do You Need Server Side Rendering? What Are The Alternatives?Vitali zaidman Do You Need Server Side Rendering? What Are The Alternatives?
Vitali zaidman Do You Need Server Side Rendering? What Are The Alternatives?
 
Remix
RemixRemix
Remix
 
Best of barcelona symposium experience
Best of barcelona symposium experienceBest of barcelona symposium experience
Best of barcelona symposium experience
 
Sitecore mvc
Sitecore mvcSitecore mvc
Sitecore mvc
 
SUGMEA - Sitecore JSS and Performance Optimization - Alex Shyba - Altudo
SUGMEA - Sitecore JSS and Performance Optimization - Alex Shyba - AltudoSUGMEA - Sitecore JSS and Performance Optimization - Alex Shyba - Altudo
SUGMEA - Sitecore JSS and Performance Optimization - Alex Shyba - Altudo
 
Getting started with spfx
Getting started with spfxGetting started with spfx
Getting started with spfx
 
An Overview on Nuxt.js
An Overview on Nuxt.jsAn Overview on Nuxt.js
An Overview on Nuxt.js
 
Angular vs React: Building modern SharePoint interfaces with SPFx
Angular vs React: Building modern SharePoint interfaces with SPFxAngular vs React: Building modern SharePoint interfaces with SPFx
Angular vs React: Building modern SharePoint interfaces with SPFx
 
#SitecoreJSS and #SitecoreSXA together. Is It Real? First experience!
#SitecoreJSS and #SitecoreSXA together. Is It Real? First experience!#SitecoreJSS and #SitecoreSXA together. Is It Real? First experience!
#SitecoreJSS and #SitecoreSXA together. Is It Real? First experience!
 
Client Side MVC with Backbone and Rails
Client Side MVC with Backbone and RailsClient Side MVC with Backbone and Rails
Client Side MVC with Backbone and Rails
 
SUGUK Cambridge - Display Templates & JSLink for IT Pros
SUGUK Cambridge - Display Templates & JSLink for IT ProsSUGUK Cambridge - Display Templates & JSLink for IT Pros
SUGUK Cambridge - Display Templates & JSLink for IT Pros
 
SPA Editor - Adobe Experience Manager Sites
SPA Editor - Adobe Experience Manager SitesSPA Editor - Adobe Experience Manager Sites
SPA Editor - Adobe Experience Manager Sites
 
Using js link and display templates
Using js link and display templatesUsing js link and display templates
Using js link and display templates
 

Recently uploaded

JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)Max Lee
 
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...Andrea Goulet
 
Mastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdfMastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdfmbmh111980
 
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...Alluxio, Inc.
 
Studiovity film pre-production and screenwriting software
Studiovity film pre-production and screenwriting softwareStudiovity film pre-production and screenwriting software
Studiovity film pre-production and screenwriting softwareinfo611746
 
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdfA Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdfkalichargn70th171
 
Workforce Efficiency with Employee Time Tracking Software.pdf
Workforce Efficiency with Employee Time Tracking Software.pdfWorkforce Efficiency with Employee Time Tracking Software.pdf
Workforce Efficiency with Employee Time Tracking Software.pdfDeskTrack
 
Agnieszka Andrzejewska - BIM School Course in Kraków
Agnieszka Andrzejewska - BIM School Course in KrakówAgnieszka Andrzejewska - BIM School Course in Kraków
Agnieszka Andrzejewska - BIM School Course in Krakówbim.edu.pl
 
What need to be mastered as AI-Powered Java Developers
What need to be mastered as AI-Powered Java DevelopersWhat need to be mastered as AI-Powered Java Developers
What need to be mastered as AI-Powered Java DevelopersEmilyJiang23
 
GraphSummit Stockholm - Neo4j - Knowledge Graphs and Product Updates
GraphSummit Stockholm - Neo4j - Knowledge Graphs and Product UpdatesGraphSummit Stockholm - Neo4j - Knowledge Graphs and Product Updates
GraphSummit Stockholm - Neo4j - Knowledge Graphs and Product UpdatesNeo4j
 
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdf
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdfImplementing KPIs and Right Metrics for Agile Delivery Teams.pdf
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdfVictor Lopez
 
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...naitiksharma1124
 
APVP,apvp apvp High quality supplier safe spot transport, 98% purity
APVP,apvp apvp High quality supplier safe spot transport, 98% purityAPVP,apvp apvp High quality supplier safe spot transport, 98% purity
APVP,apvp apvp High quality supplier safe spot transport, 98% purityamy56318795
 
A Guideline to Zendesk to Re:amaze Data Migration
A Guideline to Zendesk to Re:amaze Data MigrationA Guideline to Zendesk to Re:amaze Data Migration
A Guideline to Zendesk to Re:amaze Data MigrationHelp Desk Migration
 
Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...
Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...
Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...Abortion Clinic
 
IT Software Development Resume, Vaibhav jha 2024
IT Software Development Resume, Vaibhav jha 2024IT Software Development Resume, Vaibhav jha 2024
IT Software Development Resume, Vaibhav jha 2024vaibhav130304
 
AI/ML Infra Meetup | ML explainability in Michelangelo
AI/ML Infra Meetup | ML explainability in MichelangeloAI/ML Infra Meetup | ML explainability in Michelangelo
AI/ML Infra Meetup | ML explainability in MichelangeloAlluxio, Inc.
 
Crafting the Perfect Measurement Sheet with PLM Integration
Crafting the Perfect Measurement Sheet with PLM IntegrationCrafting the Perfect Measurement Sheet with PLM Integration
Crafting the Perfect Measurement Sheet with PLM IntegrationWave PLM
 
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1KnowledgeSeed
 

Recently uploaded (20)

JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)
 
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
 
Mastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdfMastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdf
 
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
 
Studiovity film pre-production and screenwriting software
Studiovity film pre-production and screenwriting softwareStudiovity film pre-production and screenwriting software
Studiovity film pre-production and screenwriting software
 
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdfA Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
 
Workforce Efficiency with Employee Time Tracking Software.pdf
Workforce Efficiency with Employee Time Tracking Software.pdfWorkforce Efficiency with Employee Time Tracking Software.pdf
Workforce Efficiency with Employee Time Tracking Software.pdf
 
Agnieszka Andrzejewska - BIM School Course in Kraków
Agnieszka Andrzejewska - BIM School Course in KrakówAgnieszka Andrzejewska - BIM School Course in Kraków
Agnieszka Andrzejewska - BIM School Course in Kraków
 
What need to be mastered as AI-Powered Java Developers
What need to be mastered as AI-Powered Java DevelopersWhat need to be mastered as AI-Powered Java Developers
What need to be mastered as AI-Powered Java Developers
 
GraphSummit Stockholm - Neo4j - Knowledge Graphs and Product Updates
GraphSummit Stockholm - Neo4j - Knowledge Graphs and Product UpdatesGraphSummit Stockholm - Neo4j - Knowledge Graphs and Product Updates
GraphSummit Stockholm - Neo4j - Knowledge Graphs and Product Updates
 
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdf
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdfImplementing KPIs and Right Metrics for Agile Delivery Teams.pdf
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdf
 
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
 
APVP,apvp apvp High quality supplier safe spot transport, 98% purity
APVP,apvp apvp High quality supplier safe spot transport, 98% purityAPVP,apvp apvp High quality supplier safe spot transport, 98% purity
APVP,apvp apvp High quality supplier safe spot transport, 98% purity
 
A Guideline to Zendesk to Re:amaze Data Migration
A Guideline to Zendesk to Re:amaze Data MigrationA Guideline to Zendesk to Re:amaze Data Migration
A Guideline to Zendesk to Re:amaze Data Migration
 
Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...
Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...
Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...
 
5 Reasons Driving Warehouse Management Systems Demand
5 Reasons Driving Warehouse Management Systems Demand5 Reasons Driving Warehouse Management Systems Demand
5 Reasons Driving Warehouse Management Systems Demand
 
IT Software Development Resume, Vaibhav jha 2024
IT Software Development Resume, Vaibhav jha 2024IT Software Development Resume, Vaibhav jha 2024
IT Software Development Resume, Vaibhav jha 2024
 
AI/ML Infra Meetup | ML explainability in Michelangelo
AI/ML Infra Meetup | ML explainability in MichelangeloAI/ML Infra Meetup | ML explainability in Michelangelo
AI/ML Infra Meetup | ML explainability in Michelangelo
 
Crafting the Perfect Measurement Sheet with PLM Integration
Crafting the Perfect Measurement Sheet with PLM IntegrationCrafting the Perfect Measurement Sheet with PLM Integration
Crafting the Perfect Measurement Sheet with PLM Integration
 
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
 

Headless JS UG Presentation.pptx

  • 1. Personalizing JSS app with Sitecore rules and GraphQL Let’s build a rules engine and do some personalization!
  • 2. Jack Spektor - Working with Sitecore since v6.0 - Mostly work with BE, very little experience with FE - don’t judge harshly! Sitecore Tech Lead @ AKQA NZ
  • 3. Do you love Sitecore rules as I do? So easy to use! So customizable! 😍😍😍
  • 4. But not supported with JSS and XM Cloud Sad… 😒😔😢
  • 5. Can we still use Sitecore rules though? - XM Cloud still has rules field type - And Sitecore still exposes rules field content on Experience Edge - The only limitation is - it doesn’t execute them
  • 6. We’ll build our own FE rules engine! - We’ll parse rules XML - We’ll run rules conditions on client-side - And execute actions on client- side
  • 7. APIs for extensibility - We’ll map all Sitecore rules & actions by their IDs to equivalent in JS - And we’ll make APIs to easily add new rules/actions/operators
  • 10. APIs for extensibility - And we’ll publish it to npm to easily use it in NextJS app
  • 11. How can we use it? - Personalization - A/B tests - Shop promotions - Business decision trees - Etc.
  • 12. Use case: Personalization - Let’s make layout personalization using Sitecore rules - We’ll introduce new field in Sitecore for personalization rules and render flags and we’ll use it in JSS
  • 13. Client-side personalization Standard JSS layout render flow request <Placeholde r/> <HTML/> component-props- factory page-props- factory Render components
  • 14. Client-side personalization Client-side personalization render flow request <PersonalizedPlaceh older/> <HTML/> component-props- factory page-props- factory Render components personalization? Retrieve personalization rules from Edge and run them Modify props yes no
  • 16. SSR Personalization SSR personalization render flow request page-props- factory plugin <HTML/> page-props- factory Render components personalization? Retrieve personalization rules from Edge and run them Modify props yes no
  • 18. SSG Personalization SSG personalization build flow build Personalize-sitemap plugin <HTML/> sitemap-fetcher Return all paths personalization? Retrieve personalization rules from Edge and parse them Calculate all personalized variations yes _scvariant01, _scvariant01, _scvariant10….
  • 19. SSG Personalization SSG personalization render flow SSG Identify the applied rules based on the variantId <HTML/> Has variantId? Pre-render default variation no yes _scvariant01 Pre-render variant with rule personalization actions applied
  • 20. SSG Personalization SSG personalization request flow request Calculate variantId based on rule execution result <HTML/> Has personalization? Return the default path no yes _scvariant01 Return the path with variantId to render Middleware to run personalization rules for request First Rule Second Rule
  • 22. Method comparison Method Pros Cons Client-Side Fastest response time Flickering on page load SSR No flickering No need for using custom placeholder Needs to be executed on every request SSG Fastest possible server-side personalization Max 4 rules per page possible
  • 23. Summary - Only POC so far - Need to cover all Sitecore rules and conditions - Contributions welcome! - More case studies coming (chatbot based on Sitecore rules) https://github.com/JackTheHack/Sitecore.JSS-Rule-Engine