Generate functions with AI
Describe what you want in plain English and let AI write the function. It uses your own AI provider key and is grounded in the Shopify Admin API and this app's runtime, so the code it produces fits straight into a function.
Connect a provider
On Developer -> Connections, add your API key for Anthropic (Claude) and/or OpenAI:
- Your key is encrypted at rest and used only for generation. It is never injected into your functions (unlike Secrets) and never shown again after you save it.
- Each card links to where to create a key on the provider's site.
You can connect either provider, or both and pick per generation.
Generate a function
- Open a function's Code tab. With a provider connected, a Generate with AI box appears.
- Describe the function - be specific about the input and the outcome, for example:
When an order is tagged
wholesale, add the tagB2Bto that order's customer. - Choose the provider (if you connected more than one) and select Generate.
- The generated code loads into the editor. Review it, test it, then Save. AI can make mistakes - always run a test before you rely on it.
What it knows
The generator is told this app's runtime contract, so it uses the right shapes:
export default async function (input, ctx)withctx.log,ctx.fetch, andctx.shopify.graphql(query, variables)for the Admin API (current version), andsecrets.NAMEfor stored secrets.- To read or modify store data, the function needs Needs Shopify data turned on and the matching permission granted - see Permissions and store data access.

