Starter Templates
Jumpstart your API gateway development process with our pre-built starter templates
Templates
Backend for Frontend (BFF) Auth
Optimize UX and security in web applications with this approach.
Authentication
Backend-for-Frontend (BFF)
Repository
zuplo/examples/bff-authRun Locally
npx create-zuplo-api --example bff-authBackend for Frontend (BFF) Authorization Sample#
This is the source code from the sample discussed in the Backend for Frontend (BFF) Authorization blog post.
Setup#
This sample uses an OAuth identity provider (tested with Auth0) and Upstash. In order to run the sample you will need to set the following environment variables either in your .env file if you are running locally or in the Zuplo portal if you are running there.
// Auth0 Environment Variables
// Create a Regular Web Application in Auth0
//https://auth0.com/docs/get-started/auth0-overview/create-applications/regular-web-apps
AUTH0_URL=my-url.us.auth0.com
CLIENT_ID=
CLIENT_SECRET=
// Create an Upstash Redis Database
// https://upstash.com/docs/redis/overall/getstarted
UPSTASH_URL=
UPSTASH_TOKEN=
Use this example locally#
To develop with this example locally, you can create a new Zuplo project using our CLI
npx create-zuplo-api@latest my-api --example bff-auth
Then, in the project directory run the following commands:
npm install
npm run dev
Other Examples
Jumpstart your API gateway development process with our pre-built starter templates
OpenAI App
Example ChatGPT App using an MCP Server and the OpenAI Apps SDK.
GraphQL MCP Server
Exposing GraphQL APIs as an MCP Server with built-in introspection.
MCP Custom Tools
MCP Server with a custom tool that orchestrates multiple API calls.
MCP Server Prompts
An example MCP Server with additional MCP Prompts to enhance the end user experience.