Menu

1 / 3

Secure internal communication between services (beta) - Vercel

Vercel News·Casey Gowrie·5 days ago
#UmRAyNgq
#vercel#service#bindings#fetch#fastapi
Reading 0:00
15s threshold

Service Bindings make it easy for one Vercel service to securely call another within the same deployment.

When a service declares a binding for another service, Vercel automatically injects the configured environment variable. That means user code can fetch that URL normally, while Vercel handles the internal rewrite, routing, authentication, and TLS behind the scenes.

This enables multi-service applications on Vercel, like a Next.js frontend calling a FastAPI backend, while preserving service isolation and keeping routing configuration simple:

{

"services" : {

"my_frontend" : {

"root" : "frontend/" ,

"framework" : "nextjs" ,

"bindings" : [

{

"type" : "service" ,

"service" : "my_backend" ,

"format" : "url" ,

"env" : "BACKEND_INTERNAL_URL"

}

]

} ,

"my_backend" : {

"root" : "backend/" ,

"entrypoint" : "main:app"

}

}

}

In the example above, my_frontend will be able to reach the my_backend service by making a fetch() request to BACKEND_INTERNAL_URL.

export async function GET ( ) {

const…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.