{"id":50176,"plugin_id":"plugin_asdk_app_6abf2061a1248191a70d61197a20542a","kind":"skill","collection_source":"plugin_package","comparison_source":null,"observed_at":"2026-10-24T13:42:16.968Z","digest":"14c4179d3b59001ed1500bef60062c07d266c04d14c1afdacc0c4dab5704872d","against":null,"payload":{"description":"Sets up the Hive Axyl SDK in a Unity application: UPM package selection, bootstrap, capability and auth addon registration, service resolution, and automatic token refresh wiring. Use for installing or configuring Axyl, missing services, or initialization issues; login composition is handled by the relevant login flow skill.","included_files":[],"name":"axyl-setup","skill_md_contents":"---\nname: axyl-setup\ndescription: \"Sets up the Hive Axyl SDK in a Unity application: UPM package selection, bootstrap, capability and auth addon registration, service resolution, and automatic token refresh wiring. Use for installing or configuring Axyl, missing services, or initialization issues; login composition is handled by the relevant login flow skill.\"\nlicense: Apache-2.0\nmetadata:\n  author: Com2uS Platform Corporation\n  sdk-version: 1.0.0\n  engine: Unity 6000.0+\n---\n\n# Set up Axyl in Unity\n\nInstalls the needed packages and initializes Axyl once at startup, keeping the app's\nexisting configuration and registrations. The Installed SDK section below applies to\nevery step. Login, payment and push flows have their own skills; never initialize\ninside them.\n\n**Inputs:** `appId` and the Axyl `clientId` from app provisioning, the registry URL,\nthe selected login, payment and push routes, and any provisioned host.\n**App owns:** the startup path, persistence policy and platform build settings.\n\n## Install packages\n\nInstall from a scoped registry only: a `scopedRegistries` entry whose `scopes`\ninclude `com.com2usplatform.hiveaxyl`, with the registry URL the developer supplies\n(the SDK names `https://package.openupm.com` as its public registry); `steamworks`\nalso needs scope `com.rlabrecque`. Git URLs are unsupported because they bring no\ndependency resolution. Keep a local `file:` distribution only when the developer\nsupplies it; its paths are relative to the manifest's directory, so check that each\ntarget exists.\n\nDeclare every package the app calls. An addon depends only on core, never on its\nmodule, so declare the module too (for example `push` with `push.addon.fcm`).\nInstall only the addons for the selected routes. The baseline requires Unity 6000.0+\nand .NET Standard 2.1.\n\n| Need | Package suffix after `com.com2usplatform.hiveaxyl.` | Supported target and minimum | Registration |\n|---|---|---|---|\n| Core | `core` | All SDK targets; Windows prerequisite below | `HiveBootstrap.Initialize` |\n| Auth + token APIs | `auth` | All (server API) | **Both** `AddAuth()`, `AddToken()` |\n| Secure persistence building block | `storage` | Android API 29+; Windows 11 or later on x64; iOS 17+; macOS 15+ on Apple silicon | `AddSecureStorage()`; app owns save/load policy |\n| Apple sign-in | `auth.addon.apple` | iOS 17+; macOS 15+ on Apple silicon | `AddAppleSignIn()` |\n| Google native account picker | `auth.addon.credentialmanager` | Android API 29+ | `AddCredentialManager()` |\n| Play Games | `auth.addon.gpg` | Android API 29+ | `AddGooglePlayGames()` |\n| Steam native | `auth.addon.steam`, `steamworks` | Windows 11 or later on x64; macOS 15+ on Apple silicon | `AddSteamAuth()`; inspect Steamworks.NET dependency |\n| Google/X/Apple browser or Steam OpenID | `auth.addon.webauth` | Android API 29+; WebGL; Windows 11 or later on x64; iOS 17+; macOS 15+ on Apple silicon | `AddWebAuth()` |\n| Payments Capability | `payments` | All (server API) | `AddPayments()` or `AddPayments(sandbox: true)` |\n| Apple purchases | `payments.addon.apple` | iOS 17+; macOS 15+ on Apple silicon | `AddStoreKit()` |\n| Google purchases | `payments.addon.google` | Android API 29+ | `AddPlayBilling()` |\n| Steam purchase callbacks | `payments.addon.steam`, `steamworks` | Windows 11 or later on x64; macOS 15+ on Apple silicon | `AddSteamMicrotransactions()`; app initializes/pumps Steamworks |\n| Push registry | `push` | All (server API) | `AddPush()` |\n| Apple push | `push.addon.apns` | iOS 17+; macOS 15+ on Apple silicon | `AddAPNS()`; app supplies delegate forwarding |\n| Android push | `push.addon.fcm` | Android API 29+ | `AddFCM()`; app supplies Firebase configuration |\n\nNamespaces and assembly platform restrictions come from the installed package; Steam\nextension visibility also needs platform compile guards. Other capability packages\n(mailbox, serviceaccess, tcb, coupon, analytics) have their own registration. PG\npayments use the Payments Capability and a browser, with no PG addon.\n\n### Platform prerequisites\n\nMatch Player Settings and native deployment targets to each selected addon's minimum\nbefore testing its route.\n\nEvery Windows Editor or player that loads Axyl needs the\n[Microsoft Visual C++ 2015–2022 Redistributable (x64)](https://aka.ms/vs/17/release/vc_redist.x64.exe),\nand the game's installer must install it for players; Windows and Unity do not.\n`core` links against it, so this applies even without secure storage or WebAuth. An\nolder redistributable lacks `VCRUNTIME140_1.dll`. Without it, initialization fails\nwith a `DllNotFoundException` for the `HiveAxyl_Core` native plugin.\n\n## Initialize once\n\nCall `HiveBootstrap.Initialize` once on the Unity main thread; a second call throws\n`InvalidOperationException`. Each capability picks its host when it registers;\n`Zone`/`SetZone` no longer exist.\n\n| Registration | Default host |\n|---|---|\n| `AddAuth()`, `AddToken()` | `https://core-api.hiveaxyl.com` |\n| `AddPush()` | `https://app-api.hiveaxyl.com` |\n| `AddPayments()` | `https://commerce-api.hiveaxyl.com` |\n| `AddPayments(sandbox: true)` | `https://sandbox-commerce-api.hiveaxyl.com` |\n\nOnly Payments has a sandbox; asking another capability for one does not compile.\n`AddX(baseUrl)` is for an explicitly provisioned host: ask for it, never guess.\n\nExample for an app using the payments sandbox and automatic session refresh:\n\n```csharp\nusing Hive.Axyl.Auth;\nusing Hive.Axyl.Core;\nusing Hive.Axyl.Core.Unity;\nusing Hive.Axyl.Payments;\nusing Hive.Axyl.Storage;\n\n// Run once on Unity's main thread. appId/clientId come from app provisioning.\nconst string tokenHost = \"https://core-api.hiveaxyl.com\"; // AddToken() default\nvar config = CoreConfig.CreateBuilder(appId)\n    .SetAutoRefresh(true)\n    .Build();\nHiveBootstrap.Initialize(config, b => b\n    .AddAuth()\n    .AddToken()\n    .AddPayments(sandbox: true)\n    .AddSecureStorage());\nAuthTokenRefresh.Enable(tokenHost, clientId);\n```\n\n`AuthTokenRefresh.Enable(string baseUrl, string clientId)` runs once, **after**\n`Initialize`, with the Token host and the Axyl client ID; `AddToken` alone does not\nwire refresh. The SDK refreshes live sessions: never race it with a manual refresh.\n\nRegister the selected addons in the same closure. In the Editor or off-platform a\nregistration may be a no-op, so a compiling `AddX` call does not prove the route\nworks. A missing native library can make `AddSecureStorage()` throw: guard it if the\napp should start without secure storage. Resolve optional ports with\n`HiveCore.TryResolve<T>(out var service)`, report a missing route and let the app\nchoose another; never turn a failed provider login into guest creation.\n\n## Connect app state\n\n- `IAuthService`, `ITokenService` and `ISessionManager` must resolve after setup; a\n  missing one is a setup failure.\n- Auth APIs do not install a session: the login flow exchanges the code and calls\n  `ISessionManager.SetSession` with the validated tokens.\n- Subscribe to `ISessionManager.OnSessionRefreshed` before login and persist each\n  snapshot in order, rotated refresh tokens included, so an older save never\n  overwrites a newer one.\n- `ISecureStorage` is a mechanism, not automatic persistence; handle `AccessDenied`\n  without clearing data. WebGL lacks the same guarantees: use the app's session-only\n  or supported policy, never PlayerPrefs for secrets.\n- `OnSessionExpired` and `ClearSession()` are destructive. Do not delete stored\n  credentials on app quit, transient or unknown failures, a missing refresh token\n  alone or `AccessDenied`; ending the in-memory session is not destroying recovery\n  data.\n- SDK events arrive on the main thread, but an awaited call resumes on the caller's\n  context: dispatch Unity API access when needed. Logging such as `SetAllowlist` is\n  optional.\n\n## Verify\n\n- [ ] Resolved packages share one release; required services resolve; a second\n  initialization and a missing addon are handled.\n- [ ] Each capability uses its intended host (sandbox only for Payments when asked),\n  and refresh uses the Token host.\n- [ ] Deployment targets meet each selected addon's minimum; Windows runs in the\n  Editor and in a clean x64 player with the redistributable in the installer.\n- [ ] A session refresh updates app persistence; Editor or test-double checks are\n  reported separately from device and server runs.\n\n<!-- axyl-shared: core/installed-sdk.md -->\n\n## Installed SDK\n\n- Read `Packages/manifest.json`, the lock file and each resolved `package.json`.\n  All `com.com2usplatform.hiveaxyl.*` packages must be the same release (UPM does\n  not enforce this); `com.hive.axyl.*` packages are a release before 1.0.0-rc.9.\n- The installed SDK wins for APIs, types and contracts. If its release differs\n  from this skill's `sdk-version`, apply a step only after its fields, result\n  variants, platform support and failure behaviour match; otherwise stop at that\n  step and report what is missing. Never change the installed version.\n- The app owns UI, storage, the device key and orchestration. Sample and recipe\n  classes are not SDK APIs.\n\n<!-- /axyl-shared -->\n"},"changes":[],"summary":"First saved snapshot. No earlier version is available for comparison.","summary_kind":"deterministic","summary_metadata":{}}