Use one of the following methods:
Install the @fordefi/web-sdk
package to your project:
# Using npm
npm install @fordefi/web-sdk
# Using Yarn
yarn add @fordefi/web-sdk
Add to your HTML <head>
section
<script src="https://apis.google.com/js/api.js"></script>
<script src="https://accounts.google.com/gsi/client"></script>
<!-- Option 1 - use an exact version - replace 1.3.3 with an sdk version -->
<script src="https://fordefi-sdk.s3.amazonaws.com/web-sdk@1.3.5/index.bundle.js"></script>
<!-- Option 2 - always use the latest version -->
<script src="https://fordefi-sdk.s3.amazonaws.com/web-sdk@latest/index.bundle.js"></script>
You must contact Fordefi to whitelist your domain for CORS access.
For local development or testing, you can alternatively run Chrome with CORS disabled using:
# choose any directory
mkdir -p /tmp/chrome-user-data
open -n -a /Applications/Google\ Chrome.app --args --user-data-dir=/tmp/chrome-user-data --disable-web-security