Demonstrates client-side profile updates using Log in with Audius (OAuth PKCE). No server required: the user signs in with scope=write, and the SDK stores tokens and adds authorization headers. The app calls updateUser (e.g. update bio) directly from the device.
- API key from audius.co/settings → Developer Apps
- Redirect URI registered:
updateprofile://oauth/callback
From the apps repo root:
npm install
npm run build -w @audius/sdk
cd packages/mobile/examples/update-profile
cp .env.example .env
# Edit .env: EXPO_PUBLIC_AUDIUS_API_KEY
npm install
npx expo startPress i (iOS) or a (Android). Sign in with Audius (write scope) → enter description → tap Update description.
- User signs in via
oauth.login({ scope: 'write' })(expo-web-browser + PKCE; tokens in AsyncStorage). - User edits description and taps Update description.
- App calls
sdk.users.updateUser({ id, userId, metadata: { bio } }); the SDK sends the OAuth access token.
| Path | Purpose |
|---|---|
src/config.ts |
Reads EXPO_PUBLIC_AUDIUS_API_KEY |
src/sdk.ts |
Single getSDK() with apiKey and redirectUri |
App.tsx |
oauth.login / getUser / isAuthenticated / logout; direct updateUser |