Module Configuration Interface
The Nuxt Lettermint module accepts configuration options through thelettermint key in your nuxt.config.ts file. The module exposes the following TypeScript interface:
Configuration Options
All configuration options are optional and can be set in yournuxt.config.ts file or through environment variables.
Your Lettermint API key for authenticating with the Lettermint email service.If not provided here, the module will automatically look for the
NUXT_LETTERMINT_API_KEY environment variable.It’s recommended to use environment variables instead of hardcoding your API key in the config file. See Environment Variables for more details.
Controls whether the module should automatically create the
/api/lettermint/send endpoint.When enabled (default), the module creates a ready-to-use API endpoint for sending emails from the client side using the useLettermint() composable.Set to false if you want to create your own custom endpoints with additional logic. See Auto-generated Endpoint for more details.Basic Configuration
Add the module to your Nuxt configuration:Configuration with Options
You can configure the module by adding alettermint key to your config:
Default Values
The module uses the following default values:| Option | Default Value | Source |
|---|---|---|
apiKey | '' (empty string) | Environment variable NUXT_LETTERMINT_API_KEY or configured value |
autoEndpoint | true | Module defaults |
Runtime Configuration
The module automatically integrates with Nuxt’s runtime configuration system. The API key is stored securely in the server-side runtime config:TypeScript Support
The module provides full TypeScript support with type augmentation for Nuxt’s schema:Next Steps
Environment Variables
Learn how to configure the module using environment variables
Auto-generated Endpoint
Understand how the auto-generated API endpoint works