Skip to content

A React Native Module for the Ketch iOS and Android Mobile SDKs

License

Notifications You must be signed in to change notification settings

ketch-com/ketch-react-native

Repository files navigation

ketch-react-native

This repository contains the Ketch React Native package in the /package folder and an example app in the /example folder.

Prerequisites

Usage

  1. Install core dependency
npm install @ketch-com/ketch-react-native --registry=https://npm.pkg.github.com --legacy-peer-deps

When running the above command, you may see a 401 Unauthorized response. This occurs because Github packages require authentication through a personal access token (PAT). See their Authentication to Github Packages document to set this up.

  1. Install peer dependencies
npm install react-native-default-preference react-native-webview
  1. Install Pods (IOS)
cd ios && pod install
  1. Use the <KetchServiceProvider/> component
<KetchServiceProvider
  organizationCode="YOUR_ORGANIZATION_CODE"
  propertyCode="YOUR_PROPERTY_CODE"
  identities={{ YOUR_IDENTIFIER_NAME: "YOUR_IDENTIFIER_VALUE" }}
>
  {/* The rest of your app code here */}
</KetchServiceProvider>

Where YOUR_ORGANIZATION_CODE, YOUR_PROPERTY_CODE, YOUR_IDENTIFIER_NAME, and YOUR_IDENTIFIER_VALUE are replaced with those configured within the Ketch application.

See our Getting Started and Technical Documentation documentation for further usage instructions.

Running

See the example app README.

Contributions

See the package README.