Skip to content

Commit 1ae00e4

Browse files
Merge pull request #4499 from Shopify/2026-07-rc-pick-file-intent-docs
[File Picker Intent] add File picker intent type and action to public Intents API types
2 parents 422fc94 + be1fbf4 commit 1ae00e4

2 files changed

Lines changed: 17 additions & 3 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@shopify/ui-extensions': patch
3+
'@shopify/ui-extensions-tester': patch
4+
---
5+
6+
Add `pick` action and `shopify/File` resource type to the admin Intents API, enabling extensions to open the file picker via `intents.invoke('pick:shopify/File', …)`.

packages/ui-extensions/src/surfaces/admin/api/intents/intents.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@ export interface IntentResponseApi {
8484
}
8585

8686
/**
87-
* The type of operation to perform: creating a new resource or editing an existing one.
87+
* The type of operation to perform: creating a new resource, editing an existing one, or picking existing resources.
8888
* @publicDocs
8989
*/
90-
export type IntentAction = 'create' | 'edit';
90+
export type IntentAction = 'create' | 'edit' | 'pick';
9191

9292
/**
9393
* The types of Shopify resources that support intent-based creation and editing workflows.
@@ -99,6 +99,7 @@ export type IntentType =
9999
| 'shopify/Collection'
100100
| 'shopify/Customer'
101101
| 'shopify/Discount'
102+
| 'shopify/File'
102103
| 'shopify/Location'
103104
| 'shopify/Market'
104105
| 'shopify/Menu'
@@ -140,7 +141,7 @@ export interface IntentQuery extends IntentQueryOptions {
140141
}
141142

142143
/**
143-
* The [`invoke` method](/docs/api/admin-extensions/{API_VERSION}/target-apis/utility-apis/intents-api#invoke-method) in the Intents API launches a Shopify admin workflow for creating or editing resources, such as products, customers, or discounts. It opens a native admin interface, waits for the merchant to complete the workflow, and returns the result including any created or updated resource data.
144+
* The [`invoke` method](/docs/api/admin-extensions/{API_VERSION}/target-apis/utility-apis/intents-api#invoke-method) in the Intents API launches a Shopify admin workflow for creating, editing, or picking resources, such as products, customers, or files. It opens a native admin interface, waits for the merchant to complete the workflow, and returns the result including any created, updated, or selected resource data.
144145
*
145146
* @param intent - Either a string query (for example, `'create:shopify/Product'`) or structured object describing the intent
146147
* @param options - Optional parameters when using string query format, such as resource IDs for editing or additional context data
@@ -161,6 +162,13 @@ export interface IntentQuery extends IntentQueryOptions {
161162
* data: { type: 'amount-off-product' }
162163
* });
163164
* const response = await activity.complete;
165+
*
166+
* // Pick files from the store
167+
* const activity = await intents.invoke('pick:shopify/File', {
168+
* data: { mediaTypes: ['MediaImage'], multiSelect: true }
169+
* });
170+
* const response = await activity.complete;
171+
* // response.data.ids contains the selected file GIDs
164172
* ```
165173
* @publicDocs
166174
*/

0 commit comments

Comments
 (0)