Appearance
Getting Started
Welcome to Nexus! This guide will help you get up and running with our notification infrastructure in just a few minutes.
Overview
Nexus is a modern notification infrastructure that allows you to send multi-channel notifications (Email, SMS, Push, In-App, Chat, Webhooks) through a single API.
Key Features
- Multi-Channel Delivery: Send notifications across multiple channels from one API
- Workflow Builder: Create complex notification flows with our visual builder
- Template Management: Design and manage templates with variables
- Real-time Widget: Embed notifications directly in your application
- Multi-Tenant: Built-in support for organizations and environments
Prerequisites
Before you begin, make sure you have:
- Node.js 20+ or Bun 1.1+ installed
- A PostgreSQL database
- Basic knowledge of REST APIs
Quick Start
1. Clone and Install
bash
# Clone the repository
git clone <repository-url> nexus
cd nexus
# Install dependencies
npm install
# Set up environment variables
npm run setup:env
# Run database migrations
npm run db:push
# Start development servers
npm run devbash
# Clone the repository
git clone <repository-url> nexus
cd nexus
# Install dependencies
bun install
# Set up environment variables
bun run setup:env
# Run database migrations
bun run db:push
# Start development servers
bun run devbash
# Clone the repository
git clone <repository-url> nexus
cd nexus
# Install dependencies
yarn install
# Set up environment variables
yarn setup:env
# Run database migrations
yarn db:push
# Start development servers
yarn dev2. Access the Dashboard
Once the servers are running:
- Web Dashboard: http://localhost:4000
- API Server: http://localhost:3001
- API Documentation: http://localhost:3001/docs
3. Create Your First Organization
- Open the dashboard at http://localhost:4000
- Click "Create Organization"
- Enter your organization details
- You'll receive an API key - save this securely!
4. Install an SDK
Choose your preferred language and install the SDK:
bash
npm install @nexus/node
# or
yarn add @nexus/node
# or
bun add @nexus/nodebash
pip install nexus-notificationsbash
gem install nexus-notificationsbash
composer require nexus/notificationsbash
go get github.com/nexus/nexus-go5. Send Your First Notification
Here's a simple example to send your first notification:
typescript
import { Nexus } from '@nexus/node'
const nexus = new Nexus({
apiKey: 'your-api-key-here'
})
async function sendWelcomeEmail() {
await nexus.trigger('user-onboarding', {
to: {
subscriberId: 'user-123',
email: '[email protected]',
firstName: 'John',
lastName: 'Doe'
},
payload: {
signupDate: new Date().toISOString(),
plan: 'free'
}
})
}
sendWelcomeEmail()
.then(() => console.log('Notification sent!'))
.catch(console.error)python
from nexus import Nexus
from datetime import datetime
nexus = Nexus(api_key='your-api-key-here')
def send_welcome_email():
nexus.trigger(
workflow='user-onboarding',
to={
'subscriberId': 'user-123',
'email': '[email protected]',
'firstName': 'John',
'lastName': 'Doe'
},
payload={
'signupDate': datetime.now().isoformat(),
'plan': 'free'
}
)
try:
send_welcome_email()
print('Notification sent!')
except Exception as e:
print(f'Error: {e}')ruby
require 'nexus'
nexus = Nexus::Client.new(api_key: 'your-api-key-here')
begin
nexus.trigger(
workflow: 'user-onboarding',
to: {
subscriberId: 'user-123',
email: '[email protected]',
firstName: 'John',
lastName: 'Doe'
},
payload: {
signupDate: Time.now.iso8601,
plan: 'free'
}
)
puts 'Notification sent!'
rescue => e
puts "Error: #{e.message}"
endphp
<?php
require_once 'vendor/autoload.php';
use Nexus\Client;
$nexus = new Client('your-api-key-here');
try {
$nexus->trigger('user-onboarding', [
'to' => [
'subscriberId' => 'user-123',
'email' => '[email protected]',
'firstName' => 'John',
'lastName' => 'Doe'
],
'payload' => [
'signupDate' => date('c'),
'plan' => 'free'
]
]);
echo "Notification sent!\n";
} catch (Exception $e) {
echo "Error: " . $e->getMessage() . "\n";
}go
package main
import (
"fmt"
"log"
"time"
"github.com/nexus/nexus-go"
)
func main() {
client := nexus.New("your-api-key-here")
err := client.Trigger("user-onboarding", nexus.TriggerOptions{
To: nexus.Subscriber{
SubscriberID: "user-123",
Email: "[email protected]",
FirstName: "John",
LastName: "Doe",
},
Payload: map[string]interface{}{
"signupDate": time.Now().Format(time.RFC3339),
"plan": "free",
},
})
if err != nil {
log.Fatal("Error:", err)
}
fmt.Println("Notification sent!")
}What's Next?
Now that you've sent your first notification, explore these topics:
- Create a Workflow - Build multi-step notification flows
- Design Email Templates - Create beautiful, responsive emails
- Integrate the Widget - Add in-app notifications
- Configure Providers - Connect your email/SMS services
Need Help?
- 📖 Check our API Reference
- 💬 Join our Discord Community
- 📧 Contact support at [email protected]