Skip to main content
Version: Next

Interface: App

Root shape of a Wasp app specification.

Pass an App to the app constructor and export default the result from main.wasp.ts.

Example

import { app } from '@wasp.sh/spec'

export default app({
name: 'todoApp',
title: 'ToDo App',
wasp: { version: '^0.24.0' },
parts: [],
})

Properties

auth?

optional auth?: Auth

Configuration for authentication. Enables auth when set.


client?

optional client?: Client

Configuration for the client part of the resulting Wasp app.


db?

optional db?: Db

Configuration for the app's database.


emailSender?

optional emailSender?: EmailSender

Configuration for the app's email sender.


optional head?: string[]

Extra tags injected into the HTML <head>.

Each entry is rendered inside a React component, so the strings must be valid JSX: self-closing tags must end with /> (e.g. <meta ... />), and attributes must be camelCased (e.g. httpEquiv instead of http-equiv).

Due to a React bug, avoid defer on <script> tags because it can cause hydration warnings. Use async instead.


name

name: string

Internal app name.

Must not contain spaces.


parts

parts: Part[]

All the Parts of the app.

Build entries with the dedicated constructors (page, route, query, action, api, apiNamespace, job, crud).


server?

optional server?: Server

Configuration for the server part of the resulting Wasp app.


title

title: string

App title.

Used as the browser tab title.


wasp

wasp: Wasp

Wasp metadata.

This will get checked against the Wasp CLI.


webSocket?

optional webSocket?: WebSocket

Configuration for the app's WebSocket support.