Skip to content

Commit ac75678

Browse files
committed
feat: add authentication, installation & building docs
1 parent db62f4b commit ac75678

File tree

8 files changed

+689
-607
lines changed

8 files changed

+689
-607
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"version": "1.0.0",
44
"repository": "https://github.com/datalinkhq/docs",
55
"license": "MIT",
6-
"packageManager": "yarn@3.2.3",
76
"scripts": {
87
"dev": "next",
98
"build": "next build",

pages/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Datalink - Introduction
3-
description: Get started with DataLink
3+
description: Install your Datalink SDK
44
---
55

66
import {Code} from '../components/code';

pages/sdks/installation.mdx

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
---
2+
title: Server-side Lua SDK
3+
description: Guide to using Datalink's server-side Lua SDK
4+
---
5+
6+
import {Code} from '../../components/code';
7+
8+
# Get Started
9+
To begin your Datalink reporting journey, the Lua SDK needs to be installed and configured.
10+
11+
# Installation
12+
To install the Datalink SDK, you can either use a prebuilt binary, or compile your own.
13+
14+
## Using a prebuilt release
15+
Grab the latest version of the SDK from the [Github Releases](https://github.com/datalinkhq/rbx-datalink/releases/) and drag it into your Studio's ServerStorage.
16+
17+
## Compiling the source code
18+
If you would like to compile the SDK yourself, you would require the following software:
19+
- [Git](https://git-scm.com/)
20+
- [Rojo](https://rojo.space/)
21+
- [Node.JS](https://nodejs.org/) (Optional, only for roblox-ts support)
22+
- [Yarn/PNPM/NPM](https://pnpm.io) (Optional, only for roblox-ts support)
23+
24+
25+
### Lua SDK
26+
1. Clone the repo from GitHub using git:
27+
<Code>
28+
```bash
29+
git clone https://github.com/datalinkhq/rbx-datalink.git
30+
```
31+
</Code>
32+
33+
2. Build the RBXM binary using rojo:
34+
<Code>
35+
```bash
36+
rojo build -o sdk.rbxm
37+
```
38+
</Code>
39+
40+
3. Add the SDK to the ServerStorage. You're good to go!
41+
42+
### Roblox-TS SDK
43+
44+
1. Clone the repo from GitHub using git:
45+
<Code>
46+
```bash
47+
git clone https://github.com/datalinkhq/rbx-datalink.git
48+
```
49+
</Code>
50+
51+
2. Install Node.JS dependencies:
52+
<Code>
53+
```bash
54+
pnpm i
55+
```
56+
</Code>
57+
58+
3. Compile the TypeScript code the roblox-ts compiler:
59+
<Code>
60+
```bash
61+
pnpm run build
62+
```
63+
</Code>
64+
65+
4. Build the compiled TypeScript code using rojo:
66+
<Code>
67+
```bash
68+
cd out && rojo build -o sdk.rbxm
69+
```
70+
</Code>
71+
72+
5. Add the SDK to the ServerStorage. You're good to go!

pages/sdks/meta.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{
2-
"server": "Server Module"
2+
"server": "Server Module",
3+
"installation": "SDK Compilation & Installation"
34
}

pages/sdks/server/authenticate.mdx

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
title: Authenticating using the Server Side SDK
3+
description: Guide to using Datalink's server-side Lua SDK
4+
---
5+
6+
import {Code} from '../../../components/code';
7+
import Callout from 'nextra-theme-docs/callout';
8+
9+
# Authentication
10+
11+
Before the Datalink SDK can start reporting your game analytics, it has to be configured & authenticated properly.
12+
13+
Grab an API key from the Datalink Dashboard, and use example code below.
14+
15+
<Callout type="error" emoji="">
16+
Make sure you do not leak your API Key, as it would give an attacker **FULL ACCESS** to your data.
17+
</Callout>
18+
19+
<Code>
20+
```lua
21+
local ServerStorage = game:GetService("ServerStorage")
22+
23+
local DatalinkService = require(ServerStorage.DatalinkService)
24+
25+
DatalinkService:Initialize(userId: number, key: string)
26+
```
27+
</Code>
28+
29+
30+
<Callout emoji="💡">
31+
A recommended method to safeguard your API Key is to store it in a private and secure `DataStore`.
32+
</Callout>

pages/sdks/server/lua.mdx

Lines changed: 0 additions & 8 deletions
This file was deleted.

pages/sdks/server/meta.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)