Solved

How can I create two webhook in the same project?

  • 31 October 2022
  • 3 replies
  • 367 views

Badge +4

Hi,

 

Please let me know how I can create two webhooks in the same project.

 

One for Development server.

Second for Production Server.

 

Waiting for reply asap.

 

Thanks

icon

Best answer by kaitlin 31 October 2022, 23:17

View original

3 replies

Badge +1

Hi Vincent!

At this time, we only support one webhook url per app. This is definitely on our backlog to support but I don’t have an ETA at this time.

There are a couple things you could try in the meantime:

  • Create a separate duplicate RevenueCat app for your staging/development app, with a separate webhook URL and different API keys
  • Use a neutral webhook endpoint and use the environment field in webhooks to differentiate between event types, such as SANDBOX or PRODUCTION


We have developers who use either of these options often, so it will come down to personal preference.
 
Please let me know if this helps and if you have any other questions!

And what happens when you receive event for TRASFER? 
There is no field `environment` in that event.

```

{

"api_version": "1.0",

"event": {

"app_id": "XXX",

"event_timestamp_ms": XXX,

"id": "XXX",

"store": "APP_STORE",

"transferred_from": [

"XXX"

],

"transferred_to": [

"XXX"

],

"type": "TRANSFER"

}

}
```

Badge +3

We had a single app at first. The Transfer webhook do not carry the environment as mentioned above. We had to devise a dirty trick of exposing a method of checking wether a pair of user ids was valid on a given environment and fallback to the other otherwise. Now we are moving to two separate RC projects which is not as clean, but at least guarantees unique webhooks per environment.

Userlevel 4
Badge +6

Hi Vincent!

At this time, we only support one webhook url per app. This is definitely on our backlog to support but I don’t have an ETA at this time.

There are a couple things you could try in the meantime:

  • Create a separate duplicate RevenueCat app for your staging/development app, with a separate webhook URL and different API keys
  • Use a neutral webhook endpoint and use the environment field in webhooks to differentiate between event types, such as SANDBOX or PRODUCTION


We have developers who use either of these options often, so it will come down to personal preference.
 
Please let me know if this helps and if you have any other questions!

Reply