Skip to main content

WebID

This service allows you to create and view WebID-conform profiles.

Dependencies

Install

$ yarn add @semapps/webid

Usage

const { WebIdService } = require('@semapps/webid');

module.exports = {
mixins: [WebIdService],
settings: {
usersContainer: 'http://localhost:3000/users'
}
};

Note: the users' container must be set through the LdpService

Settings

PropertyTypeDefaultDescription
baseUrlStringrequired if podProvider is trueBase URL of the instance
usersContainerStringrequired if podProvider is falseURI of the container where WebIDs will be stored
podProviderBooleanfalseSet to true if you are setting up a POD provider

Actions

The following service actions are available:

create

Parameters
PropertyTypeDefaultDescription
emailstringrequiredEmail address
nickstringFirst part of the email addressNickname
namestringnameName
familyNamestringnullFamily name
homepagestringnullUser's website
Return

Object - Created profile

edit

Parameters
PropertyTypeDefaultDescription
userIdstringThe webId of the logged userUser's slug
emailstringnullEmail address
nickstringnullNickname
namestringnameName
familyNamestringnullFamily name
homepagestringnullUser's website
Return

Object - Modified profile

view

Parameters
PropertyTypeDefaultDescription
userIdstringThe webId of the logged userUser's slug
Return

Object - User's profile

Events

The following events are emitted.

webid.created

Sent after a new profile is created.

Parameters

Object - Created profile