@fastenhealth/fasten-stitch-element-react-native

中文文档
5.0.1发布于 2026/10/28MITTypeScriptESM + CJS构建来源已验证近 30 天下载 9441
原始使用文档
文档目录5 节
  1. Installation
  2. Usage
  3. Props
  4. Building the SDK locally
  5. Feedback

fasten_view

Fasten Connect React Native SDK

A lightweight React Native SDK that embeds the Fasten Connect experience inside any React Native application. The package wraps the Stitch.js workflow in a pair of coordinated WebViews so you can authenticate with provider portals and receive connection events without leaving your native app.

Installation

Add the package to your project along with its React Native peer dependency:

npm install @fastenhealth/fasten-stitch-element-react-native react-native-webview
# or
yarn add @fastenhealth/fasten-stitch-element-react-native react-native-webview

react-native-base64 is bundled with the SDK. If you do not already have react-native-webview installed, follow the official installation guide for your platform(s).

Usage

import { FastenStitchElement } from 'fasten-connect-stitch-react-native';

const CUSTOMER_PUBLIC_ID = 'public_test_...';

export const ConnectScreen = () => (
  <FastenStitchElement
    publicId={CUSTOMER_PUBLIC_ID}
    email="[email protected]"
    brandingTheme="dark"
    brandingAccentColor="#E04E3C"
    brandingCompanyName="your brand"
    brandingLogoUrl="https://your-brand.com/assets/logo.svg"
    debugModeEnabled
    onEventBus={(event) => {
      console.log('Fasten event', event);
    }}
  />
);

FastenStitchElement renders to fill the available space, so wrap it in a container that matches how you want it to appear in your layout (e.g., a View with flex: 1).

Props

The component accepts the following options (matching the Stitch.js widget configuration):

  • publicId (required) – Your Fasten Connect public identifier.
  • externalId – Identifier you want to associate with the patient/session.
  • email – Email address used to prepopulate supported Fasten Connect forms.
  • reconnectOrgConnectionId – Reconnect a previously established patient connection.
  • searchOnly, searchQuery, searchSortBy, searchSortByOpts, showSplash – Configure the provider search experience.
  • brandId, portalId, endpointId – Restrict the experience to a specific brand/portal/endpoint.
  • brandingTheme, brandingAccentColor, brandingCompanyName, brandingLogoUrl – Customize the embedded experience. These optional strings map to the branding-theme, branding-accent-color, branding-company-name, and branding-logo-url query parameters, respectively.
  • tefcaMode - Enable TEFCA flows
  • eventTypes – Comma-delimited list of event types to receive.
  • debugModeEnabled – Surfaces debugging tools in the embedded web views.
  • onEventBus – Callback invoked with parsed payloads sent from Fasten Connect (e.g., when a connection is created).

Refer to FastenConnectOptions in src/FastenStitchElement.tsx for the complete, documented type definition.

Building the SDK locally

Transpile TypeScript to the distributable dist/ folder:

npm run build

Feedback

Please open an issue with any bugs or requests. Your feedback will help us stabilize the public SDK interface.

版本与发布记录

@fastenhealth/fasten-stitch-element-react-native 共发布 7 个版本,首次发布于 2026/01/22;过去 12 个月发布了 7 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
5.0.1latest2026/10/2816 天前
5.0.02026/10/2817 天前
1.0.62026/08/013 个月前
1.0.52026/06/264 个月前
1.0.42026/06/125 个月前
1.0.32026/06/125 个月前

关于 @fastenhealth/fasten-stitch-element-react-native 的常见问题

如何安装 @fastenhealth/fasten-stitch-element-react-native?

在项目目录运行 npm install @fastenhealth/fasten-stitch-element-react-native,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(>=18.0.0)、react-native(>=0.71.0)、react-native-webview(>=13.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@fastenhealth/fasten-stitch-element-react-native 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@fastenhealth/fasten-stitch-element-react-native 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@fastenhealth/fasten-stitch-element-react-native 可以商用吗?

@fastenhealth/fasten-stitch-element-react-native 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@fastenhealth/fasten-stitch-element-react-native 的下载量有多少?

根据 npm 官方下载统计,@fastenhealth/fasten-stitch-element-react-native 在 2026/10/15 – 2026/11/13 这 30 天内被下载 9,441 次,日均约 315 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@fastenhealth/fasten-stitch-element-react-native 还在维护吗?

最新版本 5.0.1 发布于 2026/10/28(16 天前);至今共发布 7 个版本,其中过去 12 个月发布了 7 个;首次发布于 2026/01/22。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。