🚨 Active Supply Chain Attack:node-ipc Package Compromised.Learn More
Socket
Book a DemoSign in
Socket

@lovable.dev/cloud-auth-js

Package Overview
Dependencies
Maintainers
6
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lovable.dev/cloud-auth-js

Lovable Cloud Auth JS

npmnpm
Version
0.0.4-dev.1
Version published
Weekly downloads
1M
-14.74%
Maintainers
6
Weekly downloads
 
Created
Source

@lovable.dev/cloud-auth-js

OAuth authentication library for Lovable projects using Supabase.

Installation

npm install @lovable.dev/cloud-auth-js

Usage

import { createLovableAuth } from "@lovable.dev/cloud-auth-js";
import { supabase } from "./supabase/client";

const lovableAuth = createLovableAuth();

// Sign in with OAuth
const result = await lovableAuth.signInWithOAuth("google");

if (result.redirected) {
  // Page is redirecting to OAuth provider
  return;
}

if (result.error) {
  console.error("Sign in failed:", result.error.message);
  return;
}

await supabase.auth.setSession(result.tokens);

API

createLovableAuth(config?)

Creates a Lovable auth instance.

Config options:

OptionTypeDefaultDescription
oauthBrokerUrlstring"/~oauth/initiate"OAuth broker initiate URL
supportedOAuthOriginsstring[]["https://oauth.lovable.app"]Allowed origins for OAuth postMessage

signInWithOAuth(provider, options?)

Initiates OAuth sign-in flow.

Parameters:

ParameterTypeDescription
provider"google" | "apple"OAuth provider
options.redirect_uristringCustom redirect URI (defaults to window.location.origin)
options.extraParamsRecord<string, string>Additional params to send to the OAuth broker

Returns: Promise<SignInWithOAuthResult>

Types

interface OAuthTokens {
  access_token: string;
  refresh_token: string;
}

interface LovableAuthConfig {
  oauthBrokerUrl?: string;
  supportedOAuthOrigins?: string[];
}

interface SignInWithOAuthOptions {
  redirect_uri?: string;
  extraParams?: Record<string, string>;
}

type SignInWithOAuthResult =
  | { tokens: OAuthTokens; error: null; redirected?: false }
  | { tokens?: undefined; error: Error; redirected?: false }
  | { tokens?: undefined; error: null; redirected: true };

License

MIT

Keywords

lovable

FAQs

Package last updated on 06 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts