Add coin-gated tracks example app#14012
Merged
raymondjacobson merged 4 commits intomainfrom Mar 26, 2026
Merged
Conversation
Example web app demonstrating how to browse and stream token-gated tracks using an artist coin. Supports two auth paths: Audius OAuth (PKCE) and direct Solana wallet signing via Phantom. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
5 tasks
Contributor
🌐 Web preview readyPreview URL: https://audius-web-preview-pr-14012.audius.workers.dev Unique preview for this PR (deployed from this branch). |
raymondjacobson
added a commit
to AudiusProject/api
that referenced
this pull request
Mar 26, 2026
## Summary - New `solanaWalletMiddleware` verifies ed25519 signatures from `X-Solana-Wallet`, `X-Solana-Message`, `X-Solana-Signature` headers - New `checkSolanaWalletTokenAccess` helper performs real-time on-chain token balance checks via Solana RPC (derives ATA, calls `GetTokenAccountBalance`) - Stream endpoint (`v1TrackStream`) falls back to Solana wallet balance check when standard access check fails, enabling coin-gated streaming for non-Audius wallets - Exported `BuildMediaLink` from `dbv1` package to support building stream URLs in the fallback path - Companion example app in AudiusProject/apps#14012 ## Test plan - [ ] Verify existing stream endpoint works unchanged for OAuth-authenticated users - [ ] Test Solana wallet headers with valid ed25519 signature → stream succeeds for wallets holding sufficient tokens - [ ] Test invalid/missing signature headers → 401 error - [ ] Test wallet with insufficient token balance → 403 error - [ ] Verify middleware is no-op when no Solana headers are present 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
packages/web/examples/coin-gated/demonstrating token-gated track browsing and streaming using artist coinssdk.coins.getCoinByTicker()to look up coins,sdk.users.getTracksByUser()withgateCondition: ['token']to list gated tracks, andsdk.tracks.streamTrack()for authenticated streamingTest plan
cd packages/web/examples/coin-gated && npm install && npm run devYAK) and verify coin info + gated tracks load🤖 Generated with Claude Code