
Security News
The Next Open Source Security Race: Triage at Machine Speed
Claude Opus 4.6 has uncovered more than 500 open source vulnerabilities, raising new considerations for disclosure, triage, and patching at scale.
onecrew-api-client
Advanced tools
OneCrew Backend API Client for Expo/React Native - A comprehensive TypeScript client for film and entertainment industry APIs with user profile management, talent profiles, skills, abilities, languages, portfolio management, project management, task assig
A TypeScript/JavaScript client library for the OneCrew Backend API, designed for Expo and React Native applications.
npm install onecrew-api-client
import { OneCrewApi } from 'onecrew-api-client';
// Initialize the API client
const api = new OneCrewApi('https://your-api-url.com');
// Initialize authentication
await api.initialize();
// Example: Login and manage user details
await api.auth.login({
email: 'user@example.com',
password: 'password'
});
// Create user details
const userDetails = await api.createUserDetails({
gender: 'female',
birthday: '1998-05-15', // Date string in ISO format (YYYY-MM-DD)
nationality: 'American',
height_cm: 165,
weight_kg: 58,
skin_tone: 'medium',
hair_color: 'brown',
willing_to_travel: true
});
// Get user details
const details = await api.getUserDetails();
console.log('User details:', details.data);
// Example: Managing talent profile with dropdowns
const [hairColors, skinTones, profile] = await Promise.all([
api.getAvailableHairColors(),
api.getAvailableSkinTones(),
api.getTalentProfile()
]);
// Create dropdown options with current selection
const hairColorOptions = hairColors.data.map(option => ({
id: option.id,
name: option.name,
selected: option.id === profile.data.hair_color_id
}));
const skinToneOptions = skinTones.data.map(option => ({
id: option.id,
name: option.name,
selected: option.id === profile.data.skin_tone_id
}));
// Update talent profile
await api.updateTalentProfile({
hair_color_id: 'selected-hair-color-id',
skin_tone_id: 'selected-skin-tone-id',
eye_color: 'brown',
height_cm: 175,
weight_kg: 70
});
getUsers(params?) - Get all users with filtersgetUserById(userId) - Get user by IDgetUserByIdDirect(userId) - Direct user endpointupdateUserProfile(updates) - Update current user profiledeleteUser() - Delete current usergetUserDetails(userId?) - Get user details (current user or by ID)createUserDetails(details) - Create user detailsupdateUserDetails(updates) - Update current user's detailsupdateUserDetailsById(userId, updates) - Update specific user's detailspatchUserDetails(updates) - Partial update of current user's detailsdeleteUserDetails(userId?) - Delete user detailsgetTalentProfile() - Get current user's talent profileupdateTalentProfile(updates) - Update talent profilepatchTalentProfile(updates) - Partial update of talent profilegetAvailableHairColors() - Get all available hair colors for dropdownsgetAvailableSkinTones() - Get all available skin tones for dropdownsgetAvailableSkills() - Get all available skillsgetUserSkills() - Get user's current skillsaddUserSkill(skillId) - Add skill to user profileremoveUserSkill(skillId) - Remove skill from user profilegetAvailableAbilities() - Get all available abilitiesgetUserAbilities() - Get user's current abilitiesaddUserAbility(abilityId, proficiency) - Add ability with proficiency (1-5)updateUserAbility(abilityId, proficiency) - Update ability proficiencyremoveUserAbility(abilityId) - Remove ability from user profilegetAvailableLanguages() - Get all available languagesgetUserLanguages() - Get user's current languagesaddUserLanguage(languageId, level) - Add language with proficiency levelremoveUserLanguage(languageId) - Remove language from user profilegetUserPortfolio() - Get user's portfolio itemsaddPortfolioItem(item) - Add image/video to portfolioupdatePortfolioItem(itemId, updates) - Update portfolio itemremovePortfolioItem(itemId) - Remove portfolio itemgetProjects(params?) - Get all projectsgetProjectById(projectId) - Get project by IDcreateProject(projectData) - Create new projectupdateProject(projectId, updates) - Update projectgetMyProjects(params?) - Get user's projects (supports include_deleted parameter)getDeletedProjects(params?) - Get user's deleted projects onlydeleteProject(projectId) - Soft delete a projectrestoreProject(projectId) - Restore a soft-deleted projectjoinProject(projectId, role?) - Join a projectleaveProject(projectId) - Leave a projectgetTeams(params?) - Get all teamsgetTeamById(teamId) - Get team by IDcreateTeam(teamData) - Create new teamjoinTeam(teamData) - Join a teamleaveTeam(teamId) - Leave a teamgetConversations(params?) - Get user conversationscreateConversation(participantIds, name?) - Create conversationgetMessages(conversationId, params?) - Get conversation messagessendMessage(conversationId, messageData) - Send messageUse api.chat.* for the newer chat system (/api/chat/...). This supports sender/read hydration controls to keep responses small and avoid over-fetching.
chat.getMessages(conversationId, params?) - Get conversation messages (supports include, sender_type, sender_user_fields, sender_company_fields)chat.sendMessage(conversationId, data) - Send a messagechat.getConversations(params?) - List conversationsExamples
// Profile-scoped conversation lists (avoid mixing personal + company chats)
const personalConversations = await api.chat.getConversations({ profile_type: 'user' });
const companyConversations = await api.chat.getConversations({ profile_type: 'company' });
const singleCompanyConversations = await api.chat.getConversations({
profile_type: 'company',
company_id: 'your-company-id'
});
// Personal messages only, no extra hydration (smallest payload)
const personal = await api.chat.getMessages(conversationId, {
sender_type: 'user',
include: 'none'
});
// Company messages (includes academy) with academy detection
const company = await api.chat.getMessages(conversationId, {
sender_type: 'company',
include: ['sender_company'],
sender_company_fields: ['id', 'name', 'logo_url', 'subcategory']
});
// Detect academy messages on the client
const academyMessages = (company.data?.data || []).filter(
m => m.sender_company?.subcategory === 'academy'
);
pushNotifications.registerDeviceToken(token, platform, deviceId?, appVersion?) - Register device token for push notificationspushNotifications.unregisterDeviceToken(token) - Unregister device tokenpushNotifications.getDeviceTokens() - Get user's registered device tokensExample:
// Register device token after login
import * as Notifications from 'expo-notifications';
import { Platform } from 'react-native';
// Get push token (Expo)
const { data: token } = await Notifications.getExpoPushTokenAsync({
projectId: 'your-project-id'
});
// Register with backend
await api.pushNotifications.registerDeviceToken(
token,
Platform.OS === 'ios' ? 'ios' : 'android',
'device-id-123',
'1.0.0'
);
// Unregister on logout
await api.pushNotifications.unregisterDeviceToken(token);
See CLIENT_PUSH_NOTIFICATION_INTEGRATION.md for complete integration guide.
searchUsers(params) - Search userssearchProjects(params) - Search projectssearchTeams(params) - Search teamsglobalSearch(query, params?) - Global searchgetSearchSuggestions(query) - Get search suggestionsuploadFile(file) - Upload file// Get talent profile
const talentProfile = await api.getTalentProfile();
console.log('Talent profile:', talentProfile.data);
// Update talent profile
const updatedProfile = await api.updateTalentProfile({
height_cm: 175,
weight_kg: 70,
eye_color: 'brown',
travel_ready: true,
union_member: false
});
// Get available skills
const availableSkills = await api.getAvailableSkills();
console.log('Available skills:', availableSkills.data);
// Get user's current skills
const userSkills = await api.getUserSkills();
console.log('User skills:', userSkills.data);
// Add a skill to user profile
const skillToAdd = availableSkills.data[0];
const addedSkill = await api.addUserSkill(skillToAdd.id);
console.log('Added skill:', addedSkill.data);
// Remove a skill from user profile
await api.removeUserSkill(skillToAdd.id);
// Get available abilities
const availableAbilities = await api.getAvailableAbilities();
console.log('Available abilities:', availableAbilities.data);
// Add ability with proficiency level (1-5)
const abilityToAdd = availableAbilities.data[0];
const addedAbility = await api.addUserAbility(abilityToAdd.id, 4);
console.log('Added ability:', addedAbility.data);
// Update ability proficiency
await api.updateUserAbility(abilityToAdd.id, 5);
// Get available languages
const availableLanguages = await api.getAvailableLanguages();
console.log('Available languages:', availableLanguages.data);
// Add language with proficiency level
const languageToAdd = availableLanguages.data[0];
const addedLanguage = await api.addUserLanguage(languageToAdd.id, 'native');
console.log('Added language:', addedLanguage.data);
// Get user's portfolio
const portfolio = await api.getUserPortfolio();
console.log('Portfolio items:', portfolio.data);
// Add portfolio item
const newItem = await api.addPortfolioItem({
kind: 'image',
url: 'https://example.com/image.jpg',
caption: 'My headshot',
sort_order: 1
});
console.log('Added portfolio item:', newItem.data);
// Update portfolio item
await api.updatePortfolioItem(newItem.data.id, {
caption: 'Updated headshot caption',
sort_order: 2
});
// Request account deletion (requires password confirmation)
const deletionRequest = await api.requestAccountDeletion('your-password');
console.log('Deletion requested');
console.log('Expiration date:', deletionRequest.data?.expirationDate);
console.log('Days remaining:', deletionRequest.data?.daysRemaining);
// Check deletion status
const status = await api.getAccountDeletionStatus();
if (status.data?.isPending) {
console.log('Account deletion pending');
console.log('Days remaining:', status.data.daysRemaining);
}
// Restore account within grace period
if (status.data?.isPending && status.data.daysRemaining > 0) {
await api.restoreAccount();
console.log('Account restored successfully');
}
const api = new OneCrewApi(
'https://your-api-url.com', // Base URL
30000, // Timeout in milliseconds (optional)
3 // Number of retries (optional)
);
The client automatically handles JWT token storage and refresh:
// Login
const authResponse = await api.auth.login({
email: 'user@example.com',
password: 'password'
});
// Check if user is authenticated
const isAuthenticated = await api.auth.isAuthenticated();
// Logout
await api.auth.logout();
Google sign-in now uses Supabase OAuth. You must first authenticate with Supabase, then send the access token to the backend:
import { createClient } from '@supabase/supabase-js';
// Initialize Supabase client
const supabase = createClient(
'https://your-project.supabase.co',
'your-anon-key'
);
// Option 1: Using signInWithOAuth (redirect flow)
const { data, error } = await supabase.auth.signInWithOAuth({
provider: 'google',
options: {
redirectTo: 'yourapp://auth/callback'
}
});
// After OAuth completes, get the session
const { data: { session } } = await supabase.auth.getSession();
// Send Supabase access token to backend
if (session) {
const authResponse = await api.auth.signInWithGoogle(
session.access_token,
'crew', // category (required for new users)
'director' // primary_role (optional)
);
}
// Option 2: Using signInWithIdToken (if using Google Sign-In SDK)
const { data, error } = await supabase.auth.signInWithIdToken({
provider: 'google',
token: googleIdToken
});
if (data.session) {
await api.auth.signInWithGoogle(data.session.access_token, 'crew');
}
Note: Make sure Google OAuth is configured in your Supabase Dashboard (Authentication > Providers > Google).
Apple sign-in uses Supabase OAuth. You must first authenticate with Supabase, then send the access token to the backend:
import { createClient } from '@supabase/supabase-js';
// Initialize Supabase client
const supabase = createClient(
'https://your-project.supabase.co',
'your-anon-key'
);
// Option 1: Using signInWithOAuth (redirect flow)
const { data, error } = await supabase.auth.signInWithOAuth({
provider: 'apple',
options: {
redirectTo: 'yourapp://auth/callback'
}
});
// After OAuth completes, get the session
const { data: { session } } = await supabase.auth.getSession();
// Send Supabase access token to backend
if (session) {
const authResponse = await api.auth.signInWithApple(
session.access_token,
'crew', // category (required for new users)
'director' // primary_role (optional)
);
}
// Option 2: Using signInWithIdToken (if using native Apple Sign-In SDK)
const { data, error } = await supabase.auth.signInWithIdToken({
provider: 'apple',
token: appleIdToken,
nonce: rawNonce
});
if (data.session) {
await api.auth.signInWithApple(data.session.access_token, 'crew');
}
Note: Make sure Apple OAuth is configured in your Supabase Dashboard (Authentication > Providers > Apple). You'll need an Apple Developer account and Service ID setup.
All methods return a consistent response format:
interface ApiResponse<T> {
success: boolean;
data?: T;
error?: string;
message?: string;
}
// Example usage
const response = await api.getUserById('user-id');
if (response.success) {
console.log('User data:', response.data);
} else {
console.error('Error:', response.error);
}
Full TypeScript support with comprehensive type definitions for all API responses and request parameters.
MIT
For support and questions, please contact the OneCrew team.
FAQs
OneCrew Backend API Client for Expo/React Native - A comprehensive TypeScript client for film and entertainment industry APIs with user profile management, talent profiles, skills, abilities, languages, portfolio management, project management, task assig
The npm package onecrew-api-client receives a total of 3 weekly downloads. As such, onecrew-api-client popularity was classified as not popular.
We found that onecrew-api-client demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Claude Opus 4.6 has uncovered more than 500 open source vulnerabilities, raising new considerations for disclosure, triage, and patching at scale.

Research
/Security News
Malicious dYdX client packages were published to npm and PyPI after a maintainer compromise, enabling wallet credential theft and remote code execution.

Security News
gem.coop is testing registry-level dependency cooldowns to limit exposure during the brief window when malicious gems are most likely to spread.