Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [7.7.3](https://github.com/smallcase/react-native-smallcase-gateway/compare/v7.7.2...v7.7.3) (2026-10-08)

### Improvements

* update Android Gateway SDK to 6.1.5 (Custom Tab service diagnostics, faster SDK launch)
* update iOS Gateway SDK to 7.3.0 (ASWebAuth recovery when the host app's Face ID lock is active, ASWebAuth diagnostics, faster SDK launch)

### [7.7.2](https://github.com/smallcase/react-native-smallcase-gateway/compare/v7.7.1...v7.7.2) (2026-09-23)

### Improvements
Expand Down
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,33 @@ SmallcaseGateway.triggerLeadGen({ email: "test@gmail.com" });
await SmallcaseGateway.launchScWebView("https://www.smallcase.com");
```

## Incognito Mode

`triggerTransaction` accepts an optional 4th `incognito` argument (default `false`):

```javascript
// execute a transaction in incognito mode
const res = await SmallcaseGateway.triggerTransaction(
transactionId,
utmParams,
brokerList,
true // incognito
);
```

When `true`, the broker flow opens in a private/ephemeral browsing session:

- No cookies, cache, or login state from the flow persist on the device once it closes.
- Native broker app login (e.g. Kite/Zerodha app-to-app login) is skipped in favor of the in-app web login, even if the broker app is installed and would normally be used.

This is opt-in and fully backward compatible — existing calls to `triggerTransaction(transactionId)`, `triggerTransaction(transactionId, utmParams)`, or `triggerTransaction(transactionId, utmParams, brokerList)` are unaffected and continue to run in normal (non-incognito) mode.

**Known limitations:** incognito prevents local browser data from persisting, but it does not (and cannot) override OS-level Password AutoFill suggestions already saved to the device's keychain, and it does not affect the smallcase account's own broker-connection state — once a broker is connected (incognito or not), subsequent transactions for that same account will correctly recognize it as already connected, since that state lives on smallcase's backend, not in local browser storage.

**Requires:** `com.smallcase.gateway:sdk` (Android) and `SCGateway` (iOS) versions with incognito support. Check with the platform SDK release notes for the minimum version once released.

**Using incognito for a different (e.g. linked/family) account:** `incognito: true` on its own does not switch which smallcase account the SDK is acting as — it only changes how that call's browser session behaves. To connect or transact on behalf of a different smallcase account than the one currently authenticated, call `SmallcaseGateway.init(sdkToken)` again with that account's own token before calling `triggerTransaction` — the same way you would for any account switch, incognito or not.

## Debug / Contribution

Make sure you have react native dev environment set up
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def kotlin_version = getExtOrDefault('kotlinVersion')
dependencies {
//noinspection GradleDynamicVersion
implementation 'com.facebook.react:react-native:+' // From node_modules
implementation 'com.smallcase.gateway:sdk:6.1.4'
implementation 'com.smallcase.gateway:sdk:6.1.5'
implementation 'com.smallcase.loans:sdk:5.4.0'
implementation "androidx.core:core-ktx:1.3.1"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class SmallcaseGatewayModule(reactContext: ReactApplicationContext) : ReactConte
}

@ReactMethod
fun triggerTransaction(transactionId: String, utmParams: ReadableMap?, brokerList: ReadableArray?, promise: Promise) {
fun triggerTransaction(transactionId: String, utmParams: ReadableMap?, brokerList: ReadableArray?, incognito: Boolean?, promise: Promise) {

var safeBrokerList = listOf<String>()

Expand All @@ -105,6 +105,7 @@ class SmallcaseGatewayModule(reactContext: ReactApplicationContext) : ReactConte
activity = activity,
transactionId = transactionId,
preProvidedBrokers = safeBrokerList,
incognito = incognito ?: false,
transactionResponseListener = object : TransactionResponseListener {
override fun onSuccess(transactionResult: TransactionResult) {
val res = resultToWritableMap(transactionResult, true)
Expand Down
3 changes: 3 additions & 0 deletions ios/SmallcaseGateway.m
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,17 @@ @interface RCT_EXTERN_MODULE(SmallcaseGateway, NSObject)
transactionId:(NSString *)transactionId
utmParams:(NSDictionary *)utmParams
brokerList:(NSArray *)brokerList
incognito:(nullable NSNumber *)incognito
triggerTransactionWithResolver:(RCTPromiseResolveBlock)resolve
rejecter:(RCTPromiseRejectBlock)reject) {
dispatch_async(dispatch_get_main_queue(), ^(void) {
BOOL isIncognito = incognito != nil ? [incognito boolValue] : NO;
[SCGateway.shared
triggerTransactionFlowWithTransactionId:transactionId
presentingController:[[[UIApplication sharedApplication] keyWindow] rootViewController]
utmParams:utmParams
brokerConfig:brokerList
incognito:isIncognito
completion: ^(id response, NSError * error) {
if (error != nil) {
NSMutableDictionary *responseDict = [[NSMutableDictionary alloc] init];
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "react-native-smallcase-gateway",
"title": "React Native Smallcase Gateway",
"version": "7.7.2",
"version": "7.7.3",
"description": "smallcase gateway bindings for react native",
"main": "src/index.js",
"files": [
Expand Down
2 changes: 1 addition & 1 deletion react-native-smallcase-gateway.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ Pod::Spec.new do |s|
s.dependency "ReactCommon/turbomodule/core"
end

s.dependency 'SCGateway', '7.2.2'
s.dependency 'SCGateway', '7.3.0'
s.dependency 'SCLoans', '7.5.0'
end
16 changes: 8 additions & 8 deletions smart_investing_react_native/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1410,14 +1410,14 @@ PODS:
- Yoga
- react-native-segmented-control (2.5.7):
- React-Core
- react-native-smallcase-gateway (7.6.2):
- react-native-smallcase-gateway (7.7.3):
- RCTRequired
- RCTTypeSafety
- React-Codegen
- React-Core
- ReactCommon/turbomodule/core
- SCGateway (= 7.2.1)
- SCLoans (= 7.4.0)
- SCGateway (= 7.3.0)
- SCLoans (= 7.5.0)
- React-NativeModulesApple (0.79.4):
- glog
- hermes-engine
Expand Down Expand Up @@ -1839,8 +1839,8 @@ PODS:
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- Yoga
- SCGateway (7.2.1)
- SCLoans (7.4.0)
- SCGateway (7.3.0)
- SCLoans (7.5.0)
- SocketRocket (0.7.1)
- Yoga (0.0.0)

Expand Down Expand Up @@ -2128,7 +2128,7 @@ SPEC CHECKSUMS:
React-microtasksnativemodule: ef2292ca147fa8793305e4693586ad0caf3afad3
react-native-safe-area-context: 562163222d999b79a51577eda2ea8ad2c32b4d06
react-native-segmented-control: bf6e0032726727498e18dd437ae88afcdbc18e99
react-native-smallcase-gateway: 799618640439c348253f939cc7743818b5502184
react-native-smallcase-gateway: c287b5e52ca7bbcd36e23a204d00e53b0713d7ea
React-NativeModulesApple: da60186ad0aafff031a9bc86b048711d34acc813
React-oscompat: 472a446c740e39ee39cd57cd7bfd32177c763a2b
React-perflogger: bbca3688c62f4f39e972d6e21969c95fe441fb6c
Expand Down Expand Up @@ -2163,8 +2163,8 @@ SPEC CHECKSUMS:
RNCClipboard: 37de6995ef72dc869422879e51a46a520d3f08b3
RNGestureHandler: ebef699ea17e7c0006c1074e1e423ead60ce0121
RNScreens: 3f6e41f9f89cb888a6b4b27566bdfdf7a3bf51ad
SCGateway: c18f47d4ae5df3d0189a8b6dbdf7f3503c9f07dc
SCLoans: 87d86efe22a858a151290fb919ad3a7a069c3db3
SCGateway: 515c32b16c6820f8e0c9f4a936526091e021814e
SCLoans: df8544412d5d22407e173ab7177fa38dc2372306
SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748
Yoga: a6cb833e04fb8c59a012b49fb1d040fcb0cbb633

Expand Down
12 changes: 10 additions & 2 deletions src/SmallcaseGateway.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,18 @@ const init = async (sdkToken, externalMeta) => {
* @param {string} transactionId
* @param {Object} [utmParams]
* @param {Array<string>} [brokerList]
* @param {boolean} [incognito] - when true, opens the broker flow in a private/incognito session that leaves no local browser data behind
* @returns {Promise<transactionRes>}
*/
const triggerTransaction = async (transactionId, utmParams, brokerList) => {
const triggerTransaction = async (
transactionId,
utmParams,
brokerList,
incognito
) => {
const safeUtm = safeObject(utmParams);
const safeId = typeof transactionId === 'string' ? transactionId : '';
const safeIncognito = typeof incognito === 'boolean' ? incognito : false;

let safeBrokerList = sanitizeBrokerList(brokerList);

Expand All @@ -121,7 +128,8 @@ const triggerTransaction = async (transactionId, utmParams, brokerList) => {
return SmallcaseGatewayNative.triggerTransaction(
safeId,
safeUtm,
safeBrokerList
safeBrokerList,
safeIncognito
);
};

Expand Down
3 changes: 2 additions & 1 deletion types/SmallcaseGateway.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,10 @@ declare function archiveSmallcase(iscid: string): unknown;
* @param {string} transactionId
* @param {Object} [utmParams]
* @param {Array<string>} [brokerList]
* @param {boolean} [incognito] - when true, opens the broker flow in a private/incognito session that leaves no local browser data behind
* @returns {Promise<transactionRes>}
*/
declare function triggerTransaction(transactionId: string, utmParams?: any, brokerList?: Array<string>): Promise<transactionRes>;
declare function triggerTransaction(transactionId: string, utmParams?: any, brokerList?: Array<string>, incognito?: boolean): Promise<transactionRes>;
/**
* triggers a transaction with a transaction id
*
Expand Down
Loading