{"id":"moxxum/datakit","name":"datakit","scope":"moxxum","platform":"roblox","description":"Session-locked player data via vendored ProfileStore: Version migrations, dot-path accessors","version":"0.1.0","latest":"0.1.0","versions":["0.1.0"],"license":"MIT","licenseRating":"safe","licenseCaveats":[],"licenseVerified":false,"dependencies":{},"integrity":"9b70a38dc5406e946744c2a3e73f846d3c662b302f847e83b394d5791024c2c1","likes":0,"downloads":0,"install":"forest install moxxum/datakit","url":"https://forest.dev/p/roblox/moxxum/datakit","files":"https://api.forest.dev/ai/package/roblox/moxxum/datakit/files","readme":"# datakit\n\nThin wrapper around [ProfileStore](https://github.com/MadStudioRoblox/ProfileStore):\nsession-locked player profiles, `Version`-field ordered migrations, dot-path accessors,\nautomatic session end on leave/shutdown. ProfileStore itself is vendored at a pinned\ncommit (`45c9847`, Apache-2.0 — see `LICENSE-ProfileStore`); datakit does not\nreimplement any of its internals.\n\nServer realm: `DataKit = \"moxxum/datakit@0.1.0\"` under `[server-dependencies]`.\n\n## API\n\n```lua\nDataKit.Configure(config)      -- once, before any Load\nDataKit.Load(player)           -- yields → Profile? (nil = session unavailable; kicks by default)\nDataKit.Get(player)            -- non-yielding → Profile? (already-loaded only)\nDataKit.Release(player)        -- ends the session (also automatic on leave/shutdown)\nDataKit._RunMigrations(...)    -- internal, exposed for tests\n\nprofile.Data                   -- raw data table\nprofile.Raw                    -- underlying ProfileStore profile\nprofile:Get(path)              -- \"Stats.Wins\" dot paths; errors on broken parent chain\nprofile:Set(path, value)\nprofile:IsActive()\nprofile:EndSession()\n```\n\nConfig: `Template` (required, must contain `Version: number`), `StoreName` (default\n`\"PlayerData\"`), `Migrations` (`[2] = fn` upgrades v1→v2, run in order), `UseMock`\n(default: auto-mock in Studio without DataStore access), `KickOnLoadFail` (default true).\n\n## Example\n\n```lua\nlocal DataKit = require(ServerScriptService.ServerPackages.DataKit)\n\nDataKit.Configure({\n\tTemplate = { Version = 2, Coins = 0, Stats = { Wins = 0 } },\n\tMigrations = {\n\t\t[2] = function(data) -- v1 profiles gain Stats\n\t\t\tdata.Stats = { Wins = 0 }\n\t\tend,\n\t},\n})\n\nPlayers.PlayerAdded:Connect(function(player)\n\tlocal profile = DataKit.Load(player)\n\tif profile then\n\t\tprofile:Set(\"Coins\", profile:Get(\"Coins\") + 10)\n\tend\nend)\n```\n\nBumping `Template.Version` without providing every intermediate migration makes `Load`\nfail closed (kick) rather than corrupt data.\n\n## Test\n\n`rojo build test.project.json -o test.rbxl`, open in Studio, Play Solo, expect\n`[datakit-test] ALL PASS` in Output. Uses the mock store; no DataStore access needed.\n","readmeTruncated":false}