1.0.3 • Published 6 months ago

@types/node-steam-openid v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

Installation

npm install --save @types/node-steam-openid

Summary

This package contains type definitions for node-steam-openid (https://github.com/LeeviHalme/node-steam-openid).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node-steam-openid.

index.d.ts

// Type definitions for node-steam-openid 1.0
// Project: https://github.com/LeeviHalme/node-steam-openid
// Definitions by: joshuajeschek <https://github.com/joshuajeschek>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

import { Request } from 'express';

export = SteamAuth;

declare class SteamAuth {
    /**
     * `realm` - Site name displayed to users on logon
     *
     * `returnUrl` - Your return route
     *
     * `apiKey` - Steam API key
     *
     * ```
     * const steam = new SteamAuth({
     *   realm: "http://localhost:5000",
     *   returnUrl: "http://localhost:5000/auth/steam/authenticate",
     *   apiKey: "XXXXXXXXXXXXXXXXXXXXXXXXXX"
     * });
     * ```
     */
    constructor(steamAuthOptions: SteamAuthOptions);

    /**
     * Gets the redirect URL to Steam.
     * @async
     */
    getRedirectUrl(): Promise<string>;

    /**
     * Authenticates the user with oAuth.
     * @async
     * @param request
     */
    authenticate(request: Request | object): Promise<UserObject>;
}

interface SteamAuthOptions {
    realm: string;
    returnUrl: string;
    apiKey: string;
}

/**
 * Object which holds all the authenticated user's data.
 * The key _json holds the raw response from Steam API.
 */
interface UserObject {
    _json: Record<string, any>;
    steamid: string;
    username: string;
    name: string;
    profile: string;
    avatar: {
        small: string;
        medium: string;
        large: string;
    };
}

Additional Details

  • Last updated: Wed, 20 Apr 2022 22:31:17 GMT
  • Dependencies: @types/express
  • Global values: none

Credits

These definitions were written by joshuajeschek.

1.0.2

7 months ago

1.0.1

8 months ago

1.0.3

6 months ago

1.0.0

2 years ago