Skip to main content
This article explains how to integrate Appcharge’s Frontend SDK into your app.

Step 1 | Install the SDK

In your app, install the SDK:

Step 2 | Import the checkout component

Add the following import statement to the component where you plan to trigger the checkout flow:
For JavaScript, add the following script tag in the <head> of your HTML file, before any application script that calls the SDK:
This component must only be rendered after a player performs an action that requires payment, for example, selects an offer in your web store.

Step 3 | Create a checkout session

When a player selects an offer in your web store, your backend calls the Create Checkout Session API to create a checkout session.

Localize your checkout prices

Include localized pricing in the priceDetails property so players see prices in their preferred currency. You can do this in one of two ways:
  • Pass your own localized price and currency directly in the request.
  • Retrieve localized prices on your backend using the Price Points API, then pass them in the request.
You can also use the Price Points API to localize prices displayed in your external web store, not only when creating a checkout session.
The API responds with the parsedUrl value, which is the checkout URL used in the next step.

Step 4 | Render and configure the checkout component

Once you receive the parsedUrl returned by your backend, you need to render the checkout component. This example shows a basic setup with minimal configuration, but your implementation may include any of the supported properties listed below:

Properties

The AppchargeCheckout component supports the properties below, and additional event properties to enable realtime analytics.

Complete example

You’ll typically trigger the Checkout after creating the checkout session: