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

@codeimplants/support

v1.0.0

Published

Smart support logic layer for error handling and user assistance

Readme

@codeimplants/support

Smart support logic layer for error handling and user assistance across all platforms

Platform React Native TypeScript

Overview

@codeimplants/support is a comprehensive support package that handles the logic of how users contact your organization based on their platform and error context. It provides seamless integration with WhatsApp, Email, and Phone services with automatic error context formatting.

Features

  • Cross-Platform: Works on iOS, Android, Web (React Native Web), Expo, and bare React Native
  • Smart Deep Linking: Platform-specific URL schemes (whatsapp://, mailto:, tel:)
  • Auto Error Context: Automatically formats error details in support messages
  • Type-Safe: Full TypeScript support with comprehensive types
  • Zero Config: Works out of the box with sensible defaults
  • Customizable: Override templates, messages, and platform-specific behavior

Installation

npm install @codeimplants/support
# or
yarn add @codeimplants/support
# or
pnpm add @codeimplants/support

Peer Dependencies

{
  "react": ">=18.0.0",
  "react-native": ">=0.70.0"
}

Quick Start

1. Wrap your app with SupportProvider

import { SupportProvider } from '@codeimplants/support';

const supportConfig = {
  whatsapp: {
    number: '919876543210', // Country code + number (no + or spaces)
    messageTemplate: 'Hello, I need help with...',
  },
  email: {
    address: '[email protected]',
    subjectTemplate: 'Support Request',
  },
  phone: {
    number: '+919876543210',
  },
};

function App() {
  return (
    <SupportProvider config={supportConfig}>
      <YourApp />
    </SupportProvider>
  );
}

2. Use the useSupport hook

import { useSupport } from '@codeimplants/support';

function ErrorScreen() {
  const { openWhatsApp, sendEmail, makeCall, isMethodAvailable } = useSupport({
    errorMessage: 'Failed to load user profile',
    errorCode: '500',
    screenName: 'ProfileScreen',
    timestamp: new Date().toISOString(),
    appVersion: '1.0.0',
    platform: 'ios',
    os: 'iOS 17.0',
  });

  return (
    <View>
      <Button onPress={() => openWhatsApp()}>
        Contact via WhatsApp
      </Button>
      
      <Button onPress={() => sendEmail()}>
        Send Email
      </Button>
      
      {isMethodAvailable('phone') && (
        <Button onPress={() => makeCall()}>
          Call Support
        </Button>
      )}
    </View>
  );
}

API Reference

SupportProvider

React Context Provider that makes support configuration available throughout your app.

Props:

  • config: SupportConfig - Support configuration object

useSupport(errorContext?)

Primary hook for interacting with support services.

Parameters:

  • errorContext?: ErrorContext - Optional error context to include in support messages

Returns:

{
  openWhatsApp: (customMessage?: string) => Promise<SupportActionResult>;
  sendEmail: (customSubject?: string, customBody?: string) => Promise<SupportActionResult>;
  makeCall: () => Promise<SupportActionResult>;
  isMethodAvailable: (method: 'whatsapp' | 'email' | 'phone') => boolean;
  config: SupportConfig;
}

Platform Utilities

import { isWeb, isIOS, isAndroid, getNormalizedPlatform } from '@codeimplants/support';

// Check platform
if (isWeb()) {
  // Web-specific logic
}

// Get normalized platform ('web' | 'ios' | 'android')
const platform = getNormalizedPlatform();

Platform-Specific Configuration

Override configuration for specific platforms:

const config = {
  whatsapp: { number: '919876543210' },
  email: { address: '[email protected]' },
  
  platformOverrides: {
    web: {
      // Web users get different email
      email: { address: '[email protected]' },
    },
    ios: {
      // iOS users can call directly
      phone: { number: '+919876543210' },
    },
  },
};

Error Context Auto-Formatting

When you provide an ErrorContext, it's automatically formatted into support messages:

WhatsApp Message:

Hello, I need help with an issue.

--- Error Details ---
Error: Failed to load user profile
Code: 500
Screen: ProfileScreen
Time: 2024-02-11T16:30:00.000Z
App Version: 1.0.0
Platform: ios

Email Body:

Hello,

I need assistance with an issue.

--- Error Details ---
Error: Failed to load user profile
Error Code: 500
Screen: ProfileScreen
Timestamp: 2024-02-11T16:30:00.000Z
App Version: 1.0.0
Platform: ios
OS: iOS 17.0

Please describe your issue:

Platform Compatibility

React Native (Expo)

✅ Works out of the box

React Native (Bare)

✅ Works out of the box

React Native Web

✅ Automatically detects web platform and uses https://wa.me/ for WhatsApp

iOS

✅ Uses whatsapp://, mailto:, tel: URL schemes

Android

✅ Uses whatsapp://, mailto:, tel: URL schemes

TypeScript Support

Full TypeScript support with exported types:

import type {
  SupportConfig,
  ErrorContext,
  SupportMethod,
  SupportActionResult,
} from '@codeimplants/support';

License

MIT

Contributing

Contributions are welcome! Please open an issue or PR.