@teamvortexsoftware/vortex-react-native 1.0.0 → 1.0.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 (217) hide show
  1. package/dist/InviteFormCore-D4HkMMo0.d.mts +721 -0
  2. package/dist/InviteFormCore-D9oUCbu7.d.ts +721 -0
  3. package/dist/VortexClient.js +192 -0
  4. package/dist/VortexClient.js.map +1 -0
  5. package/dist/VortexDeferredLinks.js +127 -0
  6. package/dist/VortexDeferredLinks.js.map +1 -0
  7. package/dist/clientInfo.js +45 -0
  8. package/dist/clientInfo.js.map +1 -0
  9. package/dist/components/ContactsPickerModal.js +182 -0
  10. package/dist/components/ContactsPickerModal.js.map +1 -0
  11. package/dist/components/InviteFormCore.js +2141 -0
  12. package/dist/components/InviteFormCore.js.map +1 -0
  13. package/dist/components/InviteFormMobile.js +463 -0
  14. package/dist/components/InviteFormMobile.js.map +1 -0
  15. package/dist/components/InviteFormWeb.js +295 -0
  16. package/dist/components/InviteFormWeb.js.map +1 -0
  17. package/dist/components/PlacedItemToolbar.js +147 -0
  18. package/dist/components/PlacedItemToolbar.js.map +1 -0
  19. package/dist/components/ShareButtons.js +181 -0
  20. package/dist/components/ShareButtons.js.map +1 -0
  21. package/dist/components/VrtxContactsImport.js +234 -0
  22. package/dist/components/VrtxContactsImport.js.map +1 -0
  23. package/dist/components/VrtxEmailInvitations.js +341 -0
  24. package/dist/components/VrtxEmailInvitations.js.map +1 -0
  25. package/dist/components/VrtxFindFriends.js +400 -0
  26. package/dist/components/VrtxFindFriends.js.map +1 -0
  27. package/dist/components/VrtxHeading.js +58 -0
  28. package/dist/components/VrtxHeading.js.map +1 -0
  29. package/dist/components/VrtxIncomingInvitations.js +657 -0
  30. package/dist/components/VrtxIncomingInvitations.js.map +1 -0
  31. package/dist/components/VrtxInvitationSuggestions.js +506 -0
  32. package/dist/components/VrtxInvitationSuggestions.js.map +1 -0
  33. package/dist/components/VrtxInviteContacts.js +512 -0
  34. package/dist/components/VrtxInviteContacts.js.map +1 -0
  35. package/dist/components/VrtxOutgoingInvitations.js +572 -0
  36. package/dist/components/VrtxOutgoingInvitations.js.map +1 -0
  37. package/dist/components/VrtxSearchBox.js +487 -0
  38. package/dist/components/VrtxSearchBox.js.map +1 -0
  39. package/dist/components/VrtxSelect.js +27 -0
  40. package/dist/components/VrtxSelect.js.map +1 -0
  41. package/dist/components/VrtxShareOptions.js +435 -0
  42. package/dist/components/VrtxShareOptions.js.map +1 -0
  43. package/dist/components/VrtxSubmit.js +132 -0
  44. package/dist/components/VrtxSubmit.js.map +1 -0
  45. package/dist/components/VrtxText.js +146 -0
  46. package/dist/components/VrtxText.js.map +1 -0
  47. package/dist/constants/mockData.d.mts +7 -0
  48. package/dist/constants/mockData.d.ts +7 -0
  49. package/dist/constants/mockData.js +48 -0
  50. package/dist/constants/mockData.js.map +1 -0
  51. package/dist/constants/mockData.mjs +22 -0
  52. package/dist/constants/mockData.mjs.map +1 -0
  53. package/dist/context/VortexModulesContext.js +135 -0
  54. package/dist/context/VortexModulesContext.js.map +1 -0
  55. package/dist/hooks/useInvitationFormLogic.d.mts +2 -0
  56. package/dist/hooks/useInvitationFormLogic.d.ts +2 -0
  57. package/dist/hooks/useInvitationFormLogic.js +300 -0
  58. package/dist/hooks/useInvitationFormLogic.js.map +1 -0
  59. package/dist/hooks/useInvitationFormLogic.mjs +276 -0
  60. package/dist/hooks/useInvitationFormLogic.mjs.map +1 -0
  61. package/dist/hooks/usePrefetchWidgetConfiguration.js +117 -0
  62. package/dist/hooks/usePrefetchWidgetConfiguration.js.map +1 -0
  63. package/dist/hooks/useThemeStyles.js +41 -0
  64. package/dist/hooks/useThemeStyles.js.map +1 -0
  65. package/dist/hooks/useVortexInvite.js +732 -0
  66. package/dist/hooks/useVortexInvite.js.map +1 -0
  67. package/dist/index-web.d.mts +93 -0
  68. package/dist/index-web.d.ts +93 -0
  69. package/dist/index-web.js +7397 -0
  70. package/dist/index-web.js.map +1 -0
  71. package/dist/index-web.mjs +7445 -0
  72. package/dist/index-web.mjs.map +1 -0
  73. package/dist/index.d.mts +656 -0
  74. package/dist/index.d.ts +656 -0
  75. package/dist/index.js +10206 -0
  76. package/dist/index.js.map +1 -0
  77. package/dist/index.mjs +10244 -0
  78. package/dist/index.mjs.map +1 -0
  79. package/dist/types/VortexClient.d.ts +106 -0
  80. package/dist/types/VortexClient.d.ts.map +1 -0
  81. package/dist/types/VortexDeferredLinks.d.ts +73 -0
  82. package/dist/types/VortexDeferredLinks.d.ts.map +1 -0
  83. package/dist/types/clientInfo.d.ts +5 -0
  84. package/dist/types/clientInfo.d.ts.map +1 -0
  85. package/dist/types/components/ContactsPickerModal.d.ts +18 -0
  86. package/dist/types/components/ContactsPickerModal.d.ts.map +1 -0
  87. package/dist/types/components/InviteFormCore.d.ts +166 -0
  88. package/dist/types/components/InviteFormCore.d.ts.map +1 -0
  89. package/dist/types/components/InviteFormMobile.d.ts +42 -0
  90. package/dist/types/components/InviteFormMobile.d.ts.map +1 -0
  91. package/dist/types/components/InviteFormWeb.d.ts +87 -0
  92. package/dist/types/components/InviteFormWeb.d.ts.map +1 -0
  93. package/dist/types/components/PlacedItemToolbar.d.ts +16 -0
  94. package/dist/types/components/PlacedItemToolbar.d.ts.map +1 -0
  95. package/dist/types/components/ShareButtons.d.ts +29 -0
  96. package/dist/types/components/ShareButtons.d.ts.map +1 -0
  97. package/dist/types/components/VrtxContactsImport.d.ts +14 -0
  98. package/dist/types/components/VrtxContactsImport.d.ts.map +1 -0
  99. package/dist/types/components/VrtxEmailInvitations.d.ts +31 -0
  100. package/dist/types/components/VrtxEmailInvitations.d.ts.map +1 -0
  101. package/dist/types/components/VrtxFindFriends.d.ts +25 -0
  102. package/dist/types/components/VrtxFindFriends.d.ts.map +1 -0
  103. package/dist/types/components/VrtxHeading.d.ts +6 -0
  104. package/dist/types/components/VrtxHeading.d.ts.map +1 -0
  105. package/dist/types/components/VrtxIncomingInvitations.d.ts +27 -0
  106. package/dist/types/components/VrtxIncomingInvitations.d.ts.map +1 -0
  107. package/dist/types/components/VrtxInvitationSuggestions.d.ts +25 -0
  108. package/dist/types/components/VrtxInvitationSuggestions.d.ts.map +1 -0
  109. package/dist/types/components/VrtxInviteContacts.d.ts +24 -0
  110. package/dist/types/components/VrtxInviteContacts.d.ts.map +1 -0
  111. package/dist/types/components/VrtxOutgoingInvitations.d.ts +27 -0
  112. package/dist/types/components/VrtxOutgoingInvitations.d.ts.map +1 -0
  113. package/dist/types/components/VrtxSearchBox.d.ts +28 -0
  114. package/dist/types/components/VrtxSearchBox.d.ts.map +1 -0
  115. package/dist/types/components/VrtxSelect.d.ts +6 -0
  116. package/dist/types/components/VrtxSelect.d.ts.map +1 -0
  117. package/dist/types/components/VrtxShareOptions.d.ts +41 -0
  118. package/dist/types/components/VrtxShareOptions.d.ts.map +1 -0
  119. package/dist/types/components/VrtxSubmit.d.ts +18 -0
  120. package/dist/types/components/VrtxSubmit.d.ts.map +1 -0
  121. package/dist/types/components/VrtxText.d.ts +8 -0
  122. package/dist/types/components/VrtxText.d.ts.map +1 -0
  123. package/dist/types/constants/mockData.d.ts +4 -0
  124. package/dist/types/constants/mockData.d.ts.map +1 -0
  125. package/dist/types/context/VortexModulesContext.d.ts +238 -0
  126. package/dist/types/context/VortexModulesContext.d.ts.map +1 -0
  127. package/dist/types/findFriends.js +10 -0
  128. package/dist/types/findFriends.js.map +1 -0
  129. package/dist/types/hooks/useInvitationFormLogic.d.ts +55 -0
  130. package/dist/types/hooks/useInvitationFormLogic.d.ts.map +1 -0
  131. package/dist/types/hooks/usePrefetchWidgetConfiguration.d.ts +39 -0
  132. package/dist/types/hooks/usePrefetchWidgetConfiguration.d.ts.map +1 -0
  133. package/dist/types/hooks/useThemeStyles.d.ts +35 -0
  134. package/dist/types/hooks/useThemeStyles.d.ts.map +1 -0
  135. package/dist/types/hooks/useVortexInvite.d.ts +86 -0
  136. package/dist/types/hooks/useVortexInvite.d.ts.map +1 -0
  137. package/dist/types/index-web.d.ts +23 -0
  138. package/dist/types/index-web.d.ts.map +1 -0
  139. package/dist/types/index.d.ts +23 -0
  140. package/dist/types/index.d.ts.map +1 -0
  141. package/dist/types/invitations.js +13 -0
  142. package/dist/types/invitations.js.map +1 -0
  143. package/dist/types/inviteContacts.js +14 -0
  144. package/dist/types/inviteContacts.js.map +1 -0
  145. package/dist/types/platformOperations.js +3 -0
  146. package/dist/types/platformOperations.js.map +1 -0
  147. package/dist/types/searchBox.js +11 -0
  148. package/dist/types/searchBox.js.map +1 -0
  149. package/dist/types/types/findFriends.d.ts +101 -0
  150. package/dist/types/types/findFriends.d.ts.map +1 -0
  151. package/dist/types/types/invitations.d.ts +301 -0
  152. package/dist/types/types/invitations.d.ts.map +1 -0
  153. package/dist/types/types/inviteContacts.d.ts +86 -0
  154. package/dist/types/types/inviteContacts.d.ts.map +1 -0
  155. package/dist/types/types/platformOperations.d.ts +185 -0
  156. package/dist/types/types/platformOperations.d.ts.map +1 -0
  157. package/dist/types/types/searchBox.d.ts +69 -0
  158. package/dist/types/types/searchBox.d.ts.map +1 -0
  159. package/dist/types/types/unfurlConfig.d.ts +34 -0
  160. package/dist/types/types/unfurlConfig.d.ts.map +1 -0
  161. package/dist/types/unfurlConfig.js +21 -0
  162. package/dist/types/unfurlConfig.js.map +1 -0
  163. package/dist/types/utils/analytics.d.ts +54 -0
  164. package/dist/types/utils/analytics.d.ts.map +1 -0
  165. package/dist/types/utils/configCache.d.ts +34 -0
  166. package/dist/types/utils/configCache.d.ts.map +1 -0
  167. package/dist/types/utils/contactUtils.d.ts +9 -0
  168. package/dist/types/utils/contactUtils.d.ts.map +1 -0
  169. package/dist/types/utils/featureWarnings.d.ts +56 -0
  170. package/dist/types/utils/featureWarnings.d.ts.map +1 -0
  171. package/dist/types/utils/formUtils.d.ts +93 -0
  172. package/dist/types/utils/formUtils.d.ts.map +1 -0
  173. package/dist/types/utils/gradientUtils.d.ts +67 -0
  174. package/dist/types/utils/gradientUtils.d.ts.map +1 -0
  175. package/dist/types/utils/invitationEvents.d.ts +21 -0
  176. package/dist/types/utils/invitationEvents.d.ts.map +1 -0
  177. package/dist/types/utils/moduleLoaders.d.ts +115 -0
  178. package/dist/types/utils/moduleLoaders.d.ts.map +1 -0
  179. package/dist/types/utils/moduleLoaders.web.d.ts +73 -0
  180. package/dist/types/utils/moduleLoaders.web.d.ts.map +1 -0
  181. package/dist/types/utils/nameUtils.d.ts +15 -0
  182. package/dist/types/utils/nameUtils.d.ts.map +1 -0
  183. package/dist/types/utils/themeUtils.d.ts +38 -0
  184. package/dist/types/utils/themeUtils.d.ts.map +1 -0
  185. package/dist/types/vortexInvite.d.ts +165 -0
  186. package/dist/types/vortexInvite.d.ts.map +1 -0
  187. package/dist/useInvitationFormLogic-Ct73M19B.d.mts +242 -0
  188. package/dist/useInvitationFormLogic-Ct73M19B.d.ts +242 -0
  189. package/dist/utils/analytics.js +92 -0
  190. package/dist/utils/analytics.js.map +1 -0
  191. package/dist/utils/configCache.js +68 -0
  192. package/dist/utils/configCache.js.map +1 -0
  193. package/dist/utils/contactUtils.d.mts +12 -0
  194. package/dist/utils/contactUtils.d.ts +12 -0
  195. package/dist/utils/contactUtils.js +37 -0
  196. package/dist/utils/contactUtils.js.map +1 -0
  197. package/dist/utils/contactUtils.mjs +12 -0
  198. package/dist/utils/contactUtils.mjs.map +1 -0
  199. package/dist/utils/featureWarnings.js +214 -0
  200. package/dist/utils/featureWarnings.js.map +1 -0
  201. package/dist/utils/formUtils.js +284 -0
  202. package/dist/utils/formUtils.js.map +1 -0
  203. package/dist/utils/gradientUtils.js +120 -0
  204. package/dist/utils/gradientUtils.js.map +1 -0
  205. package/dist/utils/invitationEvents.js +45 -0
  206. package/dist/utils/invitationEvents.js.map +1 -0
  207. package/dist/utils/moduleLoaders.js +275 -0
  208. package/dist/utils/moduleLoaders.js.map +1 -0
  209. package/dist/utils/moduleLoaders.web.js +72 -0
  210. package/dist/utils/moduleLoaders.web.js.map +1 -0
  211. package/dist/utils/nameUtils.js +51 -0
  212. package/dist/utils/nameUtils.js.map +1 -0
  213. package/dist/utils/themeUtils.js +141 -0
  214. package/dist/utils/themeUtils.js.map +1 -0
  215. package/dist/vortexInvite.js +83 -0
  216. package/dist/vortexInvite.js.map +1 -0
  217. package/package.json +21 -56
@@ -0,0 +1,656 @@
1
+ import react__default from 'react';
2
+ import { UnsignedData, WidgetConfiguration } from '@teamvortexsoftware/vortex-types';
3
+ export { EmailGroupMembershipCheckFunction, EmailGroupMembershipCheckResult, UnsignedData } from '@teamvortexsoftware/vortex-types';
4
+ import { EventName } from '@teamvortexsoftware/analytics-client';
5
+ export { EventName, EventNames } from '@teamvortexsoftware/analytics-client';
6
+ import { F as FindFriendsConfig, I as IncomingInvitationsConfig, O as OutgoingInvitationsConfig, a as InviteContactsConfig, S as SearchBoxConfig, b as InvitationSuggestionsConfig, c as IconRendererProps } from './InviteFormCore-D4HkMMo0.mjs';
7
+ export { g as FindFriendsContact, f as IconName, i as IncomingInvitationItem, d as InvitationFormCore, e as InvitationFormCoreProps, h as InvitationItem, k as InviteContactsContact, d as InviteFormCore, j as OutgoingInvitationItem } from './InviteFormCore-D4HkMMo0.mjs';
8
+ export { C as Contact, P as PlatformOperations, V as ViewType, u as useInvitationFormLogic } from './useInvitationFormLogic-Ct73M19B.mjs';
9
+ export { MOCK_CONTACTS, MOCK_GOOGLE_CONTACTS } from './constants/mockData.mjs';
10
+ export { filterContacts } from './utils/contactUtils.mjs';
11
+
12
+ declare const DEFAULT_ANALYTICS_URL = "https://collector.vortexsoftware.com";
13
+ /**
14
+ * Analytics event interface for React Native SDK
15
+ * Based on AnalyticsEvent from analytics-client with additional mobile-specific fields
16
+ */
17
+ interface VortexAnalyticsEvent {
18
+ name: EventName;
19
+ widgetConfigurationId: string;
20
+ deploymentId: string;
21
+ environmentId: string;
22
+ platform: string;
23
+ segmentation?: Record<string, any>;
24
+ payload?: Record<string, any>;
25
+ groups?: Array<{
26
+ type: string;
27
+ id: string;
28
+ name: string;
29
+ }>;
30
+ timestamp: number;
31
+ sessionId?: string;
32
+ useragent?: string;
33
+ foreignUserId?: string;
34
+ }
35
+ /**
36
+ * Simplified analytics event for components that emit minimal events.
37
+ * These components emit (name + segmentation) and the parent
38
+ * is responsible for enriching with widgetConfigurationId, deploymentId, etc.
39
+ */
40
+ interface SimpleAnalyticsEvent {
41
+ name: EventName;
42
+ segmentation?: Record<string, any>;
43
+ payload?: Record<string, any>;
44
+ }
45
+ /**
46
+ * Group DTO for analytics events
47
+ */
48
+ interface GroupDTO {
49
+ type: string;
50
+ id: string;
51
+ name: string;
52
+ }
53
+
54
+ /**
55
+ * Configuration for Open Graph unfurl metadata.
56
+ * Used to customize link previews when sharing invitation links.
57
+ *
58
+ * @example
59
+ * ```tsx
60
+ * <VortexInvite
61
+ * componentId="abc123"
62
+ * unfurlConfig={{
63
+ * title: "Join our team!",
64
+ * description: "You've been invited to collaborate",
65
+ * image: "https://example.com/preview.png",
66
+ * siteName: "My App",
67
+ * }}
68
+ * />
69
+ * ```
70
+ */
71
+ interface UnfurlConfig {
72
+ /** The title for the link preview (og:title) */
73
+ title?: string;
74
+ /** The description for the link preview (og:description) */
75
+ description?: string;
76
+ /** URL to an image for the link preview (og:image) */
77
+ image?: string;
78
+ /** The site name for the link preview (og:site_name) */
79
+ siteName?: string;
80
+ /** The type of content (og:type), defaults to "website" */
81
+ type?: string;
82
+ }
83
+ /**
84
+ * Converts UnfurlConfig to the metadata format expected by the API.
85
+ */
86
+ declare function unfurlConfigToMetadata(config: UnfurlConfig): Record<string, string>;
87
+
88
+ /**
89
+ * VortexModulesContext
90
+ *
91
+ * Internal context for passing optional module configuration AND loader functions
92
+ * from entry points (VortexInvite/InviteFormWeb) down to child components
93
+ * without prop drilling.
94
+ *
95
+ * This is completely internal to the SDK - end users only need to pass props
96
+ * to <VortexInvite> and everything works automatically.
97
+ *
98
+ * The key insight is that entry points inject the appropriate loader functions:
99
+ * - Native entry (index.tsx/InviteFormMobile) injects loaders from moduleLoaders.ts
100
+ * - Web entry (preview.tsx/InviteFormWeb) injects loaders from moduleLoaders.web.ts
101
+ *
102
+ * This way, components don't import loaders directly, avoiding Metro/webpack bundler issues.
103
+ *
104
+ * Example usage (internal):
105
+ * ```tsx
106
+ * // In a child component
107
+ * const { modules, loaders } = useVortexModules();
108
+ * const GradientComponent = loaders.loadGradientComponent(modules?.gradient);
109
+ * ```
110
+ */
111
+
112
+ /**
113
+ * Supported gradient library module names.
114
+ * Users specify which library they have installed.
115
+ */
116
+ type GradientModuleName = 'expo-linear-gradient' | 'react-native-linear-gradient';
117
+ /**
118
+ * Supported haptics library module names.
119
+ */
120
+ type HapticsModuleName = 'expo-haptics';
121
+ /**
122
+ * Supported QR code library module names.
123
+ */
124
+ type QRCodeModuleName = 'react-native-qrcode-svg' | 'react-qr-code';
125
+ /**
126
+ * Supported clipboard library module names.
127
+ */
128
+ type ClipboardModuleName = 'expo-clipboard' | '@react-native-clipboard/clipboard';
129
+ /**
130
+ * Supported sharing library module names.
131
+ */
132
+ type SharingModuleName = 'expo-sharing';
133
+ /**
134
+ * Unified modules configuration object.
135
+ * Users specify which optional native libraries they have installed via a single prop.
136
+ *
137
+ * @example
138
+ * ```tsx
139
+ * <VortexInvite
140
+ * componentId="abc123"
141
+ * modules={{
142
+ * gradient: 'expo-linear-gradient',
143
+ * haptics: 'expo-haptics',
144
+ * qrCode: 'react-native-qrcode-svg',
145
+ * }}
146
+ * />
147
+ * ```
148
+ */
149
+ interface VortexModules {
150
+ /**
151
+ * Gradient library for button backgrounds.
152
+ * For Expo: 'expo-linear-gradient'
153
+ * For bare RN: 'react-native-linear-gradient'
154
+ */
155
+ gradient?: GradientModuleName;
156
+ /**
157
+ * Haptics library for touch feedback.
158
+ * Currently only 'expo-haptics' is supported.
159
+ */
160
+ haptics?: HapticsModuleName;
161
+ /**
162
+ * QR code library for QR code display.
163
+ * For native: 'react-native-qrcode-svg'
164
+ * For web: 'react-qr-code'
165
+ */
166
+ qrCode?: QRCodeModuleName;
167
+ /**
168
+ * Clipboard library for copy functionality.
169
+ * For Expo: 'expo-clipboard'
170
+ * For bare RN: '@react-native-clipboard/clipboard'
171
+ */
172
+ clipboard?: ClipboardModuleName;
173
+ /**
174
+ * Sharing library for native share sheet.
175
+ * Currently only 'expo-sharing' is supported.
176
+ */
177
+ sharing?: SharingModuleName;
178
+ }
179
+
180
+ type VortexActionType = 'invite' | 'share';
181
+ interface VortexActionResult {
182
+ type: VortexActionType;
183
+ data: string;
184
+ }
185
+ interface Attributes {
186
+ [key: string]: {
187
+ value: string | string[];
188
+ type: string;
189
+ role?: string;
190
+ };
191
+ }
192
+ interface VortexInviteProps {
193
+ vortexApiUrl?: string;
194
+ componentId: string;
195
+ jwt?: string;
196
+ user?: string | UnsignedData | undefined;
197
+ googleIosClientId?: string;
198
+ googleWebClientId?: string;
199
+ onSuccess?: (result: VortexActionResult) => void;
200
+ onError?: (error: Error, type: VortexActionType) => void;
201
+ onClose?: () => void;
202
+ contentTokens?: Attributes;
203
+ widgetConfiguration?: any;
204
+ group?: {
205
+ name: string;
206
+ type: string;
207
+ id?: string;
208
+ groupId?: string;
209
+ };
210
+ groups?: GroupDTO[];
211
+ scope?: string;
212
+ scopeType?: string;
213
+ analyticsBaseURL?: string;
214
+ onEvent?: (event: VortexAnalyticsEvent) => void;
215
+ analyticsSegmentation?: Record<string, any>;
216
+ /**
217
+ * Configuration for the Find Friends feature.
218
+ * When provided, enables the Find Friends component to display
219
+ * contacts with Connect buttons. When Connect is tapped and onConnect
220
+ * returns true, an invitation is created via the Vortex backend.
221
+ *
222
+ * @example
223
+ * ```tsx
224
+ * <VortexInvite
225
+ * componentId="abc123"
226
+ * findFriendsConfig={{
227
+ * contacts: [
228
+ * { userId: 'user-123', name: 'John Doe', subtitle: '@johndoe' },
229
+ * { userId: 'user-456', name: 'Jane Smith', avatarUrl: 'https://...' },
230
+ * ],
231
+ * onConnect: async (contact) => {
232
+ * // Perform any pre-connection validation
233
+ * // Return true to create the invitation via Vortex backend
234
+ * return true;
235
+ * },
236
+ * onInvitationCreated: (contact) => {
237
+ * // Called after invitation is successfully created
238
+ * },
239
+ * }}
240
+ * />
241
+ * ```
242
+ */
243
+ findFriendsConfig?: FindFriendsConfig;
244
+ /**
245
+ * Configuration for the Incoming Invitations feature.
246
+ * When provided, enables the Incoming Invitations component to display
247
+ * invitations the user has received with Accept/Delete buttons.
248
+ */
249
+ incomingInvitationsConfig?: IncomingInvitationsConfig;
250
+ /**
251
+ * Configuration for the Outgoing Invitations feature.
252
+ * When provided, enables the Outgoing Invitations component to display
253
+ * invitations the user has sent with a Cancel button.
254
+ */
255
+ outgoingInvitationsConfig?: OutgoingInvitationsConfig;
256
+ /**
257
+ * Configuration for the Invite Contacts feature.
258
+ * When provided, enables the Invite Contacts component to display
259
+ * a list of contacts that can be invited via SMS.
260
+ *
261
+ * The component shows an "Invite your contacts" link that expands to
262
+ * a searchable contact list. When the user taps "Invite", an SMS
263
+ * invitation is created and the SMS app opens with a pre-filled message.
264
+ *
265
+ * @example
266
+ * ```tsx
267
+ * <VortexInvite
268
+ * componentId="abc123"
269
+ * inviteContactsConfig={{
270
+ * contacts: [
271
+ * { id: '1', name: 'John Doe', phoneNumber: '+1234567890' },
272
+ * { id: '2', name: 'Jane Smith', phoneNumber: '+0987654321' },
273
+ * ],
274
+ * onInvite: (contact, shortLink) => {
275
+ * console.log(`Invited ${contact.name} with link ${shortLink}`);
276
+ * },
277
+ * }}
278
+ * />
279
+ * ```
280
+ */
281
+ inviteContactsConfig?: InviteContactsConfig;
282
+ /**
283
+ * Configuration for the Search Box feature.
284
+ * When provided, enables the Search Box component with a search input,
285
+ * search button, and results list with Connect buttons.
286
+ */
287
+ searchBoxConfig?: SearchBoxConfig;
288
+ /**
289
+ * Locale code for internationalization (e.g., "es", "fr", "zh-TW").
290
+ * If provided and i18n is enabled on the widget, returns localized content.
291
+ */
292
+ locale?: string;
293
+ /**
294
+ * Configuration for invitation suggestions (People You May Know).
295
+ * When provided, enables the Invitation Suggestions component to display
296
+ * suggested contacts with Invite/Dismiss buttons.
297
+ */
298
+ invitationSuggestionsConfig?: InvitationSuggestionsConfig;
299
+ /**
300
+ * Configuration for Open Graph unfurl metadata.
301
+ * Used to customize link previews when sharing invitation links.
302
+ *
303
+ * @example
304
+ * ```tsx
305
+ * <VortexInvite
306
+ * componentId="abc123"
307
+ * unfurlConfig={{
308
+ * title: "Join our team!",
309
+ * description: "You've been invited to collaborate",
310
+ * image: "https://example.com/preview.png",
311
+ * }}
312
+ * />
313
+ * ```
314
+ */
315
+ unfurlConfig?: UnfurlConfig;
316
+ /**
317
+ * Configuration for optional native libraries.
318
+ * Specify which libraries you have installed in a single object.
319
+ *
320
+ * @example
321
+ * ```tsx
322
+ * <VortexInvite
323
+ * componentId="abc123"
324
+ * modules={{
325
+ * gradient: 'expo-linear-gradient',
326
+ * haptics: 'expo-haptics',
327
+ * qrCode: 'react-native-qrcode-svg',
328
+ * }}
329
+ * />
330
+ * ```
331
+ */
332
+ modules?: VortexModules;
333
+ }
334
+ declare function VortexInvite({ componentId, vortexApiUrl, jwt, user, googleIosClientId, googleWebClientId, onSuccess, onError, onClose, contentTokens, widgetConfiguration, group, groups, scope, scopeType, analyticsBaseURL, onEvent, analyticsSegmentation, findFriendsConfig, incomingInvitationsConfig, outgoingInvitationsConfig, inviteContactsConfig, searchBoxConfig, locale, invitationSuggestionsConfig, unfurlConfig, modules, }: VortexInviteProps): react__default.JSX.Element;
335
+
336
+ interface InvitationFormProps {
337
+ platform?: 'ios' | 'android';
338
+ onClose?: () => void;
339
+ widgetConfiguration?: any;
340
+ componentId: string;
341
+ jwt?: string;
342
+ user?: string | UnsignedData | undefined;
343
+ vortexApiUrl?: string;
344
+ group?: {
345
+ name: string;
346
+ type: string;
347
+ id?: string;
348
+ groupId?: string;
349
+ };
350
+ groups?: GroupDTO[];
351
+ scope?: string;
352
+ scopeType?: string;
353
+ googleIosClientId?: string;
354
+ googleWebClientId?: string;
355
+ analyticsBaseURL?: string;
356
+ onEvent?: (event: VortexAnalyticsEvent) => void;
357
+ analyticsSegmentation?: Record<string, any>;
358
+ findFriendsConfig?: FindFriendsConfig;
359
+ incomingInvitationsConfig?: IncomingInvitationsConfig;
360
+ outgoingInvitationsConfig?: OutgoingInvitationsConfig;
361
+ invitationSuggestionsConfig?: InvitationSuggestionsConfig;
362
+ inviteContactsConfig?: InviteContactsConfig;
363
+ searchBoxConfig?: SearchBoxConfig;
364
+ locale?: string;
365
+ unfurlConfig?: UnfurlConfig;
366
+ }
367
+ declare function InviteFormMobile({ platform, onClose, widgetConfiguration: propsWidgetConfiguration, componentId, jwt, user, vortexApiUrl, group, groups, scope, scopeType, googleIosClientId, googleWebClientId, analyticsBaseURL, onEvent, analyticsSegmentation, findFriendsConfig, incomingInvitationsConfig, outgoingInvitationsConfig, inviteContactsConfig, searchBoxConfig, locale, invitationSuggestionsConfig, unfurlConfig, }: InvitationFormProps): react__default.JSX.Element;
368
+
369
+ interface UsePrefetchWidgetConfigurationOptions {
370
+ componentId: string;
371
+ vortexApiUrl: string;
372
+ jwt?: string;
373
+ user?: string | UnsignedData;
374
+ enabled?: boolean;
375
+ }
376
+ /**
377
+ * Hook to prefetch widget configuration for instant rendering.
378
+ * This hook fetches the configuration early (e.g., when JWT becomes available)
379
+ * so the VortexInvite component can render immediately without showing a loading spinner.
380
+ *
381
+ * The hook will still refetch in the background when VortexInvite mounts to ensure
382
+ * the configuration is up-to-date (stale-while-revalidate pattern).
383
+ *
384
+ * @example
385
+ * ```tsx
386
+ * const { widgetConfiguration } = usePrefetchWidgetConfiguration({
387
+ * componentId: 'your-component-id',
388
+ * vortexApiUrl: 'https://client-api.vortexsoftware.com',
389
+ * jwt,
390
+ * enabled: !!jwt, // Only prefetch when JWT is ready
391
+ * });
392
+ *
393
+ * <VortexInvite
394
+ * componentId={componentId}
395
+ * jwt={jwt}
396
+ * widgetConfiguration={widgetConfiguration} // Pass prefetched config
397
+ * // ... other props
398
+ * />
399
+ * ```
400
+ */
401
+ declare function usePrefetchWidgetConfiguration({ componentId, vortexApiUrl, jwt, user, enabled, }: UsePrefetchWidgetConfigurationOptions): {
402
+ widgetConfiguration: WidgetConfiguration | undefined;
403
+ error: Error | null;
404
+ isLoading: boolean;
405
+ };
406
+
407
+ declare const configCache: {
408
+ /**
409
+ * Get a cached widget configuration by component ID.
410
+ * @param componentId - The widget component ID
411
+ * @returns The cached configuration, or undefined if not found
412
+ */
413
+ get: (componentId: string) => WidgetConfiguration | undefined;
414
+ /**
415
+ * Store a widget configuration in the cache.
416
+ * @param componentId - The widget component ID
417
+ * @param config - The widget configuration to cache
418
+ */
419
+ set: (componentId: string, config: WidgetConfiguration) => void;
420
+ /**
421
+ * Clear cached configuration(s).
422
+ * @param componentId - Optional component ID to clear specific config. If omitted, clears all.
423
+ */
424
+ clear: (componentId?: string) => void;
425
+ /**
426
+ * Check if a configuration exists in the cache.
427
+ * @param componentId - The widget component ID
428
+ * @returns True if configuration is cached, false otherwise
429
+ */
430
+ has: (componentId: string) => boolean;
431
+ /**
432
+ * Get cache statistics for debugging.
433
+ */
434
+ stats: () => {
435
+ size: number;
436
+ keys: string[];
437
+ };
438
+ };
439
+
440
+ /**
441
+ * Device fingerprint data collected for deferred deep linking.
442
+ */
443
+ interface DeviceFingerprint {
444
+ platform: 'ios' | 'android';
445
+ osVersion: string;
446
+ deviceModel: string;
447
+ deviceBrand: string;
448
+ timezone: string;
449
+ language: string;
450
+ screenWidth: number;
451
+ screenHeight: number;
452
+ carrierName?: string;
453
+ totalMemory?: number;
454
+ }
455
+ /**
456
+ * Response from the match-fingerprint API endpoint.
457
+ */
458
+ interface MatchFingerprintResponse {
459
+ matched: boolean;
460
+ invitationId?: string;
461
+ deepLink?: string;
462
+ metadata?: Record<string, any>;
463
+ }
464
+ /**
465
+ * Options for retrieving deferred deep links.
466
+ */
467
+ interface RetrieveDeferredDeepLinkOptions {
468
+ /** JWT token for authentication */
469
+ jwt: string;
470
+ /** Optional base URL override (defaults to production) */
471
+ baseURL?: string;
472
+ }
473
+ /**
474
+ * VortexDeferredLinks provides deferred deep linking functionality.
475
+ *
476
+ * Deferred deep linking allows you to track invitation attribution even when
477
+ * the app wasn't installed at the time the invitation link was clicked.
478
+ *
479
+ * @example
480
+ * ```tsx
481
+ * import { VortexDeferredLinks } from '@teamvortexsoftware/vortex-react-native';
482
+ *
483
+ * // On app first launch after install
484
+ * async function checkDeferredDeepLink(jwt: string) {
485
+ * const result = await VortexDeferredLinks.retrieveDeferredDeepLink({ jwt });
486
+ * if (result.matched && result.deepLink) {
487
+ * // Handle the deferred deep link
488
+ * console.log('User came from invitation:', result.invitationId);
489
+ * // Navigate to appropriate screen
490
+ * }
491
+ * }
492
+ * ```
493
+ */
494
+ declare class VortexDeferredLinks {
495
+ /**
496
+ * Collects device fingerprint data for matching.
497
+ * This data is used to match the device against fingerprints collected
498
+ * when invitation links were clicked.
499
+ */
500
+ static collectDeviceFingerprint(): DeviceFingerprint;
501
+ /**
502
+ * Retrieves a deferred deep link by matching the device fingerprint.
503
+ *
504
+ * Call this method on first app launch after installation to check if
505
+ * the user came from an invitation link.
506
+ *
507
+ * @param options - Configuration options including JWT and optional base URL
508
+ * @returns Promise resolving to match result with optional deep link
509
+ */
510
+ static retrieveDeferredDeepLink(options: RetrieveDeferredDeepLinkOptions): Promise<MatchFingerprintResponse>;
511
+ }
512
+
513
+ /**
514
+ * VortexClient provides API methods for invitation management.
515
+ *
516
+ * @example
517
+ * ```tsx
518
+ * import { VortexClient } from '@teamvortexsoftware/vortex-react-native';
519
+ *
520
+ * const client = new VortexClient({
521
+ * jwt: 'your-jwt-token',
522
+ * baseURL: 'https://client-api.vortexsoftware.com', // optional
523
+ * });
524
+ *
525
+ * // Revoke an outgoing invitation
526
+ * await client.revokeInvitation('invitation-id');
527
+ *
528
+ * // Accept an incoming invitation
529
+ * await client.acceptIncomingInvitation('invitation-id');
530
+ *
531
+ * // Delete an incoming invitation
532
+ * await client.deleteIncomingInvitation('invitation-id');
533
+ * ```
534
+ */
535
+ interface VortexClientOptions {
536
+ /** JWT token for authentication */
537
+ jwt: string;
538
+ /** Optional base URL override (defaults to production) */
539
+ baseURL?: string;
540
+ }
541
+ interface InvitationResponse {
542
+ success: boolean;
543
+ message?: string;
544
+ data?: any;
545
+ }
546
+ /** Target of an invitation (e.g., email or SMS recipient) */
547
+ interface InvitationTarget {
548
+ targetType: string;
549
+ targetValue: string;
550
+ targetName?: string;
551
+ targetAvatarUrl?: string;
552
+ }
553
+ /** Individual incoming invitation from the API */
554
+ interface IncomingInvitation {
555
+ id: string;
556
+ targets?: InvitationTarget[];
557
+ senderIdentifier?: string;
558
+ senderIdentifierType?: string;
559
+ avatarUrl?: string;
560
+ status?: string;
561
+ createdAt?: string;
562
+ source?: string;
563
+ deliveryType?: string;
564
+ /** Name of the user who created this invitation */
565
+ creatorName?: string | null;
566
+ /** Avatar URL of the user who created this invitation */
567
+ creatorAvatarUrl?: string | null;
568
+ /** Internal ID of the user who created this invitation */
569
+ foreignCreatorId?: string | null;
570
+ /** Optional metadata attached to the invitation */
571
+ metadata?: Record<string, unknown>;
572
+ }
573
+ declare class VortexClient {
574
+ private jwt;
575
+ private baseURL;
576
+ constructor(options: VortexClientOptions);
577
+ /**
578
+ * Updates the JWT token used for authentication.
579
+ */
580
+ setJwt(jwt: string): void;
581
+ /**
582
+ * Revokes an outgoing invitation that the user has sent.
583
+ *
584
+ * @param invitationId - The ID of the invitation to revoke
585
+ * @returns Promise resolving to the response
586
+ */
587
+ revokeInvitation(invitationId: string): Promise<InvitationResponse>;
588
+ /**
589
+ * Accepts an incoming invitation that the user has received.
590
+ *
591
+ * @param invitationId - The ID of the invitation to accept
592
+ * @returns Promise resolving to the response
593
+ */
594
+ acceptIncomingInvitation(invitationId: string): Promise<InvitationResponse>;
595
+ /**
596
+ * Fetches incoming (open) invitations for the current user.
597
+ *
598
+ * @returns Promise resolving to the list of incoming invitations
599
+ */
600
+ getIncomingInvitations(): Promise<IncomingInvitation[]>;
601
+ /**
602
+ * Deletes/declines an incoming invitation that the user has received.
603
+ *
604
+ * @param invitationId - The ID of the invitation to delete
605
+ * @returns Promise resolving to the response
606
+ */
607
+ deleteIncomingInvitation(invitationId: string): Promise<InvitationResponse>;
608
+ }
609
+
610
+ interface VrtxInviteContactsProps {
611
+ block: any;
612
+ /** Invite Contacts configuration with contacts list */
613
+ inviteContactsConfig?: InviteContactsConfig;
614
+ /** Function to create SMS invitation and get short link */
615
+ createSmsInvitation?: (phoneNumber: string, contactName?: string) => Promise<string | null>;
616
+ /** Trigger haptic feedback */
617
+ triggerHaptic?: (style: 'light' | 'medium' | 'heavy') => Promise<void>;
618
+ /** Theme colors from widget configuration */
619
+ theme?: {
620
+ primaryBackground?: string;
621
+ primaryForeground?: string;
622
+ secondaryBackground?: string;
623
+ secondaryForeground?: string;
624
+ foreground?: string;
625
+ border?: string;
626
+ };
627
+ /** SMS message template with {{link}} placeholder */
628
+ smsMessageTemplate?: string;
629
+ }
630
+ declare function VrtxInviteContacts({ block, inviteContactsConfig, createSmsInvitation, triggerHaptic, theme, smsMessageTemplate, }: VrtxInviteContactsProps): react__default.JSX.Element | null;
631
+
632
+ interface VrtxSearchBoxProps {
633
+ block: any;
634
+ /** Search Box configuration with callbacks */
635
+ searchBoxConfig?: SearchBoxConfig;
636
+ /** Function to create an invitation with internal ID target type */
637
+ createUserIdInvitation?: (userId: string, name?: string, avatarUrl?: string, metadata?: Record<string, unknown>) => Promise<void>;
638
+ /** Trigger haptic feedback */
639
+ triggerHaptic?: (style: 'light' | 'medium' | 'heavy') => Promise<void>;
640
+ /** Callback to emit analytics events */
641
+ onAnalyticsEvent?: (event: SimpleAnalyticsEvent) => void;
642
+ /** Function to render icons (from InviteFormCore) */
643
+ renderIcon?: (props: IconRendererProps) => react__default.ReactNode;
644
+ /** Theme colors from widget configuration */
645
+ theme?: {
646
+ primaryBackground?: string;
647
+ primaryForeground?: string;
648
+ secondaryBackground?: string;
649
+ secondaryForeground?: string;
650
+ foreground?: string;
651
+ border?: string;
652
+ };
653
+ }
654
+ declare function VrtxSearchBox({ block, searchBoxConfig, createUserIdInvitation, triggerHaptic, onAnalyticsEvent, renderIcon, theme, }: VrtxSearchBoxProps): react__default.JSX.Element;
655
+
656
+ export { type Attributes, DEFAULT_ANALYTICS_URL, type DeviceFingerprint, FindFriendsConfig, type GroupDTO, IconRendererProps, IncomingInvitationsConfig, InviteFormMobile as InvitationForm, type InvitationResponse, InvitationSuggestionsConfig, InviteContactsConfig, InviteFormMobile, type MatchFingerprintResponse, OutgoingInvitationsConfig, type RetrieveDeferredDeepLinkOptions, SearchBoxConfig, type SimpleAnalyticsEvent, type UnfurlConfig, type UsePrefetchWidgetConfigurationOptions, type VortexActionResult, type VortexActionType, type VortexAnalyticsEvent, VortexClient, type VortexClientOptions, VortexDeferredLinks, VortexInvite, type VortexInviteProps, type VortexModules, VrtxInviteContacts, type VrtxInviteContactsProps, VrtxSearchBox, type VrtxSearchBoxProps, configCache, unfurlConfigToMetadata, usePrefetchWidgetConfiguration };