What are Organizations?
In Plank, “organizations” are essentially user profiles. Each organization has:- Separate Media Library: Completely isolated collection of movies and TV shows
- Independent Watch History: Progress tracking per profile
- Custom Branding: Profile name, logo, and color theme
- Member Management: Invite other users to share the profile
Use Cases
Family Profiles
Create separate profiles for kids and adults with age-appropriate content libraries.
Personal Collections
Maintain different libraries for different moods or genres (Movies, Anime, Documentaries, etc.).
Shared Accounts
Share your Plank instance with roommates while keeping libraries separate.
Testing/Demo
Create disposable profiles for testing or demonstrating features.
Profile Selection
When you log in to Plank, you’re presented with a profile picker showing all available profiles.Profile Picker UI
The profile picker displays:- Grid of profile cards (2-5 columns depending on screen size)
- Profile logo (or default avatar)
- Profile name
- Visual indicator for profiles you’re a member of
Selecting a Profile
Click any profile card to:- Set it as your active organization
- Load that profile’s library
- Navigate to the home screen
Access Control
Profiles you’re not a member of:- Show as grayed out
- Display lock icon
- Cannot be selected
- Require an invitation from an admin
Creating Organizations
Admins can create new profiles from the profile management page.Create a Profile
- Navigate to Profiles page
- Click Manage Profiles (admins only)
- Click Create New Profile
- Enter profile details:
- Name (e.g., “Kids”, “John’s Movies”, “Anime”)
- Slug (URL-friendly identifier)
- Logo (optional, upload custom image)
- Color (theme color for the profile)
- Click Create
Profile Settings
Name
Display name shown in profile picker and throughout the UI.Slug
Unique URL identifier (e.g., “kids-profile”). Used in API endpoints and URLs.Logo
Custom profile avatar:- Supports image upload
- Displayed in profile picker
- Shows on profile switcher
- Defaults to generic avatar if not set
Color
Theme color for the profile:- Hex color code (e.g., #6366F1)
- Used for branding elements
- Default: #6366F1 (indigo)
Member Management
Profiles support multiple members with different roles.Inviting Members
Admins can invite users to join a profile:- Open profile management
- Select a profile
- Click Invite Member
- Enter user’s email address
- Select role (member or admin)
- Click Send Invitation
Accepting Invitations
Users invited to a profile:- Receive email with invitation link
- Click link to view invitation details
- Click Accept Invitation
- Profile appears in profile picker
- Can now access that profile’s library
Member Roles
Profiles have two member roles:Member
Standard user with permissions to:- View and play media in the library
- Add new media
- Delete media they added
- Search and browse
- Track watch progress
Admin
Full permissions including:- All member permissions
- Invite new members
- Remove members
- Delete any media
- Modify profile settings
- Delete the profile
Removing Members
Admins can remove members:- Open profile management
- Select a profile
- View member list
- Click remove icon next to member
- Confirm removal
- Lose access to the profile immediately
- Profile disappears from their profile picker
- Cannot access that profile’s library
How Organizations Work
Database Schema
Organizations are implemented with these tables:organization
Stores profile metadata:- id, name, slug
- logo, color
- timestamps
member
Links users to organizations:- userId, organizationId
- role (member or admin)
- join timestamp
invitation
Manages pending invitations:- email, organizationId
- inviterId, role
- status, expiresAt
Media Isolation
Each media item belongs to an organization:- Library lists filter by organizationId
- Search only queries active profile
- Media creation includes organizationId
- Unique constraint: (organizationId, infohash)
Session Management
Your session tracks the active organization:- Session updated with new activeOrganizationId
- All subsequent requests use that organizationId
- Library and API calls automatically scoped
Profile Switching
You can switch between profiles at any time:- Navigate to Profiles page
- Select a different profile
- Library refreshes with that profile’s content
- Clears React Query cache
- Loads new profile’s library
- Updates session
- Preserves watch progress per profile
Admin vs Non-Admin Users
Admin Users
Users withrole='admin' (in user table):
- Can create new profiles
- See “Manage Profiles” button
- Can invite members to any profile
- Full system access
Non-Admin Users
Regular users:- Can only access profiles they’re invited to
- Cannot create new profiles
- Cannot see profiles they’re not members of
- See “Waiting for Access” if they have no profiles
First-Time Setup
If a non-admin user logs in with no profiles:- Shows “Waiting for Access” screen
- Cannot access the app
- Must wait for admin invitation
Advanced: Better Auth Integration
Plank uses Better Auth’s organization plugin for profile management.Better Auth Features Used
- createOrganization: API to create new profiles
- setActive: Set active organization for session
- member table: Links users to organizations
- invitation table: Manages invitations
Organization Metadata
Themetadata field (JSON) can store:
- Custom profile settings
- UI preferences
- Feature flags
- (Currently unused, reserved for future features)
Security
Better Auth ensures:- Row-level security via organizationId scoping
- Session-based authorization
- Invitation token security
- Role-based permissions
Best Practices
Organizing Profiles
- Don’t over-create: Too many profiles becomes hard to manage
- Clear naming: Use descriptive names (“Kids”, not “Profile 1”)
- Consistent branding: Choose distinct logos/colors
- Purpose-driven: Create profiles for specific use cases
Invitation Management
- Pre-create profiles: Create profiles before inviting users
- Set roles carefully: Grant admin sparingly
- Monitor invitations: Check for expired invitations
- Revoke when needed: Remove members who shouldn’t have access
Library Organization
- Content segregation: Use profiles to separate types of content
- Age-appropriate: Keep kids’ content in separate profile
- Language/region: Separate profiles for different language content
Troubleshooting
Can’t See Any Profiles
Non-admin user with no invitations:- Contact admin to send invitation
- Check email for invitation links
- Verify email address matches account
Can’t Create Profiles
User is not admin:- Only users with
role='admin'can create profiles - Contact system admin for permission
Profile Not Updating
Stale cache:- Refresh the page
- Switch profiles and switch back
- Clear browser cache
Next Steps
Media Library
Learn how to build your library within a profile
Search & Browse
Discover content to add to your profile