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 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-shipped-suite-sdk

v1.0.3

Published

Shipped Shield offers premium package assurance for shipments that are lost, damaged or stolen. Instantly track and resolve shipment issues hassle-free with the app.

Downloads

2

Readme

ShippedSuite React Native SDK

Shipped Shield offers premium package assurance for shipments that are lost, damaged or stolen. Instantly track and resolve shipment issues hassle-free with the app.

Example

To run the example project, clone the repo, run yarn in the root directory to install the required dependencies for each package:

yarn

To run the example app on iOS:

yarn example ios

To run the example app on Android:

yarn example android

Requirements

iOS

Xcode 13.3.1 or later and is compatible with apps targeting iOS 11.0 or above.

Android

Android 5.0 (API level 21) and above

Installation

yarn add react-native-shipped-suite-sdk
or
npm install react-native-shipped-suite-sdk

Usage

import {
  ShippedSuite
} from 'react-native-shipped-suite-sdk'

ShippedSuite.configure({
  publicKey: 'Your public key',
  mode: 'development',
});

Create a Widget view with offers

You can initialize it and put it where you want.

import {
  ShippedSuite,
  ShippedSuiteAppearance,
  ShippedSuiteType,
  WidgetChangeEventData,
  WidgetView
} from 'react-native-shipped-suite-sdk';

<WidgetView
  ref={widgetRef}
  style={styles.widget}
  configuration={{
    type: ShippedSuiteType.Green,
    isInformational: true,
    isMandatory: false,
    isRespectServer: false,
    currency: "USD",
    appearance: ShippedSuiteAppearance.Auto
  }}
  onChange={onWidgetChange}
/>

Whenever the cart value changes, update the widget view with the latest cart value. This value should be the sum of the value of the order items, prior to discounts, shipping, taxes, etc.

widgetRef.current?.updateOrderValue(amount);

To get the callback from widget, you need implement the onChange.

const onWidgetChange = (
    event: NativeSyntheticEvent<WidgetChangeEventData>
  ) => {
    console.log(event.nativeEvent);
  };

Print log:

{"isSelected": true, "totalFee": 0.39}

Within the callback, implement any logic necessary to add or remove Shield or Green from the cart, based on whether isSelected is true or false.

Customization

If you plan to implement the widget yourself to fit the app style, you can still use the functionality provided by the SDK.

  • Request the Offers Fee
ShippedSuite.getOffersFee(amount, currency)
      .then((results: any) => console.log('Get offers fee:', results))
      .catch((error: any) => console.log('Failed to get offers fee:', error));
  • Display learn more modal
ShippedSuite.displayLearnMoreModal({
  type: ShippedSuiteType.Green,
  isInformational: true,
  appearance: ShippedSuiteAppearance.Auto
});

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

ShippedSuite is available under the MIT license. See the LICENSE file for more info.