Web Push Subscriptions returns 422 #135
-
Hello, I have an issue implementing web push notifications. I have implemented all the steps and the service worker has been properly installed in the app. However, when requesting permission for push notifications, we encounter a 422 error. For the API, there's no mention of the endpoint the button call when you press it. Documentation. Return {"errors":[{"message":"must exist"}]} |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Sorry about the lack of proper documentation. This is one of our newer packages and we are running behind on a better README. From the screenshot I can see that you are using the user auth headers, whereas this endpoint requires a JWT token (it's an oddball). You can get that by fetching Happy to answer any questions. |
Beta Was this translation helpful? Give feedback.
Sorry about the lack of proper documentation. This is one of our newer packages and we are running behind on a better README. From the screenshot I can see that you are using the user auth headers, whereas this endpoint requires a JWT token (it's an oddball). You can get that by fetching
GET /config
with user headers. Once you have it, you can use the token as illustrated on https://github.com/magicbell-io/webpush-test/blob/main/src/components/subscriber.tsx#L23.Happy to answer any questions.