Skip to main content
Hyperline provides built-in React components to:
  • Display a customer’s subscriptions
  • Preview and update the payment method
  • List and download invoices
  • List and update billing information
This doc assumes that you already have a basic working knowledge of React and that you have already set up a React project.

Getting started

1

Install the dependency

First install the @hyperline/react-components NPM package.
Install the package
2

Create an auth token

To allow a customer to see their Hyperline data, you need to generate a unique authentication token on your server side. You can use our API and the create auth token endpoint for this.
cURL
3

Integrate the React components

Then, integrate the React components. You will most likely generate a new token every time your customer accesses the page.

Components

Subscriptions

List all active subscriptions

Subscription

Display a subscription by ID

InvoicesList

List and download all invoices and refunds

PaymentMethod

Display the current payment method, delete it if allowed, or add a new payment method

CustomerBillingInfoForm

Display a form with all billing info, with an optional callback when the form has been successfully saved.

Component options

When using the components, you will need to provide an options prop with the following parameters:
NameDescriptionTypeDefault valueRequired
tokenThe token specific to your customerstring☑️
modeWhich Hyperline environment are you usingproduction | sandboxproduction
appearanceCustomise the appearance of the componentObject

Appearance

You can change the colors and fonts of the component.

Variables

They are meant to customise all elements at once.
Variable nameDescription
borderRadiusChange the roundness of the elements: Buttons, tables, …
colorBackgroundMost elements have a transparent background. In other cases, you can customise the background color of the element
colorPrimaryColor used for buttons and accent text
colorPrimaryHoverHover color for buttons
colorPrimaryDisabledColor of disabled buttons
colorBorderThe color of all our regular borders
colorTextDefault text color
colorTextSecondaryText color of secondary text
fontFamilyFont used. If you need to import a font, please read the next section

Fonts

Set your application’s font.
  • src Url of the font file
  • family Name of the font - this is the name you’ll use for the fontFamily variable