This package allows you to import Payrex.js as a CommonJS module or ES module.
- Node.js: v12.16
Use npm
to install this module:
npm install payrex-js --save-dev
loadPayrex
This is a function that returns a Promise that resolves with an instance of Payrex resource once Payrex.js has loaded. This method must be called from the client-side and not from the server-side. You should also pass your PayRex Public API key to complete the initialization.
import { loadPayrex } from 'payrex-js';
const payrex = await loadPayrex('pk_test_...');
NOTE: Replace the PayRex public API key with your own. You can get your own API keys via PayRex Dashboard. If you don't have a PayRex account, create one first.
As of this writing, we don't have yet the types
for this package. We will update our readme once it is available.