Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# EditorConfig is awesome: https://editorconfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true

[*.{css,tsx}]
charset = utf-8
indent_style = space
indent_size = 2
6 changes: 6 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# TODO: Add your OAuth Client Id
VITE_CLIENT_ID=
# TODO: Add your OAuth Client Secret
VITE_CLIENT_SECRET=
# TODO: Add the public URL where you're serving this app
VITE_REDIRECT_URI=
42 changes: 20 additions & 22 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

# Local Netlify folder
.netlify
node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
22 changes: 18 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
# StreamLabs Token
# Streamlabs Token

> This is a simple react app that allows you to get the token for [streamdevs/webhook](https://github.com/streamdevs/webhook)
> This is a simple web app that allows you to get a OAuth Token to use in [streamdevs/webhook](https://github.com/streamdevs/webhook)

You can get your own client_id and client_secret in the [StreamLabs developer console](https://dev.streamlabs.com/docs/register-your-application).
You will need a Streamlabs API app OAuth `client_id` and `client_secret`. You can register a new app in the [Streamlabs developer console](https://dev.streamlabs.com/docs/register-your-application).

## How to deploy it?
## Deployment

[![img](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/streamdevs/streamlabs-token)

## Development

Install dependencies with `yarn`

```bash
yarn
```

Start your local enviroment with `vite`

```bash
yarn dev
```
41 changes: 41 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import tseslint from 'typescript-eslint'
import reactX from 'eslint-plugin-react-x'
import reactDom from 'eslint-plugin-react-dom'

export default tseslint.config(
{ ignores: ['dist'] },
{
extends: [
...tseslint.configs.recommendedTypeChecked,
...tseslint.configs.strictTypeChecked,
...tseslint.configs.stylisticTypeChecked,
],
files: ['**/*.{ts,tsx}'],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
},
plugins: {
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
'react-x': reactX,
'react-dom': reactDom,
},
rules: {
...reactHooks.configs.recommended.rules,
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
...reactX.configs['recommended-typescript'].rules,
...reactDom.configs.recommended.rules,
},
},
)
13 changes: 13 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/streamdevs.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Streamlabs Token</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
18 changes: 8 additions & 10 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
[build]
# Directory (relative to root of your repo) that contains the deploy-ready
# HTML files and assets generated by the build. If a base directory has
# been specified, include it in the publish directory path.
publish = "build/"

# Default build command.
publish = "dist/"
command = "yarn build"

[template.environment]
REACT_APP_CLIENT_ID = "change me for your client_id"
REACT_APP_CLIENT_SECRET = "change me for your client_secret"
# TODO
VITE_CLIENT_ID = "replace me with your OAuth Client Id"
# TODO
VITE_CLIENT_SECRET = "replace me your OAuth Client Secred"

[[redirects]]
from = "/api/*"
to = "https://streamlabs.com/api/v1.0/:splat"
to = "https://streamlabs.com/api/v2.0/:splat"
status = 200
force = true
[redirects.headers]
X-From = "Netlify"
access-control-allow-origin = "*"

[[redirects]]
from = "/*"
to = "/index.html"
status = 200
status = 200
56 changes: 22 additions & 34 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,43 +1,31 @@
{
"name": "streamlabs-token",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2",
"@types/jest": "^24.0.0",
"@types/node": "^12.0.0",
"@types/react": "^16.9.0",
"@types/react-dom": "^16.9.0",
"qs": "^6.9.3",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-scripts": "3.4.1",
"typescript": "~3.7.2"
},
"version": "0.0.0",
"type": "module",
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
"dev": "vite",
"build": "tsc -b && vite build",
"lint": "eslint .",
"preview": "vite preview"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
"dependencies": {
"react": "^19.1.0",
"react-dom": "^19.1.0"
},
"devDependencies": {
"@types/qs": "^6.9.1"
"@eslint/js": "^9.25.0",
"@types/react": "^19.1.2",
"@types/react-dom": "^19.1.2",
"@vitejs/plugin-react": "^4.4.1",
"eslint": "^9.25.0",
"eslint-plugin-react-dom": "^1.50.0",
"eslint-plugin-react-hooks": "^5.2.0",
"eslint-plugin-react-refresh": "^0.4.19",
"eslint-plugin-react-x": "^1.50.0",
"globals": "^16.0.0",
"typescript": "~5.8.3",
"typescript-eslint": "^8.30.1",
"vite": "^6.3.5"
}
}
Binary file removed public/favicon.ico
Binary file not shown.
43 changes: 0 additions & 43 deletions public/index.html

This file was deleted.

Binary file removed public/logo192.png
Binary file not shown.
Binary file removed public/logo512.png
Binary file not shown.
25 changes: 0 additions & 25 deletions public/manifest.json

This file was deleted.

3 changes: 0 additions & 3 deletions public/robots.txt

This file was deleted.

1 change: 1 addition & 0 deletions public/streamdevs.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 7 additions & 31 deletions src/App.css
Original file line number Diff line number Diff line change
@@ -1,38 +1,14 @@
.App {
#root {
max-width: 1280px;
margin: 0 auto;
padding: 2rem;
text-align: center;
}

.App-logo {
height: 40vmin;
pointer-events: none;
.standalone {
text-align: left;
}

@media (prefers-reduced-motion: no-preference) {
.App-logo {
animation: App-logo-spin infinite 20s linear;
}
}

.App-header {
background-color: #282c34;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
.header__authorization-link {
color: white;
}

.App-link {
color: #61dafb;
}

@keyframes App-logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
9 changes: 0 additions & 9 deletions src/App.test.tsx

This file was deleted.

Loading