RCKit is a simple tool kit to add basic RevenueCat support to your Vapor server.
It currently only supports the V1 API for getting or creating a subscriber and webhooks.
PRs welcome :)
import RCKit
public func configure(_ app: Application) throws {
app.revenueCat.configuration = .init(token: "<Your RevenueCat Token>")
}
struct YourEntitlements: Content {
let pro: RCEntitlement?
}
let subscriber: RCSubscriber<YourEntitlements> = try await req.application.revenueCat.getSubscriber("<userID>")
...
func post(_ req: Request) async throws -> HTTPStatus {
let eventBody: RCEventBody = try req.content.decode(RCEventBody.self)
...
}