Skip to content

Quickstart: Sypnia Cloud

Create an account and a project, make a table with row-level security, sign up a first user and read their rows from your app.

Applies to Cloud
View as Markdown
On this page
  1. Create your account
  2. Create a project
  3. Create a table with row-level security
  4. Install the SDK
  5. Sign up, then write and read

In ten minutes you have a project with a table, a signed-up user and your app reading that user’s rows.

  1. Create your account

    On data.sypnia.com choose Start free, write your name and your e-mail. An e-mail arrives: «Confirm your e-mail and create your password». Open it, choose a password, and you are in.

  2. Create a project

    The console asks for an organization name and your first project. Pick Managed database (we create it for you) or My own Postgres (paste a connection string: Any Postgres). When it is ready you see its address and two keys:

    • the publishable key syp_pk_…, for your app;
    • a secret key syp_sk_…, for servers only. Keep it out of your code.
  3. Create a table with row-level security

    Open SQL in the console and run:

    SQL
    create table public.notes (
      id uuid primary key default gen_random_uuid(),
      owner uuid not null default auth.uid() references sypnia_auth.users(id) on delete cascade,
      body text not null,
      created_at timestamptz not null default now()
    );
    alter table public.notes enable row level security;
    create policy "own notes" on public.notes
      for all to authenticated
      using (owner = auth.uid()) with check (owner = auth.uid());
  4. Install the SDK

    Terminal
    npm install @sypnia/data
    src/sypnia.ts
    import { createClient } from '@sypnia/data/client';
    export const sypnia = createClient('https://<ref>.data.sypnia.com', 'syp_pk_<ref>_…');
  5. Sign up, then write and read

    Sign-up by e-mail sends a confirmation, and Sypnia doesn’t send e-mail for your project: first set your own provider in Auth → E-mail sender (SMTP, Resend, Postmark or SES), or turn on Google or GitHub. Until then signUp answers email_provider_required.

    TypeScript
    await sypnia.auth.signUp({ email: 'ana@example.com', password: 'a-long-password' });
    // after Ana confirms her e-mail and signs in:
    await sypnia.auth.signInWithPassword({ email: 'ana@example.com', password: 'a-long-password' });
    await sypnia.from('notes').insert({ body: 'Buy flour' });
    const { data } = await sypnia.from('notes').select('id, body').order('created_at', { ascending: false });
    You should see
    data holds Ana’s notes only. Another user signed in on another device gets their own, from the same table.

Next: pick how to write the rest of your app (Use any ORM), or let your agent manage the project through the device flow.

  1. Create your account
  2. Create a project
  3. Create a table with row-level security
  4. Install the SDK
  5. Sign up, then write and read

    Search pages, sections and terms