How do people handle custom webhooks subscription in the Remix template?

tititi
Shopify Partner
1 0 0

I'm able to successfully create a Google PubSub subscription in the after_auth block in shopify.server.js.

 

However, the issue is that the subscription is lost if I restart my server for any reason.

 

I would like to be able to register subscriptions when the server starts and not have to refresh a page or re-install the app.

 

 

Is there a way to register code somewhere that runs only once when the server starts or does anyone have any recommendations for dealing with this type of thing?

 

 

Thanks.

Replies 0 (0)