SummaryI could not find step-by-step instructions on how to set up spend limits on Vercel. Therefore, I want to clarify one nuance in order to be sure that I did everything right and at the same time help those people who will face the same problem in the future. ExampleNo response Steps to ReproduceSo what did I do step by step: Thus if the limit is triggered Vercel will send a POST request to my url. Then I check the signature that it is really a Vercel, then I take the token from the request url and make a pause request. Is that right? Or should I save |
Replies: 1 comment
|
@fckngold you store the token in your env keys. You find information about the webhook payload here: You may find the following useful: https://gist.github.com/borispoehland/2738d2edd62e83f332260a80eb5a9335 Keep in mind, both of the above do not add a Content-Type header that is actually required per the docs: https://vercel.com/docs/projects/overview#pausing-a-project In addition, the pause-vercel-projects actually takes into account the incoming payload which determines whether the budget has been surpassed or whether you are at the end of the billing cycle. If you used only the code from the gist you'd end up pausing the project every month. |
@fckngold you store the token in your env keys.
You find information about the webhook payload here:
https://vercel.com/docs/accounts/spend-management#webhook-payload
You may find the following useful:
https://gist.github.com/borispoehland/2738d2edd62e83f332260a80eb5a9335
https://github.com/…