@well-played.gg/react-sdk 1.0.0
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/LICENSE +21 -0
- package/README.md +57 -0
- package/dist/index.d.ts +553 -0
- package/dist/wp-react-sdk.cjs.js +479 -0
- package/dist/wp-react-sdk.es.js +42904 -0
- package/dist/wp-react-sdk.umd.js +479 -0
- package/package.json +54 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Well-Played.gg
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# WellPlayed React SDK
|
|
2
|
+
|
|
3
|
+
This is the official WellPlayed React SDK. It provides a set of components and hooks to help you integrate WellPlayed
|
|
4
|
+
into your React application and interact with the WellPlayed API.
|
|
5
|
+
|
|
6
|
+
## Installation
|
|
7
|
+
|
|
8
|
+
**WARNING: Not published yet**
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
yarn add @well-played.gg/react-sdk
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
### Configuration
|
|
17
|
+
|
|
18
|
+
Before you can use the SDK, you need to configure it with your own App Client ID. You can get an App Client ID on the [WellPlayed console](https://console.well-played.gg/apps).
|
|
19
|
+
|
|
20
|
+
```tsx
|
|
21
|
+
import { WellPlayedProvider } from '@wellplayed.gg/react-sdk';
|
|
22
|
+
|
|
23
|
+
const App = () => {
|
|
24
|
+
return (
|
|
25
|
+
<WellPlayedProvider
|
|
26
|
+
organizationId="replace-with-yours" // Your Organization ID
|
|
27
|
+
wpAppConfig={{
|
|
28
|
+
scope: "offline_access", // Offline access to allow for refresh tokens
|
|
29
|
+
client_id: "replace-with-yours", // Your App Client ID
|
|
30
|
+
redirect_uri: `${
|
|
31
|
+
window.location.protocol
|
|
32
|
+
}//${window.location.origin}`, // Your redirect URL
|
|
33
|
+
}}
|
|
34
|
+
>
|
|
35
|
+
<RouterProvider router={router} />
|
|
36
|
+
</WellPlayedProvider>
|
|
37
|
+
);
|
|
38
|
+
};
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
You can find more usage examples in the [demo](/demo) folder.
|
|
42
|
+
|
|
43
|
+
### Components
|
|
44
|
+
|
|
45
|
+
TODO
|
|
46
|
+
|
|
47
|
+
### Hooks
|
|
48
|
+
|
|
49
|
+
TODO
|
|
50
|
+
|
|
51
|
+
## License
|
|
52
|
+
|
|
53
|
+
WellPlayed React SDK is [MIT licensed](/LICENSE).
|
|
54
|
+
|
|
55
|
+
## Stay in touch
|
|
56
|
+
|
|
57
|
+
- Author - [AlexMog](https://github.com/alexmog)
|