Skip to content

feat: add react native web support#13

Merged
ivnbogdan merged 6 commits into
aptabase:mainfrom
Robert27:feat/react-native-web
Jun 17, 2026
Merged

feat: add react native web support#13
ivnbogdan merged 6 commits into
aptabase:mainfrom
Robert27:feat/react-native-web

Conversation

@Robert27

@Robert27 Robert27 commented Dec 16, 2024

Copy link
Copy Markdown
Contributor

Added support for react native web by adapting the dispatcher behavior from aptabase-js.

  • Created two new dispatcher classes to handle dispatching for each platform.
  • Updated various files to handle the new platform
  • Updated a few dependencies
  • Added and updated the vitest tests.

Resolves #12

@Robert27 Robert27 force-pushed the feat/react-native-web branch from c309c37 to bd56e18 Compare December 16, 2024 17:32
@ivnbogdan

Copy link
Copy Markdown
Contributor

@Robert27 thank you for your contribution.

Can you please highlight in a comment here the differences in implementation between the two and the reasoning for explicit support for React Native Web?

@Robert27

Copy link
Copy Markdown
Contributor Author

React Native Web has become increasingly popular, especially since Expo Web. The Bluesky web app, for example, is written with React Native Web. Specifically, I need this feature for my team, and I read the request in the discord. However, this SDK does not yet support the web platform.

Implementing it turned out to be a bit more complicated, as different philosophies were chosen between native and web.
I analyzed the other SDKs and used a comment from the founder in Discord. So web sends the events immediately, because the browser can be closed at any time, but native on the other hand batched to another endpoint, which also has no CORS restrictions.
Consequently, I had to create two dispatchers, one for web to the single event endpoint without user agent, so that CORS works, and the other one is the unmodified native dispatcher

Comment thread src/env.ts
@beshkin

beshkin commented Jan 23, 2025

Copy link
Copy Markdown

I can absolutely relate on this PR.
@Robert27 great job. I checked the implementation and looks like exactly what we need

Comment thread src/client.ts Outdated
@Robert27 Robert27 requested review from beshkin and ivnbogdan May 24, 2025 14:55
@Robert27

Robert27 commented Jun 3, 2025

Copy link
Copy Markdown
Contributor Author

I have added all the desired changes and the web functionality is now opt-in. I was also able to solve all issues with the tests and also added new ones. In addition I also updated the documentation in the readme accordingly.

My team is already using my fork in production and everything works without any problems.

@Robert27

Copy link
Copy Markdown
Contributor Author

Any updates? Is Aptabase still maintained?

@ivnbogdan

Copy link
Copy Markdown
Contributor

Hey @Robert27

This was off my radar. Sorry about it.
Would you be willing to rebase the branch so we can merge this?

@Robert27

Copy link
Copy Markdown
Contributor Author

Nice to hear! I will fix the merge conflicts later today :)

@Robert27 Robert27 force-pushed the feat/react-native-web branch from 3a0b3bf to 8f9b271 Compare June 16, 2026 17:27
@Robert27

Copy link
Copy Markdown
Contributor Author

here we go :)

Prevent unhandled rejections from fire-and-forget web sends, only run
batch flush polling for the native dispatcher, and document appVersion
for React Native Web in the README.

Co-authored-by: Cursor <cursoragent@cursor.com>
@ivnbogdan ivnbogdan merged commit fa07ed6 into aptabase:main Jun 17, 2026
1 check passed
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.

Add support for react native web

3 participants