Socket
Socket
Sign inDemoInstall

@commercetools/checkout-browser-sdk

Package Overview
Dependencies
2
Maintainers
12
Versions
17
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @commercetools/checkout-browser-sdk

## Usage examples


Version published
Maintainers
12
Install size
345 kB
Created

Readme

Source

Commercetools Checkout Typescript SDK

Usage examples

Browser environment

<script src="https://unpkg.com/@commercetools/checkout-browser-sdk@latest/browser/sdk.js"></script>
<script>
  (function(w, d, s){
    if (w.ctc) {return;}
    var js, fjs = d.getElementsByTagName(s)[0];
    var q = [];
    w.ctc = w.ctc || function() { q.push(arguments); }
    w.ctc.q = q;
    js = d.createElement(s);
    js.type = 'text/javascript';
    js.async = true;
    js.src = 'https://cdn.checkout.europe-west1.gcp.commercetools.com/sdk.js';
    fjs.parentNode.insertBefore(js, fjs);
  }(window, document, 'script'));
  ctc('init', {
    checkoutConfig: {
      sellerId: '{sellerId}',
      applicationId: '{applicationId}',
      host: 'https://app.checkout.{region}.commercetools.com',
      callbackUrl: '{callbackUrl}',
      cartId: '{cartId}',
      accessToken: '{accessToken}',
      locale: '{locale}'
    }
  });
</script>

Node environment

import sdk from '@commercetools/checkout-browser-sdk';

sdk.init({
  checkoutConfig: {
    sellerId: '{sellerId}',
    applicationId: '{applicationId}',
    host: 'https://app.checkout.{region}.commercetools.com',
    callbackUrl: '{callbackUrl}',
    cartId: '{cartId}',
    accessToken: '{accessToken}',
    locale: '{locale}'
  }
  logInfo: true,
  logWarn: true,
  logError: true,
  onInfo: m => console.log('[Info]', m),
});

FAQs

Last updated on 18 Apr 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc