Skip to content

logto-io/gpt-agenda

Repository files navigation

gpt-agenda

Deploy with Vercel

This is the repository of the GPT agenda app for the tutorial Authenticate users in GPT actions: Build a personal agenda assistant.

The result is available on gpt-agenda.fordemo.app.

Preview

The project is based on Next.js app router, and consists of two parts:

OpenAPI specification

The OpenAPI specification of the REST APIs is available at swagger.yaml. It is used for the GPT action definition.

Token validation

The REST APIs parse the Authorization header to get the access token and leverage the Userinfo endpoint to validate the token. See getUserById for details.

Development

This project uses pnpm as the package manager.

Install dependencies:

pnpm i

Start the dev server:

pnpm dev

Environment variables

To run the REST APIs, you need to set the following environment variable:

  • LOGTO_ENDPOINT: The endpoint of your Logto tenant. It can be found in the application details page of Logto Console.

To run the web app, besides the above environment variable, you also need to set the following environment variables:

  • LOGTO_APP_ID: The ID of the Logto application.
  • LOGTO_APP_SECRET: The secret of the Logto application.
  • LOGTO_COOKIE_SECRET: The secret used to sign the cookie.
  • BASE_URL: The base URL of the web app. It is used to generate the callback URL for OAuth.

Note

The web app should use a separate Logto application from the GPT actions.