Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions admin-intent-link/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Admin App Intent Link Extension

Admin app intent link extensions enable app developers to expose actions to Sidekick in the Shopify Admin. When a merchant asks Sidekick to perform an action, Sidekick can navigate the merchant to the right page in your app to complete it.

Learn more about app action extensions in Shopify's [developer documentation](https://shopify.dev/docs/apps/build/sidekick/build-app-actions).

---

## Get started with this extension

This extension demonstrates registering an app action (intent) for Sidekick. After deployment, Sidekick will be able to invoke your app's action and navigate the merchant to the correct page.

### Key files

- `shopify.extension.toml` - Extension configuration defining the intent target and action type
- `intent-schema.json` - Schema definition for the intent's input parameters
- `tools.json` - Tool definitions for actions Sidekick can perform within the intent context
- `instructions.md` - Guidelines for Sidekick on when and how to use your tools

### How it works

1. The extension registers an intent via the `[[extensions.targeting.intents]]` config
2. The `type` field (e.g., `application/email`) tells Sidekick what kind of data the action works with
3. The `action` field (e.g., `open`) tells Sidekick what the action does
4. When Sidekick invokes the action, the merchant is navigated to your app at the configured `url`

### Customizing the intent

1. Update the `type` and `action` in `shopify.extension.toml` to match your app's capabilities
2. Update `intent-schema.json` with the input parameters your action accepts
3. Update the `url` in `shopify.extension.toml` to point to the correct page in your app
4. Update `tools.json` with the tools Sidekick can use for your action
5. Update `instructions.md` with guidelines for when and how Sidekick should use your tools

### Limits

- Maximum of 5 intents per app
- Maximum of 20 tools per app (shared across all extension types — data and action)
- Tool names: up to 64 characters
- Tool descriptions: up to 512 characters
- Description fields: 256-token limit
- Instructions file: 2,048-token limit

### Testing

Run `shopify app deploy` to deploy your extension and test it with Sidekick in the Shopify Admin.

> **Note:** `shopify app dev` may not upload the intent schema correctly. Use `shopify app deploy` for testing.
12 changes: 12 additions & 0 deletions admin-intent-link/instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## When to Use the Design Email Tool

Use the `design_email` tool when the merchant asks to:
- Change background color or layout
- Update visual styling or font
- Switch to different layout template

## Important Guidelines

- Only use `design_email` while merchant has campaign open
- Confirm changes before applying
- Refer to layouts as "single-column", "two-column", or "hero-image"
66 changes: 66 additions & 0 deletions admin-intent-link/intent-schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"$schema": "https://extensions.shopifycdn.com/shopifycloud/schemas/v1/intent.json",
"inputSchema": {
"$ref": "https://extensions.shopifycdn.com/shopifycloud/schemas/v1/application/email.json",
"type": "object",
"properties": {
"recipient": {
"type": "string",
"description": "Primary recipient email address (e.g., email@example.com)",
"format": "email"
},
"cc": {
"type": "array",
"description": "CC recipient email addresses",
"items": {
"type": "string",
"format": "email"
}
},
"subject": {
"type": "string",
"description": "Email subject line (1-200 characters)",
"minLength": 1,
"maxLength": 200
},
"body": {
"type": "string",
"description": "Email message body (supports rich text formatting)"
},
"template_id": {
"type": "string",
"description": "Email template to use",
"enum": [
"blank",
"welcome",
"promotion"
]
},
"send_at": {
"type": "string",
"description": "Schedule email for future delivery (ISO 8601 date-time format)",
"format": "date-time"
},
"priority": {
"type": "string",
"description": "Email priority level",
"enum": [
"low",
"normal",
"high"
],
"default": "normal"
},
"track_opens": {
"type": "boolean",
"description": "Enable email open tracking",
"default": true
}
},
"required": [
"recipient",
"subject",
"body"
]
}
}
4 changes: 4 additions & 0 deletions admin-intent-link/locales/en.default.json.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "{{ name }}",
"description": "An app action extension for Sidekick"
}
4 changes: 4 additions & 0 deletions admin-intent-link/locales/fr.json.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "{{ name }}",
"description": "Une extension d'action d'application pour Sidekick"
}
33 changes: 33 additions & 0 deletions admin-intent-link/shopify.extension.toml.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[[extensions]]
name = "Edit email"
description = "Edit an email campaign"

handle = "{{ handle }}"
type = "admin_link"
{% if uid %}uid = "{{ uid }}"{% endif %}

# For embedded apps, URIs are defined relative to the domain of the configured application_url in your shopify.app.toml
# For example, `url = "/path"` with configured `application_url = "https://my-app-domain.com/home"` will resolve to https://my-app-domain.com/path
# For non-embedded apps URIs are an absolute path to your app
# url = "https://yourappdomain.com/path"
[[extensions.targeting]]
target = "admin.app.intent.link"
url = "/edit/{id}"

# admin.app.intent.link is a special target that is not tied to a Shopify resource.
# It can be invoked from anywhere in the Shopify Admin via Sidekick.

# Tools define actions Sidekick can perform within the intent context.
tools = "./tools.json"

# Instructions guide Sidekick on when and how to use your tools.
instructions = "./instructions.md"

# Register an intent to declare what action your app can perform.
# `type` describes the kind of data your action works with (e.g., application/email).
# `action` describes what the action does (e.g., open, create, edit).
# `schema` points to a JSON file defining the input your action accepts.
[[extensions.targeting.intents]]
type = "application/email"
action = "edit"
schema = "./intent-schema.json"
29 changes: 29 additions & 0 deletions admin-intent-link/tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[
{
"$schema": "https://extensions.shopifycdn.com/shopifycloud/schemas/v1/tool.json",
"name": "design_email",
"description": "Update visual design of email campaign including colors, layout, styling",
"inputSchema": {
"type": "object",
"properties": {
"background_color": {
"type": "string",
"description": "Background color for the email"
},
"layout": {
"type": "string",
"description": "Email layout template",
"enum": [
"single-column",
"two-column",
"hero-image"
]
},
"font_family": {
"type": "string",
"description": "Font family for email text"
}
}
}
}
]
27 changes: 25 additions & 2 deletions templates.json
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@
}
],
"minimumCliVersion": "3.78.2",
"deprecatedFromCliVersion": "3.85.3"
"deprecatedFromCliVersion": "3.85.3"
},
{
"identifier": "admin_action",
Expand Down Expand Up @@ -415,7 +415,9 @@
"path": "admin-tools"
}
],
"organizationExpFlags": ["d7c1b4ad"],
"organizationExpFlags": [
"d7c1b4ad"
],
"minimumCliVersion": "3.90.0"
},
{
Expand Down Expand Up @@ -2082,5 +2084,26 @@
"path": "tax-calculation"
}
]
},
{
"identifier": "admin_intent_link",
"name": "Admin intent link",
"defaultName": "admin-intent-link",
"group": "Links",
"supportLinks": [],
"url": "https://github.com/Shopify/extensions-templates",
"type": "admin_link",
"extensionPoints": [],
"supportedFlavors": [
{
"name": "Config only",
"value": "config-only",
"path": "admin-intent-link"
}
],
"organizationExpFlags": [
"99125067"
],
"minimumCliVersion": "3.90.0"
}
]