Skip to content

Custom params unsupported by JWT utils types #498

@JasirZaeem

Description

@JasirZaeem

The docs suggest nesting any extra params under a custom key, in signed tokens. https://docs.mux.com/guides/secure-video-playback#passing-custom-parameters-to-a-signed-token

{
  "sub": "{PLAYBACK_ID}",
  "aud": "{AUDIENCE_TYPE}",
  "exp": "{EXPIRATION_TIME}",
  "custom": {
    "session_id": "xxxx-123"
  }
}

But the type of params field in the MUXJWTSignOptions does not allow this, necessitating the use of ts-ignore if custom parameters are being used.

params?: Record<string, string>;

Maybe this can be expanded to something more relaxed like params?: Record<string, string | Record<string, string>>; ?

Not the most severe bug but would be a nice QOL improvement.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions