import { base44 } from "@/api/base44Client";// The client is pre-configured and ready to useconst user = await base44.auth.me();const userTasks = await base44.entities.Task.filter({ assignedTo: user.id, status: "pending",});console.log(`${user.name} has ${userTasks.length} pending tasks`);
import { createClientFromRequest } from "npm:@base44/sdk";Deno.serve(async (req) => { const base44 = createClientFromRequest(req); // Get the current user and their data const user = await base44.auth.me(); const userTasks = await base44.entities.Task.filter({ assignedTo: user.id, status: "pending", }); return Response.json({ user: user.name, pendingTasks: userTasks.length, });});
import { createClient } from "@base44/sdk";// Create a client for your Base44 appconst base44 = createClient({ appId: "your-app-id", // Find this in the Base44 editor URL});// Read public data (anonymous access)const products = await base44.entities.Products.list();
import { createClient } from "@base44/sdk";const base44 = createClient({ appId: "your-app-id",});// Authenticate a user (token is automatically set)await base44.auth.loginViaEmailPassword("user@example.com", "password");// Now operations use the authenticated user's permissionsconst userOrders = await base44.entities.Orders.list();