Skip to main content

Overview

The devark add command adds pre-built backend modules to your project, scaffolding authentication, database templates, and other common features.

Syntax

devark add <module>
module
string
required
The module to add to your project. See available modules below.

Available Modules

Authentication Modules

google-oauth

Adds Google OAuth authentication to your project.
devark add google-oauth

github-oauth

Adds GitHub OAuth authentication to your project.
devark add github-oauth

resend-otp

Adds OTP (One-Time Password) authentication using Resend.
devark add resend-otp

oauth (Interactive)

Triggers an interactive prompt to select an OAuth provider.
devark add oauth
When you run this command, you’ll see:
? Select an OAuth provider to authenticate with:
  > Google
    GitHub
Use arrow keys to navigate and press Enter to select.

Database Templates

node-mongo

Adds a Node.js project template with MongoDB integration.
devark add node-mongo

node-postgres

Adds a Node.js project template with PostgreSQL integration.
devark add node-postgres

Examples

$ devark add google-oauth

 Google OAuth module added successfully

Module Input

Module names are case-insensitive and whitespace is automatically trimmed.For example, GOOGLE-OAUTH, google-oauth, and google-oauth all work the same way.

Error Handling

Unsupported Module

If you specify a module that doesn’t exist:
$ devark add invalid-module
Error: Module "invalid-module" is not supported

Installation Aborted

You can cancel installation at any time by pressing Ctrl+C:
$ devark add oauth
? Select an OAuth provider to authenticate with:
  > Google
    GitHub
^C
  Installation aborted.

Interactive Prompt Cancelled

If you cancel an interactive prompt (like the OAuth selector), the installation will abort:
$ devark add oauth
? Select an OAuth provider to authenticate with:
  [Cancelled]

  Installation aborted.

Common Workflows

# Add Google OAuth
devark add google-oauth

# Or use the interactive selector
devark add oauth
The module will scaffold all necessary files for OAuth authentication including:
  • Route handlers
  • Environment variable templates
  • Configuration files

Next Steps

After adding a module:
  1. Check the generated files in your project
  2. Update environment variables (usually in .env)
  3. Review the module-specific configuration
  4. Test the functionality
Most modules require additional configuration like API keys or database connection strings. Check your .env file or generated documentation for required values.

Build docs developers (and LLMs) love