braintree-client-token
v1.0.0
Published
A lightweight utility package for generating Braintree client tokens in Shopify Hydrogen storefronts or any browser-based runtime environment.
Maintainers
Readme
Braintree Client Token Generation
A lightweight utility package for generating Braintree client tokens in Shopify Hydrogen storefronts or any browser-based runtime environment. This package solely focuses on securely generating the client token, which can then be used with the official braintree-web package to initialize payment flows.
Ideal for front-end applications that need to integrate Braintree without exposing sensitive credentials or server-side logic.
Install
npm install braintree-client-tokenUsage
import getBraintreeToken from "braintree-client-token";
const clientToken = getBraintreeToken(
env.BRAINTREE_PUBLIC_KEY,
env.BRAINTREE_PRIVATE_KEY,
env.BRAINTREE_MERCHANT_ACCOUNT_ID
);
// clientToken : string
