A helper library for integrating server-side apps with the RevenueCat webhook service.
go get "github.com/iktakahiro/revcatgo@v1.1.0"
func bind(w http.ResponseWriter, r *http.Request) error {
var webhookEvent revcatgo.WebhookEvent
err := json.NewDecoder(r.Body).Decode(&webhookEvent)
if err != nil {
return err
}
fmt.Println(webhookEvent.Type) // e.g. "INITIAL_PURCHASE"
return nil
}
Refer to the official documentation: