1.0.2 • Public • Published

Speed.js ES Module

Use Speed.js as an ES module.

Note: You must load Speed.js directly from https://js.tryspeed.com. You cannot include it in a bundle or host it yourself. This package is the same as the above link and wraps the global Speed object provided by the Speed.js script as an ES module.


Speed JS is an easy-to-use solution for businesses who want to start accepting crypto payments on their platform with a few lines of code.

Create a checkout session to collect payments. It is the easiest way to accept one-time payments with a custom-branded hosted payment page. Accepting cryptocurrency as a payment method will give you access to a whole new market of consumers who are a part of the community.


Use to install the Speed.js module:

npm install @speeddev/speed-js


yarn add @speeddev/speed-js


Import Speed.js

This function returns a newly created Speed object once speed.js is loaded. It takes the same parameters passed when directly initializing a Speed instance.

import { Speed } from "@speeddev/speed-js";

// Speed.js is not initiated until this is called
const speed = new Speed("pk_test_fdrdetxilogwetazubs");

We have placed a random API key in this example. Replace it with your actual publishable API keys to test this code through your Speed account.

For more information on how to use Speed.js, please refer to the Speed.js API reference or learn to accept a payment with Speed.

Manually include the script tag

Manually add the Speed.js script tag to the <head> on your site. When you call Speed with your publishable key, it will use the existing script tag.

<!-- Somewhere in your site's <head> -->
<script src="https://js.tryspeed.com"></script>

Once the script is loaded you can create an object of speed.js by passing a publishable key.

const speed = new Speed("pk_test_fdrdetxilogwetazubs");

Create Checkout Session

To create a checkout session you can call the function of speed.js to create a checkout session by passing a required parameter to it.

  currency: "INR",
  amount: 100,
  successUrl: "https://example.com",
  cancelUrl: "https://example.com",

Speed.js Documentation


npm i @speeddev/speed-js

DownloadsWeekly Downloads






Unpacked Size

15.9 kB

Total Files


Last publish


  • dev-sanyam
  • tryspeed