Gamification Points
Integrate the StreamLayerSDKPoints component to display gamification points in your React application, rewarding user engagement with interactive content.
Integrating Points with StreamLayer SDK
Overview
The StreamLayerSDKPoints component allows you to integrate gamification points into your React application. This component wraps the StreamLayerPoints class from the StreamLayer SDK.
Usage
Step-by-Step Guide
- Import Required Components
import { StreamLayerProvider, StreamLayerSDKReact, StreamLayerSDKPoints } from '@streamlayer/react';- Wrap Your Application with
StreamLayerProvider
const providerProps = {
sdkKey: 'your-sdk-key',
// Add other provider props as needed
};
export const Main = () => (
<StreamLayerProvider {...providerProps}>
{/* Place StreamLayerSDKPoints component inside StreamLayerProvider */}
<StreamLayerSDKPoints />
{/* Place StreamLayerSDKReact component independently if needed */}
<StreamLayerSDKReact />
</StreamLayerProvider>
);Notes
- Ensure both
StreamLayerSDKPointsandStreamLayerSDKReactcomponents are wrapped insideStreamLayerProvider. - The
StreamLayerSDKPointscomponent can be placed anywhere within your app to display points.
Related
- StreamLayerSDKReact — Main interactive gamification UI component
- Authentication Forwarding — Required for personalized points tracking
- Integration Guide — Full Web SDK setup
Updated 21 days ago
