Tokenize

What is Runner.js?

Runner.js is a browser-side JavaScript library used to tokenize and send sensitive payment information directly from a user’s browser, keeping your customers’ data secure and your software fully PCI-compliant. A single integration to Runner.js can be used to handle tokenization for all supported Payments API products in Run Developer.

If you’d like to tokenize a payment account without integrating to Runner.js, log in to your Run Merchant test account and navigate to the Developer menu where you will find a card tokenizer for your merchant account. Please reach out to your Integration Delivery lead if you require assistance.

Requirements:

Before you can tokenize an account using Runner.js, you must have:

  • public_key generated in Run Merchant or provided by your Integration Delivery Lead.

Usage

  1. Add the Runner.js script to your page by adding the tag to the header of your HTML file. version number is required as indicated in the slug below. Use latest for the most recent release.
1<script src=”https://javelin.runpayments.io/javascripts/<version>/runner.js”></script>

For example, if you are using version 1.1.4:

1<script src=”https://javelin.runpayments.io/javascripts/1.1.4/runner.js”></script>

Or you can use the latest value for version to always use the latest release:

1<script src=”https://javelin.runpayments.io/javascripts/latest/runner.js”></script>
As of 8/11/2025, the latest Runner.js version is 1.4.2. For more details, visit Runner.js Versions.
  1. Initialize Runner.js using your public_key.
1var runner = new Runner();
2 runner.init({
3 element: '#run-form',
4 publicKey: '<YOUR KEY>',
5 css: 'input%7Bwidth%3A200px%3B%7D',
6 tokenizeAutomatically: true,
7 inactivityto: 200,
8 useExpiry: true,
9 useCvv: true,
10 cardLabel: 'Your Test Card Label',
11 cvvLabel: 'Your Test CVV Label',
12 expiryLabel: 'Your Test Expiry Label'
13 });
For details on the parameters that can be passed, refer to the Runner.js page.
  1. (Optional) Subscribe to iframe loaded event:
1runner.onLoaded(function() {
2 console.log('loaded');
3 });
  1. Call the tokenize method to generate tokenized account information that has been entered into the Runner.js field. The resulting value may then be passed to the Payment API to enact payment processing activities. (Note: This action can be completed during form submission, if preferred.)
1runner.tokenize(res);

The function within the tokenize call will return the following data:

ParameterDescription
account_tokenThe payment account token returned from the iFrame
expiryExpiration date (Tokenized card only)
card_infoCard brand information (Tokenized card only)
bank_infoInstitution name (Tokenized ACH only)
risk_infoBank account Risk Score (Tokenized ACH only. Please inquire with your Integration Lead if you would like to receive this data.)
For examples of how to implement Runner.js, check out the Runner.js page.