If you have an API and a SPA that's tightly coupled then, yes, same repo.
If your API is a separate product with a separate release cycle, proper testing and backwards compatibility checks, then different repo.
If your API is a separate product with a separate release cycle, proper testing and backwards compatibility checks, then different repo.
So far the only good reason I've had for separating them has been related to deployment concerns (e.g. your API is deployed to AWS and your browser client is on Cloudflare).