Connecting to a web socket as a client
For one app idea I would need a Gadget app to be permanently connected to a Shopify web socket as a client.
I'm not sure if that is even possible with the Gadget stack. Also without incurring copious amounts of CPU time.
Any advice?
6 Replies
i think we could figure out a custom billing solution for this -- we've been looking at the same issue for discord bots
what Shopify websocket do you want to connect to?
wss://argus.shopifycloud.com/graphql?bucket_id=gid://shopify/Shop/$storeId
There will probably not be a default solution to connect to this web socket, as the permissions are very user specific andnot something that is traditionally exposed to apps.
It allows to get notified about all staff member presences in different parts of the store. This is the system Shopify uses to show you, that another staff member opened the same product in the admin dashboard as you.
To my knowledge, with product events still missing from the APIs, this is the only way to estimate which staff member authored a change on a product.
I am checking the infra options at least, to see what is feasable.
@airhorns or would you recommend using a seperate service for this, like Cloudflare workers, and then exchanging data via APIs?im not sure how cloudflare workers bills for websockets specifically but i do know they have some fancy stuff where they only bill you for when your compute is running instead of any time your function is active. if that works out that'd be a great option, but if they bill for the entire time you're listening i dont think that'd solve your problem 😦 i know they support inbound websockets but i dont know about outbound
but yeah, i think thats a good strategy in the short term
can you link me to any shopify docs about the argus thing? just curious if this is a pattern they are going to start using more and more cause if so Gadget will need to support it
Exactly, it will be interesting to see how outbound web sockets work.
I wouldn't worry about the argus stuff from Gadgets perspective. They seem to only use that stuff for internal things. No official APIs that you would typically go consume.
Any updates on this? I am also interested in integrating a websocket client connection with gadget
Hello @atom, I've responded in your help post