Skip to content

Instantly share code, notes, and snippets.

View hojongs's full-sized avatar
🎯
Focusing

Jongho Jeon hojongs

🎯
Focusing
View GitHub Profile
@hojongs
hojongs / twitch-client-credentials-flow.ts
Last active March 22, 2022 06:04
Typescript(Javascript): twitch client credentials flow using simple-oauth2
// https://github.com/lelylan/simple-oauth2
// https://dev.twitch.tv/docs/authentication/getting-tokens-oauth/#oauth-client-credentials-flow
async function getAccessToken(): Promise<AccessToken | null> {
const client = new ClientCredentials({
client: {
id: "client-id",
secret: "client-secret",
},
auth: {
tokenHost: "https://id.twitch.tv",
@hojongs
hojongs / grpcurl-health-check.sh
Created March 22, 2022 06:05
grpcurl example
#!/usr/bin/env bash
REQ='{"service": ""}'
URL='grpc.hojongs.com'
RPC='grpc.health.v1.Health/Check'
grpcurl \
-d "$REQ" \
$URL \
$RPC