npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@sideshiftapp/connect

v0.1.0

Published

SideShift Connect - Embeddable payout and pay-in widgets

Readme

@sideshiftapp/connect

Embed SideShift Connect payout and pay-in widgets in your application.

Installation

npm install @sideshiftapp/connect

Quick Start

React

import { SideShiftPayout, SideShiftPayin } from '@sideshiftapp/connect/react';

function App() {
  // Generate this token server-side via POST /api/embed/auth/token
  const token = 'eyJ...';

  return (
    <SideShiftPayout
      token={token}
      theme={{ theme: 'light', primaryColor: '#3D8CFA', borderRadius: 12 }}
      onLoad={() => console.log('Widget ready')}
      onWithdrawCompleted={(data) => console.log('Withdrew', data.amountCents / 100)}
      onSessionExpired={() => {
        // Refresh the token and re-render
      }}
    />
  );
}

Vanilla JS

import { mount } from '@sideshiftapp/connect/vanilla';

const widget = mount({
  widgetType: 'payout',
  token: 'eyJ...',
  container: '#widget-root',
  theme: { theme: 'light', primaryColor: '#3D8CFA' },
  onLoad: () => console.log('Widget ready'),
  onWithdrawCompleted: (data) => console.log('Withdrew', data.amountCents / 100),
});

// Later: clean up
widget.unmount();

Script Tag

<script type="module">
  import { mount } from 'https://cdn.jsdelivr.net/npm/@sideshiftapp/connect/dist/vanilla.mjs';

  mount({
    widgetType: 'payout',
    token: 'YOUR_TOKEN',
    container: '#widget',
    theme: { theme: 'light' },
  });
</script>

<div id="widget"></div>

Widgets

SideShiftPayout

Displays a user's balance and lets them withdraw funds to their bank account.

<SideShiftPayout
  token={token}
  theme={{ theme: 'dark', primaryColor: '#10B981' }}
  autoResize={true}
  onLoad={() => {}}
  onError={(err) => console.error(err.message)}
  onSessionExpired={() => refreshToken()}
  onWithdrawInitiated={(data) => console.log('Initiating', data.amountCents)}
  onWithdrawCompleted={(data) => console.log('Done', data.withdrawalId)}
  onBalanceUpdated={(data) => console.log('Balance:', data.balanceCents)}
  onKycStarted={() => console.log('KYC flow started')}
  onKycCompleted={() => console.log('KYC verified')}
/>

SideShiftPayin

Lets users deposit funds via credit/debit card.

<SideShiftPayin
  token={token}
  theme={{ theme: 'light' }}
  defaultAmountCents={5000}
  quickAmountsCents={[1000, 5000, 10000, 25000]}
  onDepositInitiated={(data) => console.log('Depositing', data.amountCents)}
  onDepositCompleted={(data) => console.log('Deposited', data.depositId)}
  onDepositFailed={(data) => console.error('Failed:', data.error)}
  onMethodAdded={() => console.log('Payment method added')}
  onAmountChanged={(data) => console.log('Amount:', data.amountCents)}
/>

Props

Common Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | token | string | required | Access token from POST /api/embed/auth/token | | baseUrl | string | https://app.sideshift.app | SideShift app URL | | theme | WidgetThemeConfig | { theme: 'light' } | Theme configuration | | style | CSSProperties | - | Container inline styles | | className | string | - | Container CSS class | | autoResize | boolean | true | Auto-resize iframe height to fit content | | onLoad | () => void | - | Widget loaded and ready | | onError | (err) => void | - | Widget encountered an error | | onSessionExpired | () => void | - | Token expired, regenerate and re-render |

Payout-Specific Props

| Prop | Type | Description | |------|------|-------------| | onWithdrawInitiated | (data: { amountCents }) => void | User started a withdrawal | | onWithdrawCompleted | (data: { amountCents, withdrawalId? }) => void | Withdrawal succeeded | | onBalanceUpdated | (data: { balanceCents }) => void | Balance changed | | onKycStarted | () => void | User started identity verification | | onKycCompleted | () => void | Identity verification completed |

Pay-in-Specific Props

| Prop | Type | Description | |------|------|-------------| | defaultAmountCents | number | Pre-filled deposit amount | | quickAmountsCents | number[] | Quick-select amount buttons | | onDepositInitiated | (data: { amountCents }) => void | User started a deposit | | onDepositCompleted | (data: { amountCents, depositId? }) => void | Deposit succeeded | | onDepositFailed | (data: { amountCents, error? }) => void | Deposit failed | | onMethodAdded | () => void | User added a payment method | | onAmountChanged | (data: { amountCents }) => void | User changed the deposit amount |

Theme Configuration

Full theme customization is supported:

const theme: WidgetThemeConfig = {
  theme: 'light', // 'light' | 'dark' | 'auto'

  // Simple options
  primaryColor: '#3D8CFA',
  borderRadius: 12,
  fontFamily: 'Inter, sans-serif',

  // Fine-grained color control
  colors: {
    background: '#ffffff',
    cardBackground: '#ffffff',
    primary: '#3D8CFA',
    textPrimary: '#111827',
    border: '#e5e7eb',
  },

  // Typography
  typography: {
    fontFamily: 'Inter, sans-serif',
    headingSize: '16px',
    bodySize: '14px',
  },

  // Layout options
  layout: {
    showBalance: true,
    showHistory: true,
    maxWidth: '450px',
  },

  // Custom labels
  labels: {
    balanceLabel: 'Your Earnings',
    withdrawButton: 'Cash Out',
    historyTitle: 'Past Withdrawals',
  },
};

Server-Side Token Generation

Tokens are generated on your server using your API key:

const response = await fetch('https://app.sideshift.app/api/embed/auth/token', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'x-api-key': process.env.SIDESHIFT_API_KEY, // sk_live_... or sk_test_...
  },
  body: JSON.stringify({
    sideshiftAccountId: 'user-account-id',
    widgetType: 'payout', // or 'payin' or 'both'
    expiresInSeconds: 3600,
  }),
});

const { data } = await response.json();
const token = data.accessToken; // Pass this to the widget component

Use sk_test_* keys for sandbox mode (no real money moves).

License

MIT