Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactored the with-supertokens example to use typescript #39987

Merged
merged 9 commits into from Aug 29, 2022
@@ -1,8 +1,9 @@
import ThirdPartyEmailPasswordNode from 'supertokens-node/recipe/thirdpartyemailpassword'
import SessionNode from 'supertokens-node/recipe/session'
import { appInfo } from './appInfo'
import { AuthConfig } from '../interfaces'

export let backendConfig = () => {
export let backendConfig = (): AuthConfig => {
return {
framework: 'express',
supertokens: {
Expand Down
16 changes: 16 additions & 0 deletions examples/with-supertokens/interfaces.d.ts
@@ -0,0 +1,16 @@
import { TypeFramework } from 'supertokens-node/lib/build/framework/types'

export interface AuthConfig {
framework: TypeFramework
supertokens: {
connectionURI: string
}
appInfo: {
appName: string
websiteDomain: string
apiDomain: string
apiBasePath: string
}
recipeList: any
isInServerlessEnv: boolean
}
12 changes: 8 additions & 4 deletions examples/with-supertokens/package.json
Expand Up @@ -6,10 +6,14 @@
"start": "next start"
},
"dependencies": {
"@babel/core": "^7.18.13",
ijjk marked this conversation as resolved.
Show resolved Hide resolved
"next": "latest",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"supertokens-auth-react": "^0.24.0",
"supertokens-node": "^11.0.0"
"react": "^18.2.0",
"react-dom": "^18.2.0",
"supertokens-auth-react": "^0.24.7",
"supertokens-node": "^11.2.0"
},
"devDependencies": {
"typescript": "^4.8.2"
}
}
20 changes: 20 additions & 0 deletions examples/with-supertokens/tsconfig.json
@@ -0,0 +1,20 @@
{
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": false,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"incremental": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve"
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "interfaces.d.ts"],
"exclude": ["node_modules"]
}