Aura Auth
Core Concepts

TypeScript

Learn how to configure Aura Auth with TypeScript.

Aura Auth is built with TypeScript, providing type safety and autocompletion for a better development experience. This guide walks you through configuring Aura Auth with TypeScript, ensuring you can leverage its full potential in your projects.

Aura Auth uses TypeScript generics to let you define the shape of the data it shares and manages. The library is designed to preserve type inference across its data, functions, and methods, but you can also provide your own types to improve type safety and autocompletion in your TypeScript applications.

TypeScript Configuration

Strict Mode

Enable strict mode in your tsconfig.json file so TypeScript checks types more strictly and gives you stronger type safety and autocompletion.

tsconfig.json
{
  "compilerOptions": {
    "strict": true,
    "alwaysStrict": true
  }
}

Aliases

Define path aliases in your tsconfig.json to simplify imports and improve code readability.

tsconfig.json
{
  "compilerOptions": {
    "baseUrl": ".",
    "paths": {
      "@/*": ["./src/*"]
    }
  }
}

Type and Linter Checking

Enable type and lint checking to enforce clean code and catch potential issues early.

tsconfig.json
{
  "compilerOptions": {
    "noUnusedLocals": true,
    "noUnusedParameters": true,
    "noImplicitAny": true,
    "noImplicitReturns": true,
    "noFallthroughCasesInSwitch": true,
    "strictNullChecks": true,
    "strictFunctionTypes": true
  }
}

On this page