@octopus-community/react-native 1.0.8 → 1.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/OctopusReactNativeSdk.podspec +1 -1
  2. package/README.md +40 -35
  3. package/android/build.gradle +2 -0
  4. package/android/gradle.properties +2 -2
  5. package/android/src/main/AndroidManifest.xml +2 -1
  6. package/android/src/main/AndroidManifestNew.xml +2 -1
  7. package/android/src/main/java/com/octopuscommunity/octopusreactnativesdk/OctopusActivity.kt +56 -0
  8. package/android/src/main/java/com/octopuscommunity/octopusreactnativesdk/OctopusContent.kt +396 -0
  9. package/android/src/main/java/com/octopuscommunity/octopusreactnativesdk/OctopusEventEmitter.kt +22 -0
  10. package/android/src/main/java/com/octopuscommunity/octopusreactnativesdk/OctopusEventSerializer.kt +339 -0
  11. package/android/src/main/java/com/octopuscommunity/octopusreactnativesdk/OctopusReactModule.kt +326 -0
  12. package/android/src/main/java/com/octopuscommunity/octopusreactnativesdk/{OctopusReactNativeSdkPackage.kt → OctopusReactPackage.kt} +3 -3
  13. package/android/src/main/java/com/octopuscommunity/octopusreactnativesdk/OctopusSDKInitializer.kt +22 -9
  14. package/android/src/main/java/com/octopuscommunity/octopusreactnativesdk/OctopusSSOAuthenticator.kt +5 -15
  15. package/android/src/main/java/com/octopuscommunity/octopusreactnativesdk/OctopusUIController.kt +17 -2
  16. package/android/src/main/java/com/octopuscommunity/octopusreactnativesdk/OctopusUIViewManager.kt +63 -0
  17. package/android/src/main/java/com/octopuscommunity/octopusreactnativesdk/ProfileFieldMapper.kt +2 -2
  18. package/ios/OctopusEventManager.swift +27 -0
  19. package/ios/OctopusEventSerializer.swift +271 -0
  20. package/ios/OctopusReactNativeSdk.mm +26 -1
  21. package/ios/OctopusReactNativeSdk.swift +216 -2
  22. package/ios/OctopusSSOAuthenticator.swift +1 -5
  23. package/ios/OctopusUIManager.swift +83 -0
  24. package/ios/OctopusUIViewManager.m +7 -0
  25. package/ios/OctopusUIViewManager.swift +37 -0
  26. package/lib/module/OctopusUIView.js +39 -0
  27. package/lib/module/OctopusUIView.js.map +1 -0
  28. package/lib/module/addHasAccessToCommunityListener.js +33 -0
  29. package/lib/module/addHasAccessToCommunityListener.js.map +1 -0
  30. package/lib/module/addNavigateToUrlListener.js +41 -0
  31. package/lib/module/addNavigateToUrlListener.js.map +1 -0
  32. package/lib/module/addNotSeenNotificationsCountListener.js +30 -0
  33. package/lib/module/addNotSeenNotificationsCountListener.js.map +1 -0
  34. package/lib/module/addSDKEventListener.js +48 -0
  35. package/lib/module/addSDKEventListener.js.map +1 -0
  36. package/lib/module/connectUser.js +24 -3
  37. package/lib/module/connectUser.js.map +1 -1
  38. package/lib/module/index.js +12 -0
  39. package/lib/module/index.js.map +1 -1
  40. package/lib/module/initialize.js +9 -12
  41. package/lib/module/initialize.js.map +1 -1
  42. package/lib/module/openUI.js +23 -2
  43. package/lib/module/openUI.js.map +1 -1
  44. package/lib/module/overrideCommunityAccess.js +36 -0
  45. package/lib/module/overrideCommunityAccess.js.map +1 -0
  46. package/lib/module/overrideDefaultLocale.js +75 -0
  47. package/lib/module/overrideDefaultLocale.js.map +1 -0
  48. package/lib/module/trackCommunityAccess.js +33 -0
  49. package/lib/module/trackCommunityAccess.js.map +1 -0
  50. package/lib/module/trackCustomEvent.js +36 -0
  51. package/lib/module/trackCustomEvent.js.map +1 -0
  52. package/lib/module/types/sdkEvents.js +2 -0
  53. package/lib/module/types/sdkEvents.js.map +1 -0
  54. package/lib/module/types/urlOpeningStrategy.js +23 -0
  55. package/lib/module/types/urlOpeningStrategy.js.map +1 -0
  56. package/lib/module/updateNotSeenNotificationsCount.js +33 -0
  57. package/lib/module/updateNotSeenNotificationsCount.js.map +1 -0
  58. package/lib/typescript/src/OctopusUIView.d.ts +32 -0
  59. package/lib/typescript/src/OctopusUIView.d.ts.map +1 -0
  60. package/lib/typescript/src/addHasAccessToCommunityListener.d.ts +27 -0
  61. package/lib/typescript/src/addHasAccessToCommunityListener.d.ts.map +1 -0
  62. package/lib/typescript/src/addNavigateToUrlListener.d.ts +31 -0
  63. package/lib/typescript/src/addNavigateToUrlListener.d.ts.map +1 -0
  64. package/lib/typescript/src/addNotSeenNotificationsCountListener.d.ts +24 -0
  65. package/lib/typescript/src/addNotSeenNotificationsCountListener.d.ts.map +1 -0
  66. package/lib/typescript/src/addSDKEventListener.d.ts +43 -0
  67. package/lib/typescript/src/addSDKEventListener.d.ts.map +1 -0
  68. package/lib/typescript/src/connectUser.d.ts +24 -8
  69. package/lib/typescript/src/connectUser.d.ts.map +1 -1
  70. package/lib/typescript/src/index.d.ts +13 -0
  71. package/lib/typescript/src/index.d.ts.map +1 -1
  72. package/lib/typescript/src/initialize.d.ts +9 -12
  73. package/lib/typescript/src/initialize.d.ts.map +1 -1
  74. package/lib/typescript/src/openUI.d.ts +28 -1
  75. package/lib/typescript/src/openUI.d.ts.map +1 -1
  76. package/lib/typescript/src/overrideCommunityAccess.d.ts +30 -0
  77. package/lib/typescript/src/overrideCommunityAccess.d.ts.map +1 -0
  78. package/lib/typescript/src/overrideDefaultLocale.d.ts +37 -0
  79. package/lib/typescript/src/overrideDefaultLocale.d.ts.map +1 -0
  80. package/lib/typescript/src/trackCommunityAccess.d.ts +27 -0
  81. package/lib/typescript/src/trackCommunityAccess.d.ts.map +1 -0
  82. package/lib/typescript/src/trackCustomEvent.d.ts +30 -0
  83. package/lib/typescript/src/trackCustomEvent.d.ts.map +1 -0
  84. package/lib/typescript/src/types/sdkEvents.d.ts +222 -0
  85. package/lib/typescript/src/types/sdkEvents.d.ts.map +1 -0
  86. package/lib/typescript/src/types/urlOpeningStrategy.d.ts +20 -0
  87. package/lib/typescript/src/types/urlOpeningStrategy.d.ts.map +1 -0
  88. package/lib/typescript/src/updateNotSeenNotificationsCount.d.ts +27 -0
  89. package/lib/typescript/src/updateNotSeenNotificationsCount.d.ts.map +1 -0
  90. package/package.json +2 -1
  91. package/src/OctopusUIView.tsx +57 -0
  92. package/src/addHasAccessToCommunityListener.ts +38 -0
  93. package/src/addNavigateToUrlListener.ts +54 -0
  94. package/src/addNotSeenNotificationsCountListener.ts +35 -0
  95. package/src/addSDKEventListener.ts +49 -0
  96. package/src/connectUser.ts +24 -8
  97. package/src/index.ts +13 -0
  98. package/src/initialize.ts +9 -12
  99. package/src/openUI.ts +32 -2
  100. package/src/overrideCommunityAccess.ts +33 -0
  101. package/src/overrideDefaultLocale.ts +88 -0
  102. package/src/trackCommunityAccess.ts +30 -0
  103. package/src/trackCustomEvent.ts +36 -0
  104. package/src/types/sdkEvents.ts +315 -0
  105. package/src/types/urlOpeningStrategy.ts +20 -0
  106. package/src/updateNotSeenNotificationsCount.ts +30 -0
  107. package/android/src/main/java/com/octopuscommunity/octopusreactnativesdk/OctopusReactNativeSdkModule.kt +0 -155
  108. package/android/src/main/java/com/octopuscommunity/octopusreactnativesdk/OctopusUIActivity.kt +0 -434
@@ -12,19 +12,35 @@ export interface ConnectUserParams {
12
12
  */
13
13
  profilePicture?: string;
14
14
  biography?: string;
15
- /**
16
- * Whether the user has reached legal age.
17
- * Used for age-appropriate content filtering and compliance.
18
- */
19
- legalAgeReached?: boolean;
20
15
  };
21
16
  }
22
17
  /**
23
18
  * Connects a user using SSO authentication.
24
19
  *
25
- * This function establishes a connection between your app's user and Octopus.
26
- * It requires that you have configured SSO mode during SDK initialization
27
- * and have set up a token provider using `useUserTokenProvider` or `addUserTokenRequestListener`.
20
+ * This function establishes a connection between your app's user and Octopus. It requires that you
21
+ * have configured SSO mode during SDK initialization and have set up a token provider using
22
+ * `useUserTokenProvider` or `addUserTokenRequestListener`. The token is obtained via your token
23
+ * provider; you do not pass it directly to `connectUser`. Call `connectUser` after the user logs in;
24
+ * call `disconnectUser` when they log out.
25
+ *
26
+ * @param params - User id and optional profile (username, profilePicture, biography). See {@link ConnectUserParams}.
27
+ * @returns A promise that resolves when the user is connected. Rejects if the SDK is not initialized,
28
+ * SSO is not configured, or the token provider fails.
29
+ * @see {@link useUserTokenProvider} – provide JWT from React components.
30
+ * @see {@link addUserTokenRequestListener} – provide JWT without React.
31
+ * @see {@link disconnectUser} – disconnect the current user.
32
+ *
33
+ * @example
34
+ * ```typescript
35
+ * await connectUser({
36
+ * userId: 'unique-user-id-from-your-backend',
37
+ * profile: {
38
+ * username: 'john_doe',
39
+ * profilePicture: 'https://example.com/avatar.jpg',
40
+ * biography: 'Software developer'
41
+ * }
42
+ * });
43
+ * ```
28
44
  */
29
45
  export declare function connectUser(params: ConnectUserParams): Promise<void>;
30
46
  //# sourceMappingURL=connectUser.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"connectUser.d.ts","sourceRoot":"","sources":["../../../src/connectUser.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE;QACR,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB;;;WAGG;QACH,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB;;;WAGG;QACH,eAAe,CAAC,EAAE,OAAO,CAAC;KAC3B,CAAC;CACH;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAEpE"}
1
+ {"version":3,"file":"connectUser.d.ts","sourceRoot":"","sources":["../../../src/connectUser.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE;QACR,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB;;;WAGG;QACH,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;CACH;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAEpE"}
@@ -3,11 +3,24 @@ export * from './openUI';
3
3
  export * from './closeUI';
4
4
  export * from './connectUser';
5
5
  export * from './disconnectUser';
6
+ export * from './trackCustomEvent';
7
+ export * from './overrideDefaultLocale';
8
+ export * from './updateNotSeenNotificationsCount';
9
+ export * from './overrideCommunityAccess';
10
+ export * from './trackCommunityAccess';
6
11
  export * from './addUserTokenRequestListener';
7
12
  export * from './useUserTokenProvider';
8
13
  export * from './addLoginRequiredListener';
9
14
  export * from './addEditUserListener';
15
+ export * from './addNotSeenNotificationsCountListener';
16
+ export * from './addHasAccessToCommunityListener';
17
+ export * from './addSDKEventListener';
18
+ export * from './addNavigateToUrlListener';
10
19
  export * from './types/userProfileField';
20
+ export * from './types/sdkEvents';
21
+ export * from './types/urlOpeningStrategy';
11
22
  export * from './logger';
12
23
  export * from './enums/LogLevel.enum';
24
+ export { OctopusUIView } from './OctopusUIView';
25
+ export type { OctopusUIViewProps } from './OctopusUIView';
13
26
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,UAAU,CAAC;AACzB,cAAc,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mCAAmC,CAAC;AAClD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,wCAAwC,CAAC;AACvD,cAAc,mCAAmC,CAAC;AAClD,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,UAAU,CAAC;AACzB,cAAc,uBAAuB,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC"}
@@ -128,26 +128,23 @@ export interface InitializeParams {
128
128
  /**
129
129
  * Initializes the Octopus SDK with the provided configuration.
130
130
  *
131
- * This function must be called before using any other Octopus SDK features.
132
- * It sets up the SDK with your API key and configures the authentication mode.
131
+ * This function must be called before using any other Octopus SDK features. It sets up the SDK
132
+ * with your API key, connection mode (SSO or Octopus-managed authentication), and optional theme
133
+ * and UI options. For SSO, you also need to set up a token provider with `useUserTokenProvider` or
134
+ * `addUserTokenRequestListener` before calling `connectUser`.
135
+ *
136
+ * @param params - See {@link InitializeParams} (including `theme`, `ui`). For theming guide see the main README.
137
+ * @see {@link connectUser} – connect a user after initialization (SSO mode).
133
138
  *
134
139
  * @example
135
140
  * ```typescript
136
- * // Initialize with SSO mode
137
141
  * await initialize({
138
142
  * apiKey: 'your-api-key',
139
- * connectionMode: {
140
- * type: 'sso',
141
- * appManagedFields: ['username', 'profilePicture']
142
- * }
143
+ * connectionMode: { type: 'sso', appManagedFields: ['username', 'profilePicture'] }
143
144
  * });
144
- *
145
- * // Initialize with Octopus authentication
146
145
  * await initialize({
147
146
  * apiKey: 'your-api-key',
148
- * connectionMode: {
149
- * type: 'octopus'
150
- * }
147
+ * connectionMode: { type: 'octopus' }
151
148
  * });
152
149
  * ```
153
150
  */
@@ -1 +1 @@
1
- {"version":3,"file":"initialize.d.ts","sourceRoot":"","sources":["../../../src/initialize.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAG7D,OAAO,EAAmB,KAAK,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAEhF;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,qEAAqE;IACrE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gGAAgG;IAChG,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,+EAA+E;IAC/E,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,yFAAyF;IACzF,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,WAAW,GAAG,SAAS,CAAC;AAEhE;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,yEAAyE;IACzE,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,oEAAoE;IACpE,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,8BAA8B;IAC9B,QAAQ,CAAC,EAAE,eAAe,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,UAAU,CAAC,EAAE;QACX,oCAAoC;QACpC,MAAM,CAAC,EAAE,gBAAgB,CAAC;QAC1B,oCAAoC;QACpC,MAAM,CAAC,EAAE,gBAAgB,CAAC;QAC1B,mCAAmC;QACnC,KAAK,CAAC,EAAE,gBAAgB,CAAC;QACzB,mCAAmC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AE,gBAAgB,GAAG,IAAI,CAAC;CACxC;AAED;;;;;;GAMG;AACH,MAAM,WAAW,YAAY;IAC3B;;;;;OAKG;IACH,MAAM,CAAC,EACH,eAAe,GACf;QACE,4BAA4B;QAC5B,KAAK,EAAE,eAAe,CAAC;QACvB,2BAA2B;QAC3B,IAAI,EAAE,eAAe,CAAC;KACvB,CAAC;IACN,iCAAiC;IACjC,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,yBAAyB;IACzB,IAAI,CAAC,EAAE;QACL,0FAA0F;QAC1F,KAAK,CAAC,EAAE,wBAAwB,CAAC;KAClC,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,+DAA+D;IAC/D,MAAM,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,cAAc,EACV;QACE,6BAA6B;QAC7B,IAAI,EAAE,KAAK,CAAC;QACZ,iEAAiE;QACjE,gBAAgB,EAAE,gBAAgB,EAAE,CAAC;KACtC,GACD;QACE,0CAA0C;QAC1C,IAAI,EAAE,SAAS,CAAC;KACjB,CAAC;IACN,sDAAsD;IACtD,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,0DAA0D;IAC1D,EAAE,CAAC,EAAE,gBAAgB,CAAC;CACvB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CA8BlE"}
@@ -1,5 +1,32 @@
1
+ /**
2
+ * Options for opening the Octopus UI.
3
+ */
4
+ export interface OpenUIOptions {
5
+ /**
6
+ * When `true`, URLs tapped inside the community UI are not opened by the SDK.
7
+ * Instead, a `navigateToUrl` event is emitted. Subscribe with
8
+ * `addNavigateToUrlListener` to receive the URL and decide whether to handle
9
+ * it in-app or delegate back to the SDK (system browser).
10
+ *
11
+ * @default false
12
+ */
13
+ interceptUrls?: boolean;
14
+ }
1
15
  /**
2
16
  * Opens the Octopus UI home screen.
17
+ *
18
+ * @param options - Optional configuration. Use `interceptUrls: true` to receive
19
+ * URL taps via `addNavigateToUrlListener` instead of having the SDK open them.
20
+ * @returns A promise that resolves when the UI has been opened.
21
+ *
22
+ * @example
23
+ * ```typescript
24
+ * // Open UI with default behaviour (SDK opens links in system browser)
25
+ * await openUI();
26
+ *
27
+ * // Open UI with URL interception (app receives links via addNavigateToUrlListener)
28
+ * await openUI({ interceptUrls: true });
29
+ * ```
3
30
  */
4
- export declare function openUI(): Promise<void>;
31
+ export declare function openUI(options?: OpenUIOptions): Promise<void>;
5
32
  //# sourceMappingURL=openUI.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"openUI.d.ts","sourceRoot":"","sources":["../../../src/openUI.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAAgB,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAEtC"}
1
+ {"version":3,"file":"openUI.d.ts","sourceRoot":"","sources":["../../../src/openUI.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;;;;OAOG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,MAAM,CAAC,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAI7D"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Override the community access cohort for the current user.
3
+ *
4
+ * **When to use:** When the **Octopus SDK manages the A/B logic** — i.e. Octopus assigns
5
+ * the cohort and decides who has access to the community. In that case, the "Has access
6
+ * to community" state is the cohort value. Use this function to override that cohort
7
+ * (e.g. for testing or feature gating). The new state is reflected via `addHasAccessToCommunityListener`.
8
+ *
9
+ * **When not to use:** If **your app** decides who has access (e.g. your own feature flag or A/B logic),
10
+ * do not use `overrideCommunityAccess`. Use `trackCommunityAccess` instead to report the access
11
+ * value to Octopus for analytics only; that does not change the actual access state in the SDK.
12
+ *
13
+ * @param hasAccess - `true` to grant access, `false` to deny access.
14
+ * @returns A promise that resolves when the override has been applied.
15
+ * @throws An error if the SDK is not initialized or the call fails.
16
+ * @see {@link addHasAccessToCommunityListener} – subscribe to the Octopus-managed community access state.
17
+ * @see {@link trackCommunityAccess} – when your app manages access, report it for analytics only (no change to SDK state).
18
+ *
19
+ * @example
20
+ * ```typescript
21
+ * const subscription = addHasAccessToCommunityListener((hasAccess) => {
22
+ * console.log(`Has access to community: ${hasAccess}`);
23
+ * });
24
+ * await overrideCommunityAccess(true);
25
+ * await overrideCommunityAccess(false);
26
+ * subscription.remove();
27
+ * ```
28
+ */
29
+ export declare function overrideCommunityAccess(hasAccess: boolean): Promise<void>;
30
+ //# sourceMappingURL=overrideCommunityAccess.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"overrideCommunityAccess.d.ts","sourceRoot":"","sources":["../../../src/overrideCommunityAccess.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAEzE"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Parameters for overriding the default locale used by the Octopus SDK UI.
3
+ * Uses ISO 639-1 language code and optional ISO 3166-1 alpha-2 country code.
4
+ */
5
+ export interface OverrideLocaleParams {
6
+ /** ISO 639-1 language code (e.g. `"en"`, `"fr"`). */
7
+ languageCode: string;
8
+ /** Optional ISO 3166-1 alpha-2 country code (e.g. `"US"`, `"FR"`). */
9
+ countryCode?: string;
10
+ }
11
+ /**
12
+ * Override the default locale used by the Octopus SDK for its UI.
13
+ *
14
+ * The change takes effect immediately for subsequently displayed SDK screens.
15
+ * Pass `null` to reset to the system default locale.
16
+ *
17
+ * @param locale - Object with `languageCode` and optional `countryCode`
18
+ * (e.g. `{ languageCode: 'fr' }` or `{ languageCode: 'en', countryCode: 'US' }`).
19
+ * Pass `null` to use the system default (no override).
20
+ * @returns A promise that resolves when the override has been applied.
21
+ * @throws An error if the SDK is not initialized or the call fails.
22
+ * @throws An error if locale is invalid (e.g. non-ISO language/country codes).
23
+ *
24
+ * @example
25
+ * ```typescript
26
+ * // Use French
27
+ * await overrideDefaultLocale({ languageCode: 'fr' });
28
+ *
29
+ * // Use English (US)
30
+ * await overrideDefaultLocale({ languageCode: 'en', countryCode: 'US' });
31
+ *
32
+ * // Reset to system default
33
+ * await overrideDefaultLocale(null);
34
+ * ```
35
+ */
36
+ export declare function overrideDefaultLocale(locale: OverrideLocaleParams | null): Promise<void>;
37
+ //# sourceMappingURL=overrideDefaultLocale.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"overrideDefaultLocale.d.ts","sourceRoot":"","sources":["../../../src/overrideDefaultLocale.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,qDAAqD;IACrD,YAAY,EAAE,MAAM,CAAC;IACrB,sEAAsE;IACtE,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAoCD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,oBAAoB,GAAG,IAAI,GAClC,OAAO,CAAC,IAAI,CAAC,CAaf"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Track community access for analytics without changing the actual access.
3
+ *
4
+ * **When to use:** When **your app manages its own A/B logic** — i.e. your app decides who can see
5
+ * the community (e.g. via your own feature flag or experiment). Call this to report that decision
6
+ * to Octopus for analytics only. It does not grant or restrict access in the SDK; it only records
7
+ * the value for reporting.
8
+ *
9
+ * **When not to use:** If the **Octopus SDK manages the cohort** (Octopus assigns who has access),
10
+ * use `overrideCommunityAccess` to change the cohort and `addHasAccessToCommunityListener` to react
11
+ * to it. Use `trackCommunityAccess` only when the access decision is owned by your app and you just
12
+ * need to report it.
13
+ *
14
+ * @param hasAccess - The access value to report (e.g. the variant your app decided).
15
+ * @returns A promise that resolves when the tracking call has completed.
16
+ * @throws An error if the SDK is not initialized or the call fails.
17
+ * @see {@link overrideCommunityAccess} – when Octopus manages the cohort, override it (and use addHasAccessToCommunityListener to react).
18
+ * @see {@link addHasAccessToCommunityListener} – subscribe to the Octopus-managed access state (relevant when Octopus or override sets it).
19
+ *
20
+ * @example
21
+ * ```typescript
22
+ * await trackCommunityAccess(true);
23
+ * await trackCommunityAccess(false);
24
+ * ```
25
+ */
26
+ export declare function trackCommunityAccess(hasAccess: boolean): Promise<void>;
27
+ //# sourceMappingURL=trackCommunityAccess.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trackCommunityAccess.d.ts","sourceRoot":"","sources":["../../../src/trackCommunityAccess.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAEtE"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Track custom events that are merged into Octopus analytics reports.
3
+ *
4
+ * Use this to send app-specific business events (e.g. purchases, feature usage)
5
+ * so they appear alongside Octopus Community analytics.
6
+ *
7
+ * All property values must be strings. Non-string values should be stringified
8
+ * before calling (e.g. numbers as `"123"`, booleans as `"true"`).
9
+ *
10
+ * @param name - The name of the custom event (e.g. `"purchase"`, `"screen_view"`).
11
+ * @param properties - Optional map of string key-value pairs attached to the event.
12
+ * @returns A promise that resolves when the event has been tracked.
13
+ * @throws An error if the SDK is not initialized or tracking fails.
14
+ *
15
+ * @example
16
+ * ```typescript
17
+ * await trackCustomEvent('purchase', {
18
+ * product_id: '123',
19
+ * price: '9.99',
20
+ * currency: 'EUR',
21
+ * });
22
+ *
23
+ * await trackCustomEvent('feature_used', {
24
+ * feature: 'community_search',
25
+ * source: 'home_screen',
26
+ * });
27
+ * ```
28
+ */
29
+ export declare function trackCustomEvent(name: string, properties?: Record<string, string>): Promise<void>;
30
+ //# sourceMappingURL=trackCustomEvent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trackCustomEvent.d.ts","sourceRoot":"","sources":["../../../src/trackCustomEvent.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,EACZ,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAClC,OAAO,CAAC,IAAI,CAAC,CAEf"}
@@ -0,0 +1,222 @@
1
+ /**
2
+ * Types for SDK events emitted by Octopus SDK.
3
+ * These events represent various user interactions and system events within the Octopus community.
4
+ */
5
+ /**
6
+ * Content types that can be included in a post
7
+ */
8
+ export type PostContentType = 'text' | 'image' | 'poll';
9
+ /**
10
+ * Content kind (post, comment, or reply)
11
+ */
12
+ export type ContentKind = 'post' | 'comment' | 'reply';
13
+ /**
14
+ * Reaction kinds
15
+ */
16
+ export type ReactionKind = 'heart' | 'joy' | 'mouthOpen' | 'clap' | 'cry' | 'rage' | 'unknown';
17
+ /**
18
+ * Report reasons for content or profile reporting
19
+ */
20
+ export type ReportReason = 'hateSpeech' | 'explicit' | 'violence' | 'spam' | 'suicide' | 'fakeProfile' | 'childExploitation' | 'intellectualProperty' | 'other';
21
+ /**
22
+ * Gamification actions that can gain points
23
+ */
24
+ export type GamificationPointsGainedAction = 'post' | 'comment' | 'reply' | 'reaction' | 'vote' | 'postCommented' | 'profileCompleted' | 'dailySession';
25
+ /**
26
+ * Gamification actions that can remove points
27
+ */
28
+ export type GamificationPointsRemovedAction = 'postDeleted' | 'commentDeleted' | 'replyDeleted' | 'reactionDeleted';
29
+ /**
30
+ * Source of a post click
31
+ */
32
+ export type PostClickedSource = 'feed' | 'profile';
33
+ /**
34
+ * Screen types displayed in the Octopus UI
35
+ */
36
+ export type ScreenType = 'postsFeed' | 'postDetail' | 'commentDetail' | 'createPost' | 'profile' | 'otherUserProfile' | 'editProfile' | 'reportContent' | 'reportProfile' | 'validateNickname' | 'settingsList' | 'settingsAccount' | 'settingsAbout' | 'reportExplanation' | 'deleteAccount';
37
+ /**
38
+ * Base interface for all SDK events
39
+ */
40
+ export interface BaseSDKEvent {
41
+ type: string;
42
+ }
43
+ /**
44
+ * Event emitted when a post is created
45
+ */
46
+ export interface PostCreatedEvent extends BaseSDKEvent {
47
+ type: 'postCreated';
48
+ postId: string;
49
+ content: PostContentType[];
50
+ topicId: string | null;
51
+ textLength: number;
52
+ }
53
+ /**
54
+ * Event emitted when a comment is created
55
+ */
56
+ export interface CommentCreatedEvent extends BaseSDKEvent {
57
+ type: 'commentCreated';
58
+ commentId: string;
59
+ postId: string;
60
+ textLength: number;
61
+ }
62
+ /**
63
+ * Event emitted when a reply is created
64
+ */
65
+ export interface ReplyCreatedEvent extends BaseSDKEvent {
66
+ type: 'replyCreated';
67
+ replyId: string;
68
+ commentId: string;
69
+ textLength: number;
70
+ }
71
+ /**
72
+ * Event emitted when content is deleted
73
+ */
74
+ export interface ContentDeletedEvent extends BaseSDKEvent {
75
+ type: 'contentDeleted';
76
+ contentId: string;
77
+ contentKind: ContentKind;
78
+ }
79
+ /**
80
+ * Event emitted when a reaction is modified (added, changed, or removed)
81
+ */
82
+ export interface ReactionModifiedEvent extends BaseSDKEvent {
83
+ type: 'reactionModified';
84
+ contentId: string;
85
+ contentKind: ContentKind;
86
+ previousReaction: ReactionKind | null;
87
+ newReaction: ReactionKind | null;
88
+ }
89
+ /**
90
+ * Event emitted when a poll is voted on
91
+ */
92
+ export interface PollVotedEvent extends BaseSDKEvent {
93
+ type: 'pollVoted';
94
+ contentId: string;
95
+ optionId: string;
96
+ }
97
+ /**
98
+ * Event emitted when content is reported
99
+ */
100
+ export interface ContentReportedEvent extends BaseSDKEvent {
101
+ type: 'contentReported';
102
+ contentId: string;
103
+ reasons: ReportReason[];
104
+ }
105
+ /**
106
+ * Event emitted when a profile is reported
107
+ */
108
+ export interface ProfileReportedEvent extends BaseSDKEvent {
109
+ type: 'profileReported';
110
+ profileId: string;
111
+ reasons: ReportReason[];
112
+ }
113
+ /**
114
+ * Event emitted when gamification points are gained
115
+ */
116
+ export interface GamificationPointsGainedEvent extends BaseSDKEvent {
117
+ type: 'gamificationPointsGained';
118
+ points: number;
119
+ action: GamificationPointsGainedAction;
120
+ }
121
+ /**
122
+ * Event emitted when gamification points are removed
123
+ */
124
+ export interface GamificationPointsRemovedEvent extends BaseSDKEvent {
125
+ type: 'gamificationPointsRemoved';
126
+ points: number;
127
+ action: GamificationPointsRemovedAction;
128
+ }
129
+ /**
130
+ * Screen information for screen displayed events
131
+ */
132
+ export interface ScreenInfo {
133
+ type: ScreenType;
134
+ feedId?: string;
135
+ relatedTopicId?: string | null;
136
+ postId?: string;
137
+ commentId?: string;
138
+ profileId?: string;
139
+ }
140
+ /**
141
+ * Event emitted when a screen is displayed
142
+ */
143
+ export interface ScreenDisplayedEvent extends BaseSDKEvent {
144
+ type: 'screenDisplayed';
145
+ screen: ScreenInfo;
146
+ }
147
+ /**
148
+ * Event emitted when a notification is clicked
149
+ */
150
+ export interface NotificationClickedEvent extends BaseSDKEvent {
151
+ type: 'notificationClicked';
152
+ notificationId: string;
153
+ contentId: string | null;
154
+ }
155
+ /**
156
+ * Event emitted when a post is clicked
157
+ */
158
+ export interface PostClickedEvent extends BaseSDKEvent {
159
+ type: 'postClicked';
160
+ postId: string;
161
+ source: PostClickedSource;
162
+ }
163
+ /**
164
+ * Event emitted when the translation button is clicked
165
+ */
166
+ export interface TranslationButtonClickedEvent extends BaseSDKEvent {
167
+ type: 'translationButtonClicked';
168
+ contentId: string;
169
+ viewTranslated: boolean;
170
+ contentKind: ContentKind;
171
+ }
172
+ /**
173
+ * Event emitted when the comment button is clicked
174
+ */
175
+ export interface CommentButtonClickedEvent extends BaseSDKEvent {
176
+ type: 'commentButtonClicked';
177
+ postId: string;
178
+ }
179
+ /**
180
+ * Event emitted when the reply button is clicked
181
+ */
182
+ export interface ReplyButtonClickedEvent extends BaseSDKEvent {
183
+ type: 'replyButtonClicked';
184
+ commentId: string;
185
+ }
186
+ /**
187
+ * Event emitted when the "see replies" button is clicked
188
+ */
189
+ export interface SeeRepliesButtonClickedEvent extends BaseSDKEvent {
190
+ type: 'seeRepliesButtonClicked';
191
+ commentId: string;
192
+ }
193
+ /**
194
+ * Event emitted when a profile is modified
195
+ */
196
+ export interface ProfileModifiedEvent extends BaseSDKEvent {
197
+ type: 'profileModified';
198
+ nicknameUpdated: boolean;
199
+ bioUpdated: boolean;
200
+ bioLength: number | null;
201
+ pictureUpdated: boolean;
202
+ hasPicture: boolean | null;
203
+ }
204
+ /**
205
+ * Event emitted when a session starts
206
+ */
207
+ export interface SessionStartedEvent extends BaseSDKEvent {
208
+ type: 'sessionStarted';
209
+ sessionId: string;
210
+ }
211
+ /**
212
+ * Event emitted when a session stops
213
+ */
214
+ export interface SessionStoppedEvent extends BaseSDKEvent {
215
+ type: 'sessionStopped';
216
+ sessionId: string;
217
+ }
218
+ /**
219
+ * Union type of all possible SDK events
220
+ */
221
+ export type SDKEvent = PostCreatedEvent | CommentCreatedEvent | ReplyCreatedEvent | ContentDeletedEvent | ReactionModifiedEvent | PollVotedEvent | ContentReportedEvent | ProfileReportedEvent | GamificationPointsGainedEvent | GamificationPointsRemovedEvent | ScreenDisplayedEvent | NotificationClickedEvent | PostClickedEvent | TranslationButtonClickedEvent | CommentButtonClickedEvent | ReplyButtonClickedEvent | SeeRepliesButtonClickedEvent | ProfileModifiedEvent | SessionStartedEvent | SessionStoppedEvent;
222
+ //# sourceMappingURL=sdkEvents.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sdkEvents.d.ts","sourceRoot":"","sources":["../../../../src/types/sdkEvents.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;AAExD;;GAEG;AACH,M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YAAY;IAC3D,IAAI,EAAE,oBAAoB,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,4BAA6B,SAAQ,YAAY;IAChE,IAAI,EAAE,yBAAyB,CAAC;IAChC,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAqB,SAAQ,YAAY;IACxD,IAAI,EAAE,iBAAiB,CAAC;IACxB,eAAe,EAAE,OAAO,CAAC;IACzB,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,cAAc,EAAE,OAAO,CAAC;IACxB,UAAU,EAAE,OAAO,GAAG,IAAI,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,mBAAoB,SAAQ,YAAY;IACvD,IAAI,EAAE,gBAAgB,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAoB,SAAQ,YAAY;IACvD,IAAI,EAAE,gBAAgB,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,MAAM,QAAQ,GAChB,gBAAgB,GAChB,mBAAmB,GACnB,iBAAiB,GACjB,mBAAmB,GACnB,qBAAqB,GACrB,cAAc,GACd,oBAAoB,GACpB,oBAAoB,GACpB,6BAA6B,GAC7B,8BAA8B,GAC9B,oBAAoB,GACpB,wBAAwB,GACxB,gBAAgB,GAChB,6BAA6B,GAC7B,yBAAyB,GACzB,uBAAuB,GACvB,4BAA4B,GAC5B,oBAAoB,GACpB,mBAAmB,GACnB,mBAAmB,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Strategy for handling URLs tapped inside the Octopus Community UI.
3
+ *
4
+ * When URL interception is enabled via `openUI({ interceptUrls: true })`,
5
+ * the app receives each tapped URL via `addNavigateToUrlListener`. The callback
6
+ * returns one of these strategies to decide who handles the URL.
7
+ */
8
+ export declare enum UrlOpeningStrategy {
9
+ /**
10
+ * The URL has been handled by the app. The SDK will not open it.
11
+ * Use this when you open the URL in an in-app web view or handle it yourself.
12
+ */
13
+ handledByApp = "handledByApp",
14
+ /**
15
+ * The URL should be opened by the Octopus SDK (system browser).
16
+ * The native layer will open the URL in the default browser when this is returned.
17
+ */
18
+ handledByOctopus = "handledByOctopus"
19
+ }
20
+ //# sourceMappingURL=urlOpeningStrategy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"urlOpeningStrategy.d.ts","sourceRoot":"","sources":["../../../../src/types/urlOpeningStrategy.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,oBAAY,kBAAkB;IAC5B;;;OAGG;IACH,YAAY,iBAAiB;IAE7B;;;OAGG;IACH,gBAAgB,qBAAqB;CACtC"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Force refresh the unseen notification count from the server.
3
+ *
4
+ * This method triggers a manual update of the notification badge count.
5
+ * The updated count will be emitted via the notSeenNotificationsCountChanged event.
6
+ * Use `addNotSeenNotificationsCountListener` to listen for count changes.
7
+ *
8
+ * @returns A promise that resolves when the update is complete.
9
+ * @throws An error if the SDK is not initialized or if the update fails.
10
+ *
11
+ * @example
12
+ * ```typescript
13
+ * // Listen to count changes
14
+ * const subscription = addNotSeenNotificationsCountListener((count) => {
15
+ * console.log(`Unseen notifications: ${count}`);
16
+ * // Update your badge UI
17
+ * });
18
+ *
19
+ * // Manually refresh the count
20
+ * await updateNotSeenNotificationsCount();
21
+ *
22
+ * // Later, unsubscribe
23
+ * subscription.remove();
24
+ * ```
25
+ */
26
+ export declare function updateNotSeenNotificationsCount(): Promise<void>;
27
+ //# sourceMappingURL=updateNotSeenNotificationsCount.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"updateNotSeenNotificationsCount.d.ts","sourceRoot":"","sources":["../../../src/updateNotSeenNotificationsCount.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,+BAA+B,IAAI,OAAO,CAAC,IAAI,CAAC,CAE/D"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@octopus-community/react-native",
3
- "version": "1.0.8",
3
+ "version": "1.9.1",
4
4
  "description": "React Native module for the Octopus Community SDK",
5
5
  "source": "./src/index.ts",
6
6
  "main": "./lib/module/index.js",
@@ -38,6 +38,7 @@
38
38
  "test:unit": "jest",
39
39
  "test:types": "tsc",
40
40
  "test:lint": "eslint \"**/*.{js,ts,tsx}\"",
41
+ "lint:fix": "eslint \"**/*.{js,ts,tsx}\" --fix",
41
42
  "clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
42
43
  "prepare": "typedoc && bob build"
43
44
  },