Skip to content

feat(migrate-tool): add track migration tool#14392

Open
dylanjeffers wants to merge 1 commit into
mainfrom
feat/migrate-tool
Open

feat(migrate-tool): add track migration tool#14392
dylanjeffers wants to merge 1 commit into
mainfrom
feat/migrate-tool

Conversation

@dylanjeffers
Copy link
Copy Markdown
Contributor

Summary

A small Vite + React SPA + Vercel-functions tool that helps artists move tracks from an old Audius account they've lost access to onto a new account they control. Intended to live at migrate.audius.co.

  • Located at packages/migrate-tool.
  • Frontend: PKCE OAuth (SDK with apiKey only). User signs in with new account, enters old handle, previews the tracks, submits.
  • Backend (Vercel functions + Supabase): stores requests in a migration_requests table, exposes admin endpoints gated by ADMIN_BEARER_TOKEN.
  • Migration worker: on approval, the backend SDK (initialized with apiKey + bearerToken via createSdkWithServices) fetches each old track's audio + artwork and re-uploads it as the new owner using the OAuth grant. Per-track results are written back to the DB.

Approval flow

The README is explicit that identity verification of the requester happens out-of-band (support ticket, Discord DM, etc.). The admin step in this tool is just a gate so nothing executes automatically; the team is responsible for confirming ownership before they click "Approve & execute."

Known limitations (documented in the README)

  • Tracks marked downloadable migrate with the original audio file; everything else migrates with the transcoded MP3 stream. The original master file isn't accessible via the public API for non-downloadable tracks.
  • Old account is not modified; plays / favorites / reposts / comments don't carry over.
  • The admin "approve" handler runs the migration synchronously with maxDuration: 300 set in vercel.json. For artists with many tracks this should be moved to a queue/cron worker.

Verification

  • npx tsc -b passes for the SPA and the API functions (no type errors).
  • vite build was not verified locally — there's a pre-existing vite-plugin-node-polyfills resolver issue in this worktree's install that also breaks packages/web/examples/upload, so it isn't specific to this change. A fresh install on Vercel should build cleanly.

Test plan

  • Provision a Supabase project, run supabase/migrations/0001_init.sql.
  • Create an Audius developer app, set VITE_AUDIUS_API_KEY, AUDIUS_API_KEY, AUDIUS_BEARER_TOKEN, ADMIN_BEARER_TOKEN, SUPABASE_URL, SUPABASE_SERVICE_ROLE_KEY.
  • npm run dev + sign in with a test account, enter another artist's handle, preview shows tracks.
  • Submit a request and verify the row appears in Supabase with status = 'pending'.
  • Open /admin, unlock with ADMIN_BEARER_TOKEN, click Reject — confirm status flips to rejected.
  • Submit a second request, click Approve & execute, confirm tracks re-appear on the new account and per-track results are written back.

🤖 Generated with Claude Code

A small Vite + React SPA backed by Vercel functions + Supabase that lets an
artist request migration of tracks from an old Audius account they've lost
access to onto a new account they control. Every migration sits in a
pending queue until an Audius team member approves it via an admin route
gated by a bearer token — the README spells out that identity
verification of the requester has to happen out-of-band.

The frontend uses the SDK's PKCE OAuth flow with apiKey only; on approval
the backend re-uploads each track via createSdkWithServices using the
dev app's API key + bearer token, acting on behalf of the new owner.

Designed for migrate.audius.co.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 22, 2026

⚠️ No Changeset found

Latest commit: 706631a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions
Copy link
Copy Markdown
Contributor

🌐 Web preview ready

Preview URL: https://audius-web-preview-pr-14392.audius.workers.dev

Unique preview for this PR (deployed from this branch).
Workflow run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant