lark-react-sdk
v1.0.0
Published
React SDK for Lark FinServ loan eligibility integration
Maintainers
Readme
@larkfinserv/react-sdk
React SDK for Lark FinServ loan eligibility integration. One package handles both sandbox and production environments via a runtime config flag.
Install
npm install @larkfinserv/react-sdkUsage
import LoanEligibilitySDK from '@larkfinserv/react-sdk';
const sdk = new LoanEligibilitySDK({
apiKey: 'your-api-key',
apiSecret: 'your-api-secret',
environment: 'production', // or 'sandbox'
});
await sdk.initialize({ apiKey: 'your-api-key', apiSecret: 'your-api-secret', environment: 'production' });Environments
| environment value | SDK URL | API URL |
|---|---|---|
| 'sandbox' (default) | https://sdk-lark.larkfinserv.in | https://backend-sdk.larkfinserv.in |
| 'production' | https://sdk-lark.larkfinserv.com | https://sdk-backend.larkfinserv.com |
If environment is omitted, the SDK defaults to sandbox and emits a one-time console.warn. For live traffic, you must pass environment: 'production' explicitly.
Migrating from lark-sdk-multi (production) or lark-sdk-uat (sandbox)
The legacy [email protected] and [email protected] packages remain published on npm and continue to work — no forced migration. When you are ready to consolidate:
Before (lark-sdk-multi, production):
import LoanEligibilitySDK from 'lark-sdk-multi';
const sdk = new LoanEligibilitySDK({ apiKey, apiSecret });After:
import LoanEligibilitySDK from '@larkfinserv/react-sdk';
const sdk = new LoanEligibilitySDK({ apiKey, apiSecret, environment: 'production' });Before (lark-sdk-uat, sandbox):
import LoanEligibilitySDK from 'lark-sdk-uat';
const sdk = new LoanEligibilitySDK({ apiKey, apiSecret });After:
import LoanEligibilitySDK from '@larkfinserv/react-sdk';
const sdk = new LoanEligibilitySDK({ apiKey, apiSecret, environment: 'sandbox' });
// or simply omit environment — sandbox is the default⚠ Heads up for lark-sdk-multi migrators: @larkfinserv/react-sdk defaults to sandbox, not production. Forgetting environment: 'production' will silently route traffic to .in infra. The console.warn on construction is there to catch this.
