Setup
Get S42 Accounts connected to Supabase and Wise.
All set
Sign in and add your first Wise account.
1. Create a Supabase project
Grab Project URL, anon key, and service_role key from Project Settings → API.
2. Add environment variables
Create
.env.local at the project root.# .env.local TABLE_PREFIX=SA_ NEXT_PUBLIC_SUPABASE_URL= NEXT_PUBLIC_SUPABASE_ANON_KEY= SUPABASE_SERVICE_ROLE_KEY= NEXT_PUBLIC_SITE_URL=http://localhost:3000 WISE_API_BASE=https://api.wise.com BASE_CURRENCY=GBP ALLOWED_EMAILS= ALLOWED_DOMAINS= TOKEN_ENCRYPTION_KEY=
- NEXT_PUBLIC_SUPABASE_URLReady
- NEXT_PUBLIC_SUPABASE_ANON_KEYReady
- SUPABASE_SERVICE_ROLE_KEYReady
- TOKEN_ENCRYPTION_KEY (≥32 chars)Ready
After editing .env.local, restart npm run dev and reload.
3. Create the database schema
Supabase → SQL Editor → New query → run.
create extension if not exists pgcrypto;
create table if not exists "SA_accounts" (
id uuid primary key default gen_random_uuid(),
user_id uuid not null references auth.users(id) on delete cascade,
provider text not null check (provider in ('wise')),
label text not null,
wise_profile_id bigint,
wise_profile_type text,
wise_profile_name text,
encrypted_token text not null,
created_at timestamptz not null default now()
);
alter table "SA_accounts" enable row level security;
create policy "owner can read" on "SA_accounts" for select using (auth.uid() = user_id);
create policy "owner can insert" on "SA_accounts" for insert with check (auth.uid() = user_id);
create policy "owner can delete" on "SA_accounts" for delete using (auth.uid() = user_id);
create policy "owner can update" on "SA_accounts" for update using (auth.uid() = user_id);4. Configure auth redirect
Supabase → Authentication → URL Configuration.
- Site URL:
http://localhost:3000 - Redirect URLs: add
http://localhost:3000/** - Auth → Providers → Email — enabled.
- Optional: Google provider for OAuth.
5. Get a Wise Personal API token
wise.com → Settings → API tokens → Create new (full access).
Then come back here, sign in, and Settings → Add account to paste the token.