Basic installation of Subscription-now.js is a very straightforward procedure. It involves two steps:
- Obtain your token
- Add the snippet with the token to your application
- Add the style link to your head tags
The token is a base64 encoded JSON array that has three items that can be obtained from Subscription-now Dashboard or generated if you know the following information and have basic programming knowledge.
- The ID of the app that you created Subscription-now Dashboard
- The target Subscription-now server URL
- Environment type (either
An example object looks like this:
["9dfbab59-da71-48b0-92fa-aa8a74a0c623", "https://api.subscription-now.com", "sandbox"]
When this object is stringified and base64 encoded, it will look something like this:
Adding the Snippets to Your Application
And the most basic example of the SN.js snippet can be seen below:
<script src="https://cdn.sn-nw.net/subscription-now.latest.js" id="snJS" data-sn-credentials="WyI5ZGZiYWI1OS1kYTcxLTQ4YjAtOTJmYS1hYThhNzRhMGM2MjMiLCJodHRwczovL2FwaS5zdWJzY3JpcHRpb24tbm93LmNvbSIsInNhbmRib3giXQ==" defer></script>
When you add this snippet at the end of your
<body></body> tag, Subscription-now elements will be generated.
Finally just add the following snippet between the
<head></head> tags of your application:
<link href="https://cdn.sn-nw.net/subscription-now.latest.css" rel="stylesheet">
Great, you are ready to sell subscriptions!