Skip to main content

list()

Returns a paginated list of root writers for a project. Writers are extracted from contract documents and de-duplicated via merging.

Signature

royaltyport.writers.list(projectId, options?)

Parameters

ParameterTypeRequiredDefaultDescription
projectIdstringYesThe project ID
options.pagenumberNo1Page number
options.perPagenumberNo20Items per page (max: 100)
options.includeMergedbooleanNofalseInclude merged writer records

Example

import { Royaltyport } from '@royaltyport/sdk';

const royaltyport = new Royaltyport({
  apiKey: 'rp_your_token_here',
});

const { data } = await royaltyport.writers.list('project-id', {
  perPage: 100,
  includeMerged: true,
});

for (const writer of data.items) {
  console.log(writer.name);
}

get()

Returns a single writer by ID.

Signature

royaltyport.writers.get(projectId, writerId, options?)

Parameters

ParameterTypeRequiredDefaultDescription
projectIdstringYesThe project ID
writerIdnumberYesThe writer ID
options.includeMergedbooleanNofalseInclude merged writer records

Example

import { Royaltyport } from '@royaltyport/sdk';

const royaltyport = new Royaltyport({
  apiKey: 'rp_your_token_here',
});

const { data: writer } = await royaltyport.writers.get('project-id', 15);

console.log(writer.name);
The merged array only appears when includeMerged is set to true.