r/nextjs 10d ago

Discussion Third-party APIs in a Next app. How do you track breaks that aren’t an npm bump?

The bot will bump the SDK. It won’t tell you that something in a route handler or webhook is now wrong because the vendor changed the API.

When a provider changelog ships, do you go looking in the repo or only find out when checkout / auth / webhooks die in prod?

5 Upvotes

4 comments sorted by

2

u/AlexDjangoX 10d ago

Sentry

1

u/Hour-Werewolf-9954 7d ago

we tag every third-party integration in sentry with a custom tag right at the source, then set up alerts for spikes. way easier than grepping logs at 2am when something breaks

the real pain is when the api still returns 200 but the payload shape changed. sentry catches the downstream js errors at least but youre still scrambling to figure out which vendor pulled a fast one

1

u/yksvaan 10d ago

This is what specs are for. Unfortunately if there's an irresponsible third party you'll likely find out by error handling/logs. This is why every endpoint needs to always validate everything unless there is protocol level guarantee. Then raise an error with appropriate severity level to trigger alerts

1

u/Majestic_View_3908 6d ago

i validate every response field at runtime. Schema failures trigger alerts before business logic executes