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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@suada/core

v1.0.0-rc.38

Published

Core functionality for Suada's integration management components

Readme

@suada/core

Core functionality for Suada's integration management components. This package provides the foundation for all Suada front-end SDKs.

Installation

npm install @suada/core

Usage

import { SuadaClient } from '@suada/core';

const client = new SuadaClient({
  apiKey: 'your-api-key',
  externalUserIdentifier: 'user-123',
  gridColumns: 3, // Optional: Set number of columns in the grid (default: 3)
});

// Initialize the client
await client.initialize();

// Use the client to manage integrations
const integrations = await client.getIntegrations();

Features

Core Client

The SuadaClient class provides the main interface for interacting with Suada's API:

  • Authentication Management: Handles API authentication and token management
  • Integration Management: Methods for managing third-party integrations
  • Organization Context: Support for multi-organization environments
  • Type-safe API: Full TypeScript support with comprehensive type definitions
  • Customizable Grid Layout: Configure the number of columns in the integration grid

Integration Types

Built-in support for various integration types:

  • Notion
  • Slack
  • Google Analytics
  • Linear
  • Jira
  • HubSpot
  • Zoho
  • More integrations coming soon...

OAuth Flow Support

Simplified OAuth flow management:

// Initialize OAuth flow
const authUrl = await client.initializeOAuth('notion', {
  redirectUri: 'https://your-app.com/callback'
});

// Handle OAuth callback
const result = await client.handleOAuthCallback('notion', {
  code: 'auth-code',
  state: 'state-token'
});

Error Handling

Comprehensive error handling with detailed error types:

try {
  await client.someOperation();
} catch (error) {
  if (error instanceof SuadaAuthError) {
    // Handle authentication errors
  } else if (error instanceof SuadaApiError) {
    // Handle API errors
  }
}

Configuration Options

| Option | Type | Required | Default | Description | |--------|------|----------|---------|-------------| | apiKey | string | Yes | - | Your Suada API key | | externalUserIdentifier | string | Yes | - | Identifier for the user | | baseUrl | string | No | Suada API URL | Custom API URL if needed | | theme | object | No | Default theme | Custom theme options | | size | 'small' \| 'medium' \| 'large' | No | 'medium' | Size of the component | | gridColumns | number | No | 3 | Number of columns in the integration grid | | enabledIntegrations | string[] | No | All integrations | List of integration types to enable | | onIntegrationConnected | function | No | - | Callback when integration is connected | | onIntegrationDisconnected | function | No | - | Callback when integration is disconnected | | onError | function | No | - | Callback when an error occurs |

Development

# Install dependencies
npm install

# Run tests
npm test

# Build the package
npm run build

# Run linting
npm run lint

# Run type checking
npm run typecheck

API Reference

SuadaClient

The main client class for interacting with Suada's API.

Constructor Options

interface SuadaClientOptions {
  apiKey: string;
  externalUserIdentifier: string;
  gridColumns?: number;
  baseUrl?: string;
}

Methods

  • initialize(): Initialize the client
  • getIntegrations(): Get all available integrations
  • createIntegration(type: string, config: IntegrationConfig): Create a new integration
  • deleteIntegration(id: string): Delete an integration
  • initializeOAuth(provider: string, options: OAuthOptions): Initialize OAuth flow
  • handleOAuthCallback(provider: string, params: OAuthCallbackParams): Handle OAuth callback

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

MIT