Quickstart
This walkthrough creates a posts collection and lists documents from the JavaScript SDK. Production base URL is https://api.tefily.com.
1. Create a project
Section titled “1. Create a project”- Sign in at app.tefily.com.
- Create or select an organization.
- Create a project. Copy the project ID from the project URL or project settings.
2. Define a collection
Section titled “2. Define a collection”In Kallax (schema builder):
- Create a table named
posts. - Add fields, for example
title(string, required) andstatus(string). - Open Endpoints and enable list and create (and any others you need).
- If the project has end-user auth on, add access rules or calls from the SDK will be denied once you send a project JWT. Platform tokens and service tokens still bypass rules.
3. Call the API
Section titled “3. Call the API”npm install @kataflax/sdkimport { KataflaxClient } from '@kataflax/sdk';
const client = new KataflaxClient({ baseUrl: 'https://api.tefily.com', projectId: 'YOUR_PROJECT_ID',});
const posts = client.collection('posts');
const created = await posts.create({ title: 'Hello Tefily', status: 'draft',});
const page = await posts.list({ page: 1, pageSize: 20 });console.log(page.total, created);Until you enable project auth and rules, you can call the data API without a user JWT. That is useful for a first test. For a real app, turn auth on, add requireAuth (and usually userFieldCompare for owner-scoped rows), and register or log in before create / list.
4. Optional: inject a platform or service token
Section titled “4. Optional: inject a platform or service token”Scripts and backends can skip end-user rules:
client.setToken('kfx_…'); // personal access token — admin-level, do not ship to clientsOr construct a backend client with a service token.