Getting Started
Everything you need to deploy your first application with NEXUS.
1 Quick Start
Get up and running with NEXUS in under 5 minutes. This guide will walk you through creating your first project and deploying it to our global edge network.
Prerequisites
- Node.js 18.0 or later
- npm or pnpm package manager
- A NEXUS account (free tier available)
2 Installation
Install the NEXUS CLI globally using your preferred package manager:
# Using npm
npm install -g @nexus/cli
# Using pnpm
pnpm add -g @nexus/cli
# Verify installation
nexus --version Tip
We recommend using pnpm for faster installations and better disk space efficiency.
3 Configuration
Authenticate the CLI and create your project configuration:
# Login to your account
nexus login
# Initialize a new project
nexus init my-app
# This creates a nexus.config.js file The configuration file supports the following options:
export default {
name: 'my-app',
region: 'auto', // or specific region
build: {
command: 'npm run build',
output: 'dist',
},
env: {
NODE_ENV: 'production',
},
} 4 First Deployment
Deploy your application to the NEXUS global edge network:
# Deploy to production
nexus deploy
# Deploy with a specific environment
nexus deploy --env staging
# Watch for changes and auto-deploy
nexus deploy --watch Pro tip
Connect your Git repository for automatic deployments on every push. Enable this in your project settings.
API Authentication
All API requests require authentication using an API key. Include your key in the Authorization header:
const response = await fetch('https://api.nexus.dev/v1/projects', {
headers: {
'Authorization': `Bearer ${process.env.NEXUS_API_KEY}`,
'Content-Type': 'application/json',
},
});
const projects = await response.json(); Security Warning
Never expose your API key in client-side code. Always use environment variables and server-side requests.
Next Steps
Now that you've deployed your first app, explore these resources to learn more: