Skip to content

Support React Native, Expo, and Flutter apps - #56

Draft
nrodd wants to merge 1 commit into
static-snippet-installfrom
mobile-app-support
Draft

nrodd wants to merge 1 commit into
static-snippet-installfrom
mobile-app-support

Conversation

@nrodd

@nrodd nrodd commented Oct 26, 2026

Copy link
Copy Markdown
Member

Stacked on #54 (static snippet install). Review that first; this PR's diff is only the mobile changes.

What

Mobile projects are now detected and get Fullstory's native mobile SDK installed by the coding agent, instead of the web snippet.

  • Detection (src/platform.ts): Flutter from pubspec.yaml (only when it depends on the Flutter SDK), Expo or bare React Native from package.json. Mobile skips the snippet fetch and the static installer.
  • Org config: the org id from login (format-checked before it goes in the prompt) and, for EU orgs only, the server URL are filled into the Expo plugin org/host, Gradle fullstory { org, serverUrl }, and the plist Fullstory dict (OrgId, ServerUrl).
  • New templates built from the Fullstory RN, Flutter, Android, and iOS getting-started guides:
    • React Native: Expo-managed and bare paths, Babel plugin, Podfile and asset-uploader build phase, a heads-up about the RN 0.74 to 0.78 patch, and an Expo Go caveat.
    • Flutter: runFullstoryApp/FullstoryBinding, the required Android Application subclass, version pairing between the Flutter package and the Android plugin, and notes on obfuscated builds.
    • Extras for both: FullStory.identify/FS.identify, the session URL for analytics linkage, and fsClass vs. FSMask/FSExclude for masking.
  • Reference section: mobile prompts point at Fullstory's mobile docs instead of the web llms.txt.
  • Analytics detection: adds RN packages and Flutter pubspec.yaml packages.
  • Copy: the demo guide and outro say rebuild/ship a build instead of restart the dev server/deploy.
  • Fix: removes the old React Native line in the web template that told agents to call init({ orgId }).

Decisions worth a look

  • enabledVariants 'all' in Gradle so a debug build captures right away (Fullstory's default is release only). The agent tells the user they may want to narrow it later.
  • The agent looks up the latest SDK version rather than us pinning one.
  • The iOS asset-uploader build phase is added by editing project.pbxproj, or the agent hands it to the user if it can't do that safely. This is the step most worth testing on a real app.
  • One org id for all build variants (no per-variant orgs map).

Testing

  • npm run typecheck, npm run build, and npx vitest run pass (114 tests, including the new src/platform.test.ts covering detection, org id validation, US vs. EU prompt rendering, and analytics detection from pubspec).
  • Not yet run end to end against a real RN, Expo, or Flutter app.

Detect mobile projects from package.json or pubspec.yaml and hand the
agent native SDK steps instead of the web snippet: the Babel and Expo
config plugins, Gradle, Info.plist, and the Flutter entry point. The org
id and (for EU orgs) server URL are interpolated into the build config
snippets. The extras pass uses the mobile identify, session URL, and
masking APIs, and analytics detection covers RN and Flutter SDKs.

Also drops the old React Native instruction, which told agents to call
a web-style init().

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant