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

@referrski/react-native

v0.1.19

Published

The ReferrSki React Native SDK provides a simple way to implement referral and invitation functionality in your React Native applications, with optional email-based notifications.

Downloads

23

Readme

ReferrSki React Native SDK

The ReferrSki React Native SDK provides a simple way to implement referral and invitation functionality in your React Native applications, with optional email-based notifications.

Getting Started

Before implementing the SDK, please sign up at www.referrski.com to create an account and obtain your app ID and API key.

Installation

npm install @referrski/react-native
# or
yarn add @referrski/react-native
# or
pnpm add @referrski/react-native

Configuration

After signing up at www.referrski.com, configure the SDK with your app ID and API key (auth header):

import { ReferrSki } from '@referrski/react-native';

ReferrSki.configure({
  appId: 'your-app-id',
  apiKey: 'your-api-key'
});

Usage

Sending Invitations

You can send invitations with or without email notifications:

// Send invitation without email notification
try {
  await ReferrSki.sendInvite({
    inviteeIdentifier: '[email protected]',
    inviterId: 'current-user-id',
    metadata: {
      inviterName: 'John Doe'
    }
  });
  // Invitation sent successfully
} catch (error) {
  // Handle error
}

// Send invitation with email notification
try {
  await ReferrSki.sendInvite({
    inviteeIdentifier: '[email protected]',
    inviterId: 'current-user-id',
    metadata: {
      inviterName: 'John Doe'
    },
    email: {
      fromName: 'John Doe',
      subject: 'Join our app!',
      content: 'Hey there! I think you\'d love using our app.'
    }
  });
  // Invitation sent with email notification
} catch (error) {
  // Handle error
}

Validating User Signups

After a user completes the signup process, validate that they had an invitation:

try {
  const result = await ReferrSki.validateSignup({
    userThatSignedUpId: 'user-123', // The same identifier used when creating the invitation
  });
  
  if (result.validated) {
    // User signup was validated against an invitation
    // This will be tracked in your metrics
  } else {
    // No matching invitation found for this signup
  }
} catch (error) {
  // Handle error
}

Deleting User Data (GDPR Compliance)

To delete all invitations associated with a specific inviter:

try {
  await ReferrSki.deleteInviterData('[email protected]');
  // All invitations from this user have been deleted
} catch (error) {
  // Handle error
}

Using the InviteModal Component

The SDK includes a pre-built modal component for collecting and sending invitations:

import { InviteModal } from '@referrski/react-native';

function MyComponent() {
  const [visible, setVisible] = useState(false);

  return (
    <>
      <Button onPress={() => setVisible(true)}>
        Invite Friends
      </Button>

      <InviteModal
        visible={visible}
        onClose={() => setVisible(false)}
        inviterId="current-user-id"
        inviterName="John Doe"
        sendEmail={true} // Optional: set to false to disable email notifications
        onSuccess={() => {
          console.log('Invitation sent successfully');
        }}
        style={{
          // Optional: Custom styles
          container: { /* Modal card styles */ },
          overlay: { /* Modal overlay styles */ },
          modalCard: { /* Modal card container styles */ },
          input: { /* Input field styles */ },
          inputContainer: { /* Input container styles */ },
          button: { /* Submit button styles */ },
          buttonText: { /* Button text styles */ },
          title: { /* Title text styles */ },
          description: { /* Description text styles */ },
          error: { /* Error message styles */ },
          closeButton: { /* Close button styles */ },
          closeButtonText: { /* Close button text styles */ }
        }}
        texts={{
          // Optional: Custom texts
          title: 'Invite Your Friends',
          placeholder: 'Enter friend\'s email or identifier',
          button: 'Send Invitation',
          success: 'Invitation sent!',
          error: 'Failed to send invitation'
        }}
      />
    </>
  );
}

Error Handling

The SDK throws errors in the following cases:

  • When methods are called before configuration
  • When API requests fail
  • When invitations cannot be created or verified
  • When the user doesn't have permission to perform an operation

API Reference

ReferrSki.configure(config)

Configures the SDK with your application settings.

Parameters:

  • config: Object
    • appId: string - Your ReferrSki application ID
    • apiKey: string - Your ReferrSki API key

ReferrSki.sendInvite(options)

Sends a new invitation, optionally with an email notification.

Parameters:

  • options: SendInviteOptions
    • inviteeIdentifier: string - The identifier (e.g., email) of the person to invite
    • inviterId: string - The identifier of the person sending the invitation
    • metadata?: object - Optional metadata about the invitation
    • email?: EmailConfig - Optional email configuration
      • fromName: string - Name to show in the email
      • subject: string - Email subject line
      • content: string - Email content

Returns: Promise

ReferrSki.validateSignup(options)

Validates and records that a user has completed signup after accepting an invitation.

Parameters:

  • options: ValidateSignupOptions
    • userThatSignedUpId: string - The same identifier that was used as inviteeIdentifier when creating the invitation

Returns: Promise

ReferrSki.deleteInviterData(inviterEmail)

Deletes all invitations associated with a specific inviter for the current app.

Parameters:

  • inviterEmail: string - The email/identifier whose invitations should be deleted

Returns: Promise<{ success: boolean }>

InviteModal Component

A pre-built modal component for collecting and sending invitations.

Props:

  • visible: boolean - Controls the visibility of the modal
  • onClose: () => void - Callback function when the modal is closed
  • inviterId: string - Identifier of the user sending invitations
  • inviterName: string - Name of the user sending invitations
  • sendEmail?: boolean - Whether to send email notifications (default: true)
  • onSuccess?: () => void - Optional callback when invitation is sent successfully
  • style?: Object - Optional styles for customizing the modal appearance
    • container?: StyleProp - Modal card styles
    • overlay?: StyleProp - Modal overlay styles
    • modalCard?: StyleProp - Modal card container styles
    • input?: StyleProp - Input field styles
    • inputContainer?: StyleProp - Input container styles
    • button?: StyleProp - Submit button styles
    • buttonText?: StyleProp - Button text styles
    • title?: StyleProp - Title text styles
    • description?: StyleProp - Description text styles
    • error?: StyleProp - Error message styles
    • closeButton?: StyleProp - Close button styles
    • closeButtonText?: StyleProp - Close button text styles
  • texts?: Object - Optional custom texts for the modal
    • title?: string - Modal title
    • placeholder?: string - Input placeholder
    • button?: string - Button text
    • success?: string - Success message
    • error?: string - Error message