tucmc-auth
Advanced tools
Comparing version 0.0.6 to 0.0.7
{ | ||
"name": "tucmc-auth", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"module": "dist/index.es.js", | ||
@@ -5,0 +5,0 @@ "types": "dist/tucmc-auth.d.ts", |
# TUCMC Auth API | ||
### API Setup Guide | ||
#### _app.js or _app.tsx | ||
```javascript | ||
import {AuthProvider} from "tucmc-auth" | ||
function MyApp({Component, pageProps}) { | ||
return ( | ||
<div> | ||
<AuthProvider TOKEN="-----TOKEN-----"> | ||
<Component {...pageProps} /> | ||
</AuthProvider> | ||
</div> | ||
) | ||
} | ||
export default MyApp | ||
``` | ||
#### pages/index.js or pages/index.tsx | ||
```javascript | ||
import {useAuth} from 'tucmc-auth' | ||
function Index() { | ||
const {userData, SigninWithTUCMC, signout} = useAuth() | ||
return ( | ||
<div> | ||
{userData && <h1>Hi, {userData.firstname}</h1>} | ||
<SigninWithTUCMC/> | ||
</div> | ||
) | ||
} | ||
export default Index | ||
``` | ||
made with ♥ by Triam Udom Clubs Management Committee |
14215
46