sanity-plugin-shopify-assets 1.0.2 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2023 Sanity.io
3
+ Copyright (c) 2025 Sanity.io
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -14,45 +14,45 @@ npm install sanity-plugin-shopify-assets
14
14
 
15
15
  Add it as a plugin in sanity.config.ts (or .js):
16
16
 
17
- ```
18
- import {defineConfig} from 'sanity'
19
- import {shopifyAssets} from 'sanity-plugin-shopify-assets'
20
-
21
- export const defineConfig({
22
- //...
23
- plugins: [
24
- shopifyAssets({
25
- shopifyDomain: '*.myshopify.com'
26
- })
27
- ]
28
- })
17
+ ```ts
18
+ import {defineConfig} from 'sanity'
19
+ import {shopifyAssets} from 'sanity-plugin-shopify-assets'
20
+
21
+ export const defineConfig({
22
+ //...
23
+ plugins: [
24
+ shopifyAssets({
25
+ shopifyDomain: '*.myshopify.com'
26
+ })
27
+ ]
28
+ })
29
29
  ```
30
30
 
31
31
  Simply update the `shopifyDomain` to your store URL. You'll need to install the [Sanity Connect](https://www.sanity.io/docs/sanity-connect-for-shopify) app on your store to handle authorisation. You'll need to ensure the Liquid sync option is enabled within the Sanity Connect app.
32
32
 
33
33
  Then you can enable the asset selector on a field:
34
34
 
35
- ```
35
+ ```ts
36
36
  import {defineType, defineField} from 'sanity'
37
37
 
38
38
  export const myDocumentSchema = defineType({
39
- type: "document",
40
- name: "article",
39
+ type: 'document',
40
+ name: 'article',
41
41
  fields: [
42
42
  defineField({
43
- type: "shopify.asset",
44
- name: "shopifyAsset",
43
+ type: 'shopify.asset',
44
+ name: 'shopifyAsset',
45
45
  }),
46
- ]
46
+ ],
47
47
  })
48
48
  ```
49
49
 
50
50
  It's also possible to define the Shopify domain on the field level, which allows you to retrieve assets from different stores. Each store must be connected to your Sanity project via the Sanity Connect app. In order to do this, simply declare the `shopifyDomain` on the field:
51
51
 
52
- ```
52
+ ```ts
53
53
  defineField({
54
- type: "shopify.asset",
55
- name: "shopifyAsset",
54
+ type: 'shopify.asset',
55
+ name: 'shopifyAsset',
56
56
  options: {
57
57
  shopifyDomain: '*.myshopify.com'
58
58
  }
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import {ObjectSchemaType} from 'sanity'
1
+ import type {ObjectSchemaType} from 'sanity'
2
2
  import {Plugin as Plugin_2} from 'sanity'
3
3
 
4
4
  export declare interface Asset extends ShopifyFile {