{"id":"metrik-tech/sdk","name":"sdk","scope":"metrik-tech","platform":"roblox","description":"SDK for https://metrik.app","version":"0.0.3","latest":"0.0.3","versions":["0.0.1","0.0.2","0.0.3"],"license":"GPL-3.0","licenseRating":"unsafe","licenseCaveats":["Strong copyleft: shipping this in your game plausibly requires releasing your game's entire source under GPL-3.0. Not recommended for closed-source projects."],"licenseVerified":false,"dependencies":{},"integrity":"b6539439f22c4d9311ffd06c4a972c3fc254ed109c42884841f698fa2081dbda","likes":0,"downloads":0,"install":"forest install metrik-tech/sdk","url":"https://forest.dev/p/roblox/metrik-tech/sdk","files":"https://api.forest.dev/ai/package/roblox/metrik-tech/sdk/files","readme":"# Metrik SDK `alpha`\n\n[![GitHub release (latest by date)](https://img.shields.io/github/v/release/metrik-tech/sdk?label=latest%20release)](https://github.com/metrik-tech/sdk/releases/latest) [![GitHub issues](https://img.shields.io/github/issues/metrik-tech/sdk)](https://github.com/metrik-tech/sdk/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc) [![GitHub pull requests](https://img.shields.io/github/issues-pr/metrik-tech/sdk)](https://github.com/metrik-tech/sdk/pulls?q=is%3Apr+is%3Aopen+sort%3Aupdated-desc) [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/metrik-tech/sdk/ci.yml)](https://github.com/metrik-tech/sdk/actions/workflows/ci.yml)\n\n> **Warning**\n> The Metrik API is NOT currently online. Metrik and the SDK will not work at the moment. Additionally, some parts of the codebase will just straight up not work.\n\nThis is the Roblox SDK for Metrik, the automated LiveOps toolkit for Roblox. This module is still in heavy development, is not feature complete, subject to breaking changes, and is not recommended for production use.\n\nInstall options include:\n- Plugin (coming soon)\n- Wally\n- `.rbxm`/`.rbxmx`\n- `roblox-ts`\n\n# Installation\n\n## via Wally\n\nYou must have wally installed. Learn more about Wally by Uplift Games [here](\n    https://github.com/UpliftGames/wally\n).\n\n```bash\nwally install metrik-tech/metrik\n```\n\n## via `.rbxm`/`.rbxmx`\n\nDownload from GitHub releases and insert into Studio or Rojo. Releases can be found [here](\n    https://github.com/metrik-tech/sdk/releases/latest\n).\n\n## via `roblox-ts`\n\n> **Note**\n> This is \\*NOT\\* to be used with regular Luau. This is only for use with `roblox-ts`, a TypeScript-to-Luau compiler. Learn more about `roblox-ts` and whether or not it's the right fit for your project [here](https://roblox-ts.com/).\n\n```bash\n# npm\nnpm install @rbxts/metrik\n\n# yarn\nyarn add @rbxts/metrik\n\n# pnpm\npnpm add @rbxts/metrik\n```\n\n# Usage\n\nYou need to initalize Metrik on **both** the client and the server. However, config options only need to be passed on the server (This is subject to change).\n## Server\n\n### TypeScript\n\n```ts\n// any server script (file.server.ts)\nimport Metrik from \"@rbxts/metrik\";\n\nconst metrik = new Metrik({\n    token: \"your-token-here\",\n    options: {\n        debug: true\n    }\n})\n```\n\n### Lua\n\n```lua\n-- any server script (file.server.lua)\n-- or a script in ServerScriptService\nlocal Metrik = require(path.to.Metrik)\n\nlocal metrik = Metrik.new({\n    token = \"your-token-here\",\n    options = {\n        debug = true\n    }\n})\n\n```\n\n## Client\n\n### TypeScript\n\n```ts\n// any client script (file.client.ts)\nimport Metrik from \"@rbxts/metrik\";\n\nnew Metrik();\n```\n\n### Lua\n\n```lua\n-- any client script (file.client.lua)\n-- or a LocalScript (preferably in StarterPlayerScripts)\n\nlocal Metrik = require(path.to.Metrik)\n\nMetrik.new()\n```\n\n## Options\n\n```ts\ninterface IOptions {\n    debug?: boolean; // defaults to false. logs internal events and errors to output if true\n    logMetrikMessages?: boolean; // defaults to false. logs messages outputted by the SDK to the dashboard if true \n    apiBase?: string; // defaults to https://api.metrik.app. in most cases, you shouldn't need to change this\n}\n```\n\n## API\n\n### `metrik.log(message: string, data: unknown): Promise<void>` SERVER ONLY\n\nLogs a message to the Metrik dashboard with extra details.  Internally throws a `print`.\n\n### `metrik.error(message: string, data: unknown): Promise<void>` SERVER ONLY\n\nLogs an error to the Metrik dashboard with extra details. Internally throws a `warn`.\n\n### `metrik.crash(message: string, data: unknown): Promise<void>` SERVER ONLY\n\nLogs a crash to the Metrik dashboard with extra details. Internally throws an `error`, which stops the thread where it was called AFTER the crash is logged.\n\n### `metrik.warn(message: string, data: unknown): Promise<void>` SERVER ONLY\n\nLogs a warning to the Metrik dashboard with extra details. Internally throws a `warn`.\n\n\n","readmeTruncated":false}