# @fastenhealth/fasten-stitch-element-react-native 中文文档

规范地址：https://npmcn.com/package/%40fastenhealth/fasten-stitch-element-react-native/

版本：5\.0\.1
npm 元数据更新时间：2026-10-28T13:07:47.683Z
中文译文更新时间：2026-11-14T11:01:29.718Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40fastenhealth/fasten-stitch-element-react-native
原文对照：https://npmcn.com/package/%40fastenhealth/fasten-stitch-element-react-native/?lang=original
项目主页：https://github.com/fastenhealth/fasten-stitch-element-react-native#readme
源码仓库：https://github.com/fastenhealth/fasten-stitch-element-react-native

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：25.5 kB，9 个文件
- 模块格式：ESM + CJS
- TypeScript 类型：包内自带
- 运行依赖：1 个
- peer 依赖：react \>=18\.0\.0，react-native \>=0\.71\.0，react-native-webview \>=13\.0\.0
- 首次发布：2026-01-22T06:53:57.642Z
- 最新版本发布：2026-10-28T13:07:47.154Z
- 近 30 天下载量：9441（2026-10-15 至 2026-11-13，npm 官方下载统计）
- 已发布版本数：7（近 12 个月 7 个）

## 中文简介

[![fasten\_view](https://github.com/fastenhealth/brand-kit/raw/main/connect/banner-transparent.png)](https://github.com/fastenhealth/)

## 安装

```sh
npm install @fastenhealth/fasten-stitch-element-react-native
```

也可以使用：`pnpm add @fastenhealth/fasten-stitch-element-react-native`、`yarn add @fastenhealth/fasten-stitch-element-react-native`、`bun add @fastenhealth/fasten-stitch-element-react-native`

## README

[![fasten\_view](https://github.com/fastenhealth/brand-kit/raw/main/connect/banner-transparent.png)](https://github.com/fastenhealth/)

# 紧接连接重现原生 SDK

一个轻量级的回放原生SDK,将Fasten Connect的经验嵌入任何回放原生应用程序中. 这个 软件包将 Stitch.js 工作流程包成一对协调 `WebView`s 这样您就可以通过提供者门户认证 并接收连接事件而不离开您的本地应用程序.

## 安装

将软件包添加到您的项目中, 以及其对应的本地对等依赖 :

```bash
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` 和SDK捆绑在一起 如果你还没有 `react-native-webview` 安装后,跟着 [正式安装指南](https://github.com/react-native-webview/react-native-webview#installation) 送给你的 平台.

## 使用量

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

const CUSTOMER_PUBLIC_ID = 'public_test_...';

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

`FastenStitchElement` 以填充可用的空间,所以将其包裹在一个容器中,使其与您想要它出现在其中的相匹配 您的布局( 例如, a) `View` 与 `flex: 1`) (中文(简体) ).

### 道具

组件接受以下选项(匹配 Stitch.js 部件配置):

-   `publicId` (单位:千美元)**所需经费**) – 你的快取连接公共标识符.
-   `externalId` - 识别器,您想与病人/会诊联系.
-   `email` – 用于预先流行支持的Fasten Connect表单的电子邮件地址.
-   `reconnectOrgConnectionId` ——重新连接之前确定的患者连接.
-   `searchOnly`, (中文(简体) ), `searchQuery`, (中文(简体) ), `searchSortBy`, (中文(简体) ), `searchSortByOpts`, (中文(简体) ), `showSplash` - 配置提供者搜索 经历.
-   `brandId`, (中文(简体) ), `portalId`, (中文(简体) ), `endpointId` - 将经验限制在特定品牌/门户/端点.
-   `brandingTheme`, (中文(简体) ), `brandingAccentColor`, (中文(简体) ), `brandingCompanyName`, (中文(简体) ), `brandingLogoUrl` - 自定义嵌入式 经历。 这些可选字符串映射到 `branding-theme`, (中文(简体) ), `branding-accent-color`, (中文(简体) ), `branding-company-name`, (中文(简体) ), 财务报告和审定财务报表 `branding-logo-url` 查询参数.
-   `tefcaMode` - 启用TEFCA流量
-   `eventTypes` – 逗号有限事件类型列表待接收.
-   `debugModeEnabled` – Surfaces 在嵌入式网页视图中调试工具.
-   `onEventBus` – 使用从Fasten Connect发送的解析后的有效载荷引用回调(例如当一个连接被创建时).

参见 `FastenConnectOptions` 内 `src/FastenStitchElement.tsx` 用于完整、有文件记录的类型定义.

## 在当地建设 SDK

向可分发文件传送脚本 `dist/` 文件夹 :

```bash
npm run build
```

## 反馈

请打开任何错误或请求的问题 。 你的反馈会帮助我们稳定公共SDK接口.

## 常见问题

### 如何安装 @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 和提交记录判断。

