The palmshed.github.io sign-in pages are the reference migration: they moved from hand-written fetch() calls plus manual localStorage handling to @palmshed/auth-client. The client owns token storage, the Authorization header, and token refresh.
Replace:
// before
const token = localStorage.getItem("session");
const res = await fetch(API + "/api/v1/me", {
headers: { authorization: "Bearer " + token },
});
with:
// after
const client = new AuthClient({ baseUrl: API });
const res = await client.getSession();
See UPGRADING.md for the full method-by-method table and rollback guidance.
migrate().baseUrl at the service and remove the old SDK./api/v1 contract is stable. The client works against it without version checks.