Agent skill

managing-appwrite-functions

Handles backend logic that cannot run in the browser. Use for sensitive tasks like price calculation, cleanup, or payment verification.

Stars 163
Forks 31

Install this agent skill to your Project

npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/managing-appwrite-functions

SKILL.md

Appwrite Server Functions

When to use this skill

  • When logic requires an API Key that shouldn't be exposed.
  • For scheduled tasks (CRON jobs like "Cancel Unpaid Bookings").
  • For heavy processing that would slow down the frontend.

Workflow

  • Create a new function in the Appwrite Console.
  • Set runtime to Node.js.
  • Use node-appwrite SDK inside the function.
  • Trigger via events (e.g., databases.*.collections.bookings.documents.*.create) or HTTP.

Example (Node.js)

javascript
const sdk = require('node-appwrite');

module.exports = async function (context) {
    const client = new sdk.Client()
        .setEndpoint(process.env.APPWRITE_FUNCTION_ENDPOINT)
        .setProject(process.env.APPWRITE_FUNCTION_PROJECT_ID)
        .setKey(context.req.headers['x-appwrite-key']);

    const databases = new sdk.Databases(client);
    
    // Logic: e.g., Confirm payment with Stripe and update DB
    context.log('Function triggered');
    return context.res.json({ success: true });
};

Instructions

  • Security: Never hardcode keys in the function code; use Appwrite Function Environment Variables.
  • Runtimes: Prefer the latest stable Node.js runtime (e.g., 18.x or 20.x).
  • Execution: Check "Execute" permissions to ensure only authorized users or events can run it.

Expand your agent's capabilities with these related and highly-rated skills.

Didn't find tool you were looking for?

Be as detailed as possible for better results