inspirex-onboarding-sdk
v1.0.40
Published
React Native Onboarding Flow SDK
Readme
React Native Onboarding SDK
A flexible and customizable onboarding flow SDK for React Native applications.
Installation
npm install inspirex-onboarding-sdk
# or
yarn add inspirex-onboarding-sdkUsage
- Import and initialize the SDK:
import sdk from 'inspirex-onboarding-sdk';
// Initialize the SDK
sdk.initialize('your-api-key');
// Set user information
sdk.setUser({
id: 'user-123',
name: 'John Doe',
email: '[email protected]',
properties: { plan: 'premium' }
});- Start the flow and listen for events:
// Start the flow
sdk.startFlow();
// Listen for events
sdk.on('flowStart', (data) => {
console.log('Flow started:', data.flowId);
});
sdk.on('flowComplete', (data) => {
console.log('Flow completed:', data.flowId);
});
sdk.on('screenChange', (data) => {
console.log('Screen changed:', data.screenId);
});- Render the flow in your React Native app:
import React from 'react';
import sdk from 'inspirex-onboarding-sdk';
const FlowComponent = sdk.getFlowComponent();
export const App = () => {
return (
<>
{/* Your app content */}
<FlowComponent />
</>
);
};Features
- Fully customizable UI components
- TypeScript support
- Event-based architecture
- Screen navigation
- Modal-based presentation
- Flexible styling options
API Reference
SDK Methods
initialize(apiKey: string): Initialize the SDK with your API keysetUser(user: User): Set the current user informationstartFlow(): Start the onboarding flowcompleteFlow(): Complete the current flowgetFlowComponent(): Get the React component to render the flow
Event Types
flowStart: Emitted when the flow startsflowComplete: Emitted when the flow is completedscreenChange: Emitted when the screen changes
License
ISC
