mcpField
S
salla-app-functions

salla-app-functions

github.com/sallaappDevelopment281 installsUpdated 2w ago
Repository

About salla-app-functions

A routing skill for building Salla App Functions, aimed at developers implementing store-event handlers. It coordinates design, handler creation, validation, release, and testing, and explains when functions are preferable to webhooks.

Key features

  1. 01Routes work across build-step skills
  2. 02Guidance on triggers and sync or async behavior
  3. 03Handler, sandbox, and timeout guidance
  4. 04Validation, deployment, and preview workflow
  5. 05Public and private app publishing steps

Use cases

  1. 01Choose a Salla store-event trigger
  2. 02Build a synchronous handler that can shape or block an operation
  3. 03Preview a function on a demo store
  4. 04Publish functions for public or private apps

MCP support

It describes using Salla Partners MCP tools to list, retrieve, save, delete, deploy, and preview functions, and to validate or publish apps.

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/sallaapp/salla-partners-agent-kit --skill salla-app-functions

After installing, type/salla-app-functionsin Claude Code to confirm it loaded.

Details

From the project README

Salla App Functions

A serverless handler Salla runs automatically on a store event — you write the logic, Salla runs it in a sandboxed V8 runtime. This skill is the router: work the steps in order, each in its own skill, and clear every gate before moving on.

Build flow — route to the step skill

StepDo thisSkill
1Pick the trigger, confirm its payload.data, choose sync vs asyncsalla-app-functions-design
2Write the handler (template, context, Resp, sandbox, timeouts)salla-app-functions-handler
3Keep the template wrapper (first + last line) + type-check locally (before any save)salla-app-functions-validate
4Save (deploys to demo stores)salla-app-functions-release
5Test on a demo store with salla_functions action=preview (read its return value)salla-app-functions-test
6Publish for production (public: app_publish validate → partner submits in Portal; private: salla_private_apps action=publish)salla-app-functions-release

Prefer an App Function over a webhook (when a trigger exists)

  • Secure without signature verification — runs in Salla's sandbox; no inbound request, no X-Salla-Signature.
  • Settings-aware — the merchant's settings arrive in context.settings; no extra fetch.
  • Pre-authenticated — call the Salla Admin API straight from the handler with no Authorization header (no token storage/refresh; token handling is Salla's, not yours → salla-app-auth). Mechanics live in salla-app-functions-handler; for the call itself — base URL, endpoints, scopes, bounded fetch, error shapes — see salla-api-core.
  • Synchronous and actionable — a sync action (e.g. shipment.creating) runs before the operation and your return value shapes or blocks it; a webhook only reacts after.

Fall back to a webhook (salla-webhooks) when no App Function trigger exists, or when the work can't fit the runtime timeouts or the V8 isolate (no npm; no fs/net/http servers/child_process; Web Crypto only; fetch for HTTP) — confirm those limits in salla-app-functions-handler before committing.

Act with the Salla Partners MCP

ToolActionWhat it does
salla_functionslist_triggers get save delete deploy_status previewList triggers; read template + types (.d.ts URLs) + saved content; upsert; delete; poll a deploy; run on a demo store
app_publishopen set validatePublic app: validate the publication (saves a DRAFT; partner submits in Portal) to release the function to real stores
salla_private_appspublishPrivate app: publish (app_id, confirm: true after the partner confirms) to release the function to the requested stores

Sync actions have a hard 5 s total limit (keep each internal async call < 2 s; the docs recommend < 500 ms since the merchant is blocked — a target, not the limit); async events get 30 s. Resp, the entity builders (e.g. Shipment), CommunicationEvent, and all typed contexts are pre-declared runtime globals — use them directly, already in scope. Runtime is a V8 isolate, not Node; module/response specifics live in salla-app-functions-handler.

Step 0 — Discover (ask first)

  1. Which trigger does it run on? (e.g. order.created, shipment.creating)
  2. What should it do when it fires? (notify, sync, validate/block, modify params)
  3. Does it block or change the operation, or just react after the fact?

Key resources

Comments

Markdown supported