# @types/keycloak-connect-roles

> TypeScript definitions for keycloak-connect-roles

Latest version **1.0.4** (published 2024-03-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/keycloak-connect-roles
pnpm add @types/keycloak-connect-roles
yarn add @types/keycloak-connect-roles
bun add @types/keycloak-connect-roles
```

## Health

**Score 40/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2024-03-08 |
| First published | 2023-01-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 3.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51370 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/keycloak-connect-roles
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/keycloak-connect-roles
- npm.io page: https://npm.io/package/@types/keycloak-connect-roles

## Dependencies (1)

- [@types/express](https://npm.io/package/@types/express.md) *

## Recent versions

- 1.0.4 (latest) — 2024-03-08
- 1.0.3 — 2023-11-07
- 1.0.2 — 2023-10-18
- 1.0.1 — 2023-09-14
- 1.0.0 — 2023-01-18

## README

# Installation
> `npm install --save @types/keycloak-connect-roles`

# Summary
This package contains type definitions for keycloak-connect-roles (https://github.com/osvaldo2627/keycloak-connect-roles#readme).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/keycloak-connect-roles.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/keycloak-connect-roles/index.d.ts)
````ts
import { RequestHandler } from "express";

declare enum ROLES {
    SYS_ADMIN = "sys-admin",
    USER = "user",
}

declare class Auth<T> {
    token: T;

    constructor(token: T);

    getPayload(): T;

    is(client: string, role: string): boolean;

    isOneOf(client: string, roles: string[]): boolean;

    isSysAdmin(): boolean;
}

interface KConnect {
    middleware: RequestHandler;
    protect: (roles: [string], client: string) => RequestHandler;
    RESOURCE_ACCESS_KEY: string;
    CLIENT_ID: string;
    ROLES: ROLES;
    Auth: Auth<any>;
}

declare function init<T>(config?: T): KConnect & T;

export { Auth, init, ROLES };

````

### Additional Details
 * Last updated: Fri, 08 Mar 2024 17:07:21 GMT
 * Dependencies: [@types/express](https://npmjs.com/package/@types/express)

# Credits
These definitions were written by [Arian Meidow](https://github.com/sPaCeMoNk3yIam).

---
_Source: https://npm.io/package/@types/keycloak-connect-roles · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
