@types/node-steam-openid
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

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

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: Tue, 07 Nov 2023 09:09:39 GMT
  • Dependencies: @types/express

Credits

These definitions were written by joshuajeschek.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/node-steam-openid

Weekly Downloads

271

Version

1.0.3

License

MIT

Unpacked Size

5.2 kB

Total Files

5

Last publish

Collaborators

  • types