Skip to Content
DocsApp SdkConfigurationConfiguration

Configuration

Das ProcessCube® App-SDK bietet verschiedene Konfigurationsmöglichkeiten für Next.js Anwendungen.

Konfigurationsbereiche

  • Environment Variables - Konfiguration von Engine, Authority und anderen Services über Umgebungsvariablen
  • Plugin System - withApplicationSdk Plugin für External Tasks und erweiterte Features

Schnellstart

Basis-Konfiguration

Für die meisten Anwendungen genügt diese minimale Konfiguration:

1. Environment Variables

.env.local
PROCESSCUBE_ENGINE_URL=http://localhost:10560 PROCESSCUBE_AUTHORITY_URL=http://localhost:11235

2. Next.js Config

next.config.ts
import type { NextConfig } from 'next'; const nextConfig: NextConfig = { serverExternalPackages: ['esbuild'], }; export default nextConfig;

Mit External Tasks

Wenn Sie External Tasks verwenden möchten:

next.config.ts
const { withApplicationSdk } = require('@5minds/processcube_app_sdk/server'); const nextConfig = { serverExternalPackages: ['esbuild'], applicationSdk: { useExternalTasks: true, }, }; module.exports = withApplicationSdk(nextConfig);

Konfigurationsoptionen im Überblick

Environment Variables

VariableStandardBeschreibung
PROCESSCUBE_ENGINE_URLhttp://localhost:10560Engine-Adresse
PROCESSCUBE_AUTHORITY_URL-Authority-Adresse
NEXTAUTH_CLIENT_ID-Client ID für NextAuth.js
NEXTAUTH_SECRET-Secret für NextAuth.js

Vollständige Liste →

Plugin Optionen

OptionTypStandardBeschreibung
useExternalTasksbooleanfalseExternal Tasks aktivieren
customExternalTasksDirPathstringapp/external-tasksVerzeichnis für External Task Handler

Mehr zum Plugin System →

Best Practices

Development vs. Production

Verwenden Sie unterschiedliche Environment Variables für verschiedene Umgebungen:

.env.local (Development)
PROCESSCUBE_ENGINE_URL=http://localhost:10560 PROCESSCUBE_AUTHORITY_URL=http://localhost:11235
.env.production (Production)
PROCESSCUBE_ENGINE_URL=https://engine.yourcompany.com PROCESSCUBE_AUTHORITY_URL=https://authority.yourcompany.com

Secrets Management

Speichern Sie Secrets NIEMALS im Git Repository:

.gitignore
.env*.local .env.production

Verwenden Sie stattdessen:

  • Lokal: .env.local
  • Production: Environment Variables in Ihrem Hosting-Service (Vercel, AWS, etc.)

Type Safety

Nutzen Sie TypeScript für type-safe Configuration:

lib/config.ts
export const config = { engineUrl: process.env.PROCESSCUBE_ENGINE_URL || 'http://localhost:10560', authorityUrl: process.env.PROCESSCUBE_AUTHORITY_URL, } as const; // Verwendung import { config } from '@/lib/config'; console.log(config.engineUrl); // Type-safe

Troubleshooting

Environment Variables werden nicht geladen

Problem: Variablen aus .env.local sind undefined

Lösungen:

  1. Stellen Sie sicher, dass die Datei .env.local heißt (nicht .env)
  2. Starten Sie den Development Server neu: npm run dev
  3. Verwenden Sie NEXT_PUBLIC_ Prefix für Client-Side Variables

Plugin funktioniert nicht

Problem: External Tasks starten nicht

Lösungen:

  1. Überprüfen Sie withApplicationSdk in next.config.ts
  2. Setzen Sie useExternalTasks: true
  3. Prüfen Sie die Console auf Fehler beim Server-Start

Nächste Schritte