Skip to content
Open
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
20 changes: 2 additions & 18 deletions docs/b2b-edition/docs/buyer-portal/headless.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -87,25 +87,9 @@ For the following steps, you must know in advance the URL where your build files
When re-building and re-deploying your custom Buyer Portal, you should clear the local contents of `.turbo/cache` before running `yarn build` to ensure that all updated code is reflected in the build. Also make sure to update your scripts in Script Manager again after deploying your new build files.
</Callout>

### Deploying with WebDAV

Your BigCommerce store’s [WebDAV storage](https://support.bigcommerce.com/s/article/File-Access-WebDAV) can be a viable option for serving your custom B2B Buyer Portal files without sourcing a third-party CDN.

Follow the instructions in the above support article to learn about enabling WebDAV and connecting with a client like Cyberduck. Once you’re connected, you can use your store’s WebDAV as the upload destination for the steps described in Building and Deploying.

The directory `content` should be used for static files of this nature. Let’s say you intend to upload the build files from `dist` into `content/b2b` on your store’s WebDAV. This will make your Buyer Portal files available at the following URL:

`https://{my-store}.com/content/b2b/`

The files can also be accessed via the store’s canonical URL, in this format:

`https://store-{store-hash}.mybigcommerce.com/content/b2b/`

Either of these should be used as the value of `VITE_ASSETS_ABSOLUTE_PATH` before running `yarn build`, and the same value should be utilized when updating the scripts in Script Manager.

### Deploying with Your Storefront

In a headless storefront scenario, you’re already deploying a custom frontend web application, and so you have the opportunity to deploy Buyer Portal build files with your own storefront rather than with a third-party CDN or your store’s WebDAV.
In a headless storefront scenario, you’re already deploying a custom frontend web application, and so you have the opportunity to deploy Buyer Portal build files with your own storefront rather than with a third-party CDN.

As an example, let’s say your storefront is a Next.js application and served from `mystore.com`. You might decide that the Buyer Portal static files will be available at `https://mystore.com/assets/b2b/`.

Expand Down Expand Up @@ -166,4 +150,4 @@ Managing code together in this way might offer benefits like:

* Consistent deployment of Buyer Portal customizations and related storefront customizations
* Automation of copying Buyer Portal build files into a final deployment directory
* Orchestration of related tasks, such as running the local servers for both the storefront application and Buyer Portal
* Orchestration of related tasks, such as running the local servers for both the storefront application and Buyer Portal
1 change: 0 additions & 1 deletion docs/b2b-edition/docs/buyer-portal/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,3 @@ If you want more advanced control or integration than the built-in options allow
- **[B2B Edition Settings (Help Center)](https://support.bigcommerce.com/s/article/B2B-Edition-Settings)**
- **[B2B Buyer Portal GitHub Repository](https://github.com/bigcommerce/b2b-buyer-portal)** Source code, README, and documentation for the Buyer Portal project.
- **[Catalyst Overview](https://support.bigcommerce.com/s/article/Catalyst)**
- **[BigCommerce WebDAV Support](https://support.bigcommerce.com/s/article/File-Access-WebDAV)**
20 changes: 2 additions & 18 deletions docs/b2b-edition/docs/buyer-portal/stencil.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -102,31 +102,15 @@ For the following steps, you must know in advance the URL where your build files
*When re-building and re-deploying your custom Buyer Portal, you should clear the local contents of `.turbo/cache` before running `yarn build` to ensure that all updated code is reflected in the build. Also make sure to update your scripts in Script Manager again after deploying your new build files.*
</Callout>

### Deploying with WebDAV

Your BigCommerce store’s [WebDAV storage](https://support.bigcommerce.com/s/article/File-Access-WebDAV) can be a viable option for serving your custom B2B Buyer Portal files without sourcing a third-party CDN.

Follow the instructions in the above support article to learn about enabling WebDAV and connecting with a client like Cyberduck. Once you’re connected, you can use your store’s WebDAV as the upload destination for the steps described in Building and Deploying.

The directory `content` should be used for static files of this nature. Let’s say you intend to upload the build files from `dist` into `content/b2b` on your store’s WebDAV. This will make your Buyer Portal files available at the following URL:

`https://{my-store}.com/content/b2b/`

The files can also be accessed via the store’s canonical URL, in this format:

`https://store-{store-hash}.mybigcommerce.com/content/b2b/`

Either of these should be used as the value of `VITE_ASSETS_ABSOLUTE_PATH` before running `yarn build`, and the same value should be utilized when updating the scripts in Script Manager.

### Versioning Strategy

As mentioned above, by default the build process includes a hash in the filename of several key files. If you’re hosting your build files on your store’s WebDAV, for example, the following would be an example of the final URL of such a file:
As mentioned above, by default the build process includes a hash in the filename of several key files. For example, the final URL of your index file may use this structure:

`https://{my-store}.com/content/b2b/index-{hash}.js`

This is a file-based strategy for avoiding stale cached files being served to shoppers. Upon a new build/deploy, you *must* make sure to update each file URL referenced in Script Manager each time you deploy new Buyer Portal build files.

Another strategy is to include a unique identifier in the *subdirectory* of your deployed location rather than in each individual filename. For example, say you configure `VITE_DISABLE_BUILD_HASH` to `TRUE` before building (resulting in filenames without a hash) and then upload the build files to a subdirectory of your store’s WebDAV that includes a date-based string. This could result in URLs like the following:
Another strategy is to include a unique identifier in the *subdirectory* of your deployed location rather than in each individual filename. For example, say you configure `VITE_DISABLE_BUILD_HASH` to `TRUE` before building (resulting in filenames without a hash) and then upload the build files to a subdirectory of your hosting provider that includes a date-based string. This could result in URLs like the following:

`https://{my-store}.com/content/b2b-20260101/index.js`

Expand Down
2 changes: 1 addition & 1 deletion docs/storefront/catalyst/experiments/buyer-portal.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ The Buyer Portal experience in your local Catalyst storefront will now automatic

Once you are ready to take your custom Buyer Portal to your production storefront, the Buyer Portal files must be built and deployed.

While the Buyer Portal static files can be deployed with a CDN or via your BigCommerce store’s WebDAV, the steps in this guide will assume you are deploying these build files with the Catalyst storefront itself.
While the Buyer Portal static files can be deployed with a CDN, the steps in this guide will assume you are deploying these build files with the Catalyst storefront itself.

<Callout type='info'>
These steps also assume a strategy for static file cache invalidation involving a date-based subdirectory. We’ll note where the process differs if you choose to use the Buyer Portal build hashes.
Expand Down
Loading