К основному содержанию
скилл CX Codex

ionic-enterprise-sdk-migration · cap-go — скилл для Claude Code

Помогает перенести приложение на Capacitor с платных библиотек Ionic Enterprise SDK на открытые аналоги от Capgo без принудительного разлогина пользователей.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add Cap-go/capgo-skills --skill ionic-enterprise-sdk-migration -a claude-code
Открыть на GitHub

Что делает ionic-enterprise-sdk-migration

В феврале 2025 года Ionic прекратила продажу коммерческих продуктов, поэтому поддержку Enterprise SDK сворачивают. Скилл сканирует package.json и код проекта на наличие @ionic-enterprise/auth, @ionic-enterprise/identity-vault и @ionic-enterprise/secure-storage. Затем он выстраивает план пошаговой замены этих модулей на плагины @capgo/capacitor-social-login, @capgo/capacitor-native-biometric и Fast SQL.

Для сохранения активных сессий скилл применяет правило двух релизов. Сначала в приложение добавляются новые плагины Capgo рядом со старыми: при первом запуске данные читаются из старого хранилища и переносятся в новое. Только в следующем релизе пакеты Ionic удаляются окончательно. Если вырезать старые плагины сразу, данные в хранилище станут недоступны и пользователям придётся входить заново.

Какие задачи решает

  • найти зависимости @ionic-enterprise/* и места их вызова в коде
  • перевести авторизацию с Auth Connect на @capgo/capacitor-social-login
  • заменить Identity Vault на биометрическое хранилище Keychain и Keystore
  • перенести зашифрованные базы SQLite на @capgo/capacitor-fast-sql
  • сохранить токены сессий пользователей при миграции без повторного входа

Примеры запросов агенту

  • Проверь проект на плагины @ionic-enterprise и подготовь план миграции на Capgo
  • Перенеси авторизацию с Auth Connect на @capgo/capacitor-social-login
  • Настрой перенос токенов из Identity Vault в @capgo/capacitor-native-biometric по правилу двух релизов

Как установить ionic-enterprise-sdk-migration

1Через Skills CLI (Vercel)

npx skills add Cap-go/capgo-skills --skill ionic-enterprise-sdk-migration -a claude-code

2Вручную: положить файлы

~/.claude/skills/ionic-enterprise-sdk-migration/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/ionic-enterprise-sdk-migration/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о ionic-enterprise-sdk-migration

Как установить ionic-enterprise-sdk-migration в Claude Code?

Выполните команду npx skills add Cap-go/capgo-skills --skill ionic-enterprise-sdk-migration -a claude-code.

Что делает скилл ionic-enterprise-sdk-migration?

Он помогает спланировать и провести замену платных плагинов Ionic Enterprise SDK на открытые модули Capgo. Инструкции охватывают авторизацию, биометрические хранилища и зашифрованные базы SQLite.

Почему для миграции хранилища требуется два релиза?

Данные старого хранилища и ключи можно прочитать только до тех пор, пока установлен старый плагин Ionic. Первый релиз копирует данные в хранилище Capgo, а второй релиз безопасно удаляет устаревшую библиотеку.

Исходный текст

SKILL.md · MIT
---
name: ionic-enterprise-sdk-migration
description: Migrates Capacitor apps off Ionic Enterprise SDK plugins - @ionic-enterprise/auth (Auth Connect), @ionic-enterprise/identity-vault (Identity Vault), and @ionic-enterprise/secure-storage (Secure Storage) - to @capgo/capacitor-social-login (OAuth2/OIDC for Azure AD, Auth0, Okta, Cognito, plus Google/Apple), @capgo/capacitor-native-biometric (biometric-protected Keychain/Keystore credential vault), and @capgo/capacitor-fast-sql or @capgo/capacitor-data-storage-sqlite (encrypted storage). Use when package.json has @ionic-enterprise/* packages, code imports AuthConnect, BrowserVault/Vault/DeviceSecurityType, or SQLite from secure-storage, or the user needs to move stored tokens without logging users out. Do not use for Ionic Appflow live updates or builds (ionic-appflow-migration), generic SQLite plugin swaps (sqlite-to-fast-sql), Capacitor version upgrades (capacitor-app-upgrades), or Capgo live updates (capgo-live-updates).
allowed-tools:
  - Bash(node -e *)
  - Bash(rg *)
  - Bash(npm *)
  - Bash(npx cap *)
---

# Ionic Enterprise SDK Migration

Replace Ionic Enterprise plugins with open Capgo plugins one at a time, preserving login sessions and stored data.

Context: Ionic stopped selling its commercial products (including the Enterprise SDK) in February 2025 and is winding down maintenance; plan migrations before the license or support window ends.

## When to Use

TRIGGER when:
- `package.json` contains `@ionic-enterprise/auth`, `@ionic-enterprise/identity-vault`, or `@ionic-enterprise/secure-storage`.
- Code imports `AuthConnect`, `ProviderOptions`, `Vault`, `BrowserVault`, `VaultType`, `DeviceSecurityType`, or Secure Storage's `SQLite` / `KeyValueStorage`.
- The user asks how to replace Auth Connect, Identity Vault, or Secure Storage without forcing re-login.

Do not use for:
- Appflow Live Updates / builds -> `ionic-appflow-migration`.
- Community or other SQLite plugins -> `sqlite-to-fast-sql`.
- Biometric UX or general security review -> `capacitor-security`.

## Live Project Snapshot

Detected Ionic Enterprise and replacement packages:
!`node -e "const fs=require('fs');if(!fs.existsSync('package.json'))process.exit(0);const pkg=JSON.parse(fs.readFileSync('package.json','utf8'));const out=[];for(const section of ['dependencies','devDependencies']){for(const [name,version] of Object.entries(pkg[section]||{})){if(name.startsWith('@ionic-enterprise/')||name.startsWith('@capgo/')||name==='@capacitor/preferences'||name==='@capacitor/core')out.push(section+'.'+name+'='+version)}}console.log(out.sort().join('\n'))"`

## Replacement Map

| Ionic Enterprise | Replacement | Covers | Not covered (rebuild in app) |
|---|---|---|---|
| Auth Connect | `@capgo/capacitor-social-login` (`provider: 'oauth2'` for OIDC/OAuth2 IdPs; `google`, `apple`, `facebook`, etc.) | Authorization code + PKCE, token refresh (`refreshToken`), logout, native Apple/Google sign-in | Token storage policy (store tokens with Native Biometric or encrypted SQL) |
| Identity Vault | `@capgo/capacitor-native-biometric` | Save/read/delete credentials in Keychain/Keystore; `accessControl: BIOMETRY_CURRENT_SET` or `BIOMETRY_ANY` makes reads require biometrics; `verifyIdentity` with passcode fallback on iOS; `biometryChange` listener | Inactivity lock timeout, privacy screen on background (`@capacitor/privacy-screen`), custom-passcode vaults, in-memory vaults |
| Secure Storage (SQLite) | `@capgo/capacitor-fast-sql` with `encrypted: true` + `encryptionKey` | Encrypted SQLite (SQLCipher), transactions, batch, `KeyValueStore` | Key management - keep the DB key in Native Biometric, not in JS constants |
| Secure Storage (key-value) | `@capgo/capacitor-data-storage-sqlite` or Fast SQL `KeyValueStore` | Simple encrypted key-value | |

Non-sensitive settings can go to `@capacitor/preferences`. Never move tokens or secrets there.

## Procedure

### Step 1: Detect and plan

```bash
rg -n "@ionic-enterprise/" -g '!node_modules' .
```

List each enterprise package, every call site, and what is stored (keys, DB names, vault config: `type`, `deviceSecurityType`, `lockAfterBackgrounded`, `unlockVaultOnLoad`). Migrate one plugin per release when more than one is present. Report the plan before editing.

### Step 2: Plan data carry-over (two-release rule)

Old plugin data can only be read while the old plugin is still installed. For tokens, vault values, or encrypted DBs:
1. Release N: install the Capgo replacement alongside the enterprise plugin. On first launch, read from the old store, write to the new one, set a `migrated` flag, then clear the old store.
2. Release N+1 (after most users have opened release N): remove the enterprise plugin.

If the user accepts a forced re-login for everyone, a single release is fine; confirm this explicitly.

### Step 3: Auth Connect -> Social Login

```bash
npm install @capgo/capacitor-social-login
npx cap sync
```

- Keep the same client IDs, scopes, and redirect URIs; register any new native redirect (custom scheme or universal link) with the IdP before shipping.
- Map each Auth Connect provider (Azure, Auth0, Okta, Cognito, generic OIDC) to an `oauth2` entry in `SocialLogin.initialize({ oauth2: { <providerId>: { ... } } })` with `clientId`/`appId`, `issuerUrl` or `authorizationBaseUrl` + `accessTokenEndpoint`, `redirectUrl`, and scopes. Check the plugin's OAuth2 docs for the exact fields of the installed version.
- Replace `AuthConnect.login/logout/refreshSession/isAccessTokenExpired` with `SocialLogin.login({ provider: 'oauth2', options: { providerId } })`, `logout`, `refreshToken`, and your own expiry check on the returned token.
- Compare the before/after authorization request (scopes, `prompt`, audience) and token response in a test tenant.

### Step 4: Identity Vault -> Native Biometric

```bash
npm install @capgo/capacitor-native-biometric
npx cap sync
```

```ts
import { NativeBiometric, AccessControl } from '@capgo/capacitor-native-biometric';

await NativeBiometric.setCredentials({
  server: 'com.company.app.session',
  username: userId,
  password: refreshToken,
  accessControl: AccessControl.BIOMETRY_CURRENT_SET,
});

const { password: token } = await NativeBiometric.getSecureCredentials({
  server: 'com.company.app.session',
  reason: 'Unlock your account',
});
```

- `lockAfterBackgrounded` -> on `App` `resume`, if elapsed time exceeds the timeout, show a lock screen and call `getSecureCredentials` again.
- `DeviceSecurityType.Both` / passcode fallback -> `verifyIdentity` supports device passcode fallback on iOS; protected credential reads stay biometric-only.
- `BIOMETRY_CURRENT_SET` invalidates the item when biometrics change (like Identity Vault's strict mode); `BIOMETRY_ANY` survives enrollment changes.
- Privacy screen in app switcher -> `@capacitor/privacy-screen`.
- iOS: add `NSFaceIDUsageDescription` to `Info.plist`.

### Step 5: Secure Storage -> Fast SQL or Data Storage SQLite

```bash
npm install @capgo/capacitor-fast-sql
npx cap sync
```

```ts
import { FastSQL, KeyValueStore } from '@capgo/capacitor-fast-sql';

const db = await FastSQL.connect({ database: 'app', encrypted: true, encryptionKey });
const kv = await KeyValueStore.open({ database: 'kv', encrypted: true, encryptionKey });
```

- Keep the same schema; port queries (`executeSql` -> `db.query` / `db.run` / `db.executeBatch` / `db.transaction`).
- Encryption requires SQLCipher: Android `implementation 'net.zetetic:sqlcipher-android:<version>'` in `android/app/build.gradle`; iOS CocoaPods subspec `CapgoCapacitorFastSql/SQLCipher`. Without it, `encrypted: true` fails with `Encryption is not available in this build` on iOS.
- Fast SQL runs a localhost HTTP server: add `NSAppTransportSecurity` -> `NSAllowsLocalNetworking` (iOS) and a localhost cleartext `network_security_config.xml` (Android). See `sqlite-to-fast-sql` for the full setup.
- Store `encryptionKey` with Native Biometric (Step 4) or derive it server-side; never hard-code it.

### Step 6: Clean up

```bash
npm uninstall @ionic-enterprise/auth @ionic-enterprise/identity-vault @ionic-enterprise/secure-storage
rg -n "@ionic-enterprise" -g '!node_modules' .
npx cap sync
```

Remove the Ionic Enterprise registry/token lines from `.npmrc` only after no enterprise package remains (CI installs fail otherwise).

## Verification

- Upgrade test: install the current store build, log in, store data; install the new build over it; user stays logged in and data is present.
- Fresh install: login, token refresh, logout, and biometric unlock work on real iOS and Android devices (simulators cannot fully test biometrics).
- Change device biometrics: `BIOMETRY_CURRENT_SET` items become unreadable and the app falls back to login.
- `rg -n "@ionic-enterprise" -g '!node_modules' .` returns nothing after the final release.
- `npm ci` succeeds in CI without Ionic Enterprise registry credentials.

## Error Handling

| Problem | Fix |
|---|---|
| `npm error 401 Unauthorized` / `404` for `@ionic-enterprise/*` in CI | Enterprise registry token expired; finish removal or keep the token until release N+1 |
| Users logged out after update | Data not carried over; ship the dual-plugin release N first |
| `redirect_uri_mismatch` / IdP error after switching | Register the new redirect URL with the IdP; keep scopes identical |
| `Encryption is not available in this build` | Add the SQLCipher dependency/subspec, rebuild |
| Fast SQL calls fail with network errors | Missing ATS local networking / Android cleartext config for localhost |
| Biometric read fails after enrollment change | Expected with `BIOMETRY_CURRENT_SET`; re-authenticate and save again |

© Cap-go · MIT · Cap-go/capgo-skills

Похожие скиллы

Все скиллы по теме «Мобильная разработка» →

Сначала — ionic-enterprise-sdk-migration от других авторов.

ionic-enterprise-sdk-migration capawesome-team Ведёт агента через перенос Capacitor-приложения с закрытых плагинов Ionic Enterprise SDK на альтернативы Capawesome: OAuth, Vault, Biometrics, Secure Preferences, SQLite. CX Codex +1 723установок ionic-appflow-migration capawesome-team Проводит агента через переезд проекта с Ionic Appflow на Capawesome Cloud: импорт организации одной командой и замена Live Update SDK в приложении. CX Codex +1 756установок ionic-app-development capawesome-team Руководство по разработке интерфейсов на Ionic Framework для существующих проектов с учётом жизненного цикла страниц и каталога из 80+ компонентов. CX Codex +1 1 300установок ionic Mindrally Задаёт агенту правила разработки на Ionic: структура проекта, компоненты, стили, ленивая загрузка и работа с Firebase. CX Codex +1 797установок entra-agent-id microsoft Помогает создавать и настраивать идентификаторы ИИ-агентов с поддержкой OAuth2 через Microsoft Graph beta API. Пригодится при настройке сервисных учетных записей в Microsoft Entra. 69установок azure-enterprise-infra-planner Microsoft Скилл планирует корпоративную инфраструктуру Azure по описанию нагрузки и генерирует Bicep или Terraform. Пригодится, когда нужно спроектировать landing zone, hub-spoke сеть или DR-топологию. ★ 3 149звёзд репо authentication dpearson2699 Помогает собирать сценарии входа в iOS через Apple ID, passkeys, OAuth и биометрию. Пригодится, когда нужно связать авторизацию с проверкой учётных данных и серверной валидацией. CX Codex +1 3 900установок

Из того же набора47

capgo-release-management Скилл ведёт релизы Capgo из CLI: загрузка бандлов, каналы, постепенный выкат, откат и шифрование. Пригодится, когда релиз ломается на загрузке или нужно откатить бандл. CX Codex +1 705установок capacitor-app-upgrade-v7-to-v8 Ведёт приложение на Capacitor 7 к восьмой версии: сначала npx cap migrate, потом ручной чек-лист по iOS и Android. CX Codex +1 704установок capgo-cloud Скилл помогает спланировать работу с Capgo Cloud в проектах на Capacitor: нативные сборки, live-обновления и выгрузку в сторы. Задаёт чёткий порядок действий. CX Codex +1 690установок capgo-organization-management Управляет организациями и политиками безопасности в Capgo CLI. Помогает проверять статус 2FA, настраивать пароли и срок жизни API-ключей. CX Codex +1 685установок skill-creator Помогает проектировать, форматировать и проверять скиллы для ИИ-агентов по стандартам Capgo: с триггерами, линтингом и тестами. CX Codex +1 681установок webapp-to-capacitor Планирует и выполняет превращение веб-приложения, PWA или SPA в приложение под iOS и Android на Capacitor, которое проходит ревью магазинов. CX Codex +1 665установок ionic-appflow-migration Переводит Ionic или Capacitor проект с Ionic Appflow на Capgo: живые обновления, сборки и публикация в стор. CX Codex +1 653установок capacitor-plugin-upgrade-v7-to-v8 Переводит библиотеку плагина с Capacitor 7 на 8. Запускает официальный мигратор, обновляет зависимости, параметры сборки Gradle, Kotlin 2.2 и манифесты iOS 15. CX Codex +1 643установок

Спонсоры проекта

Компании, которые помогают держать аналитику открытой