Skip to Content
Appwright

Workers

Create, publish, and manage workers

Workers are the unit of code in Bound. Each worker is a Cloudflare Worker fetch handler you write in the app’s code editor.

Creating a worker

From the Workers page, create a worker with:

  • Display name — the merchant-facing label shown in the dashboard.
  • Handle — the URL-safe identifier, auto-filled from the display name. The handle determines the worker’s URL on your storefront.
  • Source — the worker code, prepopulated with a working default handler.
  • API versions — the pinned Admin and Storefront API versions for this worker (defaults to the newest stable release).

Workers are live as soon as they’re created.

Editing and publishing

A worker can be active (deployed and reachable) or a draft (saved, but nothing deployed). Saving keeps a full version history — you can preview any past version in place and restore it. Unpublishing takes the worker offline without deleting its source or history.

Each worker’s page also shows its invocation stats (calls, errors, average duration) and recent logs.

The worker API

Inside your worker, platform capabilities are available on this.ctx.props:

export default {
  async fetch(request) {
    // Pre-authenticated Shopify Admin GraphQL client
    const { data } = await this.ctx.props.admin.query(`#graphql
      query { shop { name } }
    `);

    return Response.json(data);
  },
};
  • this.ctx.props.admin — Admin GraphQL API client (authentication is handled for you).
  • this.ctx.props.storefront — Storefront GraphQL API client.
  • this.ctx.props.secrets — values of the secrets you’ve explicitly enabled for this worker.

Secrets

Secrets are write-only: once saved, their values can never be read back, and they’re never stored in Bound’s database. A worker only receives the secrets you enable on its page — everything else is invisible to it.

Storefront access

Published workers are reachable on your store’s domain through the app proxy. The exact URL for each worker is shown on its page, with a copy button.