<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Gaurav Kumar on Medium]]></title>
        <description><![CDATA[Stories by Gaurav Kumar on Medium]]></description>
        <link>https://medium.com/@gaurav.gn90?source=rss-370173fc57f5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*-x72ILaj-9RukDTE.jpg</url>
            <title>Stories by Gaurav Kumar on Medium</title>
            <link>https://medium.com/@gaurav.gn90?source=rss-370173fc57f5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 04:22:07 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@gaurav.gn90/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Unlocking Feature: How to Call Third-Party APIs from Your BigCommerce Stencil Theme]]></title>
            <link>https://medium.com/@gaurav.gn90/unlocking-feature-how-to-call-third-party-apis-from-your-bigcommerce-stencil-theme-32a0f1fcd178?source=rss-370173fc57f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/32a0f1fcd178</guid>
            <category><![CDATA[bigcommerce-development]]></category>
            <category><![CDATA[bigcommerce]]></category>
            <category><![CDATA[bigcommerce-integration]]></category>
            <category><![CDATA[bigcommerce-developer]]></category>
            <category><![CDATA[third-party]]></category>
            <dc:creator><![CDATA[Gaurav Kumar]]></dc:creator>
            <pubDate>Mon, 26 Aug 2024 14:26:40 GMT</pubDate>
            <atom:updated>2024-08-27T05:36:35.558Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*mmF09DJ9bfPWAVd501QUHg.png" /></figure><h3><strong>Prerequisite</strong></h3><p>Set up a custom app with BigCommerce, we are not going into details to set up a custom app. If you want to set up a custom app with BigCommerce refer to documentation and GitHub code. Also, we are using a cornerstone theme for frontend (stencil)</p><p><a href="https://developer.bigcommerce.com/docs/integrations/apps/quick-start">https://developer.bigcommerce.com/docs/integrations/apps/quick-start</a></p><p><a href="https://devtools.bigcommerce.com/">Developer Portal Account(opens in a new tab)</a> (required to register apps)</p><p><a href="https://github.com/bigcommerce/sample-app-nodejs">https://github.com/bigcommerce/sample-app-nodejs</a></p><p>Once you have created a Single Click app from <a href="https://devtools.bigcommerce.com/my/apps">Developer Tools</a> then download the CLIENT_SECRET and CLIENT_ID.</p><p>Assuming you have set the application which is up and running</p><p>Since In this article, we are using Next Js so we will be doing the rest of the code in NextJs only</p><blockquote><strong>STEP — 1</strong></blockquote><p>Go to the BigCommerce Script Manager of your selected channel and enter the below code. This is just a javascript object added in the window object, you can give any name for the Client ID and URL.</p><p>Here, the Client ID will be the same as the custom app client ID, and the URL will be your hosted app&#39;s public URL.</p><pre><br>&lt;script&gt;<br>window.custom_app = {<br> oc_demo : {<br>   setting: {<br>    oc_demo_client_id: &quot;&lt;your-custom-app-client-id&gt;&quot;,<br>       oc_demo_url: &quot;https://tidy-cloths-sit.loca.lt&quot;<br>   }<br> }<br>}<br>&lt;/script&gt;<br><br>&lt;!-- Get current customer JWT token using app_client_id --&gt;<br>{{#if customer}}<br>    &lt;script&gt;<br>        const app_client_id = window.custom_app.oc_demo.setting.oc_demo_client_id;<br>        const app_url = window.custom_app.oc_demo.setting.oc_demo_url;<br>        const customerJWT = (apiAccountClientId) =&gt; {<br>            let resource = `/customer/current.jwt?app_client_id=${apiAccountClientId}`;<br>            return fetch(resource)<br>                .then(response =&gt; {<br>                    if(response.status === 200) {<br>                        return response.text();<br>                    } else {<br>                        return new Error(`response.status is ${response.status}`);<br>                    }<br>                })<br>                .then(jwt =&gt; {<br>                    console.log(jwt); // JWT here<br>                    // call your API with JWT<br>                    fetch(`${app_url}/api/test`, {<br>                        method: &#39;POST&#39;,<br>                        headers: {<br>                            &#39;Content-Type&#39;: &#39;application/json&#39;<br>                        },<br>                        body: JSON.stringify({token: jwt})<br>                    })<br><br>                })<br>            .catch(error =&gt; console.error(error));<br>        }<br>        customerJWT(app_client_id);<br>    &lt;/script&gt;<br>{{/if}}<br><br></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y8YcVXrSwZ7DcqMgQaag-g.png" /><figcaption>PART — 1</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_ynG1e0FD8ksoNJx1mDNCw.png" /><figcaption>Part — 2</figcaption></figure><p>You can add the above script to the <strong>base.html </strong>file for local development purposes.</p><blockquote><strong>STEP — 2</strong></blockquote><p>Now login from the stencil theme and open the browser’s dev tools you will see an Ajax call will appear in the network tab</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/965/1*r-aXagMACj8LmoK89lal0Q.png" /></figure><p>In the above screenshot, we can see a network call is going to our custom app server <strong>/api/test</strong></p><blockquote><strong>STEP — 3</strong></blockquote><p>Now Let’s set Authorization in our custom app</p><p>Go to <strong>lib/auth.ts</strong> file in the custom app (Already available in sample next js app)</p><p>Add the below code as a library function for your JWT token created using the above code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WYoeP-J0wQVUhRrmUrRXVg.png" /></figure><pre><br>export function decodeJwtToken(jwtToken: string) {<br>    try {<br>        const secret = CLIENT_SECRET;<br>        // Decode the JWT token<br>        const signedData = jwt.verify(jwtToken, secret, {<br>            algorithms: [&#39;HS256&#39;, &#39;HS384&#39;, &#39;HS512&#39;, &#39;RS256&#39;],<br>        });<br>        <br>        return signedData;<br>    } catch (error) {<br>        console.error(&#39;Error decoding JWT token:&#39;, error);<br>        throw error;<br>    }<br>}</pre><blockquote><strong>STEP — 4</strong></blockquote><p>Go to the <strong><em>.env </em></strong>file and add the below environment variable</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/415/1*odTA3HKP4iGSJ2VaAU19cw.png" /></figure><pre>ALLOWED_ORIGIN=&quot;&lt;your-app-public-url&gt;&quot;</pre><blockquote><strong>STEP — 5</strong></blockquote><p>In our custom application install <strong>Cors</strong> library from the terminal</p><pre>npm install cors --save</pre><blockquote><strong>STEP — 6</strong></blockquote><p>Now create a <strong><em>middleware</em></strong> folder under lib and create a new typescript file called <strong><em>cors.ts</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/328/1*HqscsB6E8LaWYDwp7L4GYg.png" /></figure><p>Add the below code in the <strong><em>cors.ts</em></strong> file. We can use this middleware in our other API endpoints.</p><pre>import Cors from &#39;cors&#39;;<br>import { NextApiRequest, NextApiResponse } from &#39;next&#39;;<br><br>// Initialize the CORS middleware<br>const cors = Cors({<br>  methods: [&#39;GET&#39;, &#39;HEAD&#39;, &#39;POST&#39;, &#39;OPTIONS&#39;], // Allowed methods<br>  origin: process.env.ALLOWED_ORIGIN,  // Replace with your allowed origin<br>  credentials: true,                // Enable cookies and other credentials<br>});<br><br>// Helper method to wait for a middleware to execute before continuing<br>function runMiddleware(req: NextApiRequest, res: NextApiResponse, fn: any) {<br>  return new Promise((resolve, reject) =&gt; {<br>    fn(req, res, (result: any) =&gt; {<br>      if (result instanceof Error) {<br>        return reject(result);<br>      }<br><br>      return resolve(result);<br>    });<br>  });<br>}<br><br>export default async function applyCors(req: NextApiRequest, res: NextApiResponse, next: () =&gt; void) {<br>  await runMiddleware(req, res, cors);<br>  next();<br>}</pre><blockquote><strong>STEP — 7</strong></blockquote><p>Create a new API called <strong><em>test.ts </em></strong>in <strong>pages/api/ </strong>and add the below code in the <strong>test.ts </strong>file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dsWM74N_Qw2wMrWlcTaa5A.png" /></figure><pre>import { NextApiRequest, NextApiResponse } from &#39;next&#39;;<br>import { decodeJwtToken } from &#39;@lib/auth&#39;;<br>import applyCors from &#39;@lib/middleware/cors&#39;;<br>//import { bigcommerceClient } from &#39;../../lib/auth&#39;;<br>export default async function handler(req: NextApiRequest, res: NextApiResponse) {<br>    await applyCors(req, res, () =&gt; null);<br>    const {<br>        body : {token},<br>        method,<br>    } = req;<br>    <br>    if (method === &#39;POST&#39;) {<br>        const decodedPayload = decodeJwtToken(token);<br>        res.status(200).json({ message: decodedPayload});<br>    } else {<br>        res.setHeader(&#39;Allow&#39;, [&#39;POST&#39;]);<br>        res.status(405).end(`Method ${method} Not Allowed`);<br>    }<br><br>}</pre><blockquote><strong>STEP — 8</strong></blockquote><p>Restart your app using the below command</p><pre>npm run dev</pre><blockquote><strong>STEP — 9</strong></blockquote><p>Now refresh the stencil theme page, you will see the JSON response of the decoded payload</p><p>Here CLIENT_SECRET is used to decrypt the JWT token, if we use a different client secret value then we will not be able to decode the JWT token and will get the error/exception.</p><blockquote><strong>STEP — 10</strong></blockquote><p>Once we have the decoded value then we can assure that it is a valid token and can proceed further.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/959/1*kWp47v9_mtCfV4PWt__4Eg.png" /></figure><p>In the above example, we are just returning the decoded value of the token, but in production, we are not going to return the decoded values. This is just for the demo purpose.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=32a0f1fcd178" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unlocking Feature: Bigcommerce Custom B2B Buyer Portal With Stencil For Local And Production…]]></title>
            <link>https://medium.com/@gaurav.gn90/bigcommerce-custom-b2b-buyer-portal-with-stencil-for-local-and-production-development-452cc898ed57?source=rss-370173fc57f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/452cc898ed57</guid>
            <category><![CDATA[b2b]]></category>
            <category><![CDATA[bigcommerce-development]]></category>
            <category><![CDATA[bigcommerce]]></category>
            <category><![CDATA[bigcommerce-integration]]></category>
            <dc:creator><![CDATA[Gaurav Kumar]]></dc:creator>
            <pubDate>Thu, 15 Aug 2024 10:33:49 GMT</pubDate>
            <atom:updated>2024-08-27T05:32:17.005Z</atom:updated>
            <content:encoded><![CDATA[<h3>Unlocking Feature: Bigcommerce Custom B2B Buyer Portal With Stencil For Local And Production Development</h3><p>The BigCommerce B2B Buyer Portal is a powerful tool that enables businesses to provide a seamless shopping experience tailored to their B2B customers. Whether you are a developer looking to set up a local development environment or preparing for production deployment, this guide will walk you through the essential steps to get your BigCommerce B2B Buyer Portal up and running.</p><figure><img alt="Big Commerce B2B Buyer Portal" src="https://cdn-images-1.medium.com/max/1024/1*SWIm0duAPc1VqMdOQtEwtg.jpeg" /></figure><blockquote><strong>Introduction to BigCommerce B2B Buyer Portal</strong></blockquote><p>The BigCommerce B2B Buyer Portal is designed for companies that sell to other businesses, offering features like custom pricing, customer-specific catalogs, and account management. It’s essential to any B2B eCommerce strategy, allowing companies to manage complex sales processes online.</p><blockquote><strong>Prerequisites</strong></blockquote><p>Before you begin, ensure you have the following:</p><ul><li>A BigCommerce account with API access.</li><li>Access to the BigCommerce Control Panel.</li><li>A local development environment (e.g., Node.js, npm/yarn).</li><li>Basic knowledge of JavaScript, HTML, and CSS.</li><li>A text editor or IDE like Visual Studio Code.</li></ul><blockquote><strong>Local Development Setup</strong></blockquote><p>Git clone the Big Commerce B2B Buyer portal</p><p><a href="https://github.com/bigcommerce/b2b-buyer-portal">https://github.com/bigcommerce/b2b-buyer-portal</a></p><p><a href="https://github.com/bigcommerce/b2b-buyer-portal">GitHub - bigcommerce/b2b-buyer-portal: B2B Buyer Portal - BigCommerce B2B Edition</a></p><p>Go to the <em>b2b-buyer-portal </em>directory</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/539/1*5qtyPpX4jZ7Ic7y7n6kKyg.png" /></figure><p>Install <em>yarn</em> if not installed in your local system</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/462/1*uvKOJRrCO6R8h_2lVVSn0A.png" /></figure><p>Run <em>yarn</em> to install dependencies</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/431/1*pxs9wn5eAxqQnjOjpFIr_Q.png" /></figure><p>Copy <strong><em>.env-example</em></strong> to <strong><em>.env</em></strong> file located in<strong> <em>apps/storefront</em></strong> folder</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/789/1*b2xkpkxd_hBj2A9RnUWMaA.png" /></figure><p>For local development keep <em>.env</em> environment variables as it is except <em>VITE_LOCAL_DEBUG; </em>set it’s value to<em> TRUE</em></p><pre>VITE_B2B_URL=https://api-b2b.bigcommerce.com<br>VITE_B2B_SOCKET_URL=https://api-b2b.bigcommerce.com<br>VITE_TRANSLATION_SERVICE_URL=https://api-b2b.bigcommerce.com<br>VITE_CATPCHA_SETKEY=captcha_setkey<br>VITE_B2B_CLIENT_ID=dl7c39mdpul6hyc489yk0vzxl6jesyx<br>VITE_LOCAL_DEBUG=TRUE<br>VITE_LOCAL_GRAPHQL_ORIGIN=https://api-b2b.bigcommerce.com<br>VITE_ASSETS_ABSOLUTE_PATH=&#39;&#39;</pre><p>Run <strong><em>yarn dev</em></strong> command</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*zi1LbYzdYd6pcxdu2RYuLw.png" /></figure><p>For me, it was running on port <strong>3001 </strong>if port <strong>3001</strong> will be occupied by any other program then an incremental port number will be assigned by itself.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/976/1*da_GMvvtz8ByPCOOywxvjw.png" /></figure><p>Now go to stencil cornerstone theme codebase</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/751/1*puS7GMnbdYcUl7pDJPpwbQ.png" /></figure><p>Open the code base in your code editor, for example, I have used Visual Code here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/471/1*pv4LKJwO5_gQGEz315ws2w.png" /></figure><p>open base.html file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/813/1*TF_sOX7reOGMAPGexeHwaQ.png" /></figure><p>Add the below piece of code just before <em>&lt;/head&gt; </em>section</p><pre><br>&lt;script&gt;<br>    {{#if customer.id}}<br>    {{#contains page_type &quot;account&quot;}}<br>    var b2bHideBodyStyle = document.createElement(&#39;style&#39;);<br>    b2bHideBodyStyle.id = &#39;b2b-account-page-hide-body&#39;;<br>    b2bHideBodyStyle.innerHTML = &#39;body { display: none !important }&#39;;<br>    document.head.appendChild(b2bHideBodyStyle);<br>    {{/contains}}<br>    {{/if}}<br>&lt;/script&gt;<br>&lt;script type=&quot;module&quot;&gt;<br>    import RefreshRuntime from &#39;http://localhost:3001/@react-refresh&#39;<br>    RefreshRuntime.injectIntoGlobalHook(window)<br>    window.$RefreshReg$ = () =&gt; {}<br>    window.$RefreshSig$ = () =&gt; (type) =&gt; type<br>    window.__vite_plugin_react_preamble_installed__ = true<br>&lt;/script&gt;<br>&lt;script type=&quot;module&quot; src=&quot;http://localhost:3001/@vite/client&quot;&gt;&lt;/script&gt;<br><br></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/886/1*zhhyk5Nqv8nEm7j_k7X25g.png" /></figure><p>Add below piece of code at the end of the file</p><pre>&lt;script type=&quot;module&quot; src=&quot;http://localhost:3001/src/main.ts&quot;&gt;&lt;/script&gt;<br>&lt;script&gt;<br>  window.B3 = {<br>    setting: {<br>      store_hash: &#39;{{settings.store_hash}}&#39;,<br>      channel_id: {{settings.channel_id}},<br>      platform: &#39;bigcommerce&#39;, // override this depending on your store channel platform: https://developer.bigcommerce.com/docs/rest-management/channels#platform<br>    },<br>  }<br>&lt;/script&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pj9tZEmjubkb-6IeAEovXw.png" /></figure><p>Now run <em>stencil start — verbose. </em>The stencil must be running successfully at port <strong>3009</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mWtB46DZxjPO-iSghWMCtQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/821/1*3gZAZazlC8iSxXHAMRfIsg.png" /></figure><p>Now your stencil is up and running and B2B buyer portal is also running</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*JBIGACzQPtg76UHJL9VsRQ.png" /><figcaption>B2B Buyer Portal</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/821/1*3gZAZazlC8iSxXHAMRfIsg.png" /><figcaption>Stencil Cornerstone Theme</figcaption></figure><p>Click on Sign In below page must appear</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cfRBKFCb4P14nF8a54KfJQ.png" /></figure><p>Login with buyer credentials you must be able to see the buyer portal below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8nrgO59r1drvTg3uzjAO3Q.png" /></figure><p>So far we have seen how to configure the B2B Buyer portal in a local system. Now let&#39;s configure the Production</p><blockquote><strong>Production Setup</strong></blockquote><p>I am using Azure blob storage containers to deploy the production build files. To set up Azure Blob Storage Containers refer to below article</p><p><a href="https://learn.microsoft.com/en-us/azure/storage/common/storage-account-create?tabs=azure-portal">https://learn.microsoft.com/en-us/azure/storage/common/storage-account-create?tabs=azure-portal</a></p><p>You can choose any storage service of any Cloud service like AWS, GCP, or Firebase.</p><p>Now Update the below ENV in the .env file</p><pre>VITE_ASSETS_ABSOLUTE_PATH=&#39;https://&lt;your-storage-account&gt;.blob.core.windows.net/&lt;container-name&gt;/assets/&#39;</pre><p>For production setup you need a host for that I have used Azure blob storage where I have pushed all my javascript files and used in production as well as local development</p><p>Go to <em>b2b-buyer-portal</em> folder and run <em>yarn build</em> command</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/717/1*_VkeUz7Kkwen1rUQOKyjTQ.png" /></figure><p>Once you run this command then you will see the following folder structure and files under <strong>apps/storefront</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/529/1*HV1NAaeVKJ9yhZxCVTxvhA.png" /></figure><p>Upload the contents of the dist folder in the Azure blob container as follows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*wtQOT4aO4SBhTdMNkrINwg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wZec9O8alkNQxJUaQbwMUg.png" /></figure><p>The absolute path must be in the following pattern</p><pre>https://&lt;your-storage-name&gt;.blob.core.windows.net/&lt;container-name&gt;/index-legacy.Db0LMXVB.js</pre><p>Now to verify these js files are working in your localhost follow the below steps</p><p>Open the base.html file for which we have done the local development configuration.</p><p>Now undo those changes and follow the below steps</p><p>Copy and Paste below code just before the &lt;/head&gt; section in the base.html file</p><pre>  &lt;script&gt;<br>    var b2bHideBodyStyle = document.createElement(&#39;style&#39;);<br>    b2bHideBodyStyle.id = &#39;b2b-account-page-hide-body&#39;;<br>    {{#if customer.id}}<br>      {{#contains page_type &quot;account&quot;}}<br>      b2bHideBodyStyle.innerHTML = &#39;body { display: none !important }&#39;;<br>      document.head.appendChild(b2bHideBodyStyle);<br>      {{/contains}}<br>    {{/if}}<br>  <br>    {{#if page_type &quot;login&quot;}}<br>      b2bHideBodyStyle.innerHTML = &#39;body { display: none !important }&#39;;<br>      document.head.appendChild(b2bHideBodyStyle);<br>    {{/if}}<br>  <br>    const removeCart = () =&gt; {<br>      const style = document.createElement(&#39;style&#39;);<br>      style.type = &#39;text/css&#39;;   <br>      style.id = &#39;b2bPermissions-cartElement-id&#39; <br>      style.innerHTML=&#39;[href=&quot;/cart.php&quot;], #form-action-addToCart, [data-button-type=&quot;add-cart&quot;], .button--cardAdd, .card-figcaption-button, [data-emthemesmodez-cart-item-add], .add-to-cart-button { display: none !important }&#39;<br>      document.getElementsByTagName(&#39;head&#39;).item(0).appendChild(style);<br>    }<br>    removeCart()<br>  &lt;/script&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1gPtn0pc4H3B__Ub0LcQPg.png" /></figure><p>And</p><p>Copy -Paste the below code at the last of the file and update</p><p>&lt;YOUR-B2B-CLIENT-ID&gt; with your b2b client id</p><pre>&lt;script&gt;<br>  window.b3CheckoutConfig = {<br>    routes: {<br>      dashboard: &#39;/account.php?action=order_status&#39;,<br>    },<br>  }<br>  window.B3 = {<br>    setting: {<br>      store_hash: &quot;{{settings.store_hash}}&quot;,<br>      channel_id: 1,<br>      platform: &quot;bigcommerce&quot;,<br>      b2b_client_id:&quot;&lt;YOUR-B2B-CLIENT-ID&gt;&quot;,<br>      b2b_url: &#39;https://api.bundleb2b.net&#39;,<br>      captcha_setkey: &#39;6LdGN_sgAAAAAGYFg1lmVoakQ8QXxbhWqZ1GpYaJ&#39;,<br>    },<br>    &#39;dom.checkoutRegisterParentElement&#39;: &#39;#checkout-app&#39;,<br>    &#39;dom.registerElement&#39;:<br>      &#39;[href^=&quot;/login.php&quot;], #checkout-customer-login, [href=&quot;/login.php&quot;] .navUser-item-loginLabel, #checkout-customer-returning .form-legend-container [href=&quot;#&quot;]&#39;,<br>    &#39;dom.openB3Checkout&#39;: &#39;checkout-customer-continue&#39;,<br>    &#39;before_login_goto_page&#39;: &#39;/account.php?action=order_status&#39;,<br>    &#39;checkout_super_clear_session&#39;: &#39;true&#39;,<br>    &#39;dom.navUserLoginElement&#39;: &#39;.navUser-item.navUser-item--account&#39;,<br>  }<br>&lt;/script&gt;<br>&lt;script<br>  type=&quot;module&quot;<br>  crossorigin<br>  src=&quot;https://&lt;your-storage-name&gt;.blob.core.windows.net/&lt;conatiner-name&gt;/index.o7-Xyns9.js&quot;<br>&gt;&lt;/script&gt;<br>&lt;script<br>  nomodule<br>  crossorigin<br>  src=&quot;https://&lt;your-storage-name&gt;.blob.core.windows.net/&lt;conatiner-name&gt;/polyfills-legacy.CXJzAxq-.js&quot;<br>&gt;&lt;/script&gt;<br>&lt;script<br>  nomodule<br>  crossorigin<br>  src=&quot;https://&lt;your-storage-name&gt;.blob.core.windows.net/&lt;conatiner-name&gt;/index-legacy.Db0LMXVB.js&quot;<br>&gt;&lt;/script&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*snSWCKWlCL7FPukBHK0YUA.png" /></figure><p>Now using the above header and footer code we can use the prod b2b buyer portal in our localhost</p><p>The above scripts are almost the same as what we see in the B2B control panel once the B2B edition is configured only URLs can be different.</p><p><strong><em>Note: </em></strong><em>Since I used Azure cloud storage, you can choose any hosting platform or storage service that suits your needs. We can also configure these storage files and folders with a CDN to optimize performance on the client side.</em></p><blockquote><strong>Conclusion</strong></blockquote><p>Developing and deploying the BigCommerce B2B Buyer Portal is a straightforward process that allows businesses to offer a tailored eCommerce experience to their B2B customers. By following this guide, you can ensure that your portal is set up correctly in both local and production environments, paving the way for successful online sales and customer satisfaction.</p><p>I have tried to cover every step that will be required to set up B2B Buyer Portal for local and Prod Development. In my next article, I will share how to deploy the dist folder to the Azure Storage blob via an automation process.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=452cc898ed57" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>