Skip to content

Commit

Permalink
update cdn and product view docs (#156)
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminkalk authored May 30, 2024
1 parent 388ca81 commit b067830
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 12 deletions.
8 changes: 4 additions & 4 deletions .github/PACKAGE_WORKFLOW.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,18 @@ We can simply add our new package workflow by adding the below lines to the end
When you create a Pull Request and it is merged into the `main` branch, your package is then built and pushed to [npm](npmjs.com). You can see the piplines running [here](https://github.com/adobe/commerce-events/actions). If you search for your package name, you should see the latest build as version `0.0.0-<github commit hash>` and should also have a qa tag.

### - UNPKG Access
### - JSDELIVR Access

> :memo: The 2.x packages will be located at `/umd/index.js` or `umd.index.js`

[unpkg](https://unpkg.com/) is a fast, global content delivery network for everything on npm. We can access our package by going to the url
[jsdelivr](https://jsdelivr.com/) is a fast, global content delivery network for everything on npm. We can access our package by going to the url

- `https://unpkg.com/@adobe/commerce-events-<package-name>@qa/dist/index.js`
- `https://cdn.jsdelivr.net/npm/@adobe/commerce-events-<package-name>@qa/dist/index.js`

Using the sdk as an example, you should be able to access your file on the cdn in your html like so:

```html
<script async defer src="https://unpkg.com/@adobe/commerce-events-sdk@qa/dist/index.js"></script>
<script async defer src="https://cdn.jsdelivr.net/npm/@adobe/commerce-events-sdk@qa/dist/index.js"></script>
```

## Github Actions (CI/CD) for "Prod"
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Under the dev script, our built files are hosted at:

### QA

Merging a change to the `main` branch triggers a github action that builds and deploys the latest code to QA: https://unpkg.com/@adobe/magento-storefront-event-collector@qa/dist/index.js.
Merging a change to the `main` branch triggers a github action that builds and deploys the latest code to QA: https://cdn.jsdelivr.net/npm/@adobe/magento-storefront-event-collector@qa/dist/index.js.

### Production

Expand All @@ -36,7 +36,7 @@ Release steps:

- once the PR is approved and merged, create a [new release tag for the repo](https://github.com/adobe/commerce-events/tags)

Creating a new release tag triggers a github action that builds and deploys the latest code to Prod: https://unpkg.com/@adobe/magento-storefront-event-collector/dist/index.js.
Creating a new release tag triggers a github action that builds and deploys the latest code to Prod: https://cdn.jsdelivr.net/npm/@adobe/magento-storefront-event-collector/dist/index.js.

### NPM Packages

Expand Down
3 changes: 3 additions & 0 deletions examples/events/product-page-view.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

[`product`](./example-contexts/mock-product-context.md)

[`shoppingCart`](./example-contexts/mock-shopping-cart-context.md)

### 🔧 Usage

```javascript
Expand All @@ -30,6 +32,7 @@ const mse = window.magentoStorefrontEvents;

/* set before firing event */
mse.context.setProduct(productCtx);
mse.context.setShoppingCart(shoppingCartCtx);

mse.publish.productPageView();
```
6 changes: 3 additions & 3 deletions packages/storefront-events-collector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ This package listens for and handles events published by the [Adobe Commerce Eve

## Installation

The collector can be used as a hosted script, or bundled in a JavaScript application. The script version is hosted on [unpkg][unpkg], and the bundled version is hosted on [npm][npm].
The collector can be used as a hosted script, or bundled in a JavaScript application. The script version is hosted on [jsdelivr][jsdelivr], and the bundled version is hosted on [npm][npm].

To load the Collector as a script, use the following snippet.

```
<script src="https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@adobe/commerce-events-collectors/dist/index.js"></script>
```

To install the script as a dependency, run this command.
Expand Down Expand Up @@ -314,5 +314,5 @@ If you have any questions or encounter any issues, please reach out at these loc
[contributing-badge]: https://img.shields.io/badge/PRs-welcome-success?style=flat-square
[sdk]: https://npmjs.com/package/@adobe/magento-storefront-events-sdk
[acdl]: https://github.com/adobe/adobe-client-data-layer
[unpkg]: https://unpkg.com/@adobe/magento-storefront-event-collector/dist/index.js
[jsdelivr]: https://cdn.jsdelivr.net/npm/@adobe/magento-storefront-event-collector/dist/index.js
[issues]: https://github.com/adobe/commerce-events/issues
6 changes: 3 additions & 3 deletions packages/storefront-events-sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ Our context schemas are designed to simplify forwarding to two edges:

## Installation

This SDK can be used as a hosted script, or bundled in a JavaScript application. The script version is hosted on [unpkg][unpkg], and the bundled version is hosted on [npm][npm].
This SDK can be used as a hosted script, or bundled in a JavaScript application. The script version is hosted on [jsdelivr][jsdelivr], and the bundled version is hosted on [npm][npm].

To load the SDK as a script, use the following snippet.

```
<script src="https://unpkg.com/@adobe/commerce-events-sdk/dist/index.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@adobe/commerce-events-sdk/dist/index.js"></script>
```

To install the script as a dependency, run this command.
Expand Down Expand Up @@ -140,5 +140,5 @@ If you have any questions or encounter any issues, please reach out on [GitHub][
[contributing-badge]: https://img.shields.io/badge/PRs-welcome-success?style=flat-square
[commerce]: https://business.adobe.com/products/magento/magento-commerce.html
[collectors]: https://github.com/adobe/commerce-events/tree/main/packages/storefront-events-collector
[unpkg]: https://unpkg.com/@adobe/magento-storefront-events-sdk/dist/index.js
[jsdelivr]: https://cdn.jsdelivr.net/npm/@adobe/magento-storefront-events-sdk/dist/index.js
[issues]: https://github.com/adobe/commerce-events/issues

0 comments on commit b067830

Please # to comment.