https://github.com/joeriddles/nats.js-demo
Simple demo of nat.js with Synadia Cloud / NGS
https://github.com/joeriddles/nats.js-demo
nats natsio
Last synced: about 2 months ago
JSON representation
Simple demo of nat.js with Synadia Cloud / NGS
- Host: GitHub
- URL: https://github.com/joeriddles/nats.js-demo
- Owner: joeriddles
- Created: 2025-03-20T16:02:45.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-20T16:13:29.000Z (over 1 year ago)
- Last Synced: 2025-10-08T23:19:00.783Z (9 months ago)
- Topics: nats, natsio
- Language: JavaScript
- Homepage:
- Size: 173 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# nats.js demo
Simple demo of [nat.js](https://github.com/nats-io/nats.js/) with [Synadia Cloud / NGS](https://docs.synadia.com/cloud/faq).
Setup:
```shell
npm install
```
To run:
```shell
node main.mjs
```
Alternatively, you can run it with the `NATS_CREDS` environment variable:
```shell
NATS_CREDS='...' node main.mjs
# or even...
NATS_CRESDS="$(cat )" node main.mjs
```
Expected output:
```
connected: connect.ngs.global:4222
>>> hello world
<<< hello world
---
connected: jetstream
created stream: users
created durable consumer: user-consumer
>>> 1 data
<<< 1 {"user_id":1}
```
Synadia Cloud — create stream:

Docs:
- https://nats-io.github.io/nats.js/
- https://github.com/nats-io/nats.js/
- https://docs.synadia.com/cloud/faq