![Maven Central Adds Sigstore Signature Validation](https://cdn.sanity.io/images/cgdhsj6q/production/7da3bc8a946cfb5df15d7fcf49767faedc72b483-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
@sitecore-cloudsdk/personalize
Advanced tools
© Sitecore Corporation A/S. All rights reserved. Sitecore© is a registered trademark of Sitecore Corporation A/S.
© Sitecore Corporation A/S. All rights reserved. Sitecore© is a registered trademark of Sitecore Corporation A/S.
This package provides browser- and server-side functions to run personalization in your app. Personalization is for showing the most relevant content to your users.
To use the Sitecore Cloud SDK, you need:
npm install @sitecore-cloudsdk/personalize
init()
function.personalize()
function.Run personalization from the browser side:
"use client";
import { useEffect } from "react";
import { init, personalize } from "@sitecore-cloudsdk/personalize/browser";
export default function Home() {
useEffect(() => {
initPersonalize();
}, []);
const initPersonalize = async () => {
await init({
sitecoreEdgeContextId: process.env.NEXT_PUBLIC_SITECORE_EDGE_CONTEXT_ID || "",
siteName: process.env.NEXT_PUBLIC_SITENAME || "",
enableBrowserCookie: true,
});
console.log(`Initialized "@sitecore-cloudsdk/personalize/browser".`);
};
const runPersonalization = async () => {
const personalizationData = {
channel: "WEB",
currency: "USD",
friendlyId: "personalize_test",
language: "EN",
};
await personalize(personalizationData);
console.log("Ran personalization.");
};
return (
<div>
<button onClick={runPersonalization}>run personalization</button>
</div>
);
}
Run personalization from the server side:
import { NextResponse } from "next/server";
import type { NextRequest } from "next/server";
import { init, personalize } from "@sitecore-cloudsdk/personalize/server";
export async function middleware(req: NextRequest) {
const res = NextResponse.next();
await init(
{
sitecoreEdgeContextId: process.env.NEXT_PUBLIC_SITECORE_EDGE_CONTEXT_ID || "",
siteName: process.env.NEXT_PUBLIC_SITENAME || "",
enableServerCookie: true,
},
req,
res
);
console.log(`Initialized "@sitecore-cloudsdk/personalize/server".`);
const personalizationData = {
channel: "WEB",
currency: "EUR",
friendlyId: "personalize_test",
language: "EN",
};
const personalizeRes = await personalize(personalizationData, req);
console.log("personalizeResponse:", personalizeRes);
return res;
}
Coming soon.
The Sitecore Cloud SDK uses the Apache 2.0 license.
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
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.