Back to Supabase

Use Supabase with Hono

apps/docs/content/guides/getting-started/quickstarts/hono.mdx

1.26.082.1 KB
Original Source
<AiPrompt id="hono" />

<$Partial path="quickstart_db_setup.mdx" />

3. Create a Hono app

Bootstrap the Hono example app from the Supabase Samples using the CLI.

bash
npx supabase@latest bootstrap hono

4. Install Supabase's Agent Skills (optional)

Supabase's Agent Skills is a curated set of instructions that give your AI agent procedural knowledge about working with Supabase.

Install them so your AI coding agent can produce more accurate, reliable code using current Supabase patterns, such as authentication, server-side rendering, and database migrations, rather than relying solely on training data.

To install, run the following command in the root of your project:

bash
npx skills add supabase/agent-skills

5. 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.

bash
npm install

6. Set up the required environment variables

Copy the .env.example file to .env and update the values with your Supabase project URL and publishable key, which you can get from the helper below, or from the project Connect panel.

Lastly, enable anonymous sign-ins in the Auth settings.

bash
cp .env.example .env
<Button variant="primary" asChild> <a href="/dashboard/project/_?showConnect=true">Open Connect panel</a> </Button>

<$Partial path="api_settings.mdx" variables={{ "framework": "", "tab": "" }} />

7. Start the app

Start the app, go to http://localhost:5173.

Learn how server side auth works with Hono.

bash
npm run dev

Next steps