react-native-insider 8.0.1 → 8.0.2

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.
@@ -0,0 +1,598 @@
1
+ ---
2
+ name: academy-doc-generator
3
+ description: Generates Insider Academy developer guide documentation (.md + .html) from a given React Native SDK module (JS + .d.ts), exposing only public APIs. Supports --format, --output, and --dry-run flags. Output is structurally identical to the iOS and Android academy-doc-generator skills so the three platform docs stay in lockstep.
4
+ version: 1.0.0
5
+ type: custom
6
+ project: Insider React Native SDK
7
+ generated_by: skill-creator-agent
8
+ generated_from: .orbit-output/config/architecture/
9
+ ---
10
+
11
+ # Academy Doc Generator
12
+
13
+ Generates developer guide documentation for the Insider Academy website from a given React Native SDK module. Outputs Markdown and/or HTML formats, exposing only the public JS/TS API surface (the `.d.ts` is the source of truth for what is public).
14
+
15
+ The same skill exists for the iOS SDK (`mobile-ios`) and the Android SDK (`mobileandroid`). Output structure, section order, emojis (✅ / ⛔), version-badge style, callout boxes, HTML template (pre-tokenized spans, VS Code dark theme, sticky sidebar TOC, tab switcher, copy-to-clipboard, self-contained assets) are **intentionally identical across the three platforms** so the Academy docs line up side by side.
16
+
17
+ **Usage:** `/academy-doc-generator <module> [--format md|html] [--output <dir>] [--dry-run]`
18
+
19
+ - `--format md` — generate only Markdown
20
+ - `--format html` — generate only HTML
21
+ - *(no flag)* — generate both (default)
22
+ - `--output <dir>` — write output to a custom directory instead of `docs/{module-name}/`
23
+ - `--dry-run` — show discovery/analysis results without writing any files
24
+
25
+ ## Activation
26
+
27
+ <agent-activation>
28
+ When this skill is invoked:
29
+
30
+ ### Step 0: Create Task List for Progress Tracking
31
+
32
+ Before starting any work, create a task list using TaskCreate so the user can see step-by-step progress. Create the following tasks in a single batch:
33
+
34
+ 1. **"Parse input arguments"** — activeForm: "Parsing input arguments"
35
+ 2. **"Resolve module path (JS + .d.ts)"** — activeForm: "Resolving module path"
36
+ 3. **"Discover public API surface from .d.ts"** — activeForm: "Discovering public API surface"
37
+ 4. **"Analyze public API and build validation registry"** — activeForm: "Analyzing public API"
38
+ 5. **"Discover related types"** — activeForm: "Discovering related types"
39
+ 6. **"Trace entry points in index.js / index.d.ts"** — activeForm: "Tracing entry points"
40
+ 7. **"Read SDK version from package.json"** — activeForm: "Reading SDK version"
41
+ 8. **"Generate Markdown documentation"** — activeForm: "Generating Markdown documentation"
42
+ 9. **"Generate HTML documentation"** — activeForm: "Generating HTML documentation"
43
+ 10. **"Validate generated code examples"** — activeForm: "Validating generated code examples"
44
+ 11. **"Write output files"** — activeForm: "Writing output files"
45
+ 12. **"Display summary"** — activeForm: "Displaying summary"
46
+
47
+ Skip (or delete) tasks that will not run based on parsed flags:
48
+ - Skip "Generate Markdown documentation" if `--format html`
49
+ - Skip "Generate HTML documentation" if `--format md`
50
+ - Skip "Write output files" if `--dry-run`
51
+
52
+ **Progress tracking rule:** Before starting each step, set its task to `in_progress` via TaskUpdate. After completing each step, set it to `completed`. Keep the spinner accurate throughout the run.
53
+
54
+ ### Step 1: Parse Input
55
+
56
+ The user provides arguments in the format: `<module> [--format md|html] [--output <dir>] [--dry-run]`
57
+
58
+ 1. **module** (required): One of three shapes
59
+ - A module / class name: `InsiderAppCards`, `InsiderUser`, `InsiderEvent`, `InsiderProduct`, `InsiderIdentifier`
60
+ - A JS file path: `src/InsiderAppCards.js` or `index.js`
61
+ - A directory: a subfolder under `src/` (e.g., `src/appcards/` if one exists)
62
+ 2. **--format** (optional): `md` (Markdown only) or `html` (HTML only). Omitted → generate both.
63
+ 3. **--output** (optional): Custom output directory. Omitted → `docs/{module-name}/` at repo root.
64
+ 4. **--dry-run** (optional): Run full discovery and analysis but write no files.
65
+
66
+ Parse the arguments: split on `--` flags. If `--format` is provided with an invalid value (not `md` or `html`), HALT with a clear error. If the module cannot be resolved in Step 2, HALT there.
67
+
68
+ ### Step 2: Resolve Module Path (JS + .d.ts)
69
+
70
+ Resolve the input to a concrete `(jsPath, dtsPath, moduleName)` triple:
71
+
72
+ 1. If input is a file path (`src/Foo.js` or `index.js`): the `.d.ts` is the sibling with the same basename (`src/Foo.d.ts` / `index.d.ts`). Derive `moduleName` from the exported class or from the basename.
73
+ 2. If input is a bare name like `InsiderAppCards`: check, in order:
74
+ - `./index.js` — only if the name matches the default export (`RNInsider`)
75
+ - `src/{Name}.js` + `src/{Name}.d.ts`
76
+ 3. If input is a directory: collect all `*.js` files under it, find the primary module (largest public surface, or the one whose basename matches the directory name). The primary module's `.d.ts` drives discovery; sibling `.d.ts` files inside the same directory are also considered.
77
+
78
+ Validate with the Read tool that both the `.js` and its `.d.ts` exist. If either is missing, HALT with a clear message — React Native docs pull their shape from `.d.ts`, so a missing `.d.ts` means there is no public API to document.
79
+
80
+ **module-name derivation (for output paths and titles):**
81
+ - Strip the `Insider` prefix from the class name
82
+ - Convert to kebab-case
83
+ - Examples: `InsiderAppCards` → `app-cards`, `InsiderUser` → `user`, `InsiderProduct` → `product`, `InsiderEvent` → `event`, `InsiderIdentifier` → `identifier`, `RNInsider` → `insider` (top-level facade)
84
+
85
+ **IMPORTANT:** `Insider` prefix is stripped only in **file paths and document titles**. Inside code examples, type names, and prose, the original class name (`InsiderAppCards`, `RNInsiderUser`, etc.) MUST be preserved verbatim.
86
+
87
+ ### Step 3: Discover Public API Surface from `.d.ts`
88
+
89
+ `.d.ts` files are the **single source of truth** for what is public in this codebase. Anything declared in a `.js` file but absent from its sibling `.d.ts` is internal and MUST NOT be documented.
90
+
91
+ For the resolved module's `.d.ts`:
92
+
93
+ 1. Read the file completely with the Read tool.
94
+ 2. Extract:
95
+ - `export default class …` / `export class …` / `export declare class …`
96
+ - `export interface …` / `export type …`
97
+ - `export enum …` / `export const enum …`
98
+ - `export function …`
99
+ - `export { … }` re-exports
100
+ - Top-level `declare module 'react-native-insider' { … }` blocks (for `index.d.ts`)
101
+ 3. For each class, extract:
102
+ - Public methods (not prefixed with `#` or `private`): name, parameters (name + TS type + optional marker), return type
103
+ - Public properties / getters: name, type, read-only marker
104
+ - Static vs instance distinction (`static` keyword)
105
+ - JSDoc `/** … */` preceding each member (description, `@param`, `@returns`, `@deprecated`, `@example`)
106
+ 4. For each interface / type: name, fields (name, type, `?:` optional marker), description from JSDoc
107
+ 5. For each enum: name, values, underlying type (numeric / string)
108
+
109
+ **Private field / method exclusion (MANDATORY):**
110
+ - ES private fields (`#field`) in `.js` are never public. Even if their getter is exposed, document the getter, not the private slot.
111
+ - TypeScript `private` / `protected` modifiers → not documented.
112
+ - Anything in `.js` that has no counterpart in `.d.ts` → not documented.
113
+
114
+ **Deprecated detection:** Scan `.d.ts` and `.js` for:
115
+ - JSDoc `/** @deprecated … */` tags
116
+ - `@deprecated` TypeScript annotation
117
+ - `console.warn('… is deprecated …')` at the top of a method body
118
+
119
+ If deprecations are found, record the deprecation message and any replacement API mentioned — they populate the "Deprecated APIs" section. If none are found, **omit the Deprecated APIs section entirely.**
120
+
121
+ **Fluent builder detection:**
122
+ - A class whose setters all return `this` (check `.js` bodies or `: this` in `.d.ts`) is a fluent builder.
123
+ - In examples, show chained usage: `Insider.createNewProduct(...).setColor('red').setSize('M').setBrand('Nike');`
124
+ - Applies to `RNInsiderUser`, `RNInsiderProduct`, `RNInsiderEvent`, `RNInsiderIdentifier`.
125
+
126
+ **Static facade detection:**
127
+ - A class whose every exported member is `static` is a static facade (e.g., `RNInsider`).
128
+ - Emit an auto Note: `The {ClassName} class cannot be instantiated directly. Call its static methods on the default export: \`import Insider from 'react-native-insider'\`.`
129
+
130
+ **Frozen singleton detection:**
131
+ - A module exporting `Object.freeze(new SomeClass())` (e.g., `InsiderAppCards`) is a singleton accessed via a getter on the facade (`Insider.appCards`).
132
+ - Emit an auto Note: `The {ClassName} instance cannot be constructed directly. Access it through the main Insider SDK: \`Insider.appCards\`.`
133
+ - The "Access" subsection shows the getter usage.
134
+
135
+ **Zero public API check:** If the `.d.ts` yields no public members, display:
136
+ ```
137
+ No public API found for module at {resolved-path}.
138
+ The .d.ts file does not export any class, interface, type, enum, or function.
139
+ Aborting documentation generation.
140
+ ```
141
+ Then HALT.
142
+
143
+ ### Step 4: Analyze Public API and Build Validation Registry
144
+
145
+ Build a **validation registry** that lists every name the generated docs are allowed to reference:
146
+
147
+ - All type names (classes, interfaces, type aliases, enums)
148
+ - All method names and their full signatures
149
+ - All property / field / enum-value names
150
+ - All imported names from the package entry (`react-native-insider`)
151
+
152
+ This registry is used in Step 10 to validate code examples. Any identifier used in a generated example that is **not** in the registry MUST be corrected before writing files.
153
+
154
+ Also note characteristics that affect example generation:
155
+ - Promise + callback duality (e.g., `getCampaigns`) → both variants shown.
156
+ - Polymorphic second argument (e.g., `itemRemovedFromCart(productID, saleIDOrCustomParameters?, customParameters?)`) → show both shapes (string saleID, and plain object custom params).
157
+ - Date parameters → use `new Date()` in examples; never mention epoch-millis conversion (that is bridge-internal).
158
+ - Callback signature `(error: Error | null, value: X) => void` → used directly in callback examples.
159
+
160
+ ### Step 5: Discover Related Types
161
+
162
+ Public methods often return or accept types defined in sibling `.d.ts` files. For each referenced type name that is **not** a TS built-in (string, number, boolean, Date, Array, Promise, Error) and **not** already processed:
163
+
164
+ 1. Search `src/**/*.d.ts` with the Glob tool to locate the declaration.
165
+ 2. Read that `.d.ts` and extract its public shape (same rules as Step 3).
166
+ 3. These related types MUST appear under **Core Types** in the output.
167
+ 4. Follow the chain recursively until all reachable public types are documented.
168
+
169
+ Example: `InsiderAppCards.getCampaigns()` returns `Promise<InsiderAppCardsCampaignResponse>` which exposes `appCards: InsiderAppCard[]`. `InsiderAppCard` has `buttons: InsiderAppCardButton[]` and `action: InsiderAppCardAction` (polymorphic: `InsiderAppCardDeeplinkAction | InsiderAppCardFeedbackAction | InsiderAppCardOpenSettingsAction`). All of these belong under Core Types.
170
+
171
+ **Do not document** types that are internal (no `.d.ts` export) or that come from `react-native` / standard library (`NativeEventEmitter`, `EmitterSubscription`, etc.).
172
+
173
+ ### Step 6: Trace Entry Points in `index.js` / `index.d.ts`
174
+
175
+ The React Native equivalent of iOS `Insider.h` cross-reference is the top-level facade at the repo root. Read `index.js` AND `index.d.ts` and look for how the target module is reached from the `Insider` default export:
176
+
177
+ - Static getter: `static get appCards(): RNInsiderAppCards` → entry is `Insider.appCards`
178
+ - Static factory: `static createNewProduct(...): RNInsiderProduct` → entry is `Insider.createNewProduct(id, name, taxonomy, imageURL, price, currency)`
179
+ - Static factory: `static tagEvent(name: string): RNInsiderEvent` → entry is `Insider.tagEvent('event_name')`
180
+ - Static accessor: `static getCurrentUser(): RNInsiderUser` → entry is `Insider.getCurrentUser()`
181
+ - Direct constructor export: `export class InsiderIdentifier` → entry is `new InsiderIdentifier().addEmail(...)`
182
+ - Re-exported class / error: `export { InsiderAppCardsError }` → mentioned in error-handling section
183
+
184
+ Use the most specific entry point for the target module. The "Getting Started → Access" subsection shows a minimal JavaScript + TypeScript example that obtains the instance or factory result.
185
+
186
+ ### Step 7: Read SDK Version
187
+
188
+ 1. Read `package.json` at the repo root.
189
+ 2. Extract the `version` field (e.g., `8.0.0`).
190
+ 3. Record today's date in `YYYY-MM-DD` format.
191
+
192
+ **Version display rule:** In the document header, show only the semver (`SDK Version: 8.0.0 | Generated: YYYY-MM-DD`) — do **not** prefix with `RN-`. The `RN-` prefix is a bridge-internal SDK-identification string; it must never appear in developer-facing docs. This keeps the version badge visually identical to the iOS and Android docs.
193
+
194
+ Also read from `package.json`:
195
+ - `peerDependencies.react-native` (minimum React Native version, e.g., `>=0.83.0`)
196
+ - `peerDependencies.react` (minimum React version, e.g., `>=19.2.0`)
197
+
198
+ These populate the Prerequisites section.
199
+
200
+ ### Step 8: Generate Markdown Documentation
201
+
202
+ **Skip this step if `--format html` was specified.**
203
+
204
+ Generate a `.md` file that structurally mirrors the iOS and Android academy docs.
205
+
206
+ **Template:**
207
+
208
+ ```
209
+ # {Module Name}
210
+
211
+ > SDK Version: {version} | Generated: {YYYY-MM-DD}
212
+
213
+ {2-3 sentence module description — purpose, capabilities, ergonomics (Promise+callback duality if applicable)}
214
+
215
+ > **Note:** {static facade / frozen singleton access note — only emit if the detection rule in Step 3 fired}
216
+
217
+ ## Contents
218
+
219
+ - [Getting Started](#getting-started)
220
+ - [Prerequisites](#prerequisites)
221
+ - [Access](#access)
222
+ - [API Reference](#api-reference)
223
+ - [Core Types](#core-types)
224
+ - [{Method Group 1}](#...)
225
+ - [{Method Group 2}](#...)
226
+ - [Deprecated APIs](#deprecated-apis) <!-- only if deprecations were found in Step 3 -->
227
+ - [Full Example](#full-example)
228
+
229
+ ## Getting Started
230
+
231
+ ### Prerequisites
232
+
233
+ - React Native >= {version from peerDependencies, fallback 0.83.0}
234
+ - React >= {version from peerDependencies, fallback 19.2.0}
235
+ - `react-native-insider` installed: `npm install react-native-insider`
236
+ - iOS: `cd ios && pod install`
237
+ - Android: no additional native setup required (autolinking)
238
+
239
+ ### Access
240
+
241
+ {Entry point from Step 6, rendered in both JavaScript and TypeScript code blocks}
242
+
243
+ **JavaScript:**
244
+
245
+ ```js
246
+ import Insider from 'react-native-insider';
247
+
248
+ const appCards = Insider.appCards;
249
+ ```
250
+
251
+ **TypeScript:**
252
+
253
+ ```ts
254
+ import Insider from 'react-native-insider';
255
+
256
+ const appCards = Insider.appCards;
257
+ ```
258
+
259
+ ## API Reference
260
+
261
+ ### Core Types
262
+
263
+ #### {TypeName}
264
+
265
+ {Short description of the type from JSDoc, or synthesized from the module context}
266
+
267
+ | Name | Type | Required | Description |
268
+ | ---- | ---- | -------- | ----------- |
269
+ | {field} | `{TSType}` | ✅ | {description} |
270
+ | {field} | `{TSType}` | ⛔ | {description} |
271
+
272
+ (Repeat for every Core Type discovered in Steps 3 + 5. Use the original type names verbatim — `InsiderAppCard`, not `AppCard`.)
273
+
274
+ ### {Method Group}
275
+
276
+ #### {methodName}
277
+
278
+ **JavaScript:**
279
+
280
+ ```js
281
+ {method signature in JS form — e.g., Insider.appCards.getCampaigns(completion)}
282
+ ```
283
+
284
+ **TypeScript:**
285
+
286
+ ```ts
287
+ {method signature in TS form — e.g., Insider.appCards.getCampaigns(): Promise<InsiderAppCardsCampaignResponse>}
288
+ ```
289
+
290
+ {1-3 sentence description from JSDoc or synthesized}
291
+
292
+ | Name | Type | Required | Description |
293
+ | ---- | ---- | -------- | ----------- |
294
+ | {param} | `{TSType}` | ✅ | {description} |
295
+
296
+ **Example:**
297
+
298
+ **JavaScript:**
299
+
300
+ ```js
301
+ import Insider from 'react-native-insider';
302
+
303
+ Insider.appCards.getCampaigns((error, response) => {
304
+ if (error) return;
305
+ const cards = response.appCards;
306
+ });
307
+ ```
308
+
309
+ **TypeScript:**
310
+
311
+ ```ts
312
+ import Insider, { InsiderAppCardsError } from 'react-native-insider';
313
+
314
+ try {
315
+ const response = await Insider.appCards.getCampaigns();
316
+ const cards = response.appCards;
317
+ } catch (error) {
318
+ if (error instanceof InsiderAppCardsError) {
319
+ console.warn(error.code, error.message);
320
+ }
321
+ }
322
+ ```
323
+
324
+ ## Deprecated APIs
325
+
326
+ > The following APIs are deprecated and will be removed in a future release.
327
+
328
+ ### {deprecatedMethodName}
329
+
330
+ **Deprecated since:** {version or annotation info}
331
+ **Replacement:** {replacement API if mentioned}
332
+
333
+ {Migration guidance with before/after code in JavaScript and TypeScript}
334
+
335
+ ## Full Example
336
+
337
+ {A complete, runnable example that uses the module end-to-end — from `Insider.init(...)` through the most important call chains. Both JavaScript and TypeScript variants.}
338
+ ```
339
+
340
+ **Rules:**
341
+
342
+ - **Table of Contents**: anchor-linked entries for every major section and method group.
343
+ - **Version metadata**: SDK version and today's date as the blockquote immediately under the H1.
344
+ - **Separate signatures**: show JavaScript and TypeScript in **separate labeled code blocks** (`**JavaScript:**` / `**TypeScript:**`) — NOT a combined "Signature" block.
345
+ - **Required vs optional**: `✅` for required parameters/fields, `⛔` for optional (emoji glyphs, not text).
346
+ - **Type columns**: use the exact TypeScript type from the `.d.ts`. Render backticks around types: `` `string` ``, `` `InsiderAppCard[]` ``, `` `(error: Error | null, value: X) => void` ``.
347
+ - **`CustomParameters`** type: if a method accepts it, show the expanded form once — `{ [key: string]: string | number | boolean | Date | number[] | string[] }` — and add a sentence like "Typed key-value bag; each value's type is auto-detected and preserved across the native bridge."
348
+ - **Promise + callback duality**: for methods that accept a completion callback AND return a Promise (App Cards), show BOTH variants in the Example block: the callback form in JavaScript, the `await` form in TypeScript (or both forms in TypeScript if space permits).
349
+ - **Polymorphic arguments**: methods like `itemRemovedFromCart(productID, saleIDOrCustomParameters?, customParameters?)` and `visitCartPage(products, saleIDOrCustomParameters?, customParameters?)` MUST show both shapes in separate examples (string saleID AND plain object custom params). Do not rename or collapse the parameter — keep `saleIDOrCustomParameters` verbatim from `.d.ts`.
350
+ - **Fluent builders**: show chained usage in the builder's example (`createNewProduct(...).setColor(...).setSize(...).setBrand(...)`).
351
+ - **Method grouping**: organize methods under logical group headings — App Cards example: `Campaigns Management` (`getCampaigns`, `markAsRead`, `markAsUnread`, `delete`), `App Card Interaction` (`view`, `click`), `Button Interaction` (`clickButton`), `Error Handling` (`InsiderAppCardsError`, `InsiderAppCardsErrorCode`). For other modules, use the groupings already documented in `.orbit-output/config/architecture/API_DOCS.md` and `CODE-CATALOG.md`.
352
+ - **Group parallelism with iOS/Android**: when a module exists on all three platforms, the group names and method order MUST match the iOS and Android docs so readers switching tabs see the same layout.
353
+ - **Inline tips**: add `> **Tip:**` boxes where useful (observer lifecycle, convenience methods, Promise vs callback choice, etc.).
354
+ - **Bridge details are hidden**: never mention `shouldNotProceed`, `checkParameters`, `parseObjectWithTypes`, `NativeModules.RNInsider`, 3-part product serialization, or epoch-millis-as-string conversion. Developers use the JS API; bridge plumbing is internal.
355
+ - **Strict example validation**: every identifier (class, method, property, enum value) used in code examples MUST exist in the validation registry from Step 4.
356
+
357
+ ### Step 9: Generate HTML Documentation
358
+
359
+ **Skip this step if `--format md` was specified.**
360
+
361
+ Generate an `.html` file styled for the Insider Academy docs site. The HTML template is **intentionally identical** to the iOS and Android academy-doc-generator skill output, with only the React Native specific substitutions below.
362
+
363
+ **Syntax Highlighting — Pre-tokenized Spans (MANDATORY):**
364
+
365
+ Do NOT use JavaScript-based syntax highlighting (no Prism.js, no highlight.js, no runtime tokenizer). Write code blocks with **inline `<span>` elements** carrying CSS classes directly in the HTML source:
366
+
367
+ ```html
368
+ <pre><code><span class="kw">const</span> <span class="param">appCards</span> = <span class="type">Insider</span>.<span class="fn">appCards</span></code></pre>
369
+ ```
370
+
371
+ **CSS Classes (VS Code dark theme):**
372
+
373
+ | Class | Color | Usage |
374
+ |-------|-------|-------|
375
+ | `.kw` | `#569cd6` (blue) | Language keywords: `const`, `let`, `var`, `function`, `class`, `if`, `else`, `for`, `in`, `return`, `await`, `async`, `import`, `from`, `export`, `default`, `new`, `try`, `catch`, `this`, `null`, `undefined`, `void`, `interface`, `type`, `enum`, `extends`, `implements`, `readonly` |
376
+ | `.type` | `#4ec9b0` (teal) | Type names: `Insider`, `RNInsider`, `InsiderAppCards`, `InsiderAppCard`, `InsiderUser`, `String`, `Number`, `Boolean`, `Date`, `Promise`, `Error`, `Array`, `Record`, module-imported class names |
377
+ | `.str` | `#ce9178` (orange) | String literals: `'react-native-insider'`, `"my-partner"`, template strings |
378
+ | `.num` | `#b5cea8` (light green) | Numeric literals |
379
+ | `.cmt` | `#6a9955` (green) | Comments: `// comment`, `/* comment */` |
380
+ | `.ann` | `#dcdcaa` (yellow) | Decorators / annotations where applicable (`@deprecated`, JSDoc `@param`) — rare in JS/TS code, used if shown |
381
+ | `.fn` | `#dcdcaa` (yellow) | Function / method names at call sites and declarations: `getCampaigns`, `markAsRead`, `init`, `tagEvent` |
382
+ | `.param` | `#9cdcfe` (light blue) | Parameters and local variables: `appCards`, `error`, `response`, `completion`, `product` |
383
+
384
+ **Tokenizing rules:**
385
+ - Every identifier in `<pre><code>` blocks MUST wear one of the classes above.
386
+ - Keywords and types outrank param when ambiguous.
387
+ - Method names after `.` or in call position use `.fn`; variable / parameter reads use `.param`.
388
+ - HTML entities (`&lt;`, `&gt;`, `&amp;`) must be used for `<`, `>`, `&` inside `<code>` blocks.
389
+
390
+ **HTML Layout Structure:**
391
+
392
+ ```html
393
+ <!DOCTYPE html>
394
+ <html lang="en">
395
+ <head>
396
+ <meta charset="utf-8" />
397
+ <title>{Module Name} - Insider React Native SDK</title>
398
+ <style>{inline CSS — no external stylesheets}</style>
399
+ </head>
400
+ <body>
401
+ <aside class="sidebar-toc"><!-- sticky sidebar TOC, hidden below 1200px --></aside>
402
+ <div class="content">
403
+ <nav class="breadcrumb">Docs &gt; React Native SDK &gt; {Module Name}</nav>
404
+ <div class="version-meta">SDK Version: {version} | Generated: {YYYY-MM-DD}</div>
405
+ <h1>{Module Name}</h1>
406
+ <div class="toc"><!-- inline boxed TOC --></div>
407
+ <!-- Content sections: Getting Started, API Reference, Deprecated APIs (if any), Full Example -->
408
+ </div>
409
+ <script>{inline JS — tab sync + copy button + scroll-spy, no external libs}</script>
410
+ </body>
411
+ </html>
412
+ ```
413
+
414
+ **Code block group (language switcher):**
415
+
416
+ ```html
417
+ <div class="code-group">
418
+ <div class="lang-tabs">
419
+ <div class="lang-tab active" data-lang="javascript">JavaScript</div>
420
+ <div class="lang-tab" data-lang="typescript">TypeScript</div>
421
+ </div>
422
+ <div class="lang-content active" data-lang="javascript">
423
+ <div class="code-wrapper">
424
+ <pre><code><!-- pre-tokenized JS code with span classes --></code></pre>
425
+ </div>
426
+ </div>
427
+ <div class="lang-content" data-lang="typescript">
428
+ <div class="code-wrapper">
429
+ <pre><code><!-- pre-tokenized TS code with span classes --></code></pre>
430
+ </div>
431
+ </div>
432
+ </div>
433
+ ```
434
+
435
+ Tab labels are **"JavaScript"** and **"TypeScript"** (NOT "JS" / "TS", and NOT the iOS / Android pair). `data-lang` values are `javascript` and `typescript`.
436
+
437
+ **Callout boxes:** `<div class="note">`, `<div class="tip">`, `<div class="warning">` — same class names as iOS and Android outputs. No `.callout` prefix.
438
+
439
+ **HTML Feature Requirements:**
440
+
441
+ 1. **Pre-tokenized syntax highlighting** (above). No JavaScript tokenizer, no external CDN.
442
+ 2. **Copy to clipboard**: a "Copy" button injected by inline JS onto each `.code-wrapper`. Uses `navigator.clipboard.writeText(code.textContent)`.
443
+ 3. **Sticky sidebar TOC**: screens ≥ 1200px render a fixed sidebar on the left with the table of contents.
444
+ - `position: sticky; top: 0; height: 100vh`
445
+ - Highlight the current section using `IntersectionObserver` with `rootMargin: '-20% 0px -70% 0px'`
446
+ - Hide on narrower screens via media query
447
+ 4. **Inline TOC**: keep the boxed TOC at the top of the content area; visible on all screen sizes.
448
+ 5. **Tab switcher**: clicking a `.lang-tab` in any `.code-group` synchronizes ALL `.code-group` blocks on the page to the same `data-lang`.
449
+ 6. **Version metadata**: SDK version + generation date as a subtle bar immediately below the breadcrumb.
450
+ 7. **Deprecated APIs**: if present, render with an amber/yellow warning callout style and include migration guidance.
451
+ 8. **Self-contained**: all CSS and JS inline. No external stylesheets, fonts (beyond system-ui fallbacks), or scripts.
452
+ 9. **Light theme only** for page chrome; dark theme only inside code blocks (VS Code dark palette above).
453
+
454
+ **Per-platform substitutions (vs. iOS and Android skills):**
455
+
456
+ | Element | Value |
457
+ |---------|-------|
458
+ | Page `<title>` | `{Module Name} - Insider React Native SDK` |
459
+ | Breadcrumb | `Docs > React Native SDK > {Module Name}` |
460
+ | Language tab labels | `JavaScript`, `TypeScript` |
461
+ | `data-lang` values | `javascript`, `typescript` |
462
+ | Version badge source | `package.json` → `version` field (no `RN-` prefix) |
463
+
464
+ Every other aspect of the HTML (CSS classes, layout, interactivity, callout styling, table styling, emoji choices) MUST match the iOS and Android outputs exactly.
465
+
466
+ ### Step 10: Validate Generated Code Examples
467
+
468
+ Before writing any output file, perform a strict validation pass:
469
+
470
+ 1. Extract every identifier (class name, method name, property / field name, enum value, imported name) from all code examples in both the Markdown and HTML outputs.
471
+ 2. Cross-reference each against the validation registry built in Step 4.
472
+ 3. Names from the registry are valid. Names from standard JS/TS (`console`, `Error`, `Promise`, `await`, `new`, `import`, `export`, `const`, `let`, `var`, `function`, `async`, `try`, `catch`, `if`, `else`, `return`) are valid. Names from `react-native-insider` public exports (from `index.d.ts`) are valid.
473
+ 4. Any identifier not covered by the above is a validation failure:
474
+ - Log a warning: `Warning: Example references non-existent API: {name}`
475
+ - Fix the example to use a correct registry name
476
+ - Re-run validation until clean
477
+ 5. Proceed to Step 11 only after validation is clean (or report failures and abort if something cannot be fixed automatically).
478
+
479
+ ### Step 11: Write Output Files
480
+
481
+ **If `--dry-run` was specified:** skip this step entirely. Display the summary (Step 12) and exit.
482
+
483
+ Determine the output directory:
484
+ - If `--output <dir>` was provided, use that directory.
485
+ - Otherwise, use `docs/{module-name}/` (where `{module-name}` is the kebab-cased name from Step 2).
486
+
487
+ Only write the file(s) matching the selected format:
488
+ - If `--format md`: write only `{output-dir}/{module-name}.md`
489
+ - If `--format html`: write only `{output-dir}/{module-name}.html`
490
+ - If no `--format` flag: write both files
491
+
492
+ Create the output directory if it does not exist. Use the Write tool.
493
+
494
+ ### Step 12: Summary
495
+
496
+ Display a summary containing:
497
+
498
+ - Module resolved: `{moduleName}` at `{jsPath}` (+ `.d.ts`)
499
+ - Public classes / interfaces / enums documented (counts)
500
+ - Public methods documented (count)
501
+ - Core types discovered across sibling `.d.ts` files (count)
502
+ - Deprecated APIs found (count — 0 if none)
503
+ - Entry point(s) used for Access section
504
+ - Example validation: `PASSED` or `N fixes applied`
505
+ - Output format(s) generated: `md`, `html`, `both`, or `DRY RUN (no files written)`
506
+ - SDK version and generation date
507
+ - Output file paths (or `N/A` if dry run)
508
+ - Reminder: run the iOS (`mobile-ios`) and Android (`mobileandroid`) `/academy-doc-generator` for the same module to keep the three platform docs in sync.
509
+
510
+ </agent-activation>
511
+
512
+ ## Project Context
513
+
514
+ - **SDK**: Insider React Native SDK (JavaScript + TypeScript declarations, native bridge to iOS / Android)
515
+ - **Academy URL**: `https://academy.insiderone.com/docs/react-native-advanced-integration`
516
+ - **Public API Detection**: `.d.ts` files are the source of truth. Anything exported from a `.d.ts` is public; anything in `.js` without a `.d.ts` counterpart is internal.
517
+ - **Version Source**: `package.json` → `version` (displayed as plain semver; the bridge-internal `RN-` prefix is never shown in docs)
518
+ - **Cross-Platform Consistency**: iOS (`mobile-ios`) and Android (`mobileandroid`) repositories have a same-named skill. Section order, emoji set, version-badge style, HTML template, callout boxes are identical across all three so the Academy pages line up.
519
+ - **Bridge Layer**: JS → `NativeModules.RNInsider` → native Insider SDK. Bridge implementation details (`shouldNotProceed`, `checkParameters`, `parseObjectWithTypes`, 3-part product serialization, epoch-millis-string dates) are hidden from the generated docs.
520
+
521
+ ## Key Paths
522
+
523
+ - **JS source root**: `src/` (plus `index.js` at repo root for the top-level facade)
524
+ - **TypeScript declarations**: sibling `.d.ts` next to every public `.js`
525
+ - **Top-level facade**: `index.js` + `index.d.ts` — `RNInsider` default export plus re-exports (`InsiderAppCardsError`, `InsiderAppCardsErrorCode`, enums)
526
+ - **Version file**: `package.json`
527
+ - **Architecture docs**: `.orbit-output/config/architecture/ARCHITECTURE.md`, `CODE-CATALOG.md`, `API_DOCS.md`, `project.yaml` — use for method grouping and cross-reference when generating sections
528
+ - **Code style rules**: `.claude/rules/code-style.md` — naming, fluent API, parameter validation conventions
529
+ - **Output (default)**: `docs/{module-name}/` at repo root
530
+ - **iOS reference skill**: `~/Documents/development/insider/mobile-ios/.orbit-output/skills/custom/academy-doc-generator.md`
531
+ - **Android reference skill**: `~/Documents/development/insider/mobileandroid/.orbit-output/skills/custom/academy-doc-generator.md`
532
+ - **Reference PDF outputs**: `~/Downloads/App-Cards-iOS.pdf`, `~/Downloads/App-Cards-Android.pdf`
533
+
534
+ ## Examples
535
+
536
+ ### Example 1: Generate both formats (default)
537
+
538
+ ```bash
539
+ /academy-doc-generator InsiderAppCards
540
+ ```
541
+
542
+ Outputs:
543
+ - `docs/app-cards/app-cards.md`
544
+ - `docs/app-cards/app-cards.html`
545
+
546
+ ### Example 2: Generate only Markdown
547
+
548
+ ```bash
549
+ /academy-doc-generator src/InsiderUser.js --format md
550
+ ```
551
+
552
+ Outputs:
553
+ - `docs/user/user.md`
554
+
555
+ ### Example 3: Generate only HTML with custom output directory
556
+
557
+ ```bash
558
+ /academy-doc-generator InsiderProduct --format html --output ~/Desktop/rn-docs
559
+ ```
560
+
561
+ Outputs:
562
+ - `~/Desktop/rn-docs/product.html`
563
+
564
+ ### Example 4: Dry run to preview discovery
565
+
566
+ ```bash
567
+ /academy-doc-generator InsiderEvent --dry-run
568
+ ```
569
+
570
+ Outputs:
571
+ - No files written. Summary displays resolved module, public API surface, related types, entry point, and example-validation status.
572
+
573
+ ### Example 5: Event builder (fluent builder example)
574
+
575
+ ```bash
576
+ /academy-doc-generator InsiderEvent
577
+ ```
578
+
579
+ Outputs:
580
+ - `docs/event/event.md`
581
+ - `docs/event/event.html`
582
+
583
+ Showcases chained `tagEvent('name').addParameterWithString(...).addParameterWithInt(...).build()` usage in examples (detected via the fluent-builder rule in Step 3).
584
+
585
+ ### Example 6: Identifier (constructor-based entry point)
586
+
587
+ ```bash
588
+ /academy-doc-generator InsiderIdentifier
589
+ ```
590
+
591
+ Outputs:
592
+ - `docs/identifier/identifier.md`
593
+ - `docs/identifier/identifier.html`
594
+
595
+ Access section shows `new InsiderIdentifier().addEmail(...)` (detected via Step 6 entry-point tracing).
596
+
597
+ ---
598
+ *Generated by: skill-creator-agent | Based on: .orbit-output/config/architecture/ | Aligned with: mobile-ios and mobileandroid academy-doc-generator skills*
package/LICENSE CHANGED
@@ -1,7 +1,9 @@
1
- Copyright 2016 Insider
1
+ MIT License
2
+
3
+ Copyright (c) 2016 Insider
2
4
 
3
5
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
6
 
5
7
  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
8
 
7
- THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
9
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md CHANGED
@@ -1,9 +1,10 @@
1
- # React Native Insider SDK
1
+ # Insider ReactNative SDK
2
2
 
3
- Official React Native SDK for [Insider](https://useinsider.com/) - A single platform for building individualized, cross-channel customer experiences.
3
+ Official React Native SDK for [Insider](https://www.insiderone.com) - A single platform for building individualized, cross-channel customer experiences.
4
4
 
5
+ [![Coverus](https://github.com/useinsider/coverus-artifacts/raw/main/badges/github/useinsider/react-native-insider/coverage.svg)](http://coverus.internal.dataforce/app/project/github/useinsider/react-native-insider)
5
6
  [![npm version](https://img.shields.io/npm/v/react-native-insider.svg)](https://www.npmjs.com/package/react-native-insider)
6
- [![License](https://img.shields.io/badge/license-Commercial-blue.svg)](https://useinsider.com)
7
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
7
8
 
8
9
  ## Features
9
10
 
@@ -699,7 +700,7 @@ function App() {
699
700
 
700
701
  ## Support
701
702
 
702
- - **Documentation**: [Insider Developer Hub](https://academy.useinsider.com/docs)
703
+ - **Documentation**: [Insider Developer Hub](https://academy.insiderone.com/docs/react-native-integration)
703
704
  - **GitHub**: [useinsider/react-native-insider](https://github.com/useinsider/react-native-insider)
704
705
  - **Issues**: [Report issues](https://github.com/useinsider/react-native-insider/issues)
705
706
  - **Email**: Contact your Insider representative
@@ -707,4 +708,3 @@ function App() {
707
708
  ## License
708
709
 
709
710
  This SDK is provided by Insider. Please refer to your commercial agreement with Insider for licensing terms.
710
- # Test
package/RNInsider.podspec CHANGED
@@ -9,12 +9,12 @@ Pod::Spec.new do |s|
9
9
  s.authors = package_json['author']
10
10
  s.license = 'MIT'
11
11
  s.platform = :ios, '12.0'
12
- s.source = {:http => 'https://mobilesdk.useinsider.com/iOS/15.0.1/InsiderMobileIOSFramework.zip'}
12
+ s.source = {:http => 'https://mobilesdk.useinsider.com/iOS/15.0.3/InsiderMobileIOSFramework.zip'}
13
13
  s.source_files = 'ios/RNInsider/*.{h,m}'
14
14
  s.requires_arc = true
15
15
  s.static_framework = true
16
16
  s.dependency 'React'
17
- s.dependency 'InsiderMobile', '15.0.1'
17
+ s.dependency 'InsiderMobile', '15.0.3'
18
18
  s.dependency 'InsiderGeofence', '1.2.4'
19
19
  s.dependency 'InsiderHybrid', '1.7.6'
20
20
 
@@ -47,7 +47,7 @@ repositories {
47
47
 
48
48
  dependencies {
49
49
  implementation "com.facebook.react:react-native:${getVersionFromPartner('reactNativeVersion', '+')}"
50
- implementation 'com.useinsider:insider:16.0.1'
50
+ implementation 'com.useinsider:insider:16.0.3'
51
51
  implementation 'com.useinsider:insiderhybrid:1.3.4'
52
52
 
53
53
  implementation 'androidx.security:security-crypto:1.1.0-alpha06'