はじめに
このプラグインのインストール手順とフルマークダウンガイドを含むセットアップの質問をコピーする。
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.
インストール
「インストール」AIアシストセットアップを使用してプラグインをインストールできます。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セットアップを使用する場合は、以下のコマンドを実行してプラグインをインストールし、以下のプラットフォーム固有の指示に従ってください。
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.tsパブリック API がアップストリームで変更されたときは、再度同期を実行してください。
始めから続けてください
始めから続けてください「始めから続けてください」を使用している場合 「始めから続けてください」を使用してダッシュボードと __CAPGO_KEEP_0__ の作業を計画する場合、__CAPGO_KEEP_0__ を接続してください。 Using @API/__CAPGO_KEEP_1__-persistent-account Using @capgo/capacitor-persistent-account for the native capability in Using @capgo/capacitor-persistent-account, API の概要 API 概要 概要の実装詳細のために API キー API キーの実装詳細のために、 デバイス 実装詳細のためにデバイス