Use Supabase with Hono
Learn how to create a Supabase project, add some sample data to your database, secure it with auth, and query the data from a Hono app.
1
Create a Supabase project
Go to database.new and create a new Supabase project.
When your project is up and running, go to the Table Editor, create a new table and insert some data.
Alternatively, you can run the following snippet in your project's SQL Editor. This will create a countries
table with some sample data.
Make the data in your table publicly readable by adding an RLS policy:
2
Create a React app
Boostrap the Hono example app from the Supabase Samples using the CLI.
3
Install the Supabase client library
The package.json
file in the project includes the necessary dependencies, including @supabase/supabase-js
and @supabase/ssr
to help with server-side auth.
4
Set up the required environment variables
Copy the .env.example
file to .env
and update the values with your Supabase project URL and anon key.
Lastly, enable anonymous sign-ins in the Auth settings.
Project URL
Anon key
Next steps
- Learn how server side auth works with Hono.
- Insert more data into your database
- Upload and serve static files using Storage