@builder.io/plugin-sfcc-commerce-api 0.0.3 → 0.0.6

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/README.md CHANGED
@@ -1,3 +1,62 @@
1
- # Builder.io Saleforce Commerce Api plugin [alpha]
1
+ # Builder.io Salesforce Commerce Api plugin [alpha]
2
+
3
+ Easily connect your SalesForce B2C Commerce PWA APP to your Builder.io content!
4
+
5
+ ## SalesForce Setup API Access
6
+ Read through this [get started guide](https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/setting-up-api-access.html) to make sure you have your *Shopper Login and API Access Service (SLAS)* client setup ready.
7
+
8
+
9
+ ## Installation
10
+
11
+ Go to [builder.io/account/organization](https://builder.io/account/organization) and type `@builder.io/plugin-sfcc-commerce-api` in the input, then hit save.
12
+
13
+
14
+ ![Installation screenshot](https://cdn.builder.io/api/v1/image/assets%2Fd1ed12c3338144da8dd6b63b35d14c30%2F2c0da6f6b3104d6d87bdf62caa9ee271)
15
+
16
+ Following, you'll be prompted to enter the following data:
17
+ * Client id
18
+ * Organization id
19
+ * Proxy address
20
+ * Short code
21
+ * Site id
22
+
23
+ **The same configuration you find at your config/default.js file**
24
+ ![Config screenshot](https://cdn.builder.io/api/v1/image/assets%2F1fa6810c36c54e87bfe1a6cc0f0be906%2Fa1e74597f82e46d390fd0b328c19bf78)
25
+
26
+ Log into your Administration panel with your SFCC credentials at your [account administrator panel](https://account.demandware.com/)
27
+
28
+ ![Credentials screenshot](https://cdn.builder.io/api/v1/image/assets%2Fd1ed12c3338144da8dd6b63b35d14c30%2F92cfc4b9885d41eaa4d5c23b00ebeace)
29
+
30
+
31
+ After putting the required info, hit the connect button. You will now see a few new field types (for [model](https://builder.io/c/docs/guides/getting-started-with-models) fields, [symbol](https://builder.io/c/docs/guides/symbols) inputs, [custom components](https://builder.io/c/docs/custom-react-components) fields), and [custom targeting attributes](https://www.builder.io/c/docs/guides/targeting-and-scheduling#custom-targeting) that can be used in three different contexts:
32
+
33
+
34
+
35
+ ![Custom targeting attributes](https://cdn.builder.io/api/v1/image/assets%2Fd1ed12c3338144da8dd6b63b35d14c30%2F761dc7267e3b45198c460dfe6b0cec8e)
36
+
37
+ ### Custom targeting
38
+
39
+ Custom targeting in Builder.io allow users to target content by a multitude of attributes, and in this plugin you'll be able to add specific content from SFCC products, for this you'll need first to set the target attributes on the host site, either by setting the `userAttributes` if you're rendering client side:
40
+
41
+ ```ts
42
+ builder.setUserAttributes({
43
+ product: currentProduct.id,
44
+ });
45
+ ```
46
+
47
+ Or by passing it as a query param to the [content API](https://www.builder.io/c/docs/query-api#:~:text=userAttributes) call, or in [graqhql query](https://www.builder.io/c/docs/graphql-api#:~:text=with%20targeting) for e.g in Gatsby or nextjs.
48
+
49
+ - `SfCommerceProduct` when used as a custom targeting type, it'll target contexts where the field is set to the product ID, you'll need to set the product ID on the host environment, using one of the methods above.
50
+
51
+ - `SfCommerceProductsList` when used as a custom targeting type, it'll target contexts where the field is set to the a list of product Ids, you'll need to set the list of product Ids on the host environment, using one of the methods above.
52
+
53
+ - `SfCommerceCategory` can be used as custom targeting attribute to target specific category by ID, you'll need to set the category ID on the host environment, using one of the methods above.
54
+
55
+ - `SfCommerceCategoriesList` when used as a custom targeting type, it'll target contexts where the field is set to the a list of category Ids, you'll need to set the list of category Ids on the host environment, using one of the methods above.
56
+
57
+
58
+ ### Seeing the plugin in action
59
+
60
+ Try creating a custom [model](https://builder.io/c/docs/guides/getting-started-with-models), [component](https://builder.io/c/docs/custom-react-components), or [symbol](https://builder.io/c/docs/guides/symbols) using any of the SFCC field types, and edit away!
61
+
2
62
 
3
- TODO