0.3.1 • Published 4 years ago

@tepez/auth0-rules-types v0.3.1

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

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

0.3.1

4 years ago

0.3.0

5 years ago

0.2.0

5 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.0

6 years ago