twendy1T
Convex Community8mo ago
6 replies
twendy1

Help with RevenueCat webhook

Hello, I was trying to setup Convex with RevenueCat webhook. Mostly the logic works fine but it breaks after I fetched subscriber information from RevenueCat and tried to parse json from response. It seems like RevenueCat includes field with key $attConsentStatus and Convex doesnt like it because we are getting validator error:
Uncaught Error: Field name $attConsentStatus starts with a '$', which is reserved.
    at validateObjectField (../../node_modules/convex/src/values/value.ts:162:2)
    at convexToJsonInternal (../../node_modules/convex/src/values/value.ts:349:6)
    at convexToJsonInternal (../../node_modules/convex/src/values/value.ts:350:15)
    at convexToJsonInternal (../../node_modules/convex/src/values/value.ts:350:15)
    at convexToJson (../../node_modules/convex/src/values/value.ts:417:0)
    at syscallArgs (../../node_modules/convex/src/server/impl/actions_impl.ts:16:4)
    at runMutation [as runMutation] (../../node_modules/convex/src/server/impl/actions_impl.ts:40:6)
    at handler (../convex/revenuecatActions.ts:87:16)


Here is the code which Im using for fetching data (which is in Try/Catch), written inside internalAction:
const response = await fetch(url, {
                method: 'GET',
                headers: {
                    Authorization: `Bearer ${apiKey}`,
                    Accept: 'application/json',
                    'Content-Type': 'application/json',
                },
            });

const customerInfo = (await response.json()) as RevenueCatCustomerInfoResponse;
Was this page helpful?