To apply component properties to a node, use the componentPropertyReferences property. Also note that the addComponentProperty() method returns a unique property ID, which you need to use in componentPropertyReferences and setProperties().
// Add component's text properties
const prop1 = componentNode.addComponentProperty('PropertyName 1', 'TEXT', '');
const prop2 = componentNode.addComponentProperty('PropertyName 2', 'TEXT', '');
// Apply these properties to text nodes inside component
textNode1.componentPropertyReferences = {characters: prop1};
textNode2.componentPropertyReferences = {characters: prop2};
// Set new values for component properties
instanceNode.setProperties({[prop1]: value1, [prop2]: value2})
Please read the documentation: