npm package: @spling-labs/spling-protocol
Description: The official Spling Labs spling protocol. Create your own solana on-chain dApp with this protocol.
Author: Spling Labs
Latest version: 1.0.9

<div align="center">
  <img src="https://raw.githubusercontent.com/spling-labs/social-protocol-react-native-template/main/assets/spling_header.jpg" />

  <h1>Spling Protocol</h1>
   <p>
    <a href="https://spling-labs.github.io/spling-protocol/"><img alt="Docs" src="https://img.shields.io/badge/docs-typedoc-blueviolet" /></a>
    <a href="https://www.npmjs.com/package/@spling-labs/spling-protocol"><img alt="Version" src="https://img.shields.io/npm/v/@spling-labs/spling-protocol"/></a>
    <a href="https://www.npmjs.com/package/@spling-labs/spling-protocol"><img alt="Downloads" src="https://img.shields.io/npm/dm/@spling-labs/spling-protocol"/><a>
    <img alt="License" src="https://img.shields.io/npm/l/@spling-labs/spling-protocol" />
 </p>
</div>

Spling Labs - Spling Protocol for building a solana on-chain dApp.

If you have any questions about the SDK, join our [Discord](https://discord.gg/7e3QN3Hy64) to get help!

## Quick Setup

### Install

Install these dependencies over:

npm:
```shell
npm install @spling-labs/spling-protocol
```

If you plan to install the package in your react.js or next.js project, keep in mind that you need to install this package with the --no-optiona flag:
```shell
npm install @spling-labs/spling-protocol --no-optional
```

### Setup (React Example)

```tsx
import React, { useEffect } from 'react'
import { SplingProtocol } from '@spling-labs/spling-protocol'
import { Keypair } from "@solana/web3.js";

export default function SplingProtocol() {
  useEffect(() => {
    ;(async () => {
      const wallet: Keypair = Keypair.generate()
      const options = { rpcUrl: "https://api.mainnet-beta.solana.com/" } as ProtocolOptions

      // Initialize the spling protocol
      const splingProtocol = await new SplingProtocol(wallet, options).init()

      // You can call now functions like:
      const issuer = await splingProtocol.createIssuer() 
    })()
  }, [wallet?.publicKey])
  return <div></div>
}
```

### Setup (React Native Example)

```tsx
import React, { useEffect } from 'react'
import { SplingProtocol } from '@spling-labs/spling-protocol'
import { Keypair } from "@solana/web3.js";

export default function SplingProtocol() {
  useEffect(() => {
    ;(async () => {
      const wallet: Keypair = Keypair.generate()
      const options = { rpcUrl: "https://api.mainnet-beta.solana.com/" } as ProtocolOptions

      // Initialize the spling protocol
      const splingProtocol = await new SplingProtocol(wallet, options).init()

      // You can call now functions like:
      const issuer = await splingProtocol.createIssuer() 
    })()
  }, [])
  
  return <View></View>;
}
```

### Setup (NodeJS Example)

```js
import { SplingProtocol } from '@spling-labs/spling-protocol'
const wallet: Keypair = Keypair.generate()
const options = { rpcUrl: "https://api.mainnet-beta.solana.com/" } as ProtocolOptions

// Initialize the spling protocol
const splingProtocol = await new SplingProtocol(wallet, options).init()

// You can call now functions like:
const issuer = await splingProtocol.createIssuer() 
```