0

Revenue Cat docs clearly mentions that you can specify the operating system in the Get request, by specifying OS in the headers by using X-Platform property, so you can get OS specific management_url

curl --request GET \
     --url https://api.revenuecat.com/v1/subscribers/app_user_id \
     --header 'X-Platform: ios' \
     --header 'accept: application/json'

Refrence : https://www.revenuecat.com/reference/subscribers#the-subscriber-object

But when I use X-Platform in my call , it throws following error

{
  code: 7243,
  message: 'Secret API keys should not be used in your app.'
}

My API Call In NestJs

 const data = await lastValueFrom<SubscriberInfo>(
      this.httpService
        .get(`${revenueCatBaseURl}${userId}`, {
          headers: {
            'Content-Type': 'application/json',
            'X-Platform': 'ios',
            accept: 'application/json',
            Authorization: 'Bearer token,
          },
        })
        .pipe(
          map((res) => {
            return res.data;
          }),
          catchError((error: AxiosError) => {
            console.log(error.response.data);
            throw 'An error happened!';
          }),
        ),
    );

The call works fine without X-Platform

M Nouman
  • 437
  • 1
  • 5
  • 22

0 Answers0