Custom Features

Examples of how to consume the reflected API endpoints for custom logic.

!TIP While the engine handles standard CRUD automatically, these same API endpoints can be consumed directly within your application whenever you need to implement custom logic or unique functionalities that go beyond basic data management.

Create a Record

const user = await $fetch("/api/users", {
  method: "POST",
  body: {
    name: "Cliford Pereira",
    email: "clifordpereira@gmail.com",
    bio: "Full-Stack Developer",
  },
});

Get All Records

const users = await $fetch("/api/users");

Get Record by ID

const user = await $fetch("/api/users/1");

Update a Record

const updated = await $fetch("/api/users/1", {
  method: "PATCH",
  body: {
    bio: "Updated bio",
  },
});

Delete a Record

await $fetch("/api/users/1", {
  method: "DELETE",
});

Note: If authentication is enabled (default):

  • Fullstack App: The module integrates with nuxt-auth-utils, so session cookies are handled automatically.
  • Backend-only App: You must include the Authorization: Bearer <token> header in your requests.