Skip to content
Migrating from NextAuth.js v4? Read our migration guide.

providers/lastfm

Built-in Last.fm integration.

LastFMProfile

Properties

image

image: {
  #text: string;
  size: string;
 }[];
#text
#text: string;
size
size: string;

name

name: string;

realname?

optional realname: string;

url

url: string;

default()

function default<P>(options): OAuthConfig<P>

Add Last.fm login to your page.

Setup

Callback URL

https://example.com/api/auth/callback/lastfm

Configuration

import { Auth } from "@auth/core"
import LastFM from "@auth/core/providers/lastfm"
 
const request = new Request(origin)
const response = await Auth(request, {
  providers: [
    LastFM({
      clientId: LASTFM_API_KEY,
      clientSecret: LASTFM_SHARED_SECRET,
    }),
  ],
})

Resources

Notes

Last.fm uses a custom authentication flow that is similar to OAuth, but requires generating an api_sig with your API secret to exchange the temporary token for a session key.

This provider assumes you handle the session key exchange manually or through a custom callback, since Auth.js does not support MD5 hashing without adding dependencies.

Type Parameters

Type Parameter
P extends LastFMProfile

Parameters

ParameterType
optionsOAuthUserConfig<P>

Returns

OAuthConfig<P>

Auth.js © Balázs Orbán and Team - 2025