Requirements
- Target platform
- OpenClaw
- Install method
- Manual import
- Extraction
- Extract archive
- Prerequisites
- OpenClaw
- Primary doc
- SKILL.md
Supabase integration for Hakke Studio projects. Auth, database, storage, edge functions. Use with vercel skill for full-stack deployment.
Supabase integration for Hakke Studio projects. Auth, database, storage, edge functions. Use with vercel skill for full-stack deployment.
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete.
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run.
Supabase integration especΓfica para proyectos de Hakke Studio.
ProyectoSupabase URLUsohakke-apphttps://[project].supabase.coSaaS multi-tenant
# Supabase CLI (ya instalado) supabase --version # Si no estΓ‘ instalado npm install -g supabase
supabase login This opens browser for OAuth login with contacto@hakke.cl.
cd /home/bastianberrios/proyectos/HAKKE/hakke-app supabase link --project-ref <project-id>
supabase gen types typescript --local > lib/supabase/database.types.ts
supabase migration new <migration_name>
supabase db push
supabase db reset
supabase status Returns: anon key - Public key (client-side) service_role key - Secret key (server-side ONLY)
-- In Supabase Dashboard SQL Editor INSERT INTO auth.users (email, encrypted_password, email_confirmed_at) VALUES ( 'user@example.com', crypt('password123', gen_salt('bf')), NOW() );
ALTER TABLE users ENABLE ROW LEVEL SECURITY;
-- Users can only see their own data CREATE POLICY "Users can view own data" ON users FOR SELECT USING (auth.uid() = id); -- Users can update own data CREATE POLICY "Users can update own data" ON users FOR UPDATE USING (auth.uid() = id);
-- In Supabase Dashboard SQL Editor INSERT INTO storage.buckets (id, name, public) VALUES ('avatars', 'avatars', false);
-- Users can upload to own folder CREATE POLICY "Users can upload avatars" ON storage.objects FOR INSERT WITH CHECK ( bucket_id = 'avatars' AND auth.uid()::text = (storage.foldername(name))[1] );
supabase functions new <function-name>
supabase functions deploy <function-name>
curl -i -L --request POST 'https://<project>.supabase.co/functions/v1/<function-name>' \ --header 'Authorization: Bearer <anon-key>' \ --header 'Content-Type: application/json' \ --data '{"name":"Functions"}'
βββββββββββββββββββββββββββββββββββββββββββ β hakke-app (SaaS) β βββββββββββββββββββββββββββββββββββββββββββ€ β tenants table (multi-tenant) β β - id, slug, name, plan β β - owner_id (FK β auth.users) β β - subscription_status β βββββββββββββββββββββββββββββββββββββββββββ€ β Row Level Security (RLS) β β - tenant_id = current_tenant() β βββββββββββββββββββββββββββββββββββββββββββ
-- Function to get current tenant CREATE OR REPLACE FUNCTION current_tenant_id() RETURNS uuid AS $$ BEGIN RETURN (auth.jwt()->>'tenant_id')::uuid; END; $$ LANGUAGE plpgsql SECURITY DEFINER; -- RLS Policy example CREATE POLICY "Users can only see own tenant data" ON appointments FOR ALL USING (tenant_id = current_tenant_id());
-- Check subscription status CREATE OR REPLACE FUNCTION has_active_subscription() RETURNS boolean AS $$ DECLARE tenant_record tenants%ROWTYPE; BEGIN SELECT * INTO tenant_record FROM tenants WHERE id = current_tenant_id(); RETURN tenant_record.subscription_status = 'active'; END; $$ LANGUAGE plpgsql SECURITY DEFINER;
SELECT table_name FROM information_schema.tables WHERE table_schema = 'public';
SELECT column_name, data_type, is_nullable, column_default FROM information_schema.columns WHERE table_name = 'users';
SELECT schemaname, tablename, rowsecurity FROM pg_tables WHERE schemaname = 'public';
NEXT_PUBLIC_SUPABASE_URL=https://<project>.supabase.co NEXT_PUBLIC_SUPABASE_ANON_KEY=<anon-key> SUPABASE_SERVICE_ROLE_KEY=<service-role-key>
NEXT_PUBLIC_SUPABASE_URL= NEXT_PUBLIC_SUPABASE_ANON_KEY= SUPABASE_SERVICE_ROLE_KEY=
// lib/supabase/server.ts import { createClient } from '@supabase/supabase-js'; import { cookies } from 'next/headers'; export function createServerClient() { const cookieStore = cookies(); return createClient( process.env.NEXT_PUBLIC_SUPABASE_URL!, process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!, { auth: { persistSession: false, }, } ); }
// lib/supabase/client.ts import { createClient } from '@supabase/supabase-js'; export const supabase = createClient( process.env.NEXT_PUBLIC_SUPABASE_URL!, process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY! );
# Check if Supabase is accessible curl -I https://<project>.supabase.co/rest/v1/ # Expected: 401 Unauthorized (means API is working, just need auth)
-- Check if RLS is enabled SELECT tablename, rowsecurity FROM pg_tables WHERE schemaname = 'public'; -- Check policies SELECT schemaname, tablename, policyname, permissive, roles, cmd, qual, with_check FROM pg_policies WHERE schemaname = 'public';
# Check if user exists supabase auth list # Check logs supabase logs auth
# In hakke-app directory vercel # Add env vars in Vercel Dashboard or CLI vercel env add NEXT_PUBLIC_SUPABASE_URL vercel env add NEXT_PUBLIC_SUPABASE_ANON_KEY vercel env add SUPABASE_SERVICE_ROLE_KEY
PracticeWhyRLS always onSecurity firstService key server-onlyNever expose to clientType generationType-safe queriesMigrations in gitReproducible DBSeparate anon/service keysPrinciple of least privilege
Docs: https://supabase.com/docs Dashboard: https://supabase.com/dashboard CLI Reference: https://supabase.com/docs/reference/cli SQL Editor: Dashboard β SQL Editor Logs: Dashboard β Logs Supabase Hakke v1.1.0 - Production-ready for Hakke Studio
Code helpers, APIs, CLIs, browser automation, testing, and developer operations.
Largest current source with strong distribution and engagement signals.