Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@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 0 weekly downloads. As such, @sitecore-cloudsdk/personalize popularity was classified as not 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 3 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.