はじめに
このプラグインのインストール手順とマークダウンガイドを含むセットアッププロンプトをコピーします。
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-persistent-account`
Run the required Capacitor sync/update step after installation.
Read this markdown guide for the full setup steps: https://raw.githubusercontent.com/Cap-go/website/refs/heads/main/apps/docs/src/content/docs/docs/plugins/persistent-account/getting-started.mdx
Use that guide for platform-specific steps, native file edits, permissions, config changes, imports, and usage setup.
If that guide references other docs pages, read them too.
Install
「インストール」のセクションAI-Assisted セットアップを使用してプラグインをインストールできます。AI ツールに Capgo スキルを追加するには、以下のコマンドを実行してください。
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins次に、以下のプロンプトを使用してください。
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-persistent-account` plugin in my project.Manual Setupを使用する場合は、以下のコマンドを実行して、以下のプラットフォーム固有の指示に従ってください。
bun add @capgo/capacitor-persistent-accountbunx cap syncインポート
「インポート」のセクションimport { CapacitorPersistentAccount } from '@capgo/capacitor-persistent-account';APIの概要
APIの概要のセクションreadAccount
「readAccount」のセクションデータを永続ストレージから読み取ります。
saveAccount()を使用して以前保存したアカウントデータを取得します。データはアプリのセッションをまたいで保存され、サポートされているプラットフォームでアプリを再インストールしてもデータは残ります。
import { CapacitorPersistentAccount } from '@capgo/capacitor-persistent-account';
const result = await CapacitorPersistentAccount.readAccount();if (result.data) { console.log('Account data:', result.data);} else { console.log('No account data found');}saveAccount
セクション:saveAccountアカウントデータを永続ストレージに保存します。
提供されたアカウントデータをプラットフォーム固有のセキュアストレージメカニズムを使用して保存します。データはアプリのセッションをまたいで保存され、アプリを再インストールしてもデータは残ります。既存のアカウントデータは上書きされます。
import { CapacitorPersistentAccount } from '@capgo/capacitor-persistent-account';
await CapacitorPersistentAccount.saveAccount({ data: { userId: '12345', username: 'john.doe', email: 'john@example.com' }});真実の源
セクション:真実の源このページはプラグインの src/definitions.tspublic APIがアップストリームで変更されたときに再度syncを実行してください。
Getting Startedから続けてください
Section titled “Getting Startedから続けて”Capgoを使用している場合、Capacitor Live Updateを使用する必要があります。 はじめに を使用してダッシュボードとAPIの操作を計画する場合、APIに接続してください。 Using @capgo/capacitor-persistent-account Using @capgo/capacitor-persistent-accountのネイティブ機能 API まとめ API Overviewの実装詳細 Introduction Introductionの実装詳細 API キー API Keysの実装詳細 デバイス __CAPGO_KEEP_0__の実装詳細についてはデバイスを参照してください。