@accelbyte/sdk 0.1.1-alpha.62 → 0.2.0-beta.11

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.
@@ -10,25 +10,4 @@ npm run dev
10
10
  yarn dev
11
11
  ```
12
12
 
13
- Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
14
-
15
- You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file.
16
-
17
- [API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`.
18
-
19
- The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.
20
-
21
- ## Learn More
22
-
23
- To learn more about Next.js, take a look at the following resources:
24
-
25
- - [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
26
- - [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
27
-
28
- You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
29
-
30
- ## Deploy on Vercel
31
-
32
- The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
33
-
34
- Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
13
+ And open the url in your browser http://localhost:3000/
@@ -11,7 +11,7 @@
11
11
  "link:stop": "yarn unlink @accelbyte/sdk && yarn install --force"
12
12
  },
13
13
  "dependencies": {
14
- "@accelbyte/sdk": "0.1.1-alpha.57",
14
+ "@accelbyte/sdk": "0.2.0-beta.5",
15
15
  "@next/font": "13.0.7",
16
16
  "@types/node": "18.11.17",
17
17
  "@types/react": "18.0.26",
@@ -9,22 +9,17 @@ import Head from 'next/head'
9
9
  import Image from 'next/image'
10
10
  import styles from '../styles/Home.module.css'
11
11
 
12
- import { Accelbyte, CurrencyInfo, DiscoveryConfigData, ItemInfo, ItemPagingSlicedResult, NamespaceInfo } from '@accelbyte/sdk'
12
+ import { Accelbyte, CurrencyInfo, DiscoveryConfigData, ItemPagingSlicedResult, NamespaceInfo } from '@accelbyte/sdk'
13
13
 
14
14
  const SDK_CONFIG = {
15
- baseURL: process.env.NEXT_SDK_BASE_URL || '',
16
- clientId: process.env.NEXT_SDK_CLIENT_ID || '',
17
- namespace: process.env.NEXT_SDK_NAMESPACE || '',
18
- redirectURI: process.env.NEXT_SDK_REDIRECT_URI || ''
15
+ baseURL: 'https://demo.accelbyte.io',
16
+ clientId: '77f88506b6174c3ea4d925f5b4096ce8',
17
+ namespace: 'accelbyte',
18
+ redirectURI: 'http://localhost:3030'
19
19
  }
20
20
 
21
21
  const sdk = Accelbyte.SDK({
22
- options: SDK_CONFIG,
23
- config: {
24
- headers: {
25
- Authorization: `Bearer ${process.env.NEXT_SDK_ACCESS_TOKEN}`
26
- }
27
- }
22
+ options: SDK_CONFIG
28
23
  })
29
24
 
30
25
  interface TestSdkReturnType {
@@ -43,8 +38,14 @@ export const getServerSideProps: GetServerSideProps<{ data: TestSdkReturnType }>
43
38
  sdk.Platform.Item().fetchItemsByCriteria({}),
44
39
 
45
40
  // These require authentication and we can't use it right away.
46
- // Ensure that you have set `NEXT_SDK_ACCESS_TOKEN` in the `.env` file.
47
- sdk.Basic.Namespace().getNamespaces()
41
+ // Ensure that you have logged in (have cookies) or pass the access token to the `Authorization` header.
42
+ sdk.Basic.Namespace({
43
+ config: {
44
+ headers: {
45
+ Authorization: `Bearer <replace-this-with-access-token>`
46
+ }
47
+ }
48
+ }).getNamespaces()
48
49
  ])
49
50
 
50
51
  return {
@@ -54,7 +55,7 @@ export const getServerSideProps: GetServerSideProps<{ data: TestSdkReturnType }>
54
55
  listDiscoveryConfigs: listDiscoveryConfigs.response?.data,
55
56
  listOfCurrencies: listOfCurrencies.response?.data,
56
57
  listOfItems: listOfItems.response?.data,
57
- listOfNamespaces: listOfNamespaces.response?.data
58
+ listOfNamespaces: listOfNamespaces.response?.data || null
58
59
  }
59
60
  }
60
61
  }
@@ -2,16 +2,16 @@
2
2
  # yarn lockfile v1
3
3
 
4
4
 
5
- "@accelbyte/sdk@0.1.1-alpha.57":
6
- version "0.1.1-alpha.57"
7
- resolved "https://registry.yarnpkg.com/@accelbyte/sdk/-/sdk-0.1.1-alpha.57.tgz#c61e64262cf27427a86a0b290ca7a2e09650c66b"
8
- integrity sha512-yg3mTTyQWkOR+OkKQo5Vj322jmZkGBcoAyaqhOlobTaVGdqxahgR4wEoFaYbsspIlfNvEvrfQ/ZNhz7ybpbgbQ==
5
+ "@accelbyte/sdk@0.2.0-beta.4":
6
+ version "0.2.0-beta.4"
7
+ resolved "https://registry.yarnpkg.com/@accelbyte/sdk/-/sdk-0.2.0-beta.4.tgz#0c0e3851e0cd27d74b49497f1f587f6e96ad09b9"
8
+ integrity sha512-9jm93+ghZY5IjennavAXVUMf62+0dV530J9UThFxQJ2KigtQhD+VKioyf99UvymYlc4MZ9DpRHHit6k0v9cwBg==
9
9
  dependencies:
10
10
  axios "0.27.2"
11
11
  buffer "6.0.3"
12
12
  crypto-js "4.1.1"
13
13
  lodash-core "4.17.19"
14
- nanoid "3.1.30"
14
+ nanoid "3.1.31"
15
15
  platform "1.3.6"
16
16
  query-string "7.1.1"
17
17
  uuid "8.3.2"
@@ -247,10 +247,10 @@ mime-types@^2.1.12:
247
247
  dependencies:
248
248
  mime-db "1.52.0"
249
249
 
250
- nanoid@3.1.30:
251
- version "3.1.30"
252
- resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.30.tgz#63f93cc548d2a113dc5dfbc63bfa09e2b9b64362"
253
- integrity sha512-zJpuPDwOv8D2zq2WRoMe1HsfZthVewpel9CAvTfc/2mBD1uUT/agc5f7GHGWXlYkFvi1mVxe4IjvP2HNrop7nQ==
250
+ nanoid@3.1.31:
251
+ version "3.1.31"
252
+ resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.31.tgz#f5b58a1ce1b7604da5f0605757840598d8974dc6"
253
+ integrity sha512-ZivnJm0o9bb13p2Ot5CpgC2rQdzB9Uxm/mFZweqm5eMViqOJe3PV6LU2E30SiLgheesmcPrjquqraoolONSA0A==
254
254
 
255
255
  nanoid@^3.3.4:
256
256
  version "3.3.4"
@@ -5,19 +5,14 @@ import { config } from 'dotenv'
5
5
  config()
6
6
 
7
7
  const SDK_CONFIG = {
8
- baseURL: process.env.SDK_BASE_URL || '',
9
- clientId: process.env.SDK_CLIENT_ID || '',
10
- namespace: process.env.SDK_NAMESPACE || '',
11
- redirectURI: process.env.SDK_REDIRECT_URI || ''
8
+ baseURL: 'https://demo.accelbyte.io',
9
+ clientId: '77f88506b6174c3ea4d925f5b4096ce8',
10
+ namespace: 'accelbyte',
11
+ redirectURI: 'http://localhost:3030'
12
12
  }
13
13
 
14
14
  const sdk = Accelbyte.SDK({
15
- options: SDK_CONFIG,
16
- config: {
17
- headers: {
18
- Authorization: `Bearer ${process.env.SDK_ACCESS_TOKEN}`
19
- }
20
- }
15
+ options: SDK_CONFIG
21
16
  })
22
17
 
23
18
  // Sample SDK calls:
@@ -43,8 +38,14 @@ async function main() {
43
38
  console.info(JSON.stringify(listOfItems))
44
39
 
45
40
  // These require authentication and we can't use it right away.
46
- // Ensure that you have set `SDK_ACCESS_TOKEN` in the `.env` file.
47
- const listOfNamespaces = await sdk.Basic.Namespace().getNamespaces()
41
+ // Ensure that you have logged in (have cookies) or pass the access token to the `Authorization` header.
42
+ const listOfNamespaces = sdk.Basic.Namespace({
43
+ config: {
44
+ headers: {
45
+ Authorization: `Bearer <replace-this-with-access-token>`
46
+ }
47
+ }
48
+ }).getNamespaces()
48
49
 
49
50
  console.info('List of namespaces:')
50
51
  console.info(JSON.stringify(listOfNamespaces))
@@ -8,7 +8,7 @@
8
8
  "link:stop": "yarn unlink @accelbyte/sdk && yarn install --force"
9
9
  },
10
10
  "dependencies": {
11
- "@accelbyte/sdk": "0.1.1-alpha.57",
11
+ "@accelbyte/sdk": "0.2.0-beta.5",
12
12
  "dotenv": "16.0.3"
13
13
  }
14
14
  }
@@ -2,16 +2,16 @@
2
2
  # yarn lockfile v1
3
3
 
4
4
 
5
- "@accelbyte/sdk@0.1.1-alpha.57":
6
- version "0.1.1-alpha.57"
7
- resolved "https://registry.yarnpkg.com/@accelbyte/sdk/-/sdk-0.1.1-alpha.57.tgz#c61e64262cf27427a86a0b290ca7a2e09650c66b"
8
- integrity sha512-yg3mTTyQWkOR+OkKQo5Vj322jmZkGBcoAyaqhOlobTaVGdqxahgR4wEoFaYbsspIlfNvEvrfQ/ZNhz7ybpbgbQ==
5
+ "@accelbyte/sdk@0.2.0-beta.4":
6
+ version "0.2.0-beta.4"
7
+ resolved "https://registry.yarnpkg.com/@accelbyte/sdk/-/sdk-0.2.0-beta.4.tgz#0c0e3851e0cd27d74b49497f1f587f6e96ad09b9"
8
+ integrity sha512-9jm93+ghZY5IjennavAXVUMf62+0dV530J9UThFxQJ2KigtQhD+VKioyf99UvymYlc4MZ9DpRHHit6k0v9cwBg==
9
9
  dependencies:
10
10
  axios "0.27.2"
11
11
  buffer "6.0.3"
12
12
  crypto-js "4.1.1"
13
13
  lodash-core "4.17.19"
14
- nanoid "3.1.30"
14
+ nanoid "3.1.31"
15
15
  platform "1.3.6"
16
16
  query-string "7.1.1"
17
17
  uuid "8.3.2"
@@ -112,10 +112,10 @@ mime-types@^2.1.12:
112
112
  dependencies:
113
113
  mime-db "1.52.0"
114
114
 
115
- nanoid@3.1.30:
116
- version "3.1.30"
117
- resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.30.tgz#63f93cc548d2a113dc5dfbc63bfa09e2b9b64362"
118
- integrity sha512-zJpuPDwOv8D2zq2WRoMe1HsfZthVewpel9CAvTfc/2mBD1uUT/agc5f7GHGWXlYkFvi1mVxe4IjvP2HNrop7nQ==
115
+ nanoid@3.1.31:
116
+ version "3.1.31"
117
+ resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.31.tgz#f5b58a1ce1b7604da5f0605757840598d8974dc6"
118
+ integrity sha512-ZivnJm0o9bb13p2Ot5CpgC2rQdzB9Uxm/mFZweqm5eMViqOJe3PV6LU2E30SiLgheesmcPrjquqraoolONSA0A==
119
119
 
120
120
  platform@1.3.6:
121
121
  version "1.3.6"
@@ -0,0 +1,13 @@
1
+ This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
2
+
3
+ ## Getting Started
4
+
5
+ Run the command below:
6
+
7
+ ```bash
8
+ npm run dev
9
+ # or
10
+ yarn dev
11
+ ```
12
+
13
+ And open the link http://localhost:3030/
@@ -11,7 +11,7 @@
11
11
  "link:stop": "yarn unlink @accelbyte/sdk && yarn install --force"
12
12
  },
13
13
  "dependencies": {
14
- "@accelbyte/sdk": "0.1.1-alpha.57",
14
+ "@accelbyte/sdk": "0.2.0-beta.5",
15
15
  "dotenv": "16.0.3",
16
16
  "react": "^18.2.0",
17
17
  "react-dom": "^18.2.0"
@@ -1,20 +1,14 @@
1
- // @ts-check
2
1
  import { Accelbyte } from '@accelbyte/sdk'
3
2
 
4
3
  const SDK_CONFIG = {
5
4
  baseURL: '/api',
6
- clientId: import.meta.env.VITE_SDK_CLIENT_ID || '',
7
- namespace: import.meta.env.VITE_SDK_NAMESPACE || '',
8
- redirectURI: import.meta.env.VITE_SDK_REDIRECT_URI || ''
5
+ clientId: '77f88506b6174c3ea4d925f5b4096ce8',
6
+ namespace: 'accelbyte',
7
+ redirectURI: 'http://localhost:3030'
9
8
  }
10
9
 
11
10
  const sdk = Accelbyte.SDK({
12
- options: SDK_CONFIG,
13
- config: {
14
- headers: {
15
- Authorization: `Bearer ${import.meta.env.VITE_SDK_ACCESS_TOKEN}`
16
- }
17
- }
11
+ options: SDK_CONFIG
18
12
  })
19
13
 
20
14
  export async function getSdkTestValues() {
@@ -25,8 +19,14 @@ export async function getSdkTestValues() {
25
19
  sdk.Platform.Item().fetchItemsByCriteria({}),
26
20
 
27
21
  // These require authentication and we can't use it right away.
28
- // Ensure that you have set `VITE_SDK_ACCESS_TOKEN` in the `.env` file.
29
- sdk.Basic.Namespace().getNamespaces()
22
+ // Ensure that you have logged in (have cookies) or pass the access token to the `Authorization` header.
23
+ sdk.Basic.Namespace({
24
+ config: {
25
+ headers: {
26
+ Authorization: `Bearer <replace-this-with-access-token>`
27
+ }
28
+ }
29
+ }).getNamespaces()
30
30
  ])
31
31
 
32
32
  return {
@@ -2,16 +2,16 @@
2
2
  # yarn lockfile v1
3
3
 
4
4
 
5
- "@accelbyte/sdk@0.1.1-alpha.57":
6
- version "0.1.1-alpha.57"
7
- resolved "https://registry.yarnpkg.com/@accelbyte/sdk/-/sdk-0.1.1-alpha.57.tgz#c61e64262cf27427a86a0b290ca7a2e09650c66b"
8
- integrity sha512-yg3mTTyQWkOR+OkKQo5Vj322jmZkGBcoAyaqhOlobTaVGdqxahgR4wEoFaYbsspIlfNvEvrfQ/ZNhz7ybpbgbQ==
5
+ "@accelbyte/sdk@0.2.0-beta.4":
6
+ version "0.2.0-beta.4"
7
+ resolved "https://registry.yarnpkg.com/@accelbyte/sdk/-/sdk-0.2.0-beta.4.tgz#0c0e3851e0cd27d74b49497f1f587f6e96ad09b9"
8
+ integrity sha512-9jm93+ghZY5IjennavAXVUMf62+0dV530J9UThFxQJ2KigtQhD+VKioyf99UvymYlc4MZ9DpRHHit6k0v9cwBg==
9
9
  dependencies:
10
10
  axios "0.27.2"
11
11
  buffer "6.0.3"
12
12
  crypto-js "4.1.1"
13
13
  lodash-core "4.17.19"
14
- nanoid "3.1.30"
14
+ nanoid "3.1.31"
15
15
  platform "1.3.6"
16
16
  query-string "7.1.1"
17
17
  uuid "8.3.2"
@@ -681,10 +681,10 @@ ms@2.1.2:
681
681
  resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"
682
682
  integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==
683
683
 
684
- nanoid@3.1.30:
685
- version "3.1.30"
686
- resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.30.tgz#63f93cc548d2a113dc5dfbc63bfa09e2b9b64362"
687
- integrity sha512-zJpuPDwOv8D2zq2WRoMe1HsfZthVewpel9CAvTfc/2mBD1uUT/agc5f7GHGWXlYkFvi1mVxe4IjvP2HNrop7nQ==
684
+ nanoid@3.1.31:
685
+ version "3.1.31"
686
+ resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.31.tgz#f5b58a1ce1b7604da5f0605757840598d8974dc6"
687
+ integrity sha512-ZivnJm0o9bb13p2Ot5CpgC2rQdzB9Uxm/mFZweqm5eMViqOJe3PV6LU2E30SiLgheesmcPrjquqraoolONSA0A==
688
688
 
689
689
  nanoid@^3.3.4:
690
690
  version "3.3.4"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@accelbyte/sdk",
3
- "version": "0.1.1-alpha.62",
3
+ "version": "0.2.0-beta.11",
4
4
  "author": "AccelByte Inc",
5
5
  "license": "AccelByte License",
6
6
  "main": "./dist/index.node.js",
@@ -1,7 +0,0 @@
1
- # To use this file, copy this as `.env` file, then replace the values.
2
-
3
- NEXT_SDK_BASE_URL=${NEXT_SDK_BASE_URL}
4
- NEXT_SDK_REDIRECT_URI=${NEXT_SDK_REDIRECT_URI}
5
- NEXT_SDK_CLIENT_ID=${NEXT_SDK_CLIENT_ID}
6
- NEXT_SDK_NAMESPACE=${NEXT_SDK_NAMESPACE}
7
- NEXT_SDK_ACCESS_TOKEN=${NEXT_SDK_ACCESS_TOKEN}
@@ -1,7 +0,0 @@
1
- # To use this file, copy this as `.env` file, then replace the values.
2
-
3
- SDK_BASE_URL=${SDK_BASE_URL}
4
- SDK_REDIRECT_URI=${SDK_REDIRECT_URI}
5
- SDK_CLIENT_ID=${SDK_CLIENT_ID}
6
- SDK_NAMESPACE=${SDK_NAMESPACE}
7
- SDK_ACCESS_TOKEN=${SDK_ACCESS_TOKEN}
@@ -1,5 +0,0 @@
1
- VITE_SDK_BASE_URL=${SDK_BASE_URL}
2
- VITE_SDK_REDIRECT_URI=${SDK_REDIRECT_URI}
3
- VITE_SDK_CLIENT_ID=${SDK_CLIENT_ID}
4
- VITE_SDK_NAMESPACE=${SDK_NAMESPACE}
5
- VITE_SDK_ACCESS_TOKEN=${SDK_ACCESS_TOKEN}