Current collected state Current
Observed since 20 Oct, 22:00 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
@03gibbss/remix-auth-twitch
A TwitchStrategy for Remix Auth, based on the OAuth2Strategy
The Twitch strategy is used to authenticate users against a Twitch account. It extends the OAuth2Strategy.
| Runtime | Has Support |
|---|---|
| Node.js | ✅ |
| Cloudflare | ✅ |
Follow the steps on the Twitch documentation to create a new application and get a client ID and secret.
npm i @03gibbss/remix-auth-twitch
import { TwitchStrategy } from "@03gibbss/remix-auth-twitch";
let twitchStrategy = new TwitchStrategy(
{
clientID: "YOUR_CLIENT_ID",
clientSecret: "YOUR_CLIENT_SECRET",
callbackURL: "https://example.com/auth/twitch/callback",
},
async ({ accessToken, extraParams, profile }) => {
// Get the user data from your DB or API using the tokens and profile
const user = await db.user.findUnique({
where: { twitchId: profile.id },
});
if (user) {
return { id: user.id, displayName: user.displayName };
}
const newUser = await db.user.create({
data: { twitchId: profile.id, displayName: profile.display_name },
});
return { id: newUser.id, displayName: newUser.displayName };
}
);
authenticator.use(twitchStrategy);
// app/routes/login.tsx
export default function Login() {
return (
<Form action="/auth/twitch" method="post">
<button>Login with Twitch</button>
</Form>
);
}
// app/routes/auth/twitch.tsx
import { ActionFunction, LoaderFunction, redirect } from "remix";
import { authenticator } from "~/auth.server";
export let loader: LoaderFunction = () => redirect("/login");
export let action: ActionFunction = ({ request }) => {
return authenticator.authenticate("twitch", request);
};
// app/routes/auth/twitch/callback.tsx
import { LoaderFunction } from "remix";
import { authenticator } from "~/auth.server";
export let loader: LoaderFunction = ({ request }) => {
return authenticator.authenticate("twitch", request, {
successRedirect: "/dashboard",
failureRedirect: "/login",
});
};
Download counts and popularity will appear here as the collector receives them.
| Package / target | Requirement | Relationship |
|---|---|---|
remix-authEnvironment{
"local_name": "remix-auth",
"alias": false,
"peer_metadata": null
} | ^3.0.0 | runtime |
remix-auth-oauth2Environment{
"local_name": "remix-auth-oauth2",
"alias": false,
"peer_metadata": null
} | ^1.2.2 | runtime |
@babel/coreEnvironment{
"local_name": "@babel/core",
"alias": false,
"peer_metadata": null
} | ^7.14.2 | development |
@babel/preset-envEnvironment{
"local_name": "@babel/preset-env",
"alias": false,
"peer_metadata": null
} | ^7.14.1 | development |
@babel/preset-reactEnvironment{
"local_name": "@babel/preset-react",
"alias": false,
"peer_metadata": null
} | ^7.13.13 | development |
@babel/preset-typescriptEnvironment{
"local_name": "@babel/preset-typescript",
"alias": false,
"peer_metadata": null
} | ^7.13.0 | development |
@remix-run/nodeEnvironment{
"local_name": "@remix-run/node",
"alias": false,
"peer_metadata": null
} | ^1.0.3 | development |
@remix-run/reactEnvironment{
"local_name": "@remix-run/react",
"alias": false,
"peer_metadata": null
} | ^1.1.1 | development |
@remix-run/server-runtimeEnvironment{
"local_name": "@remix-run/server-runtime",
"alias": false,
"peer_metadata": null
} | ^1.0.0 | development |
@types/jestEnvironment{
"local_name": "@types/jest",
"alias": false,
"peer_metadata": null
} | ^26.0.23 | development |
@typescript-eslint/eslint-pluginEnvironment{
"local_name": "@typescript-eslint/eslint-plugin",
"alias": false,
"peer_metadata": null
} | ^4.23.0 | development |
@typescript-eslint/parserEnvironment{
"local_name": "@typescript-eslint/parser",
"alias": false,
"peer_metadata": null
} | ^4.23.0 | development |
babel-jestEnvironment{
"local_name": "babel-jest",
"alias": false,
"peer_metadata": null
} | ^26.6.3 | development |
eslintEnvironment{
"local_name": "eslint",
"alias": false,
"peer_metadata": null
} | ^7.26.0 | development |
eslint-config-prettierEnvironment{
"local_name": "eslint-config-prettier",
"alias": false,
"peer_metadata": null
} | ^8.3.0 | development |
eslint-plugin-jestEnvironment{
"local_name": "eslint-plugin-jest",
"alias": false,
"peer_metadata": null
} | ^24.3.6 | development |
eslint-plugin-jest-domEnvironment{
"local_name": "eslint-plugin-jest-dom",
"alias": false,
"peer_metadata": null
} | ^3.9.0 | development |
eslint-plugin-prettierEnvironment{
"local_name": "eslint-plugin-prettier",
"alias": false,
"peer_metadata": null
} | ^3.4.0 | development |
eslint-plugin-unicornEnvironment{
"local_name": "eslint-plugin-unicorn",
"alias": false,
"peer_metadata": null
} | ^32.0.1 | development |
jestEnvironment{
"local_name": "jest",
"alias": false,
"peer_metadata": null
} | ^26.6.3 | development |
jest-fetch-mockEnvironment{
"local_name": "jest-fetch-mock",
"alias": false,
"peer_metadata": null
} | ^3.0.3 | development |
prettierEnvironment{
"local_name": "prettier",
"alias": false,
"peer_metadata": null
} | ^2.3.2 | development |
reactEnvironment{
"local_name": "react",
"alias": false,
"peer_metadata": null
} | ^17.0.2 | development |
ts-nodeEnvironment{
"local_name": "ts-node",
"alias": false,
"peer_metadata": null
} | ^10.8.0 | development |
typescriptEnvironment{
"local_name": "typescript",
"alias": false,
"peer_metadata": null
} | ^4.3.5 | development |
@remix-run/server-runtimeEnvironment{
"local_name": "@remix-run/server-runtime",
"alias": false,
"peer_metadata": null
} | ^1.0.0 | peer |
Source distribution
{
"integrity": "sha512-GvHJjaNL/foUJN624wQ2aCClN51E9vAWiDTGHDpl5fjnx5DqLVqvYOeiFreozSVXBL5oKnNxcD7AYoLp5b1qHA==",
"shasum": "dbe9c86d3c05ceb7df2df59016cd6b4f097a6860",
"tarball": "https://registry.npmjs.org/@03gibbss/remix-auth-twitch/-/remix-auth-twitch-1.0.0.tgz",
"fileCount": 5,
"unpackedSize": 9681,
"signatures": [
{
"keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
"sig": "MEUCIQCQDdlL9DbcPzWg6z3mgOSPpV4ZEwAuuDYHamHk7lKGmwIgHcCQ0+FjnK3uOs6EbV+d99kKaU82PW2KPFGVWrT2c9k="
}
],
"npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJilTdtACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrJKg//TniSqjX2rnhrvmV97aBDQ1DPRb+hRRcsWlEGjNsAD7jybtaz\r\nHB+lnuDw64do/PLIoJt7jSA3cCMrdP180p2wXdIqO0tajcVPXwaqwRUSVMby\r\no+BIe0zGH0RndWxhiC+Y1IBMFvh82d1LXK7k/fDHN/gCbyny1Frjw6F3sU3S\r\nXJgwkp5K3UB5oMyzA6J+zQcZmK7VP6KL1NV4OCqwQkiNRfz5+BWm60rDYFM5\r\nekb9DF6JGQ4MG/spBSfFxfkYMSCNWDS944YtPY6YQgcz89LvPimC+C0p6fj1\r\nrsw3EqowA8SQ2YZXFgvkZEL9FkCaBCDTvbkz7F4TxWStNPKe9XVhAXNZTYcg\r\nfCCmQ8wFJUn2uIDge0/6y71qYtDGCgniL5ZEVOIheiBnxish25iEzKQgDuJR\r\nb9sh7r7Vy3Ccppnr3dsTYTsbLatddJCpoX+v+u9iPASjeHdMR9p257ST6gcy\r\nZYc/4kLv8Qg2m7ZHQ9kZ6vz+Z5+O1SIEJ/EyRMNzAVetdh7fZcjtb1+YNjXQ\r\nPE/MRrxzlNaZXvZVPXvvLkb/t8MfGOt+riFXXtBxyk7wr8FZUBlhMkGkfSZU\r\ny7jsuUZW3d2rCovAXqabpDe59efLqWK82gRItrq/C+iT7BS5TwpDWBBuhxVw\r\n/vy5EruJY+I0lLQGN4O6Xk6F1bd+ZuU1/tI=\r\n=TnfQ\r\n-----END PGP SIGNATURE-----\r\n"
}Shared repository data · GitHub
Observed since 20 Oct, 22:00 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:c854da50f29ef8f4f30cd6c9d58f77541c775b14f0dfe6ea36f6174716990cb2