HCL CDP Web SDK
npm install hclcdp-web-sdkThis repository contains the HCL CDP Web SDK, which provides a set of tools and components to integrate with the HCL Customer Data Platform (CDP). For those wanting to integrate using a React/Nextjs application, use the hclcdp-web-sdk-react
To install the HCL CDP Web SDK for React, you can use npm or yarn:
``bash`
npm install hclcdp-web-sdk
or
`bash`
yarn add hclcdp-web-sdk
Here's an example of how to use the HCL CDP Web SDK - replace with endpoint and writeKey suitable for your environment.
`typescript
"use client"
import Link from "next/link"
import { HclCdp } from "hclcdp-web-sdk"
import type { HclCdpConfig } from "hclcdp-web-sdk"
import { useEffect } from "react"
export default function Raw() {
useEffect(() => {
const config: HclCdpConfig = {
writeKey: "
inactivityTimeout: 1,
enableSessionLogging: false,
enableUserLogoutLogging: false,
cdpEndpoint: "
}
HclCdp.init(config, () => {
console.log("cdp initialized")
HclCdp.page("Raw Home Page")
})
})
return (
React