# supersub

> Supersub JS Sdk

Latest version **0.0.34** (published 2024-06-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install supersub
pnpm add supersub
yarn add supersub
bun add supersub
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; large bundle; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.34 |
| Published | 2024-06-03 |
| First published | 2024-06-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 19 |
| Unpacked size | 13.6 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Kester Atakere |
| Maintainers | alphaglitch |
| Keywords | supersub, sdk, subscription, subscription management, payment, recurrent payment |

## Links

- npm: https://www.npmjs.com/package/supersub
- Repository: https://github.com/codergon/supersub-sdk
- Homepage: https://github.com/codergon/supersub-sdk#readme
- Issues: https://github.com/codergon/supersub-sdk/issues
- npm.io page: https://npm.io/package/supersub

## Dependencies (19)

- [viem](https://npm.io/package/viem.md) 2.8.6
- [react](https://npm.io/package/react.md) ^18.2.0
- [wagmi](https://npm.io/package/wagmi.md) latest
- [ethers](https://npm.io/package/ethers.md) ^6.12.2
- [rollup](https://npm.io/package/rollup.md) ^3.25.1
- [sonner](https://npm.io/package/sonner.md) ^1.4.41
- [react-dom](https://npm.io/package/react-dom.md) ^18.2.0
- [typescript](https://npm.io/package/typescript.md) ^5.1.3
- [@types/node](https://npm.io/package/@types/node.md) ^20.3.0
- [react-modal](https://npm.io/package/react-modal.md) ^3.16.1
- [@types/react](https://npm.io/package/@types/react.md) ^18.2.11
- [react-spinners](https://npm.io/package/react-spinners.md) ^0.13.8
- [@privy-io/wagmi](https://npm.io/package/@privy-io/wagmi.md) ^0.2.4
- [@alchemy/aa-core](https://npm.io/package/@alchemy/aa-core.md) ^3.12.3
- [@alchemy/aa-alchemy](https://npm.io/package/@alchemy/aa-alchemy.md) 3.13.0
- [@alchemy/aa-accounts](https://npm.io/package/@alchemy/aa-accounts.md) 3.13.0
- [@privy-io/react-auth](https://npm.io/package/@privy-io/react-auth.md) ^1.64.0
- [@phosphor-icons/react](https://npm.io/package/@phosphor-icons/react.md) ^2.1.5
- [@tanstack/react-query](https://npm.io/package/@tanstack/react-query.md) ^5.28.14

## Recent versions

- 0.0.34 (latest) — 2024-06-03
- 0.0.33 — 2024-06-03
- 0.0.32 — 2024-06-03
- 0.0.3 — 2024-06-03
- 0.0.2 — 2024-06-03
- 0.0.1 — 2024-06-03

## README

# Supersub SDK

Welcome to the Supersub SDK documentation. Supersub is a cross-chain crypto subscription platform powered by Alchemy's account abstraction infrastructure and Chainlink's Cross-Chain Interoperability Protocol. This SDK allows you to seamlessly integrate crypto-based subscriptions into your React applications.

## Demo

![Demo](shot.png?raw=true "Demo Image")

## Installation

Install the Supersub SDK using npm:

```bash
npm install supersub
```

Or using yarn:

```bash
yarn add supersub
```

## Setup

To integrate the Supersub SDK into your React application, follow these steps:

### 1. Wrap your application with `SuperSubProvider`

In your main entry file (usually `index.tsx`), import and set up the `SuperSubProvider` around your application component. This enables all child components to access the Supersub functionality via React context.

```tsx
import React from "react";
import ReactDOM from "react-dom/client";
import App from "./App";
import "./index.css";
import { SuperSubProvider } from "supersub";

const root = ReactDOM.createRoot(document.getElementById("root")!);
root.render(
  <React.StrictMode>
    <SuperSubProvider>
      <App />
    </SuperSubProvider>
  </React.StrictMode>
);
```

### 2. Use the `useSuperSub` hook

In your components, utilize the `useSuperSub` hook to access the `openSubscription` method. This method triggers the subscription process.

```tsx
import { useSuperMeta } from "supersub";

function App() {
  const { openSubscription } = useSuperSub();

  return (
    <>
      <h1>Supersub Subscription Demo</h1>
      <div className="card">
        <button
          onClick={() =>
            openSubscription({
              productId: 10,
              defaultPlanId: 13,
              apiKey: "pk_your_api_key_here",
            })
          }
        >
          Pay with Supersub
        </button>
      </div>
    </>
  );
}

export default App;
```

## Configuration

Replace the `apiKey`, `productId`, and `defaultPlanId` with your actual product and plan identifiers and your Supersub API key to configure the subscription settings.

## Contributing

1. Fork it!
2. Create your feature branch: `git checkout -b feature-name`
3. Commit your changes: `git commit -am 'Your commit message'`
4. Push to the branch: `git push origin feature-name`
5. Submit a pull request

## Show Your Support

Love using Supersub? You can show your support by starring the [repo](https://github.com/codergon/Supersub).

Don't forget to [follow me on twitter](https://twitter.com/thealpha_knight).

Thanks! - Kester A.

## License

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details

---

Thank you for choosing Supersub ✨

---
_Source: https://npm.io/package/supersub · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
