# `@delysium/sso-api`
Interfaces for Delysium SSO api.

## Installation

> 🚨 Please make sure to add this NPM token in your `.npmrc` file:
> `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`.
>
> You can do so by running the following command:
>
> ```bash
> echo "//registry.npmjs.org/:_authToken=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" >> .npmrc
> ```

```bash
npm i @delysium/sso-api
```

## Usage
```ts
import {AuthApi, BodyRequest, Empty, Endpoint, LoginRequest, TokenResponse, UserResponse, AuthEmptyRequest} from "@delysium/sso-api"

// Create a new utility class and implement the API interfaces
class AuthSDK implements AuthApi {
    async getMe(request: AuthEmptyRequest): Promise<UserResponse> {
        const endpoint = Endpoint.ME
        return new Promise((resolve, reject) => {
            // TODO http call
        })
    }

    async login(req: BodyRequest<LoginRequest>): Promise<TokenResponse> {
        const endpoint = Endpoint.LOGIN
        return new Promise((resolve, reject) => {
            // TODO http call
        })
    }

    async logout(req: AuthEmptyRequest): Promise<Empty> {
        const endpoint = Endpoint.LOGOUT
        return new Promise((resolve, reject) => {
            // TODO http call
        })
    }
}
    
```