Comments (5)
May also want to change how webhooks are configured in the config object. Maybe have all relevant properties in their own object (which puts related params together)
const TES = require('tesjs');
const express = require('express');
// basic express app for example
const app = express();
app.get('/', (req, res) => {
res.send('OK')
});
app.listen(8080);
// initialize TESjs
const tes = new TES({
identity: YOUR_CLIENT_ID, // now not an obj as only client id is relevant to ALL cases of ID
listener: {
webhook: {
baseURL: "https://example.com",
secret: YOUR_SECRET, // secret is now only useful for webhooks so it moves here
port: 8080,
server: app
},
ignoreDuplicateMessages: true,
ignoreOldMessages: true,
}
});
This would be a breaking change, and require a version number upgrade (v0.5.0 or would it be v1.0.0??), but would also make it so omitting the webhook
param would be what implies websocket usage.
from tesjs.
Another alternative (that I am now leaning towards) is moving ignoreDuplicateMessages
and ignoreOldMessages
to options
and making listener
become webhook
:
const TES = require('tesjs');
const express = require('express');
// basic express app for example
const app = express();
app.get('/', (req, res) => {
res.send('OK')
});
app.listen(8080);
// initialize TESjs
const tes = new TES({
identity: YOUR_CLIENT_ID, // now not an obj as only client id is relevant to ALL cases of ID
options: {
debug: true,
ignoreDuplicateMessages: true,
ignoreOldMessages: true,
},
webhook: {
baseURL: "https://example.com",
secret: YOUR_SECRET, // secret is now only useful for webhooks so it moves here
port: 8080,
server: app
}
});
This is also a breaking change, and will require a version number upgrade
from tesjs.
In the interest of allowing Websocket connections on serverside applications as well, we should also allow client secrets to be specified for app access token use in config.
const config = {
identity: {
client_id,
client_secret, // used only in server-side apps
user_access_token, // used only in client-side apps
},
options: {
debug,
ignoreDuplicateMessages,
ignoreOldMessages,
},
webhook: {
baseURL,
secret, // required
port,
server
}
}
from tesjs.
I've about hit what I can do based on the RFC. Will have to wait until general availability so I can test then PR the changes.
from tesjs.
EventSub WebSockets open beta is finally out! My work on this is so stale, I'll be starting mostly fresh.
from tesjs.
Related Issues (20)
- [QUESTION]Client-ID HOT 1
- [RFE] When we automatically issue tokens, we want to choose a permission. HOT 1
- [QUESTION]Reasons to search for an appetizer for receiving a 409 error HOT 3
- [BUG] TES will allow incorrect configuration HOT 2
- [RFE] Switch to use fetch
- [RFE] Allow External Auth Handling
- [BUG] can't subscribe to raid event HOT 6
- [CHORE] Switch to Async/Await Syntax HOT 1
- [QUESTION] error when i subscribe to any event HOT 7
- [RFE] Improve Error Handling For Subscribe
- Refactor whserver
- [RFE] Switch lib to ESM HOT 1
- Update Express to 4.18.2 HOT 1
- [RFE] Add Version to `subscribe` HOT 1
- [RFE] Improve docs HOT 2
- [Chore] Update WebSocket URL
- Allow TES config to allow url for websocket connect to Twitch Mock CLI HOT 3
- [CHORE] Update Subscription Quotas Per Connection
- [BUG] TypeError: this.refreshToken is not a function HOT 3
- [BUG] Channel receive redeem problem HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tesjs.