Webhook usecase

can i use webhook feature to pass a payload from space A to other space B . space B will read the data from payload and act on it ?

1 Like

How to set this up:

  • On Space B: You need to build your Space so that it exposes a web endpoint. A common way to do this is using a Docker Space running a lightweight FastAPI server, or using the @webhook_endpoint decorator provided by the huggingface_hub Python library in a Gradio Space.

  • In your HF Settings: You go to your user/organization Webhooks settings, select Space A as the “Target Repository,” and paste the Direct URL of Space B as the destination.

  • Security: You configure a Webhook Secret in your settings and set that same secret as an Environment Variable in Space B. Space B’s code should verify the X-Webhook-Secret header so it only accepts requests from Hugging Face.

1 Like