JavaScript SDK

Integrate banking, payments, and financial services into your web applications with our lightweight JavaScript library. Works with React, Vue, Angular, and any modern JavaScript framework.

Get Started View on GitHub

Getting Started

Install the SDK via npm or include directly in your HTML:

npm install @onelinkfintech/sdk
yarn add @onelinkfintech/sdk
<script src="https://cdn.onelinkfintech.com/sdk/v2/latest/onelink.min.js"></script>

Initialize the SDK

import OneLink from '@onelinkfintech/sdk';

// Initialize with your API keys
const client = new OneLink({
  apiKey: 'your_live_api_key', // Get from dashboard
  environment: 'sandbox' // or 'production'
});

Key Features

Pre-built UI Components

Drop-in components for account opening, KYC flows, and payment widgets that match your brand.

TypeScript Support

Full TypeScript definitions for all API methods and response types.

React Hooks

Custom hooks for React applications to manage state and side effects.

Webhook Helpers

Utilities for verifying and handling webhook events from our API.

Error Handling

Consistent error objects with codes and user-friendly messages.

Localization

Support for 15+ languages in UI components and error messages.

Core Functionality

Banking

// Create a new bank account
const account = await client.accounts.create({
  currency: 'EUR',
  owner: {
    name: 'John Doe',
    email: 'john@example.com'
  }
});

// Get account balance
const balance = await client.accounts.getBalance(account.id);

Payments

// Send a payment
const payment = await client.payments.create({
  amount: 1000, // in cents
  currency: 'EUR',
  recipient: 'recipient_id',
  description: 'Invoice #123'
});

// List payments
const payments = await client.payments.list({
  limit: 10,
  status: 'completed'
});

Cards

// Issue a virtual card
const card = await client.cards.create({
  accountId: 'acc_123',
  type: 'virtual',
  limits: {
    daily: 5000 // €50.00
  }
});

// Freeze a card
await client.cards.update(card.id, { status: 'frozen' });

UI Components

Embed pre-built components that handle complex financial workflows:

Account Onboarding

// Initialize the account onboarding widget
const onboarding = client.ui.onboarding({
  container: '#onboarding-container',
  onComplete: (account) => {
    console.log('Account created:', account);
  },
  onError: (error) => {
    console.error('Error:', error);
  }
});

// Start the flow
onboarding.start();

Payment Widget

// Initialize payment widget
const paymentWidget = client.ui.payment({
  container: '#payment-container',
  amount: 1999, // €19.99
  currency: 'EUR',
  onSuccess: (payment) => {
    console.log('Payment successful:', payment);
  }
});

Compatibility

The JavaScript SDK works with all modern browsers and frameworks:

Chrome Firefox Safari Edge React Vue Angular Svelte Node.js

Browser Support

The SDK supports all modern browsers that implement ES6 features. For legacy browser support, include our polyfill bundle:

<script src="https://cdn.onelinkfintech.com/sdk/v2/latest/onelink.polyfill.min.js"></script>

Ready to Integrate Financial Services?

Get started with the OneLinkFintech JavaScript SDK today.

Get API Keys Full Documentation