v1.0.8
Configure
AbleCredit.configure() authenticates the current user session against the AbleCredit backend. Call it once after the user logs in, before any loan or capture operations.
What happens internally
- The SDK validates
sdkKeyandtenantIdvia a network ping to/api/v2/partners/ping. - On success, the ping response is cached locally. Subsequent
configure()calls on the same device skip the network round-trip – safe to call on every app start. - If
configure()returnsAbleCreditResult.Failure, do not proceed to any loan or capture operations.
Parameters
| Parameter | Description |
|---|---|
sdkKey | Renamed from apiKey in v1.0.8. Your SDK authentication key. |
tenantId | Your organisation's tenant identifier. |
userId | The currently logged-in user's identifier. |
baseUrl | AbleCredit backend base URL (UAT or Production). |
branchId | Your branch identifier. Scopes the loan to a specific branch. |
val result = AbleCredit.configure(
context = this,
sdkKey = "your_sdk_key",
tenantId = "your_tenant_id",
userId = "user_123",
baseUrl = "https://your-base-url.com",
branchId = "branch_001",
)
when (result) {
is AbleCreditResult.Success -> { /* proceed */ }
is AbleCreditResult.Failure -> { /* handle */ }
}Initialize
AbleCredit.initialize(context) bootstraps the SDK's dependency injection container and registers background services. It must be called exactly once, from Application.onCreate(), before any other SDK method.
Theming
The AbleCredit SDK ships with a default light-green + black palette. You can replace any or all colours by declaring the same token names in your own res/values/colors.xml. Android's resource-merge system picks your value at build time – no SDK API call required.