メインコンテンツにスキップ

Getting Started

GitHub

AI-Assisted Setupを使用してプラグインをインストールできます。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-account
bunx cap sync
import { CapacitorPersistentAccount } from '@capgo/capacitor-persistent-account';

アカウントデータを永続ストレージから読み取ります。

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');
}

プラットフォーム固有の安全なストレージメカニズムを使用して、提供されたアカウントデータを保存します。 アプリのセッションをまたいで、再インストールを乗り越えてデータが保存されます。 既存のアカウントデータは上書きされます。

クリップボードにコピー

import { CapacitorPersistentAccount } from '@capgo/capacitor-persistent-account';
await CapacitorPersistentAccount.saveAccount({
data: {
userId: '12345',
username: 'john.doe',
email: 'john@example.com'
}
});

Getting Started から続けて src/definitions.ts. Re-run the sync when the public API changes upstream.

アカウント情報を保存する場合に使用

アカウント情報を保存する場合に使用

アカウント情報を保存する場合に使用 スタート APIと連携するためにダッシュボードとAPIの運用を計画する @capgo/capacitor-persistent-accountを使用する native capabilityの@capgo/capacitor-persistent-accountの使用方法 APIの概要 APIの実装詳細 導入 __CAPGO_KEEP_0__の実装詳細 APIのキー APIの実装詳細 デバイス __CAPGO_KEEP_0__の実装詳細