Skip to main content
The legacy Kavach* names are gone. Exports are TheAuth*, env vars are THEAUTH_*, webhook headers are X-TheAuth-*, and database tables are theauth_*. The theauth codemod rename command updates your source for the part that is mechanical.

Run the codemod

The command is a dry run by default. It lists what would change and writes nothing.
Review the summary, then apply it.

What it changes

It scans .ts, .tsx, .js, .jsx, .mjs, .cjs, .mts, .cts, .vue and .svelte files and skips node_modules, dist, build and other generated folders.
  • Identifiers such as createKavach, KavachConfig and useKavachContext in imports, usages, type references and comments, matched on word boundaries only. KavachProvider becomes TheAuthProvider in JSX opening and closing tags.
  • Old package names in import paths (kavachos, @kavachos/react) become @glinr/theauth and @glinr/theauth-react.
  • process.env.KAVACH_X and import.meta.env.KAVACH_X become THEAUTH_X.
  • Other string literals are never touched.
The mapping lives in one data file, packages/cli/src/rename-map.ts, and a test checks that every target name is a real export in this repo.

What it only reports

Some mentions need a human, so the summary lists them with file and line and leaves them alone.
  • X-Kavach-* header strings. Update your webhook receivers and senders together.
  • kavach_* table or cookie names. createTables renames existing kavach_* tables in place, so you rarely need to edit these.
  • Any other Kavach mention, for example a variable named kavachos_notes.
Running the command again after --write changes nothing, so it is safe to repeat.

Auth names

Auth* names, such as createAuth, remain as deprecated aliases and are not rewritten. Switch them to TheAuth* at your own pace.
Last modified on October 7, 2026