项目为MIT LICENSE,任何基于本项目的改动都不强制申明、引用。欢迎各种修改、衍生。
nvm install 16
nvm use 16
npm run dev
create table if not exists navinocode_states (
id uuid primary key default gen_random_uuid(),
client_id text not null unique,
data jsonb not null default '{}'::jsonb,
updated_at timestamptz not null default now()
);
alter table navinocode_states enable row level security;
-- 示例策略(匿名访问):如果只你自己使用该项目,可以放宽为 anon 全权限
create policy "anon read own state" on navinocode_states
for select using (true);
create policy "anon upsert state" on navinocode_states
for insert with check (true);
create policy "anon update state" on navinocode_states
for update using (true);
Supabase URL 与 anon key,即可使用“从云端拉取 / 上传本地数据”。客户端标识 client_id 会保存在浏览器 localStorage。client_id 等于 JWT 中自定义的 claim 或者要求登录后再访问。