SupaBase Anonymous Login
Knowledge

SupaBase Anonymous Login

Learn how to log in SupaBase Anonymous

Pankaj Sharma
Flutterflow development company
February 12, 2025
Table of content

Overview

Supabase Anonymous Login allows users to access your app without creating an account or providing credentials. This feature is useful for onboarding new users quickly, enabling guest browsing, or offering limited functionality before requiring authentication.

With Supabase's authentication service, you can seamlessly implement anonymous sign-ins while ensuring security and scalability. Additionally, you can later upgrade an anonymous session to a fully registered account without losing user data.

This approach enhances user experience by reducing friction during onboarding while maintaining flexibility in authentication workflows.

Prerequisites

  • Supabase
  • FlutterFlow

Supabase

Supabase is an open-source Backend-as-a-Service (BaaS) platform that offers a scalable backend for building web and mobile applications. It provides developers with tools to set up a complete backend without manually configuring databases or authentication systems. Supabase is often described as an alternative to Google Firebase, but with a stronger focus on open-source technologies and relational databases like PostgreSQL.

Follow the steps below to set up your Supabase project:

1. Set up a Supabase Project

  • Go to Supabase.
  • Sign in or create an account.
  • Create a new project:
    • Enter the project name.
    • Choose a region.
    • Set up a database password (keep it secure).
  • Wait for the project to initialize.

2. Configure API Keys

  1. Go to Project Settings > API.
  2. Copy the Project URL and API Key (usually the anon public key). You'll need these to configure the client-side.

3. Enable Anonymous Sign-Ins

  • Go to Project Settings > Authentication.
  • There you will see Auth settings page.
  • There is a User Signups section, there you have to enable Anonymous Sign-Ins and save it.

FlutterFlow

FlutterFlow is a low-code development platform built on top of Flutter, Google's open-source UI toolkit for building natively compiled applications for mobile, web, and desktop from a single codebase.

Follow the steps below to set up your FlutterFlow project:

1. Create a FlutterFlow Project

  • Go to the FlutterFlow console.
  • Click on Create a project and follow the instructions to set up a new project.

2. Enable Supabase Authentication in FlutterFlow

  • In the settings, enable authentication and select Supabase as the authentication type in the FlutterFlow console.
  • Set up the entry and login pages.
  • Enable Supabase in FlutterFlow and fill in the API URL and Anon Key which you already copied from Supabase Project Settings > API.

3. Flutterflow Functionality

  • We just created simple Auth Page and Home page in flutterflow project.
  • Auth Page has only one button named as Guest Sign In.
  • On Tab on Guest Sign In button, we call anonymousLogin custom action.

// Automatic FlutterFlow imports

import '/backend/supabase/supabase.dart';

import '/flutter_flow/flutter_flow_theme.dart';

import '/flutter_flow/flutter_flow_util.dart';

import '/custom_code/actions/index.dart'; // Imports other custom actions

import '/flutter_flow/custom_functions.dart'; // Imports custom functions

import 'package:flutter/material.dart';

// Begin custom action code

// DO NOT REMOVE OR MODIFY THE CODE ABOVE!



Future anonymousLogin(BuildContext context) async {

 // Add your function code here!

 final supabase = Supabase.instance.client;

 try {

   final response = await supabase.auth.signInAnonymously();



   if (response.user != null) {

     print("Signed in as anonymous user: ${response.user!.id}");

     context.goNamedAuth('HomePage', context.mounted);

   }

 } catch (error) {

   print("Error signing in anonymously: $error");

 }

}

  • When user successfully login as a anonymous user, they will navigate to Logged In page, you can set any page in “context.goNamedAuth('Any Page Name', context.mounted);”.

Conclusion

Supabase Anonymous Login simplifies user onboarding by allowing guest access without account creation. Integrated with FlutterFlow, it ensures seamless authentication while maintaining security and scalability. Users can later upgrade to a registered account without losing data, enhancing flexibility and engagement.

SupaBase Anonymous Login

Ex- Technical Lead at Paytm Money | Senior Software Developer | NIT Surathkal

Flutterflow project image

Need expert help in Flutterflow and Supabase?

Contact Us
Flutterflow development company

View more blogs

Ready to develop your own product? Get in touch today!

Get in Touch  
Flutterflow app development
Whatsapp icon