@accelbyte/sdk 0.2.0-beta.4 → 0.2.0-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/README.md +1 -4
- package/dist/index.browser.es.js +950 -541
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.d.ts +1499 -1060
- package/dist/index.node.es.js +950 -541
- package/dist/index.node.es.js.map +1 -1
- package/dist/index.node.js +950 -541
- package/dist/index.node.js.map +1 -1
- package/examples/next/package.json +1 -1
- package/examples/node/package.json +1 -1
- package/examples/typescript-node/README.md +13 -0
- package/examples/typescript-node/node-example.ts +60 -0
- package/examples/vite/package.json +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2023 AccelByte Inc. All Rights Reserved
|
|
3
|
+
* This is licensed software from AccelByte Inc, for limitations
|
|
4
|
+
* and restrictions contact your company contract manager.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
// import { Accelbyte } from '@accelbyte/sdk'
|
|
8
|
+
import { config } from 'dotenv'
|
|
9
|
+
|
|
10
|
+
import { Accelbyte } from '../../src/AccelbyteSdkFactory'
|
|
11
|
+
|
|
12
|
+
config()
|
|
13
|
+
|
|
14
|
+
const SDK_CONFIG = {
|
|
15
|
+
baseURL: 'https://demo.accelbyte.io',
|
|
16
|
+
clientId: '77f88506b6174c3ea4d925f5b4096ce8',
|
|
17
|
+
namespace: 'accelbyte',
|
|
18
|
+
redirectURI: 'http://localhost:3030'
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const sdk = Accelbyte.SDK({
|
|
22
|
+
options: SDK_CONFIG
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
// Sample SDK calls:
|
|
26
|
+
main()
|
|
27
|
+
|
|
28
|
+
async function main() {
|
|
29
|
+
console.info(SDK_CONFIG)
|
|
30
|
+
|
|
31
|
+
// console.log(sdk.IAM.)
|
|
32
|
+
console.log(sdk.IAM.UserAuthorization().createLoginURL())
|
|
33
|
+
//
|
|
34
|
+
// const listDiscoveryConfigs = await sdk.AccelbyteConfig.PublicTemplate().getDiscoveryTemplateConfigs()
|
|
35
|
+
//
|
|
36
|
+
// console.info('List of discovery configs:')
|
|
37
|
+
// console.info(JSON.stringify(listDiscoveryConfigs))
|
|
38
|
+
//
|
|
39
|
+
// const listOfCurrencies = await sdk.Platform.Currency().getCurrencies()
|
|
40
|
+
// const listOfItems = await sdk.Platform.Item().fetchItemsByCriteria({})
|
|
41
|
+
//
|
|
42
|
+
// console.info('List of namespaces:')
|
|
43
|
+
// console.info(JSON.stringify(listOfCurrencies))
|
|
44
|
+
//
|
|
45
|
+
// console.info('List of items:')
|
|
46
|
+
// console.info(JSON.stringify(listOfItems))
|
|
47
|
+
//
|
|
48
|
+
// // These require authentication and we can't use it right away.
|
|
49
|
+
// // Ensure that you have logged in (have cookies) or pass the access token to the `Authorization` header.
|
|
50
|
+
// const listOfNamespaces = sdk.Basic.Namespace({
|
|
51
|
+
// config: {
|
|
52
|
+
// headers: {
|
|
53
|
+
// Authorization: `Bearer <replace-this-with-access-token>`
|
|
54
|
+
// }
|
|
55
|
+
// }
|
|
56
|
+
// }).getNamespaces()
|
|
57
|
+
//
|
|
58
|
+
// console.info('List of namespaces:')
|
|
59
|
+
// console.info(JSON.stringify(listOfNamespaces))
|
|
60
|
+
}
|