Skip to main content


Affirm Merchant Help

Update Affirm.js to point to production

To update Affirm.js to point to our live environment from sandbox environment, locate the _affirm_config reference in your existing page templates:

<!-- Affirm -->
 _affirm_config = {
   public_api_key:  "YOUR_PUBLIC_KEY",
   script:          ""
 (function(l,g,m,e,a,f,b){var d,c=l[m]||{},h=document.createElement(f),n=document.getElementsByTagName(f)[0],k=function(a,b,c){return function(){a[b]._.push([c,arguments])}};c[e]=k(c,e,"set");d=c[e];c[a]={};c[a]._=[];d._=[];c[a][b]=k(c,a,b);a=0;for(b="set add save post open empty reset on off trigger ready setProduct".split(" ");a<b.length;a++)d[b[a]]=k(c,e,b[a]);a=0;for(b=["get","token","url","items"];a<b.length;a++)d[b[a]]=function(){};h.async=!0;h.src=g[f];n.parentNode.insertBefore(h,n);delete g[f];d(g);l[m]=c})(window,_affirm_config,"affirm","checkout","ui","script","ready");
// Use your live public API Key and script to point to Affirm production environment.
<!-- End Affirm -->

Update the script parameter in the Affirm.js embed code to point to our live environment at and replace the public_api_key parameter with your live public API key found at

After you’ve connected to our live environment, you’re ready to deploy to your production environment.