-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Description
const clientBrevo = new ContactsApi();
clientBrevo.setApiKey(
ContactsApiApiKeys.apiKey,
client.options.brevo.apiKey
);
await clientBrevo.createContact({
email,
attributes: {
VORNAME: firstName,
NACHNAME: lastName,
FIRMA: company,
},
listIds: client.options.brevo.listId
.split(',')
.map((id) => parseInt(id, 10)),
updateEnabled: true,
});After update to version 2.3.0 TypeScript get Error on createBrevo
TS2322: Type string is not assignable to type object
In version 2.30
/**
* Pass the set of attributes and their values. These attributes must be present in your Brevo account. For eg.
{'FNAME':'Elly', 'LNAME':'Roger', 'COUNTRIES':['India','China']}
*/
'attributes'?: { [key: string]: object; };
In version 2.2.0 it was as object
/**
* Pass the set of attributes and their values. The attribute\'s parameter should be passed in capital letter while creating a contact. Values that don\'t match the attribute type (e.g. text or string in a date attribute) will be ignored.These attributes must be present in your Brevo account. For eg. {\"FNAME\":\"Elly\", \"LNAME\":\"Roger\"}
*/
'attributes'?: object;
How i can pass obejct if i have string or string[]
And i can't use this alias and why:
attributes: {
VORNAME: firstName as object,
NACHNAME: lastName as any,
FIRMA: company,
},
How to Fix:
'attributes'?: { [key: string]: string | string[]; };
or with number or boolean what can be set as attribute.
lguichard, aloisklink, mathroule, dannylouveton and marcandreh
Metadata
Metadata
Assignees
Labels
No labels