Skip to content

Last FM API Key is not actually optional #473

Closed
@aidan-walden

Description

@aidan-walden

NodeJs Version: 23.9.0
Lavalink Version: 4.0.8
Magmastream NPM Package Version: 2.8.6

Describe the Bug
In the magmastream docs, the Last FM API key is marked as optional. However, TypeScript will throw a compile time error if this property is not included within the Manager constructor. Additionally, passing an empty string is not allowed, as magmastream will throw a runtime error:


    if (typeof lastFmApiKey !== "undefined" && (typeof lastFmApiKey !== "string" || lastFmApiKey.trim().length === 0)) {
        throw new TypeError('Manager option "lastFmApiKey" must be a non-empty string.');
    }

To Reproduce
Steps to reproduce the behavior:

  1. Create an instance of Manager, without Last FM API key
  2. Observe as you are unable to compile your code (assuming TypeScript)

Expected Behavior
An instance of Manager can be created without specifying a Last FM API key.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions