Member dining app
Goal: A small Next.js app that signs a member in with Blackbird, lists restaurants, and shows their passport — built from@flynetdev/core and
@flynetdev/react.Prep time: ~15 minutes
Mise en place
@flynetdev/core— OAuth (with PKCE) and server-side Discovery@flynetdev/react—FlynetProvider,ConnectWithBlackbird,RestaurantList,UserPassport
First course — the connect link
Build the authorize URL on the server.FlynetOAuth adds the PKCE
code_challenge; stash the matching verifier and CSRF state in an
httpOnly cookie for the callback.
app/connect/route.ts
app/page-connect.tsx
Second course — the restaurant list
Discovery uses the API key, which stays on the server.RestaurantList
is presentational — hand it the data you fetched.
app/page.tsx
Main course — the passport
Exchange the code for tokens, then render the member component underFlynetProvider with a member client.
app/callback/route.ts
app/passport.tsx