Getting Started

Getting Started with Aldero

Build an app on Aldero in 30 minutes. This guide walks you through setting up authentication, billing, and notifications.

Prerequisites

  • Node.js 22+ or Dart 3.0+
  • An Aldero account (sign up at dashboard.aldero.io)

1. Create Your Tenant

Sign up at dashboard.aldero.io/signup. You’ll get:

  • A tenant slug (e.g., myapp)
  • A production and sandbox environment
  • A default OAuth2 client for your dashboard

Your API endpoints:

  • Auth: https://myapp.aldero.io
  • Billing: https://myapp.billing.aldero.io
  • Notifications: https://myapp.ntf.aldero.io
  • Sandbox: same URLs with myapp-sandbox prefix

2. Create an OAuth2 Client

In the dashboard, go to Applications > Create Application:

SettingFor mobile appsFor web apps
Typenativespa
Callback URLmyapp://auth/callbackhttp://localhost:3000/auth/callback
Allowed Originshttp://localhost:3000

Copy the Client ID — you’ll need it in your app.

3. Install the SDK

Flutter (Dart)

# pubspec.yaml
dependencies:
  aldero:
    path: ../sdks/dart/aldero  # or publish to pub.dev

Node.js (TypeScript)

npm install @aldero/sdk  # or link locally

4. Add Authentication

Flutter

import 'package:aldero/aldero.dart';
 
final aldero = AlderoClient(
  config: AlderoConfig(
    domain: 'aldero.io',
    tenantSlug: 'myapp',
  ),
);
 
// Sign up
final result = await aldero.auth.signup(
  email: 'user@example.com',
  password: 'securepassword',
);
print('Welcome ${result.user.email}');
 
// Login
final login = await aldero.auth.login(
  email: 'user@example.com',
  password: 'securepassword',
);
 
// Get profile
final user = await aldero.auth.getProfile();

Node.js (backend)

import { AlderoClient } from '@aldero/sdk';
 
const aldero = new AlderoClient({
  domain: 'aldero.io',
  tenantSlug: 'myapp',
  apiKey: 'bil_your_api_key',
});

5. Set Up Billing

Provision billing tenant

In the dashboard, go to Settings > Billing and click “Set Up Billing”.

Create products

Go to Billing > Products > Add Product and create your pricing:

Product ID: myapp_pro_monthly
Plan ID: pro
Price: 999 (in cents = $9.99)
Interval: month
Features: ["pro_features", "no_ads"]
Grants: { "api_calls": 1000 }

Query entitlements

// Flutter
final entitlements = await aldero.billing.getEntitlements(userId);
if (entitlements.hasFeature('pro_features')) {
  // Show pro content
}
print('API calls remaining: ${entitlements.grant("api_calls")}');
// Node.js
const entitlements = await aldero.billing.getEntitlements(userId);
if (entitlements.features.includes('pro_features')) {
  // Allow access
}

6. Add Purchases (RevenueCat)

  1. Create a RevenueCat project and connect App Store / Play Store
  2. Add products matching your billing product IDs
  3. Configure webhook: https://myapp.billing.aldero.io/webhooks/revenuecat
  4. Set webhook authorization secret in dashboard Settings > Billing > Webhooks

When a user purchases, RevenueCat sends a webhook → billing service creates entitlements → your app queries them.

7. Send Notifications

Provision notification tenant

In the dashboard, go to Settings > Notifications and click “Set Up Notifications”.

Register a device (Flutter)

await aldero.notifications.registerDevice(
  userId: userId,
  token: apnsToken,
  platform: 'ios',
);

Send a notification (backend)

await aldero.notifications.send({
  templateName: 'welcome',
  channel: 'push',
  to: userId,
  variables: { name: 'John' },
});

Create templates

In the dashboard, go to Notifications > Templates > Create Template and add your notification templates with {{variable}} syntax.

Next Steps