Files
Katerina Skroumpelou a7563e9fe6 docs(examples): use latest v2 of supabase-js and remove lock files (#44704)
* Use latest 2.x version of `@supabase/supabase-js` in all examples
* Use `latest` version of `@supabase/ssr` in all examples
* Remove lock files from examples
* Add examples lock files in .gitignore

The rationale is:
- Lock files are not actively maintained/updated (or the versions in the
package.json files for that matter)
- They pin an arbitrary version (from the end-user perspective)
- Removes the need to manually update the versions and reinstall
- Consistency

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

## Release Notes

* **Chores**
* Broadened Supabase SDK dependency version constraints across example
projects for greater flexibility with compatible updates
  * Updated some SSR package dependencies to track latest releases
* Added gitignore rules for dependency lock files in example directories

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-04-14 09:24:46 +03:00
..

Hono Supabase Auth Example

Based on the Hono/JSX + Vite example by @MathurAditya724 \o/

This example shows how to use Supabase Auth both on the client and server side with Hono.

Supabase setup

  • Create a new Supabase project at database.new
  • Go to the SQL Editor and run the following query to create the countries table.
-- Create the table
create table countries (
  id bigint primary key generated always as identity,
  name text not null
);
-- Insert some sample data into the table
insert into countries (name)
values
  ('Canada'),
  ('United States'),
  ('Mexico');

alter table countries enable row level security;
  • In a new query, create the following access policy.
create policy "authenticated users can read countries"
on public.countries
for select to authenticated
using (true);

Setup

  • Run npm install to install the dependencies.
  • Run cp .env.example .env.
  • Set the required environment vairables in your .env file.

Commands

Run the vite dev server

npm run dev

Building

npm run build

This project is configured to use node runtime, you can change it to your desired runtime in the vite.config.js file. We are using @hono/vite-build package for building the project and @hono/vite-dev-server for running the dev server.