Skip to main content

Family Cloud

The CloudikePhotos SDK provides features for managing a Family cloud.

Initialization#

    import  CLPhotos from 'web_photos';
    let photosApp;        const options = {        logLevel: 'error' // 'trace' | 'debug' | 'info' | 'warn' | 'error'    };        const config = {        authToken: '', // user auth token         baseUrl: '', // api base url required        userAgent: '' // user agent name required    }        try {        photosApp = CLPhotos.init(options, config);    } catch (e) {        // catch photo sdk InternalError    }

Create Family Cloud#

The following code example demonstrates how to create a new Family Cloud1

const params = {name: 'new family', is_opened: true}; // ICreateFamilySchemaphotosApp.family.createUserFamily(params).then(({data}) => {    const family = data; // IFamilySchema});

Copy to Family Cloud#

The following code example demonstrates adding items to Family Cloud1 timeline.

const items = [item1, item2]; // IItemSchema[]photosApp.familyTimeline.addItemsToTimeline(items).then(({data}) => {    const operations = data; // IOperationResult[]});

Copy to Personal Cloud#

The following code example demonstrates adding items to Personal timeline.

const items = [item1, item2]; // IItemSchema[]photosApp.timeline.addItemsToTimeline(items).then(({data}) => {    const operations = data; // IOperationResult[]});

Read Family Cloud from Cloud Storage#

The following code example demonstrates how to get a Family Cloud1 data for owner

const familyId = 'sdfsf9938434sdf';photosApp.family.getUserFamily(familyId).then(({data}) => {    const familyData = data; // IFamilySchema});

Get List of Family Cloud Members#

The following code example demonstrates how to get a Family Cloud1 Members2 list

const familyId = 'sdfsf9938434sdf';const params = {limit: 10};photosApp.family    .getFamilyMembers(familyId, params)    .then(({data}) => {        const {            _embedded: {members},        } = data;    });

Get Information About the Current Family Cloud1#

The following code example demonstrates how to get a family cloud data for owner

const familyId = 'sdfsf9938434sdf';photosApp.family.getUserFamily(familyId).then(({data}) => {    const familyData = data; // IFamilySchema});

Invite Family Members#

The following code example demonstrates how to create an invitation link (invite_hash) to a Family Cloud1

const familyId = 'sdfsf9938434sdf';photosApp.family.unlockUserFamily(familyId).then(({data}) => {    const {invite_hash} = data; // IFamilySchema    // for domain saas.cloudike.com invite link will look like    const inviteLink = `https://saas.cloudike.com/invite?fchash=${invite_hash}`;});

Remove an Invitation link from Family Cloud#

The following code example demonstrates how to remove an invitation link (invite_hash) to a Family Cloud1

const familyId = 'sdfsf9938434sdf';photosApp.family.lockUserFamily(familyId).then(({data}) => {    const family = data; // IFamilySchema});

Remove Family Cloud#

The following code example demonstrates how to remove a Family Cloud1

const familyId = 'sdfsf9938434sdf';photosApp.family.deleteUserFamily(familyId).then(() => {    // family cloud is successfully deleted});

Remove Family Cloud Members#

The following code example demonstrates how to remove Member from Family Cloud1 by memberId and familyId

const familyId = 'sdfsf9938434sdf';const memberId = 'egser65665dfd6f';photosApp.family.deleteFamilyMember(familyId, memberId).then(() => {    // member with memberId = 'egser65665dfd6f' is successfully    // removed from a family with familyId = 'sdfsf9938434sdf'});

Join a new member to Family#

The following code example demonstrates how to send a request to join Family Cloud1 by invite hash

const hash = '56sfsfer5df4';const params = {name: 'Member name'};photosApp.family.joinFamilyMember(hash, params).then(({data}) => {    const joinedMember = data; // IMemberSchema});

  1. Family Cloud - the list of photos or videos files which are shared with a group of people↩
  2. Members - a group of people who have access to Family Cloud1 ↩