Skip to Content

next-workflow-builder

DevKit AI Builder Template DocumentationMarketplace
CTRL K
Demo
CTRL K
  • DevKit 
  • AI Builder Template 
    • Introduction
    • Getting Started
    • Configuration
    • Plugins
      • Overview
      • HTTP Request
      • Condition
      • Loop
      • Merge
      • Database Query
      • Run Workflow
      • Run Workflows in Sequence
      • Switch
    • Creating Plugins
    • API Reference
    • CLI Reference
    • Components
    • Database
    • Authentication
    • Deployment
    • Architecture
    • Contributing
    • MCP Server
  • Marketplace
  • Introduction
  • Getting Started
  • Configuration
  • Plugins
    • Overview
    • HTTP Request
    • Condition
    • Loop
    • Merge
    • Database Query
    • Run Workflow
    • Run Workflows in Sequence
    • Switch
  • Creating Plugins
  • API Reference
  • CLI Reference
  • Components
  • Database
  • Authentication
  • Deployment
  • Architecture
  • Contributing
  • MCP Server

On This Page

  • Next.js plugin options
  • Options
  • Auth options example
  • Layout component options
  • Environment variables
Question? Give us feedback Edit this page 
DocumentationConfiguration

Configuration

Next.js plugin options

The nextWorkflowBuilder() function accepts a NextWorkflowBuilderConfig object:

import nextWorkflowBuilder from "next-workflow-builder"; const withNextWorkflowBuilder = nextWorkflowBuilder({ debug: false, databaseUrl: process.env.DATABASE_URL, authOptions: { socialProviders: { vercel: { clientId: process.env.VERCEL_CLIENT_ID, clientSecret: process.env.VERCEL_CLIENT_SECRET, }, }, }, });

Options

OptionTypeDefaultDescription
debugbooleanfalseEnable debug logging
databaseUrlstringundefinedOverride the PostgreSQL connection URL. Falls back to process.env.DATABASE_URL when not set.
authOptionsRecord<string, unknown>undefinedBetter Auth configuration options (must be JSON-serializable)
anonymousAuthbooleantrueEnable anonymous authentication so users can try the app before signing in

The authOptions object is serialized and injected as an environment variable at build time, so all values must be JSON-serializable. This is where you configure authentication providers, email/password settings, and other Better Auth options.

Auth options example

const withNextWorkflowBuilder = nextWorkflowBuilder({ authOptions: { emailAndPassword: { enabled: true, requireEmailVerification: false, }, socialProviders: { github: { clientId: process.env.GITHUB_CLIENT_ID, clientSecret: process.env.GITHUB_CLIENT_SECRET, }, google: { clientId: process.env.GOOGLE_CLIENT_ID, clientSecret: process.env.GOOGLE_CLIENT_SECRET, }, vercel: { clientId: process.env.VERCEL_CLIENT_ID, clientSecret: process.env.VERCEL_CLIENT_SECRET, }, }, }, });

Layout component options

The Layout component accepts props from Better Auth UI’s AuthUIProviderProps:

<Layout social={{ providers: ["vercel", "github"] }} > {children} </Layout>

When using social auth providers, pass the provider names in the social.providers array to display the corresponding login buttons in the auth dialog.

Environment variables

VariableRequiredDescription
DATABASE_URLYesPostgreSQL connection string
BETTER_AUTH_SECRETYesSecret key for Better Auth session encryption
BETTER_AUTH_URLYesBase URL for Better Auth callbacks (e.g., http://localhost:3000)
INTEGRATION_ENCRYPTION_KEYYesKey used to encrypt stored integration credentials at rest
NEXT_PUBLIC_APP_URLNoPublic app URL (alternative to BETTER_AUTH_URL)
VERCEL_URLNoAuto-set by Vercel for preview deployments

Plugin-specific environment variables are defined by each plugin’s formFields[].envVar configuration. See Plugins for details.

Last updated on March 12, 2026
Getting StartedPlugins

© 2026 All rights reserved.

Product by David Sanchez