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
| Parameter | Type | Required | Default | Description |
|---|
projectId | string | Yes | — | The project ID |
options.page | number | No | 1 | Page number |
options.perPage | number | No | 20 | Items per page (max: 100) |
options.includeMerged | boolean | No | false | Include 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
| Parameter | Type | Required | Default | Description |
|---|
projectId | string | Yes | — | The project ID |
writerId | number | Yes | — | The writer ID |
options.includeMerged | boolean | No | false | Include 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.