Skip to content
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

SDK-Documentation Update #3

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
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
CompeyDev marked this conversation as resolved.
Show resolved Hide resolved
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>
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 @@
---
CompeyDev marked this conversation as resolved.
Show resolved Hide resolved
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 the 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 — so please respect our mission.
</Callout>
18 changes: 17 additions & 1 deletion pages/sdks/sdk/methods/isAuthenticated.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,26 @@ description: Guide to using Datalink's server-side Lua SDK
import {Code} from '../../../../components/code';
import Callout from 'nextra-theme-docs/callout';

# IsAuthenticated
# isAuthenticated

Primary resource for acknowledging if the SDK is or is not authenticated

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

local isDatalinkAuthenticated = DatalinkInstance:isAuthenticated()

if not isDatalinkAuthenticated then
...
end
```
```typescript


```
</Code>
12 changes: 10 additions & 2 deletions pages/sdks/sdk/methods/meta.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
{
"isAuthenticated": ":isAuthenticated",
"authenticateAsync": ":authenticateAsync",
"getFastFlagAsync": ":getFastFlagAsync",
"fireCustomEvent": ":fireCustomEvent",
"fireEconomyEvent": ":fireEconomyEvent",
"fireProgressionEvent": ":fireProgressionEvent",
"getFastIntAsync": ":getFastIntAsync",
"invokeEventAsync": ":invokeEventAsync"
"getFastFlagAsync": ":getFastFlagAsync",
"getAllFastFlagsAsync": ":getAllFastFlagsAsync",
"setVerboseLogging": ":setVerboseLogging",
"setLocalVariable": ":setLocalVariable",
"getLocalVariable": ":getLocalVariable",
"getLocalVariables": ":getLocalVariables",
"getPlayerHash": ":getPlayerHash"
}
15 changes: 15 additions & 0 deletions pages/sdks/sdk/methods/setLocalVariable.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';

# setLocalVariable

<Code>
```lua

```
</Code>
15 changes: 15 additions & 0 deletions pages/sdks/sdk/methods/setVerboseLogging.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';

# setVerboseLogging

<Code>
```lua

```
</Code>
15 changes: 15 additions & 0 deletions pages/sdks/sdk/properties/branch.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';

# Branch

<Code>
```lua

```
</Code>
5 changes: 4 additions & 1 deletion pages/sdks/sdk/properties/meta.json
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
{ }
{
"branch": ".Branch",
"version": ".Version"
}
15 changes: 15 additions & 0 deletions pages/sdks/sdk/properties/version.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';

# Version

<Code>
```lua

```
</Code>
7 changes: 6 additions & 1 deletion pages/sdks/sdk/signals/meta.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
{
"onAuthenticated": ".onAuthenticated"
"onAuthenticated": ".onAuthenticated",
"onDaemonStarted": ".onDaemonStarted",
"onDaemonStopped": ".onDaemonStopped",
"onMessageRequestFail": ".onMessageRequestFail",
"onMessageRequestSent": ".onMessageRequestSent",
"onThrottled": ".onThrottled"
}
15 changes: 15 additions & 0 deletions pages/sdks/sdk/signals/onDaemonStarted.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';

# onDaemonStarted

<Code>
```lua

```
</Code>
15 changes: 15 additions & 0 deletions pages/sdks/sdk/signals/onDaemonStopped.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';

# onDaemonStopped

<Code>
```lua

```
</Code>
Loading