@tepez/auth0-rules-types
TypeScript icon, indicating that this package has built-in type declarations

0.3.1 • Public • Published

auth0-rules-types

Typescript types for the auth0 rule runtime environment

npm version

Install

npm install --save @tepez/auth0-rules-types

Usage

The module declares global variables so you should import it, e.g.:

import '@tepez/auth0-rules-types'

It also defines types you can use in the rules:

  • IAuth0RuleUser - the user object (first argument of the rule function)
  • IAuth0RuleContext - the context object (second argument of the rule function)
  • IAuth0RuleCallback - the callback function (third argument of the rule function)
  • IAuthRuleFunction - the rule function itself

Add typings for cache

Add:

declare global {
    namespace NodeJS {
        interface Global {
            CACHE_KEY: string
        }
    }
}

Now you can access the cache on the global variable, global.CACHE_KEY

Add typings for rules configuration

Add:

declare global {
    interface IAuth0RuleConfiguration {
        KEY: string
    }
}

Now you can access the configuration using configuration.KEY

Readme

Keywords

none

Package Sidebar

Install

npm i @tepez/auth0-rules-types

Weekly Downloads

8

Version

0.3.1

License

MIT

Unpacked Size

21.8 kB

Total Files

4

Last publish

Collaborators

  • tomyam1