1.7.1 • Published 1 year ago

@algolia/predict-react v1.7.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Predict for React

🚧 This version is not yet production-ready.

Predict for React lets you build personalized user experiences with Algolia Predict.

Installation

Predict for React is available on the npm registry and works alongside the Predict API client (@algolia/predict) to retrieve the user profile.

yarn add @algolia/predict@alpha @algolia/predict-react
# or
npm install @algolia/predict@alpha @algolia/predict-react

Usage

import { Predict, usePredict } from '@algolia/predict-react';

function App({ userProfile }) {
  return (
    <Predict userProfile={userProfile}>
      <Page />
    </Predict>
  );
}

function Page() {
  const {
    userProfile,
    affinities,
    funnelStage,
    orderValue,
    cartAbandonment,
    segments,
    properties,
    zones,
  } = usePredict();

  return <>{/* Your JSX */}</>;
}

Continue reading our Getting Started guide.

Documentation

The documentation offers a few ways to learn about Predict for React:

  • Getting Started. Discover the library: fetch the user profile (on the server and on the client), personalize content with zones, inspect the user profile.
  • API Reference. Learn about the components and Hooks provided by the library.
  • Guides. Read common use cases and learn how to implement them.
  • Playbook. Find inspiration for your personalization use cases, and copy the templates.

You can find more on the documentation.

Inspect and debug

Personalized experiences are hard to debug because the content depends on who is browsing the app. The Predict Tools web extension lets you inspect user profiles to debug personalized apps.

Predict Tools web extension open on the Predict Storefront

The Predict Tools web extension is your development companion for Predict. It presents data to better analyze and debug your Predict experience.

Read more about the Predict Tools web extension.

License

MIT

1.7.1

1 year ago

1.7.0

1 year ago

1.6.1

1 year ago

1.6.0

1 year ago

1.5.0

1 year ago

1.4.1

1 year ago

1.4.0

2 years ago

1.3.0

2 years ago

1.2.0

2 years ago

1.0.2

2 years ago

1.1.0

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago