Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can I use this in a React Native app? #201

Closed
saikarthikp9 opened this issue Oct 25, 2021 · 7 comments
Closed

Can I use this in a React Native app? #201

saikarthikp9 opened this issue Oct 25, 2021 · 7 comments

Comments

@saikarthikp9
Copy link

No description provided.

@aricart
Copy link
Member

aricart commented Oct 25, 2021

Unlikely, it uses native Node.js TCP. And more importantly, if you don't have production code using nats-streaming, you should instead be using jetstream. JetStream is built into the currently supported javascript clients. For WebSockets, see:

https://github.com/nats-io/nats.ws
https://github.com/nats-io/nats.deno/blob/main/jetstream.md

@aricart aricart closed this as completed Oct 25, 2021
@bahmanbs
Copy link

bahmanbs commented Jan 30, 2024

@saikarthikp9 thanks to the Mehrdad, now there is a repository that includes a working example in react native here

@aricart
Copy link
Member

aricart commented Jan 30, 2024

@saikarthikp9 You shouldn't be using stan.js (use jetstream instead)

@bahmanbs
Copy link

@aricart i need to comunicate with nats, not jetstream, i do not need persistence but only pub sub.
whas is you reason for this? guide me please.

@Jarema
Copy link
Member

Jarema commented Jan 31, 2024

stan.js is a client for old nats-streaming persistence solution that was replaced by jetstream.

For both Core NATS (pub/sub request/reply) and JetStream, use
https://github.com/nats-io/nats.ws

The example you linked also uses nats.ws, not stan.js

@bahmanbs
Copy link

bahmanbs commented Jan 31, 2024

@Jarema sure, we are using the same package of "nats.ws" as you said. it does not work on react native. it needs following polyfills to work, so it makes developers confused.

Screenshot from 2024-01-31 09-56-06

@aricart
Copy link
Member

aricart commented Jan 31, 2024

@bahmanbs we don't have a "native" react native transport. However if you follow the last comment on nats-io/nats.ws#195 you should be able to get started with it

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

No branches or pull requests

4 participants