@finspringinnovations/mahindrafdsdk
v1.0.4
Published
Mahindra SDK for React Native applications
Readme
Mahindra SDK
A React Native SDK for Mahindra Finance services, providing components and utilities for financial applications.
Installation
npm install mahindrafdsdk
# or
yarn add mahindrafdsdkUsage
Basic Setup
import { MahindraSDK, Home, BookFD } from 'mahindrafdsdk';
// Initialize the SDK
const sdk = new MahindraSDK({
apiBaseUrl: 'https://api.mahindra.com',
environment: 'production',
theme: {
primaryColor: '#1e40af',
secondaryColor: '#1f2937',
backgroundColor: '#f8fafc',
},
});
// Use components
function App() {
return (
<View>
<Home
onNavigate={(screen) => console.log(`Navigate to ${screen}`)}
title="Mahindra Finance"
subtitle="Welcome to our services"
/>
</View>
);
}Available Components
Home Component
Main landing page component for the Mahindra Finance SDK.
import { Home } from 'mahindrafdsdk';
<Home
onNavigate={(screen) => handleNavigation(screen)}
title="Custom Title"
subtitle="Custom Subtitle"
/>BookFD Component
Fixed Deposit booking component.
import { BookFD } from 'mahindrafdsdk';
<BookFD
onBookFD={(data) => handleFDBooking(data)}
onCancel={() => handleCancel()}
title="Book Fixed Deposit"
/>SDK Configuration
interface SDKConfig {
apiBaseUrl?: string;
theme?: {
primaryColor?: string;
secondaryColor?: string;
backgroundColor?: string;
};
environment?: 'development' | 'staging' | 'production';
}Utility Methods
// Get SDK version
const version = MahindraSDK.getVersion();
// Get platform information
const platformInfo = MahindraSDK.getPlatformInfo();
// Get current configuration
const config = sdk.getConfig();
// Update configuration
sdk.updateConfig({
apiBaseUrl: 'https://new-api.mahindra.com',
environment: 'staging',
});Development
Building the SDK
yarn buildRunning Tests
yarn testLinting
yarn lintLicense
MIT
