SimpleTech Labs
WebsiteConsoleAPITwitterTelegram ChannelTelagram Chat
SimplePay
SimplePay
  • Introduction
    • Overview
    • Core concepts
      • Transparency
      • Non-Custodial
      • Direct payments
      • Lowest Fees
    • Protocol
    • Security
      • Collected data
  • GETTING STARTED
    • Create an App
    • Setup Client
      • Widget
    • Setup Server
      • Webhooks
    • No-Code
      • Web and Telegram Store
  • Javascript SDK
    • Introduction
    • Services
      • Cryptocurrency
      • Currency
      • Invoice
  • Components
    • Payment Widget
  • Simple ID
    • Auth.js integration Guide
  • API Documentation
    • Overview
    • Apps
      • Get App Info
      • Dev Mode
    • Wallets
    • Assets
      • Fiat Currency
      • Cryptocurrency
    • Products
    • Invoices
      • Methods
    • Transactions
      • Page 1
    • Billing
  • Referral Program
    • 💰Referral Program Basics
  • Legal
    • 📄Terms of Use
    • 🔏Privacy Policy
    • 🍪Cookies
Powered by GitBook
On this page
  • Installation
  • API Client
  • Initialization
  • Calling API methods
  • WebSocket Client
  • Initialization
  • Subscribing to events

Was this helpful?

  1. Javascript SDK

Introduction

PreviousWeb and Telegram StoreNextServices

Last updated 9 months ago

Was this helpful?

We provide API client libraries to simplify integration with our product

Only TypeScript client is publicly available now. If you are using another language/framework, we will be glad to help you with integration, feel free to for your language or framework

Installation

To install Client Library use package manager for your language

npm install --save-dev @simplepay-ai/api-client

API Client

Initialization

To make API requests you should create instance of API Client

import { Client } from '@simplepay-ai/api-client';

const api = new Client({
    apiKey: '<place your API key here>'
});

We recommend to create a single instance of Client and then reuse it in different parts of your application

Do not expose your API key when using Client in frontend application

Exposing API key to third-parties gives them ability to bypass payment step and access paid functions of your application

API key should only be set when using Client on server-side

Calling API methods

To get usage examples, see specific API sections:

WebSocket Client

Initialization

To subscribe to updates about invoice status changes you should create instance of WebSocket Client

import { WsClient } from '@simplepay-ai/api-client';

const ws = new WsClient();

Subscribing to events

To get usage examples, see specific API sections:

WebSocket Client intended to use in frontend applications for informing end customers about status of their payments. Do not use it as handler for crediting accounts or providing them access to paid features of your application, use instead

Request API Client
💵 Currency
🪙 Cryptocurrency
🧾 Invoice
Webhooks
🧾 Invoice