Gamification Points
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
StreamLayerProviderconst 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.
Updated 6 months ago
