From 6ef87b5ff48276547517b264308562b157cb3c22 Mon Sep 17 00:00:00 2001 From: sydneycollins-cio <149523950+sydneycollins-cio@users.noreply.github.com> Date: Mon, 26 Oct 2026 14:53:09 -0400 Subject: [PATCH 1/2] feat(MBL-2652): make inApp.siteId optional with a pk_ key Co-Authored-By: Claude Opus 5.5 --- README.md | 2 +- .../sdk/messaginginapp/NativeMessagingInAppModule.kt | 11 ++++++----- api-extractor-output/customerio-reactnative.api.md | 2 +- src/types/data-pipelines.ts | 6 +++++- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index fe4226a3..df9ec001 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,7 @@ useEffect(() => { logLevel: CioLogLevel.debug, trackApplicationLifecycleEvents: true, inApp: { - siteId: 'your-site-id', // Required for in-app messaging + siteId: 'your-site-id', // Optional with a pk_ key }, push: { android: { diff --git a/android/src/main/java/io/customer/reactnative/sdk/messaginginapp/NativeMessagingInAppModule.kt b/android/src/main/java/io/customer/reactnative/sdk/messaginginapp/NativeMessagingInAppModule.kt index 40a130e1..79cc28ec 100644 --- a/android/src/main/java/io/customer/reactnative/sdk/messaginginapp/NativeMessagingInAppModule.kt +++ b/android/src/main/java/io/customer/reactnative/sdk/messaginginapp/NativeMessagingInAppModule.kt @@ -265,15 +265,16 @@ class NativeMessagingInAppModule( builder: CustomerIOBuilder, config: Map ) { - // Site ID is still required. Native in-app reads the key and region from the CustomerIO setup. + // Site ID is optional with a public (pk_) key. Native in-app reads the key and region from the CustomerIO setup. val siteId = config.getTypedValue(Keys.Config.SITE_ID) - if (siteId.isNullOrBlank()) { - SDKComponent.logger.error("Site ID is required to initialize InAppMessaging module") - return + val configBuilder = if (siteId.isNullOrBlank()) { + MessagingInAppModuleConfig.Builder() + } else { + MessagingInAppModuleConfig.Builder(siteId = siteId) } val module = ModuleMessagingInApp( - MessagingInAppModuleConfig.Builder(siteId = siteId).apply { + configBuilder.apply { setEventListener(eventListener = ReactInAppEventListener.instance) colorSchemeFromConfig(config)?.let { colorScheme -> setColorScheme(colorScheme) diff --git a/api-extractor-output/customerio-reactnative.api.md b/api-extractor-output/customerio-reactnative.api.md index b8c754fd..feee2218 100644 --- a/api-extractor-output/customerio-reactnative.api.md +++ b/api-extractor-output/customerio-reactnative.api.md @@ -36,7 +36,7 @@ export type CioConfig = { trackApplicationLifecycleEvents?: boolean; autoTrackDeviceAttributes?: boolean; inApp?: { - siteId: string; + siteId?: string; colorScheme?: CioColorScheme; notificationInboxAccessibilityLabels?: NotificationInboxAccessibilityLabels; }; diff --git a/src/types/data-pipelines.ts b/src/types/data-pipelines.ts index 921cb9ae..bf43b141 100644 --- a/src/types/data-pipelines.ts +++ b/src/types/data-pipelines.ts @@ -68,7 +68,11 @@ export type CioConfig = { trackApplicationLifecycleEvents?: boolean; autoTrackDeviceAttributes?: boolean; inApp?: { - siteId: string; + /** + * Workspace site ID. Optional when `cdpApiKey` is a public `pk_` key, which identifies the + * workspace. Pass `inApp: {}` to turn on in-app messaging without one. + */ + siteId?: string; /** * Color scheme used to render in-app messages. Defaults to `CioColorScheme.Auto`, which * follows the device appearance. Set it when the app has its own appearance setting that From 8ef8eecd5acbe1342d390508581a9bb307af86fc Mon Sep 17 00:00:00 2001 From: sydneycollins-cio <149523950+sydneycollins-cio@users.noreply.github.com> Date: Tue, 27 Oct 2026 12:40:17 -0400 Subject: [PATCH 2/2] feat(MBL-2652): take native iOS 5.1.0 so inApp works without siteId on iOS Co-Authored-By: Claude Opus 5.5 --- __tests__/in-app-site-id.test.ts | 21 +++++++++++++++++++-- package.json | 2 +- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/__tests__/in-app-site-id.test.ts b/__tests__/in-app-site-id.test.ts index 83371627..5d8a5057 100644 --- a/__tests__/in-app-site-id.test.ts +++ b/__tests__/in-app-site-id.test.ts @@ -1,6 +1,6 @@ /** - * `inApp.siteId` stays required, even with a workspace public (`pk_`) key, until the native SDKs - * and the in-app renderer support key-only setup. The JavaScript layer forwards the config as given. + * `inApp.siteId` is optional with a workspace public (`pk_`) key. The JavaScript layer forwards the + * config as given, and the native SDKs start in-app without a site ID when it is left out. */ jest.mock('react-native', () => ({ @@ -56,4 +56,21 @@ describe('in-app site ID', () => { expect.anything() ); }); + + it('forwards an empty inApp config with a pk_ key', async () => { + const config: CioConfig = { + cdpApiKey: 'pk_eu_test-key', + inApp: {}, + }; + + await CustomerIO.initialize(config); + + expect(nativeInitialize).toHaveBeenCalledWith( + expect.objectContaining({ + cdpApiKey: 'pk_eu_test-key', + inApp: {}, + }), + expect.anything() + ); + }); }); diff --git a/package.json b/package.json index 7eabb5c4..ec458e07 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ }, "./package.json": "./package.json" }, - "cioNativeiOSSdkVersion": "= 5.0.0", + "cioNativeiOSSdkVersion": "= 5.1.0", "files": [ "src", "lib",