You can add login to a web or mobile app without writing your own auth server: a backend as a service runs sign-up, login and tokens for you, and your frontend calls it through an SDK. On WoWSQL that is ProjectAuthClient in @wowsql/sdk 3.10.0, with email and password, magic links, email or phone OTP, and OAuth (including Google) already in the auth docs.
This walkthrough uses the official TypeScript snippets. Method names are signUp, signIn, sendMagicLink, sendOtp, verifyOtp, getOAuthAuthorizationUrl and exchangeOAuthCallback — not the Firebase or Supabase names. After login, you call the auto-generated REST API as that user so Row Level Security can apply. For the wider "no backend" path, see How to launch an app without building a backend. If you already have a Postgres database and only need accounts, see Add auth to a Postgres app.
Key facts
- Auth methods (docs): email and password, magic links, email or phone OTP, OAuth with 19 working providers (20 are listed;
keycloakcannot be used for sign-in yet), TOTP two-factor, optional Cloudflare Turnstile, and anonymous sign-in when enabled.- API: PostgREST at
https://<project>.wowsqlconnect.com/rest/v1. Send the anon key (wowsql_anon_…) inapikeyand the user's access token inAuthorization: Bearer …. The service key bypasses RLS and is server-only. There is no GraphQL API.- SDK:
@wowsql/sdk3.10.0 (WowSQLClient,.table(),ProjectAuthClient,WowSQLStorage). The docs also list official SDKs for Python, Go, Java, PHP, Ruby, Rust, Swift, Flutter/Dart, Kotlin and C# (WOWSQL.SDK3.10.0 on NuGet; the docs path is/docs/client-sdk/c-sdk).- Plans (pricing, checked 20 November 2026): Free $0, Pro $25/month, Scale $99/month. Yearly billing saves 7%.
Step 1: Create a project and enable auth
- Sign up at app.wowsql.com/signup and create a project. Pick Mumbai, US East or Frankfurt, whichever is closest to your users.
- In the dashboard, enable Authentication. The setup asks for a JWT secret of at least 32 characters and creates the auth tables.
- Copy the project slug and the anon key (
wowsql_anon_…). Keep the service key (wowsql_service_…) off the client.
Install the SDK:
npm install @wowsql/sdk
# pin if you want: npm install @wowsql/sdk@3.10.0
Step 2: Email and password
From the TypeScript SDK docs:
import { ProjectAuthClient } from '@wowsql/sdk'
const auth = new ProjectAuthClient({
projectUrl: 'myproject', // → https://myproject.wowsqlconnect.com
apiKey: 'wowsql_anon_your_key_here',
})
// Sign up → POST /auth/v1/signup
const result = await auth.signUp({
email: 'user@example.com',
password: 'SecurePassword123',
full_name: 'John Doe',
})
console.log(`Access token: ${result.session?.accessToken}`)
// Sign in → POST /auth/v1/login
const login = await auth.signIn({
email: 'user@example.com',
password: 'SecurePassword123',
})
if (login.requires2fa) {
// TOTP is on for this user: finish with verifyTwoFactorLogin
console.log(`2FA required, method: ${login.method}`)
} else {
console.log(`Access token: ${login.session?.accessToken}`)
}
Store the access token and refresh token however your app already stores a session (httpOnly cookie, secure storage, and so on). Restore them later with auth.setSession({ accessToken, refreshToken }). Sign out with auth.logout().
If a user has TOTP enabled, signIn does not return a session. It returns a challenge; complete it with verifyTwoFactorLogin as shown in the SDK docs (added in 3.10.0).
Step 3: Magic link
Magic links are passwordless email login. The user clicks a link, and your app completes the session from the callback.
// Send magic link — sendMagicLink(email, purpose?, captchaToken?)
await auth.sendMagicLink('user@example.com', 'login')
Configure the email templates and the redirect in the dashboard first, or the message will not go out. If you enabled Cloudflare Turnstile under Attack Protection, pass the captchaToken as the third argument.
Step 4: Email or phone OTP
// Email OTP — needs Auth → Emails configured
await auth.sendOtp({ email: 'user@example.com', purpose: 'login' })
const emailLogin = await auth.verifyOtp({
email: 'user@example.com',
otp: '123456',
purpose: 'login',
})
// Phone OTP — E.164, e.g. +15551234567
// Needs Auth → SMS / Phone OTP (Twilio, Fast2SMS, or MSG91) enabled
await auth.sendOtp({ phone: '+15551234567', purpose: 'login' })
const phoneLogin = await auth.verifyOtp({
phone: '+15551234567',
otp: '123456',
purpose: 'login',
})
The purpose and the verify payload must match what you configured. Phone OTP uses your own SMS provider credentials, not a built-in WoWSQL SMS bundle.
Step 5: Google OAuth
Configure the Google provider in the dashboard (client ID and secret). Add the callback URL https://<slug>.wowsqlconnect.com/auth/v1/oauth/google/callback to the Google Cloud OAuth client. Then, from the SDK docs:
import { ProjectAuthClient } from '@wowsql/sdk'
const auth = new ProjectAuthClient({
projectUrl: process.env.WOWSQL_PROJECT_URL!, // e.g. https://<slug>.wowsqlconnect.com
apiKey: process.env.WOWSQL_ANON_KEY!, // wowsql_anon_...
})
// Internally: GET /auth/v1/oauth/google?frontend_redirect_uri=...
const { authorizationUrl } = await auth.getOAuthAuthorizationUrl(
'google',
'https://yourapp.com/auth/callback', // must be an allowed origin
)
// Redirect the browser to authorizationUrl. Google handles login.
On the callback page, the docs show two patterns: read access_token and refresh_token from the query string if the project is set up to return them, or exchange the authorization code yourself:
const result = await auth.exchangeOAuthCallback(
'google',
'authorization_code_from_callback',
)
console.log(`OAuth login successful: ${result.user?.id}`)
The same getOAuthAuthorizationUrl call works for other enabled providers (github, apple, and the rest of the 19 that work today). Provider setup detail lives in OAuth for Projects.
Step 6: Call the API as the signed-in user
Login is only useful if subsequent queries run as that user. Keep the anon key in apikey and put the access token in Authorization. That combination is what the SDK connection guide documents:
const accessToken = login.session?.accessToken
const mine = await fetch('https://myproject.wowsqlconnect.com/rest/v1/todos?select=*', {
headers: {
apikey: 'wowsql_anon_your_key_here',
Authorization: `Bearer ${accessToken}`,
},
})
Pair this with RLS policies that use auth.uid(), as in the row level security guide. Do not put the service key in the app.
You can also use WowSQLClient for schema queries when a service role on the server is appropriate:
import WowSQLClient from '@wowsql/sdk'
const client = new WowSQLClient({
projectUrl: 'myproject',
apiKey: 'wowsql_anon_your_key_here',
})
const todos = await client.table('todos').select('*').get()
The snippets on this page are copied from the public TypeScript SDK and auth docs (3.10.0), checked on 20 November 2026. We did not re-run them against a private test project in this writing pass, so copy them as documented and try them on your own project before you ship.
FAQ
How do I add login to an app without building a backend?
Create a project on a BaaS, enable auth, and call its SDK from your frontend. On WoWSQL, install @wowsql/sdk, enable Authentication in the dashboard, and use ProjectAuthClient.signUp / signIn (or magic link, OTP, or OAuth). Then send the user's access token with API requests.
Can I add Google login without my own server?
Yes. Configure the Google provider in the WoWSQL dashboard, register the project callback URL at Google, and use getOAuthAuthorizationUrl('google', yourRedirect) from ProjectAuthClient. A small server route is still a good place to keep secrets if you exchange codes yourself, but the provider setup is not a custom auth service you have to write.
How do I use a magic link or OTP instead of a password?
Call sendMagicLink(email, 'login') or sendOtp({ email }) / sendOtp({ phone }) and then verifyOtp(...). Configure email or SMS in the dashboard first. Phone OTP needs Twilio, Fast2SMS, or MSG91 credentials.
How does the logged-in user only see their own rows?
Enable Row Level Security and write policies with auth.uid(). Send the anon key in apikey and the user's JWT in Authorization: Bearer …. Details are in the RLS guide.
Is there a free plan for this?
Yes. WoWSQL Free is $0 with 10,000 monthly active users, 256 MB database and 512 MB files (pricing, checked 20 November 2026). Over a limit, the project becomes read-only.