Dokümantasyon

Hızlı Başlangıç

Birkaç dakikada proje oluştur, API key al, Node.js ile ilk satırı yaz.

Nasıl çalışır?

Her proje bir edge bölgesine atanır.

İstek: {EDGE}/{service}/… + X-Liap-Key (liap_live_…).

Proje UUID path’te yok — anahtar projeyi seçer.

Proje: X-Liap-Key. Kullanıcı oturumu: ayrıca Bearer lca_… (/auth/me).

1. Proje + API key

Dashboard → Projects → bölge seç → oluştur. Durum active olunca data_plane_url görünür.

API Anahtarları → Create key. Secret bir kez gösterilir; sakla.

Node.js
const EDGE = process.env.LIAP_EDGE // https://cdn-tr-01.liap.cloud
const API_KEY = process.env.LIAP_API_KEY // liap_live_...

const res = await fetch(`${EDGE}/db/tables/todos/rows`, {
  headers: { 'X-Liap-Key': API_KEY },
})

Dashboard’da API key üretin. DB/storage için X-Liap-Key yeter. Auth oturumu için login sonrası Bearer lca_ da gerekir.

2. SDK kur

Monorepo SDK yolu veya paket adı ile kurulum:

Node.js
npm install ./sdk/node
# veya: npm install @liap-cloud/sdk

import { createClient } from '@liap-cloud/sdk'

const liap = createClient(process.env.LIAP_EDGE, {
  apiKey: process.env.LIAP_API_KEY,
})

3. Auth + ilk satır

Son-kullanıcı kaydı token döner. Service-role (API key) ile doğrudan tablo yazabilirsin.

Node.js
// Son-kullanıcı
await liap.auth.register({
  email: '[email protected]',
  password: 'demo12345',
  name: 'Demo',
})

// Service-role ile satır
await liap.db.from('todos').insert({ title: 'Merhaba Liap', done: false })
const rows = await liap.db.from('todos').select()
console.log(rows)

4. Ham fetch (SDK’sız)

Node.js
const res = await fetch(`${EDGE}/db/tables/todos/rows`, {
  headers: { 'X-Liap-Key': API_KEY },
})
console.log(await res.json())

Proje active değilse 409/503 alırsın — edge provisioning birkaç saniye sürebilir.

Docs · API