1.4.49 • Published 11 months ago

subs-react v1.4.49

Weekly downloads
-
License
ISC
Repository
-
Last release
11 months ago

Subs Widget

Use Subs in your website has never been easier! Thanks to our React JS Package.

Installation

First, install the package:

yarn install subs-react

or

npm install subs-react

Usage

Now you just need to import and use our customizable button:

import { Subs } from 'subs-react';

const handleResponse = (response : {success:boolean, message: string}) => {
   console.log("This is what happened" , response);    
}

return(
<Subs address={"0x135B48F76870C2e0d5440dE8F5E7b7A6a7d52720"} 
        appId="40" 
        chain={"mumbai"} 
        color='red'
        width={200}
        defaultPayment='Premium'
        choice={["payment", "token"]}
        dataOnSubs={handleResponse} />
)

How it Works

Just widget without default payment

<Subs address={"0x135B48F76870C2e0d5440dE8F5E7b7A6a7d52720"} 
        appId="40" 
        chain={"mumbai"} 
        dataOnSubs={handleResponse} 
/>

Widget with default payment

<Subs address={"0x135B48F76870C2e0d5440dE8F5E7b7A6a7d52720"} 
        appId="40" 
        chain={"mumbai"} 
        defaultPayment='Premium'
        dataOnSubs={handleResponse} 
/>

Widget with default payment and preselected token

<Subs address={"0x135B48F76870C2e0d5440dE8F5E7b7A6a7d52720"} 
        appId="40" 
        chain={"mumbai"} 
        defaultPayment='Premium'
        choice={{
              payment: "Premium",
              token: "0x8e468E7Cbf7E7E056A7591C796F2dd4C5C255591"
        }}
        dataOnSubs={handleResponse} 
/>

Options

You can choose multiple ways to present your button:

  • address: Address of the owner of the App
  • appId: App ID
  • chain: Network of your subscription plan
  • color: Customize the color of your button
  • width: Width of the component
  • defaultPayment: Payment name, if you want to show a particular payment
  • choice: Payment name and token address, prechoose and only keep the Subscribe button
  • response: Informs you if a subscription is done successfully.

Popup

If the Popup doesn't show up, some parts of your CSS may cause some issues.

First view of the Popup

First, you need to accept our terms and conditions by checking the check box.

Approval Step

Users will need to approve an amount of token before the subscription. We will later debit the amount with TransferFrom calls periodically.

Sign to Subscribe

When the approval is done, all you need to do is sign to trigger the subscription process.

Error Message

If the user doesn't have enough funds in their wallet, the first debit won't work, and no one will be charged for this action.

Success

Congratulations! If the transaction is a success, users will be charged from now on. It is possible to get the result thanks to dataOnSubs, the function will return the status of the operation and a message if an error happens.

1.4.20

11 months ago

1.4.22

11 months ago

1.4.21

11 months ago

1.4.24

11 months ago

1.4.23

11 months ago

1.4.26

11 months ago

1.4.25

11 months ago

1.4.28

11 months ago

1.4.27

11 months ago

1.4.29

11 months ago

1.4.31

11 months ago

1.4.30

11 months ago

1.4.33

11 months ago

1.4.32

11 months ago

1.4.35

11 months ago

1.4.34

11 months ago

1.4.37

11 months ago

1.4.36

11 months ago

1.4.39

11 months ago

1.4.38

11 months ago

1.4.11

11 months ago

1.4.10

11 months ago

1.4.13

11 months ago

1.4.12

11 months ago

1.4.15

11 months ago

1.4.14

11 months ago

1.4.17

11 months ago

1.4.16

11 months ago

1.4.19

11 months ago

1.4.18

11 months ago

1.4.40

11 months ago

1.4.42

11 months ago

1.4.41

11 months ago

1.4.44

11 months ago

1.4.43

11 months ago

1.4.46

11 months ago

1.4.48

11 months ago

1.4.47

11 months ago

1.4.49

11 months ago

1.4.9

11 months ago

1.4.8

1 year ago

1.4.7

1 year ago

1.4.6

1 year ago

1.4.5

1 year ago

1.4.4

1 year ago

1.4.3

1 year ago

1.4.2

1 year ago

1.4.1

1 year ago

1.3.10

1 year ago

1.3.11

1 year ago

1.3.9

1 year ago

1.3.8

1 year ago

1.3.7

1 year ago

1.3.6

1 year ago

1.3.5

1 year ago

1.3.4

1 year ago

1.3.3

1 year ago

1.3.2

1 year ago

1.3.1

1 year ago

1.3.0

1 year ago

1.2.8

1 year ago

1.2.7

1 year ago

1.2.6

1 year ago

1.2.5

1 year ago

1.2.4

1 year ago

1.2.9

1 year ago

1.2.3

1 year ago

1.2.2

1 year ago

1.2.0

1 year ago

1.2.1

1 year ago

1.1.9

1 year ago

1.1.8

1 year ago

1.1.7

1 year ago

1.1.6

1 year ago

1.1.12

1 year ago

1.1.11

1 year ago

1.1.10

1 year ago

1.1.15

1 year ago

1.1.14

1 year ago

1.1.13

1 year ago

1.1.5

1 year ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.0.19

2 years ago

1.1.0

2 years ago

1.0.18

2 years ago

1.0.17

2 years ago

1.0.16

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.22

2 years ago

1.0.21

2 years ago

1.0.20

2 years ago

1.0.26

2 years ago

1.0.25

2 years ago

1.0.24

2 years ago

1.0.23

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.0

2 years ago

0.0.0

2 years ago