Skip to content

SDK-Documentation Update #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
!.yarn/sdks
node_modules
.next
.env
14 changes: 7 additions & 7 deletions pages/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,27 @@ import {Code} from '../components/code';
import Link from 'next/link';

# Datalink
Datalink is a tool that helps to provide Roblox Developers with critical & detailed analysis surrounding both Player & Game state & data in a Roblox Experience
Datalink is a tool that helps to provide Roblox Developers with critical & detailed analysis surrounding both Player & Game state & data in a Roblox Experience.

## Product Summary
Datalink should provide a suite of interfaces which help to destinguish and expose information regarding state, health, mobility, player data + more;
Datalink will provide a suite of interfaces which help to destinguish and expose information regarding state, health, mobility, player data + more. A portion of what we have planned is listed below:

- Game/Experience State
- State is defined by the contextual agreement surrounding a servers ability to perform, allow users to join, remove and update datastores.
- For example, The State field could include;
- For example, The State field could include:
- Servers Per `Hour`, `Day`, `Month`, `Annum`
<br> </br>
- Game/Experience Health
- Health is defined by how much CPU, Memory, Processing Time is being taken up by the server.
- Additionally, we can look further and provide feedback regarding player crashing rates, reproduction steps on how these players might of crashed and potential fixes if any are obvious
- Additionally, we can look further and provide feedback regarding player crashing rates, reproduction steps on how these players might of crashed and potential fixes if any are common.
<br> </br>
- Data
- Data includes all kinds of information regading the places inside of your Roblox Experience
- Data includes all kinds of information regading the places inside of your Roblox Experience.
- Custom Developer Events will also be counted under this field, as we are unable to process specifics in your events.
<br> </br>
- So, so much more!
- We're still yet and looking into providing so much more which'll help improve the scalability of your experience!
- Some examples of what we're planning to Ship Datalink with are;
- Some other examples of what we're planning to ship datalink including are:
- Fast/Feature Flags
- DataStore, MemoryStore & MessagingService wrappers
- Game Event Controllers
Expand All @@ -42,4 +42,4 @@ The [LuaU SDK](https://docs.datalink.dev/sdks/installation) is designed to simpl

> RESTful APIs

The [RESTful API](https://docs.datalink.dev/reference/api_reference/overview) is the backend to the Datalink service, if you've chosen to write your own wrapper/module for the Datalink service, then taking advantage of these APIs will be of interest.
The [RESTful API](https://docs.datalink.dev/reference/api_reference/overview) is the backend to the Datalink service, if you've chosen to write your own wrapper/module for the Datalink service, then taking advantage of these APIs will be of interest.
8 changes: 5 additions & 3 deletions pages/sdks/sdk/authentication.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ end):catch(warn)
```
</Code>


<Callout type="error" emoji="">
Please ensure that the following are **NOT** exposed to the client;
Please ensure that the Authentication Key is **NOT** exposed to the client as this would provide an attacker **full, unrestricted** access to your experience's data.
</Callout>

- Authentication Key
- This key would allow an attacker **FULL ACCESS** to your experiences data
<Callout emoji="💡">
A recommended method to safeguard your API Key is to store it in a private and secure `DataStore`.
</Callout>
17 changes: 15 additions & 2 deletions pages/sdks/sdk/methods/authenticateAsync.mdx
Original file line number Diff line number Diff line change
@@ -1,15 +1,28 @@
---
title: Authenticating using the Server Side SDK
description: Guide to using Datalink's server-side Lua SDK
title: Authentication
description: Datalink Authentication
---

import {Code} from '../../../../components/code';
import Callout from 'nextra-theme-docs/callout';

# authenticateAsync

Primary resource used in authenticating the SDK

<Code>
```lua
local DatalinkSDK = require(Path.To.DatalinkSDK)
local DatalinkInstance = DatalinkSDK.new({
datalinkUserAccountId = YOUR_ACCOUNT_ID,
datalinkUserToken = YOUR_ACCOUNT_TOKEN
})

DatalinkInstance:authenticateAsync():andThen(function()
print('Hello from Datalink!')
end)
```
```typescript

```
</Code>
49 changes: 49 additions & 0 deletions pages/sdks/sdk/methods/fireCustomEvent.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
title: FireCustomEvent - Method
description: Invoke a custom datalink event over to the dashboard!
---

import {Code} from '../../../../components/code';
import Callout from 'nextra-theme-docs/callout';

# fireCustomEvent

This method is used to invoke a custom developer event, a custom event allows the developer to send whatever information they would like to send over to the Datalink Service.

## Parameters

#### eventName: String

The `eventName` parameter should be used to define the name of the custom event the developer would like to invoke.

#### eventParameters: Dictionary ( [string]: [datatype](https://www.tutorialspoint.com/lua/lua_data_types.htm) )

The `eventParameters` parameter should be defined as a dictionary which contains the parameters the developer would like to attach to the custom event.

## Example

<Code>
```lua
local DatalinkSDK = require(Path.To.DatalinkSDK)
local DatalinkInstance = DatalinkSDK.new({
datalinkUserAccountId = YOUR_ACCOUNT_ID,
datalinkUserToken = YOUR_ACCOUNT_TOKEN
})

DatalinkInstance:authenticateAsync():andThen(function()
DatalinkInstance:fireCustomEvent(
"MyEventName", {
["MyEventParameter"] = "PlayerExperience",
["MyEventValue"] = Player.Experience
}
)
end)
```
```typescript

```
</Code>

<Callout type="warning" emoji="">
The above is just an **EXAMPLE** of what you're enabled to do with Datalink - you're able to send a lot more than just player information into the dashboard!
</Callout>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: Guide to using Datalink's server-side Lua SDK
import {Code} from '../../../../components/code';
import Callout from 'nextra-theme-docs/callout';

# invokeEventAsync
# fireEconomyEvent

<Code>
```lua
Expand Down
15 changes: 15 additions & 0 deletions pages/sdks/sdk/methods/fireProgressionEvent.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
title: Authenticating using the Server Side SDK
description: Guide to using Datalink's server-side Lua SDK
---

import {Code} from '../../../../components/code';
import Callout from 'nextra-theme-docs/callout';

# fireProgressionEvent

<Code>
```lua

```
</Code>
15 changes: 15 additions & 0 deletions pages/sdks/sdk/methods/getAllFastFlagsAsync.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
title: Authenticating using the Server Side SDK
description: Guide to using Datalink's server-side Lua SDK
---

import {Code} from '../../../../components/code';
import Callout from 'nextra-theme-docs/callout';

# getAllFastFlagsAsync

<Code>
```lua

```
</Code>
41 changes: 41 additions & 0 deletions pages/sdks/sdk/methods/getAllGameLogsAsync.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
title: GetAllGameLogsAsync - Method
description: Get all game logs relative to the current place.
---

import {Code} from '../../../../components/code';
import Callout from 'nextra-theme-docs/callout';

# getAllGameLogsAsync

This method is used to retrieve all game logs for this expereince under the Datalink Service

## Example

<Code>
```lua
local DatalinkSDK = require(Path.To.DatalinkSDK)
local DatalinkInstance = DatalinkSDK.new({
datalinkUserAccountId = YOUR_ACCOUNT_ID,
datalinkUserToken = YOUR_ACCOUNT_TOKEN
})

DatalinkInstance:authenticateAsync():andThen(function()
DatalinkInstance:getAllGameLogsAsync():andThen(function(gameLogs)
if not gameLogs[1] then
return
end

print(gameLogs[1]) --[[{
["id"] = 1,
["type"] = "Error",
["trace"] = "erroringFunction()",
["message"] = "Attempted to index nil"
}]]--
end)
end)
```
```typescript

```
</Code>
47 changes: 47 additions & 0 deletions pages/sdks/sdk/methods/getGameLogAsync.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
title: getGameLogAsync - Method
description: Get a game log relative to the current place.
---

import {Code} from '../../../../components/code';
import Callout from 'nextra-theme-docs/callout';

# getGameLogAsync

This method is used to retrieve a specific game log for this expereince under the Datalink Service.

## Parameters

#### logId: Number

The `logId` parameter should be used to get details on a specific log object.

## Example

<Code>
```lua
local DatalinkSDK = require(Path.To.DatalinkSDK)
local DatalinkInstance = DatalinkSDK.new({
datalinkUserAccountId = YOUR_ACCOUNT_ID,
datalinkUserToken = YOUR_ACCOUNT_TOKEN
})

DatalinkInstance:authenticateAsync():andThen(function()
DatalinkInstance:getGameLogAsync(422):andThen(function(gameLogObject)
print(gameLogObject) --[[{
["id"] = 422,
["type"] = "Error",
["trace"] = "erroringFunction()",
["message"] = "Attempted to index nil"
}]]--
end)
end)
```
```typescript

```
</Code>

<Callout type="none" emoji="">
An example of why you might want to use this functionality, this feature enables a developer to display logs & errors on a dashboard in-game.
</Callout>
15 changes: 15 additions & 0 deletions pages/sdks/sdk/methods/getLocalVariable.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
title: Authenticating using the Server Side SDK
description: Guide to using Datalink's server-side Lua SDK
---

import {Code} from '../../../../components/code';
import Callout from 'nextra-theme-docs/callout';

# getLocalVariable

<Code>
```lua

```
</Code>
15 changes: 15 additions & 0 deletions pages/sdks/sdk/methods/getLocalVariables.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
title: Authenticating using the Server Side SDK
description: Guide to using Datalink's server-side Lua SDK
---

import {Code} from '../../../../components/code';
import Callout from 'nextra-theme-docs/callout';

# getLocalVariables

<Code>
```lua

```
</Code>
49 changes: 49 additions & 0 deletions pages/sdks/sdk/methods/getPlayerHash.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
title: GetPlayerHash - Method
description: Get Datalink anonimized player hashes
---

import {Code} from '../../../../components/code';
import Callout from 'nextra-theme-docs/callout';

# getPlayerHash

This method should be used to get the hash assigned to a player, this hash is generated via a sha256 algorithm & provides a way to link specific data to a player anonymously

## Parameters

#### player: Player

The `player` parameter is pretty self explanitory, the player you want to get the hash of

## Example

<Code>
```lua
local DatalinkSDK = require(Path.To.DatalinkSDK)
local DatalinkInstance = DatalinkSDK.new({
datalinkUserAccountId = YOUR_ACCOUNT_ID,
datalinkUserToken = YOUR_ACCOUNT_TOKEN
})

DatalinkInstance:authenticateAsync():andThen(function()
DatalinkInstance:fireCustomEvent(
"playerDrivenEvent", {
["playerHash"] = DatalinkInstance:getPlayerHash(player),
["playerEvent"] = "PlayerPartyStarted",
["playerInvites"] = {
DatalinkInstance:getPlayerHash(playerThatWasInvited)
}
}
)
end)
```
```typescript

```
</Code>

<Callout type="none" emoji="">
It's important that you keep the data sent to datalink anonymous.
Datalink is an anonymous data-driven platform — please respect our mission.
</Callout>
Loading