Lovelace Developer Portal
Overview
Auth Hub
Studio
Agents Cloud
Skills
Memory Platform
Lattice Cloud
Hosting
Ada CLI
MCP Gateway
Ada
Periscope
Editor Extensions
Skip to main content

Auth Quick Start

What This Is

A fast setup path for Sign in with Lovelace using @lovelace-ai/auth-react and @lovelace-ai/auth-nextjs.

Who This Is For

Developers who want a working integration first, then deeper customization.

What You Will Finish With

  • AuthProvider integration.
  • Top app-bar sign-in control.
  • Server verification route.

Step 1: Set Client ID

bash
NEXT_PUBLIC_LOVELACE_OAUTH_CLIENT_ID=<registered-client-id>

Step 2: Wrap App in Provider

tsx
"use client";

import type { ReactNode } from "react";
import {
  AuthProvider,
  assertLovelaceClientIdConfigured,
} from "@lovelace-ai/auth-react";

export function AppProviders({ children }: { children: ReactNode }) {
  assertLovelaceClientIdConfigured();
  return <AuthProvider>{children}</AuthProvider>;
}

Step 3: Add App-Bar Auth Action

tsx
"use client";

import { useLovelaceSignIn } from "@lovelace-ai/auth-react";

export function AppBarAuthAction() {
  const auth = useLovelaceSignIn();

  if (auth.status === "loading")
    return <button disabled>Checking session</button>;
  if (auth.status === "authenticated") {
    return <button onClick={() => void auth.signOut()}>Sign out</button>;
  }

  return <button onClick={() => auth.signIn()}>Sign in</button>;
}

Step 4: Add Verification Route

ts
import { createLovelaceSignInRoute } from "@lovelace-ai/auth-nextjs/server";

export const POST = createLovelaceSignInRoute({
  audience: process.env.NEXT_PUBLIC_LOVELACE_OAUTH_CLIENT_ID,
  sessionDurationSeconds: 60 * 60 * 24 * 7,
});

Next

  • External Integration
  • Production Hardening

Build and deploy AI agents with ease.

Quick Start

  • Getting Started
  • Build Your First Agent
  • Platform Concepts
  • Examples & Tutorials

Develop

  • Create an Agent
  • Connect an MCP Server
  • API Reference
  • CLI Tools

Platform

  • Agents Cloud
  • Roadmap
  • Platform Changelog
  • Status

Resources

  • Discord
  • GitHub
  • Support
  • Developer Blog
Lovelace logo
Lovelace
Made with ❤️ by Reasonable Tech CompanySupport
TermsPrivacy
All systems operational

Start Here

Quick Start

External Integration

First-Party Integration

Production Hardening

Troubleshooting

API Reference