Skip to main content

Introduction

The @smartbills/react-native SDK provides native mobile components for displaying digital receipts, barcodes, and QR codes in React Native applications. It includes a provider for configuration, pre-built receipt components, and hooks for receipt management.
This SDK is built on top of @smartbills/react-hooks and @smartbills/sdk. All React hooks from the hooks SDK are available when using this package.

Installation

Expo Projects

Requirements

Provider Setup

Wrap your app with SmartbillsReactNativeProvider. It requires an SBClient instance and a configuration object:

Provider Config

Components

Receipt

The Receipt component renders a full digital receipt with merchant info, line items, payment details, and totals:
The Receipt component is composed of several sub-components that can also be used independently:

Barcode

Renders a barcode from receipt data:

QRCode

Renders a QR code:

Brand

Displays a merchant brand logo:

Money

Formats and displays a monetary value according to the configured locale and currency:

Hooks

useReceiptRef

A convenience hook for creating a ref to a Receipt component, useful for programmatic scrolling or capturing the receipt as an image:

All React Hooks Available

Since the React Native SDK wraps @smartbills/react-hooks, all hooks from the hooks SDK are available in your React Native app. See the React Hooks Reference for the complete list.

Camera Integration for Receipt Capture

The SDK works alongside React Native camera libraries for receipt scanning workflows. Use the device camera to capture receipt images, then upload them via the usePresignedUpload hook:

Internationalization

The SDK includes built-in i18n support for English and French. Set the locale in the provider config:

Complete Example

A full receipt viewer screen:

React Hooks Reference

Full reference for all available React hooks

JavaScript SDK

Core client documentation