Security News
UK Officials Consider Banning Ransomware Payments from Public Entities
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.
@sitecore-cloudsdk/personalize
Advanced tools
This package provides browser- and server-side functions to run personalizations in your app. Personalization is for showing the most relevant content to your users.
This package provides browser- and server-side functions to run personalizations in your app. Personalization is for showing the most relevant content to your users.
npm install @sitecore-cloudsdk/personalize
CloudSDK
function, available in the core
package.events
package.personalize
function.Run personalizations from the browser side:
'use client';
import { useEffect } from 'react';
import { CloudSDK } from '@sitecore-cloudsdk/core/browser';
import { personalize } from '@sitecore-cloudsdk/personalize/browser';
export default function Home() {
const getPersonalizeData = async () => {
// Run interactive personalization:
const data = await personalize({
channel: 'WEB',
currency: 'EUR',
friendlyId: '<YOUR_EXPERIENCE_FRIENDLY_ID>'
});
console.log(data);
};
useEffect(() => {
CloudSDK({
/* Initialization settings. See `core` package code examples. */
})
.addEvents() // Initialize the `events` package to enable web personalization
.addPersonalize({ enablePersonalizeCookie: true, webPersonalization: true }) // Enable web personalization
.initialize();
getPersonalizeData();
}, []);
return <></>;
}
Run personalizations from the server side:
import type { NextRequest, NextResponse } from 'next/server';
import { CloudSDK } from '@sitecore-cloudsdk/core/server';
import { personalize } from '@sitecore-cloudsdk/personalize/server';
export async function middleware(request: NextRequest) {
const response = NextResponse.next();
await CloudSDK(request, response, {
/* Initialization settings. See `core` package code examples. */
})
.addPersonalize({ enablePersonalizeCookie: true })
.initialize();
// Run interactive personalization:
const data = await personalize(request, {
channel: 'WEB',
currency: 'EUR',
friendlyId: '<YOUR_EXPERIENCE_FRIENDLY_ID>'
});
console.log(data);
return response;
}
FAQs
This package provides browser- and server-side functions to run personalizations in your app. Personalization is for showing the most relevant content to your users.
The npm package @sitecore-cloudsdk/personalize receives a total of 14,381 weekly downloads. As such, @sitecore-cloudsdk/personalize popularity was classified as popular.
We found that @sitecore-cloudsdk/personalize demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.